@abi-software/map-utilities 1.6.1-beta.1 → 1.6.1-beta.2

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(Ne,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("@element-plus/icons-vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue"],Te):(Ne=typeof globalThis<"u"?globalThis:Ne||self,Te(Ne.MapUtilities={},Ne["@element-plus/icons-vue"],Ne.Vue))})(this,function(Ne,Te,s){"use strict";var JK=Object.defineProperty;var eG=(Ne,Te,s)=>Te in Ne?JK(Ne,Te,{enumerable:!0,configurable:!0,writable:!0,value:s}):Ne[Te]=s;var cr=(Ne,Te,s)=>eG(Ne,typeof Te!="symbol"?Te+"":Te,s);const Fr=(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 kg;const rt=typeof window<"u",N_=t=>typeof t=="string",Sg=()=>{},Sl=rt&&((kg=window==null?void 0:window.navigator)==null?void 0:kg.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function _g(t){return typeof t=="function"?t():s.unref(t)}function I_(t){return t}function Io(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function B_(t,e=!0){s.getCurrentInstance()?s.onMounted(t):e?t():s.nextTick(t)}function $r(t){var e;const r=_g(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Bo=rt?window:void 0;function Jt(...t){let e,r,n,a;if(N_(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Bo):[e,r,n,a]=t,!e)return Sg;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),_g(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 Io(u),u}let Tg=!1;function D_(t,e,r={}){const{window:n=Bo,ignore:a=[],capture:i=!0,detectIframe:o=!1}=r;if(!n)return;Sl&&!Tg&&(Tg=!0,Array.from(n.document.body.children).forEach(h=>h.addEventListener("click",Sg)));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=[Jt(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}),Jt(n,"pointerdown",h=>{const v=$r(t);v&&(l=!h.composedPath().includes(v)&&!c(h))},{passive:!0}),o&&Jt(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 Ng(t,e=!1){const r=s.ref(),n=()=>r.value=!!t();return n(),B_(n,e),r}const Ig=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Bg="__vueuse_ssr_handlers__";Ig[Bg]=Ig[Bg]||{};var Dg=Object.getOwnPropertySymbols,P_=Object.prototype.hasOwnProperty,O_=Object.prototype.propertyIsEnumerable,A_=(t,e)=>{var r={};for(var n in t)P_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Dg)for(var n of Dg(t))e.indexOf(n)<0&&O_.call(t,n)&&(r[n]=t[n]);return r};function Vr(t,e,r={}){const n=r,{window:a=Bo}=n,i=A_(n,["window"]);let o;const l=Ng(()=>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 Io(d),{isSupported:l,stop:d}}var Pg=Object.getOwnPropertySymbols,R_=Object.prototype.hasOwnProperty,L_=Object.prototype.propertyIsEnumerable,M_=(t,e)=>{var r={};for(var n in t)R_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Pg)for(var n of Pg(t))e.indexOf(n)<0&&L_.call(t,n)&&(r[n]=t[n]);return r};function F_(t,e,r={}){const n=r,{window:a=Bo}=n,i=M_(n,["window"]);let o;const l=Ng(()=>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 Io(d),{isSupported:l,stop:d}}var Og;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Og||(Og={}));var $_=Object.defineProperty,Ag=Object.getOwnPropertySymbols,V_=Object.prototype.hasOwnProperty,q_=Object.prototype.propertyIsEnumerable,Rg=(t,e,r)=>e in t?$_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z_=(t,e)=>{for(var r in e||(e={}))V_.call(e,r)&&Rg(t,r,e[r]);if(Ag)for(var r of Ag(e))q_.call(e,r)&&Rg(t,r,e[r]);return t};z_({linear:I_},{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 H_=()=>rt&&/firefox/i.test(window.navigator.userAgent),_l=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(Ne,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("@element-plus/icons-vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue"],Te):(Ne=typeof globalThis<"u"?globalThis:Ne||self,Te(Ne.MapUtilities={},Ne["@element-plus/icons-vue"],Ne.Vue))})(this,function(Ne,Te,s){"use strict";var eG=Object.defineProperty;var tG=(Ne,Te,s)=>Te in Ne?eG(Ne,Te,{enumerable:!0,configurable:!0,writable:!0,value:s}):Ne[Te]=s;var cr=(Ne,Te,s)=>tG(Ne,typeof Te!="symbol"?Te+"":Te,s);const Fr=(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 Sg;const rt=typeof window<"u",I_=t=>typeof t=="string",_g=()=>{},Sl=rt&&((Sg=window==null?void 0:window.navigator)==null?void 0:Sg.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Tg(t){return typeof t=="function"?t():s.unref(t)}function B_(t){return t}function Io(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function D_(t,e=!0){s.getCurrentInstance()?s.onMounted(t):e?t():s.nextTick(t)}function $r(t){var e;const r=Tg(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Bo=rt?window:void 0;function Qt(...t){let e,r,n,a;if(I_(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Bo):[e,r,n,a]=t,!e)return _g;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),Tg(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 Io(u),u}let Ng=!1;function P_(t,e,r={}){const{window:n=Bo,ignore:a=[],capture:i=!0,detectIframe:o=!1}=r;if(!n)return;Sl&&!Ng&&(Ng=!0,Array.from(n.document.body.children).forEach(h=>h.addEventListener("click",_g)));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 Ig(t,e=!1){const r=s.ref(),n=()=>r.value=!!t();return n(),D_(n,e),r}const Bg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dg="__vueuse_ssr_handlers__";Bg[Dg]=Bg[Dg]||{};var Pg=Object.getOwnPropertySymbols,O_=Object.prototype.hasOwnProperty,A_=Object.prototype.propertyIsEnumerable,R_=(t,e)=>{var r={};for(var n in t)O_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Pg)for(var n of Pg(t))e.indexOf(n)<0&&A_.call(t,n)&&(r[n]=t[n]);return r};function Vr(t,e,r={}){const n=r,{window:a=Bo}=n,i=R_(n,["window"]);let o;const l=Ig(()=>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 Io(d),{isSupported:l,stop:d}}var Og=Object.getOwnPropertySymbols,L_=Object.prototype.hasOwnProperty,M_=Object.prototype.propertyIsEnumerable,F_=(t,e)=>{var r={};for(var n in t)L_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Og)for(var n of Og(t))e.indexOf(n)<0&&M_.call(t,n)&&(r[n]=t[n]);return r};function $_(t,e,r={}){const n=r,{window:a=Bo}=n,i=F_(n,["window"]);let o;const l=Ig(()=>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 Io(d),{isSupported:l,stop:d}}var Ag;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Ag||(Ag={}));var V_=Object.defineProperty,Rg=Object.getOwnPropertySymbols,q_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable,Lg=(t,e,r)=>e in t?V_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H_=(t,e)=>{for(var r in e||(e={}))q_.call(e,r)&&Lg(t,r,e[r]);if(Rg)for(var r of Rg(e))z_.call(e,r)&&Lg(t,r,e[r]);return t};H_({linear:B_},{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 K_=()=>rt&&/firefox/i.test(window.navigator.userAgent),_l=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 hi=()=>{},K_=Object.prototype.hasOwnProperty,Rn=(t,e)=>K_.call(t,e),$t=Array.isArray,Mt=t=>typeof t=="function",Nt=t=>typeof t=="string",bt=t=>t!==null&&typeof t=="object",G_=Object.prototype.toString,U_=t=>G_.call(t),Tl=t=>U_(t).slice(8,-1),Lg=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},j_=/-(\w)/g,W_=Lg(t=>t.replace(j_,(e,r)=>r?r.toUpperCase():"")),Y_=/\B([A-Z])/g,Z_=Lg(t=>t.replace(Y_,"-$1").toLowerCase());var Mg=typeof global=="object"&&global&&global.Object===Object&&global,X_=typeof self=="object"&&self&&self.Object===Object&&self,kr=Mg||X_||Function("return this")(),Sr=kr.Symbol,Fg=Object.prototype,Q_=Fg.hasOwnProperty,J_=Fg.toString,pi=Sr?Sr.toStringTag:void 0;function eT(t){var e=Q_.call(t,pi),r=t[pi];try{t[pi]=void 0;var n=!0}catch{}var a=J_.call(t);return n&&(e?t[pi]=r:delete t[pi]),a}var tT=Object.prototype,rT=tT.toString;function nT(t){return rT.call(t)}var aT="[object Null]",iT="[object Undefined]",$g=Sr?Sr.toStringTag:void 0;function va(t){return t==null?t===void 0?iT:aT:$g&&$g in Object(t)?eT(t):nT(t)}function ga(t){return t!=null&&typeof t=="object"}var oT="[object Symbol]";function Do(t){return typeof t=="symbol"||ga(t)&&va(t)==oT}function sT(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,lT=1/0,Vg=Sr?Sr.prototype:void 0,qg=Vg?Vg.toString:void 0;function zg(t){if(typeof t=="string")return t;if(dr(t))return sT(t,zg)+"";if(Do(t))return qg?qg.call(t):"";var e=t+"";return e=="0"&&1/t==-lT?"-0":e}var uT=/\s/;function cT(t){for(var e=t.length;e--&&uT.test(t.charAt(e)););return e}var dT=/^\s+/;function fT(t){return t&&t.slice(0,cT(t)+1).replace(dT,"")}function nn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Hg=NaN,hT=/^[-+]0x[0-9a-f]+$/i,pT=/^0b[01]+$/i,vT=/^0o[0-7]+$/i,gT=parseInt;function Kg(t){if(typeof t=="number")return t;if(Do(t))return Hg;if(nn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=fT(t);var r=pT.test(t);return r||vT.test(t)?gT(t.slice(2),r?2:8):hT.test(t)?Hg:+t}function Gg(t){return t}var mT="[object AsyncFunction]",yT="[object Function]",bT="[object GeneratorFunction]",wT="[object Proxy]";function Ug(t){if(!nn(t))return!1;var e=va(t);return e==yT||e==bT||e==mT||e==wT}var Nl=kr["__core-js_shared__"],jg=function(){var t=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function CT(t){return!!jg&&jg in t}var ET=Function.prototype,xT=ET.toString;function Ln(t){if(t!=null){try{return xT.call(t)}catch{}try{return t+""}catch{}}return""}var kT=/[\\^$.*+?()[\]{}|]/g,ST=/^\[object .+?Constructor\]$/,_T=Function.prototype,TT=Object.prototype,NT=_T.toString,IT=TT.hasOwnProperty,BT=RegExp("^"+NT.call(IT).replace(kT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function DT(t){if(!nn(t)||CT(t))return!1;var e=Ug(t)?BT:ST;return e.test(Ln(t))}function PT(t,e){return t==null?void 0:t[e]}function Mn(t,e){var r=PT(t,e);return DT(r)?r:void 0}var Il=Mn(kr,"WeakMap");function OT(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 AT=800,RT=16,LT=Date.now;function MT(t){var e=0,r=0;return function(){var n=LT(),a=RT-(n-r);if(r=n,a>0){if(++e>=AT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function FT(t){return function(){return t}}var Po=function(){try{var t=Mn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),$T=Po?function(t,e){return Po(t,"toString",{configurable:!0,enumerable:!1,value:FT(e),writable:!0})}:Gg,VT=MT($T);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 zT=9007199254740991,HT=/^(?:0|[1-9]\d*)$/;function Bl(t,e){var r=typeof t;return e=e??zT,!!e&&(r=="number"||r!="symbol"&&HT.test(t))&&t>-1&&t%1==0&&t<e}function KT(t,e,r){e=="__proto__"&&Po?Po(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Dl(t,e){return t===e||t!==t&&e!==e}var GT=Object.prototype,UT=GT.hasOwnProperty;function jT(t,e,r){var n=t[e];(!(UT.call(t,e)&&Dl(n,r))||r===void 0&&!(e in t))&&KT(t,e,r)}var Wg=Math.max;function WT(t,e,r){return e=Wg(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=Wg(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),OT(t,this,l)}}var YT=9007199254740991;function Pl(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=YT}function ZT(t){return t!=null&&Pl(t.length)&&!Ug(t)}var XT=Object.prototype;function QT(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||XT;return t===r}function JT(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var eN="[object Arguments]";function Yg(t){return ga(t)&&va(t)==eN}var Zg=Object.prototype,tN=Zg.hasOwnProperty,rN=Zg.propertyIsEnumerable,Ol=Yg(function(){return arguments}())?Yg:function(t){return ga(t)&&tN.call(t,"callee")&&!rN.call(t,"callee")};function nN(){return!1}var Xg=typeof Ne=="object"&&Ne&&!Ne.nodeType&&Ne,Qg=Xg&&typeof module=="object"&&module&&!module.nodeType&&module,aN=Qg&&Qg.exports===Xg,Jg=aN?kr.Buffer:void 0,iN=Jg?Jg.isBuffer:void 0,Al=iN||nN,oN="[object Arguments]",sN="[object Array]",lN="[object Boolean]",uN="[object Date]",cN="[object Error]",dN="[object Function]",fN="[object Map]",hN="[object Number]",pN="[object Object]",vN="[object RegExp]",gN="[object Set]",mN="[object String]",yN="[object WeakMap]",bN="[object ArrayBuffer]",wN="[object DataView]",CN="[object Float32Array]",EN="[object Float64Array]",xN="[object Int8Array]",kN="[object Int16Array]",SN="[object Int32Array]",_N="[object Uint8Array]",TN="[object Uint8ClampedArray]",NN="[object Uint16Array]",IN="[object Uint32Array]",We={};We[CN]=We[EN]=We[xN]=We[kN]=We[SN]=We[_N]=We[TN]=We[NN]=We[IN]=!0,We[oN]=We[sN]=We[bN]=We[lN]=We[wN]=We[uN]=We[cN]=We[dN]=We[fN]=We[hN]=We[pN]=We[vN]=We[gN]=We[mN]=We[yN]=!1;function BN(t){return ga(t)&&Pl(t.length)&&!!We[va(t)]}function DN(t){return function(e){return t(e)}}var em=typeof Ne=="object"&&Ne&&!Ne.nodeType&&Ne,vi=em&&typeof module=="object"&&module&&!module.nodeType&&module,PN=vi&&vi.exports===em,Rl=PN&&Mg.process,tm=function(){try{var t=vi&&vi.require&&vi.require("util").types;return t||Rl&&Rl.binding&&Rl.binding("util")}catch{}}(),rm=tm&&tm.isTypedArray,nm=rm?DN(rm):BN,ON=Object.prototype,AN=ON.hasOwnProperty;function RN(t,e){var r=dr(t),n=!r&&Ol(t),a=!r&&!n&&Al(t),i=!r&&!n&&!a&&nm(t),o=r||n||a||i,l=o?JT(t.length,String):[],c=l.length;for(var u in t)AN.call(t,u)&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Bl(u,c)))&&l.push(u);return l}function LN(t,e){return function(r){return t(e(r))}}var MN=LN(Object.keys,Object),FN=Object.prototype,$N=FN.hasOwnProperty;function VN(t){if(!QT(t))return MN(t);var e=[];for(var r in Object(t))$N.call(t,r)&&r!="constructor"&&e.push(r);return e}function am(t){return ZT(t)?RN(t):VN(t)}var qN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zN=/^\w*$/;function Ll(t,e){if(dr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Do(t)?!0:zN.test(t)||!qN.test(t)||e!=null&&t in Object(e)}var gi=Mn(Object,"create");function HN(){this.__data__=gi?gi(null):{},this.size=0}function KN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var GN="__lodash_hash_undefined__",UN=Object.prototype,jN=UN.hasOwnProperty;function WN(t){var e=this.__data__;if(gi){var r=e[t];return r===GN?void 0:r}return jN.call(e,t)?e[t]:void 0}var YN=Object.prototype,ZN=YN.hasOwnProperty;function XN(t){var e=this.__data__;return gi?e[t]!==void 0:ZN.call(e,t)}var QN="__lodash_hash_undefined__";function JN(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=gi&&e===void 0?QN:e,this}function Fn(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])}}Fn.prototype.clear=HN,Fn.prototype.delete=KN,Fn.prototype.get=WN,Fn.prototype.has=XN,Fn.prototype.set=JN;function eI(){this.__data__=[],this.size=0}function Oo(t,e){for(var r=t.length;r--;)if(Dl(t[r][0],e))return r;return-1}var tI=Array.prototype,rI=tI.splice;function nI(t){var e=this.__data__,r=Oo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():rI.call(e,r,1),--this.size,!0}function aI(t){var e=this.__data__,r=Oo(e,t);return r<0?void 0:e[r][1]}function iI(t){return Oo(this.__data__,t)>-1}function oI(t,e){var r=this.__data__,n=Oo(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=eI,qr.prototype.delete=nI,qr.prototype.get=aI,qr.prototype.has=iI,qr.prototype.set=oI;var mi=Mn(kr,"Map");function sI(){this.size=0,this.__data__={hash:new Fn,map:new(mi||qr),string:new Fn}}function lI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ao(t,e){var r=t.__data__;return lI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function uI(t){var e=Ao(this,t).delete(t);return this.size-=e?1:0,e}function cI(t){return Ao(this,t).get(t)}function dI(t){return Ao(this,t).has(t)}function fI(t,e){var r=Ao(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=sI,zr.prototype.delete=uI,zr.prototype.get=cI,zr.prototype.has=dI,zr.prototype.set=fI;var hI="Expected a function";function Ml(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(hI);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 pI=500;function vI(t){var e=Ml(t,function(n){return r.size===pI&&r.clear(),n}),r=e.cache;return e}var gI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mI=/\\(\\)?/g,yI=vI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(gI,function(r,n,a,i){e.push(a?i.replace(mI,"$1"):n||r)}),e});function bI(t){return t==null?"":zg(t)}function Ro(t,e){return dr(t)?t:Ll(t,e)?[t]:yI(bI(t))}var wI=1/0;function yi(t){if(typeof t=="string"||Do(t))return t;var e=t+"";return e=="0"&&1/t==-wI?"-0":e}function Fl(t,e){e=Ro(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[yi(e[r++])];return r&&r==n?t:void 0}function Hr(t,e,r){var n=t==null?void 0:Fl(t,e);return n===void 0?r:n}function im(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var om=Sr?Sr.isConcatSpreadable:void 0;function CI(t){return dr(t)||Ol(t)||!!(om&&t&&t[om])}function EI(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=CI),a||(a=[]);++i<o;){var l=t[i];r(l)?im(a,l):a[a.length]=l}return a}function xI(t){var e=t==null?0:t.length;return e?EI(t):[]}function kI(t){return VT(WT(t,void 0,xI),t+"")}function an(){if(!arguments.length)return[];var t=arguments[0];return dr(t)?t:[t]}function SI(){this.__data__=new qr,this.size=0}function _I(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function TI(t){return this.__data__.get(t)}function NI(t){return this.__data__.has(t)}var II=200;function BI(t,e){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!mi||n.length<II-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=SI,Kr.prototype.delete=_I,Kr.prototype.get=TI,Kr.prototype.has=NI,Kr.prototype.set=BI;function DI(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 PI(){return[]}var OI=Object.prototype,AI=OI.propertyIsEnumerable,sm=Object.getOwnPropertySymbols,RI=sm?function(t){return t==null?[]:(t=Object(t),DI(sm(t),function(e){return AI.call(t,e)}))}:PI;function LI(t,e,r){var n=e(t);return dr(t)?n:im(n,r(t))}function lm(t){return LI(t,am,RI)}var $l=Mn(kr,"DataView"),Vl=Mn(kr,"Promise"),ql=Mn(kr,"Set"),um="[object Map]",MI="[object Object]",cm="[object Promise]",dm="[object Set]",fm="[object WeakMap]",hm="[object DataView]",FI=Ln($l),$I=Ln(mi),VI=Ln(Vl),qI=Ln(ql),zI=Ln(Il),on=va;($l&&on(new $l(new ArrayBuffer(1)))!=hm||mi&&on(new mi)!=um||Vl&&on(Vl.resolve())!=cm||ql&&on(new ql)!=dm||Il&&on(new Il)!=fm)&&(on=function(t){var e=va(t),r=e==MI?t.constructor:void 0,n=r?Ln(r):"";if(n)switch(n){case FI:return hm;case $I:return um;case VI:return cm;case qI:return dm;case zI:return fm}return e});var pm=kr.Uint8Array,HI="__lodash_hash_undefined__";function KI(t){return this.__data__.set(t,HI),this}function GI(t){return this.__data__.has(t)}function Lo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new zr;++e<r;)this.add(t[e])}Lo.prototype.add=Lo.prototype.push=KI,Lo.prototype.has=GI;function UI(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 jI(t,e){return t.has(e)}var WI=1,YI=2;function vm(t,e,r,n,a,i){var o=r&WI,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&YI?new Lo:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(n)var m=o?n(g,p,f,e,t,i):n(p,g,f,t,e,i);if(m!==void 0){if(m)continue;h=!1;break}if(v){if(!UI(e,function(y,b){if(!jI(v,b)&&(p===y||a(p,y,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 ZI(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function XI(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var QI=1,JI=2,eB="[object Boolean]",tB="[object Date]",rB="[object Error]",nB="[object Map]",aB="[object Number]",iB="[object RegExp]",oB="[object Set]",sB="[object String]",lB="[object Symbol]",uB="[object ArrayBuffer]",cB="[object DataView]",gm=Sr?Sr.prototype:void 0,zl=gm?gm.valueOf:void 0;function dB(t,e,r,n,a,i,o){switch(r){case cB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case uB:return!(t.byteLength!=e.byteLength||!i(new pm(t),new pm(e)));case eB:case tB:case aB:return Dl(+t,+e);case rB:return t.name==e.name&&t.message==e.message;case iB:case sB:return t==e+"";case nB:var l=ZI;case oB:var c=n&QI;if(l||(l=XI),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=JI,o.set(t,e);var d=vm(l(t),l(e),n,a,i,o);return o.delete(t),d;case lB:if(zl)return zl.call(t)==zl.call(e)}return!1}var fB=1,hB=Object.prototype,pB=hB.hasOwnProperty;function vB(t,e,r,n,a,i){var o=r&fB,l=lm(t),c=l.length,u=lm(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in e:pB.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 m=o;++f<c;){h=l[f];var y=t[h],b=e[h];if(n)var w=o?n(b,y,h,e,t,i):n(y,b,h,t,e,i);if(!(w===void 0?y===b||a(y,b,r,n,i):w)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){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 gB=1,mm="[object Arguments]",ym="[object Array]",Mo="[object Object]",mB=Object.prototype,bm=mB.hasOwnProperty;function yB(t,e,r,n,a,i){var o=dr(t),l=dr(e),c=o?ym:on(t),u=l?ym:on(e);c=c==mm?Mo:c,u=u==mm?Mo:u;var d=c==Mo,f=u==Mo,h=c==u;if(h&&Al(t)){if(!Al(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Kr),o||nm(t)?vm(t,e,r,n,a,i):dB(t,e,c,r,n,a,i);if(!(r&gB)){var v=d&&bm.call(t,"__wrapped__"),p=f&&bm.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,m=p?e.value():e;return i||(i=new Kr),a(g,m,r,n,i)}}return h?(i||(i=new Kr),vB(t,e,r,n,a,i)):!1}function Fo(t,e,r,n,a){return t===e?!0:t==null||e==null||!ga(t)&&!ga(e)?t!==t&&e!==e:yB(t,e,r,n,Fo,a)}var bB=1,wB=2;function CB(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?Fo(u,c,bB|wB,n,d):f))return!1}}return!0}function wm(t){return t===t&&!nn(t)}function EB(t){for(var e=am(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,wm(a)]}return e}function Cm(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function xB(t){var e=EB(t);return e.length==1&&e[0][2]?Cm(e[0][0],e[0][1]):function(r){return r===t||CB(r,t,e)}}function kB(t,e){return t!=null&&e in Object(t)}function SB(t,e,r){e=Ro(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=yi(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&&Pl(a)&&Bl(o,a)&&(dr(t)||Ol(t)))}function Em(t,e){return t!=null&&SB(t,e,kB)}var _B=1,TB=2;function NB(t,e){return Ll(t)&&wm(e)?Cm(yi(t),e):function(r){var n=Hr(r,t);return n===void 0&&n===e?Em(r,t):Fo(e,n,_B|TB)}}function IB(t){return function(e){return e==null?void 0:e[t]}}function BB(t){return function(e){return Fl(e,t)}}function DB(t){return Ll(t)?IB(yi(t)):BB(t)}function PB(t){return typeof t=="function"?t:t==null?Gg:typeof t=="object"?dr(t)?NB(t[0],t[1]):xB(t):DB(t)}var Hl=function(){return kr.Date.now()},OB="Expected a function",AB=Math.max,RB=Math.min;function xm(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(OB);e=Kg(e)||0,nn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?AB(Kg(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(y,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?RB(S,i-_):S}function m(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function y(){var k=Hl();if(m(k))return b(k);l=setTimeout(y,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(Hl())}function x(){var k=Hl(),E=m(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(y,e),v(c)}return l===void 0&&(l=setTimeout(y,e)),o}return x.cancel=w,x.flush=C,x}function LB(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return qT(t,PB(e),a)}function $o(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 Vo(t,e){return Fo(t,e)}function sn(t){return t==null}function MB(t){return t===void 0}function FB(t,e,r,n){if(!nn(t))return t;e=Ro(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=yi(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=nn(d)?d:Bl(e[a+1])?[]:{})}jT(l,c,u),l=l[c]}return t}function $B(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],l=Fl(t,o);r(l,o)&&FB(i,Ro(o,t),l)}return i}function VB(t,e){return $B(t,e,function(r,n){return Em(t,n)})}var km=kI(function(t,e){return t==null?{}:VB(t,e)});const ln=t=>t===void 0,ma=t=>typeof t=="boolean",wt=t=>typeof t=="number",$n=t=>typeof Element>"u"?!1:t instanceof Element,qo=t=>sn(t),qB=t=>Nt(t)?!Number.isNaN(Number(t)):!1,zB=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Sm=t=>Object.keys(t);class _m extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function HB(t,e){throw new _m(`[${t}] ${e}`)}function nt(t,e){if(process.env.NODE_ENV!=="production"){const r=Nt(t)?new _m(`[${t}] ${e}`):t;console.warn(r)}}const KB="utils/dom/style",Tm=(t="")=>t.split(" ").filter(e=>!!e.trim()),Kl=(t,e)=>{!t||!e.trim()||t.classList.add(...Tm(e))},Vn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Tm(e))},bi=(t,e)=>{var r;if(!rt||!t||!e)return"";let n=W_(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 ya(t,e="px"){if(!t)return"";if(wt(t)||qB(t))return`${t}${e}`;if(Nt(t))return t;nt(KB,"binding value must be a string or number")}function GB(t,e){if(!rt)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 Nm="__epPropKey",ke=t=>t,UB=t=>bt(t)&&!!t[Nm],zo=(t,e)=>{if(!bt(t)||UB(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),Rn(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,[Nm]:!0};return Rn(t,"default")&&(c.default=a),c},Fe=t=>$o(Object.entries(t).map(([e,r])=>[e,zo(r,e)])),un=ke([String,Object,Function]),Im={validating:Te.Loading,success:Te.CircleCheck,error:Te.CircleClose},vt=(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},jB=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Gr=t=>(t.install=hi,t),lt={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"},Ct="update:modelValue",Gl="change",Bm=["","default","small","large"],WB=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ba=t=>t,YB=["class","style"],ZB=/^on[A-Z]/,XB=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=s.computed(()=>((r==null?void 0:r.value)||[]).concat(YB)),a=s.getCurrentInstance();return a?s.computed(()=>{var i;return $o(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(e&&ZB.test(o))))}):(nt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),s.computed(()=>({})))},Ho=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},o)=>{s.watch(()=>s.unref(o),l=>{l&&nt(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 hi=()=>{},G_=Object.prototype.hasOwnProperty,Rn=(t,e)=>G_.call(t,e),$t=Array.isArray,Mt=t=>typeof t=="function",Nt=t=>typeof t=="string",bt=t=>t!==null&&typeof t=="object",U_=Object.prototype.toString,j_=t=>U_.call(t),Tl=t=>j_(t).slice(8,-1),Mg=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},W_=/-(\w)/g,Y_=Mg(t=>t.replace(W_,(e,r)=>r?r.toUpperCase():"")),Z_=/\B([A-Z])/g,X_=Mg(t=>t.replace(Z_,"-$1").toLowerCase());var Fg=typeof global=="object"&&global&&global.Object===Object&&global,J_=typeof self=="object"&&self&&self.Object===Object&&self,kr=Fg||J_||Function("return this")(),Sr=kr.Symbol,$g=Object.prototype,Q_=$g.hasOwnProperty,eT=$g.toString,pi=Sr?Sr.toStringTag:void 0;function tT(t){var e=Q_.call(t,pi),r=t[pi];try{t[pi]=void 0;var n=!0}catch{}var a=eT.call(t);return n&&(e?t[pi]=r:delete t[pi]),a}var rT=Object.prototype,nT=rT.toString;function aT(t){return nT.call(t)}var iT="[object Null]",oT="[object Undefined]",Vg=Sr?Sr.toStringTag:void 0;function ga(t){return t==null?t===void 0?oT:iT:Vg&&Vg in Object(t)?tT(t):aT(t)}function ma(t){return t!=null&&typeof t=="object"}var sT="[object Symbol]";function Do(t){return typeof t=="symbol"||ma(t)&&ga(t)==sT}function lT(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,uT=1/0,qg=Sr?Sr.prototype:void 0,zg=qg?qg.toString:void 0;function Hg(t){if(typeof t=="string")return t;if(dr(t))return lT(t,Hg)+"";if(Do(t))return zg?zg.call(t):"";var e=t+"";return e=="0"&&1/t==-uT?"-0":e}var cT=/\s/;function dT(t){for(var e=t.length;e--&&cT.test(t.charAt(e)););return e}var fT=/^\s+/;function hT(t){return t&&t.slice(0,dT(t)+1).replace(fT,"")}function nn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Kg=NaN,pT=/^[-+]0x[0-9a-f]+$/i,vT=/^0b[01]+$/i,gT=/^0o[0-7]+$/i,mT=parseInt;function Gg(t){if(typeof t=="number")return t;if(Do(t))return Kg;if(nn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=hT(t);var r=vT.test(t);return r||gT.test(t)?mT(t.slice(2),r?2:8):pT.test(t)?Kg:+t}function Ug(t){return t}var yT="[object AsyncFunction]",bT="[object Function]",wT="[object GeneratorFunction]",CT="[object Proxy]";function jg(t){if(!nn(t))return!1;var e=ga(t);return e==bT||e==wT||e==yT||e==CT}var Nl=kr["__core-js_shared__"],Wg=function(){var t=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ET(t){return!!Wg&&Wg in t}var xT=Function.prototype,kT=xT.toString;function Ln(t){if(t!=null){try{return kT.call(t)}catch{}try{return t+""}catch{}}return""}var ST=/[\\^$.*+?()[\]{}|]/g,_T=/^\[object .+?Constructor\]$/,TT=Function.prototype,NT=Object.prototype,IT=TT.toString,BT=NT.hasOwnProperty,DT=RegExp("^"+IT.call(BT).replace(ST,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function PT(t){if(!nn(t)||ET(t))return!1;var e=jg(t)?DT:_T;return e.test(Ln(t))}function OT(t,e){return t==null?void 0:t[e]}function Mn(t,e){var r=OT(t,e);return PT(r)?r:void 0}var Il=Mn(kr,"WeakMap");function AT(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 RT=800,LT=16,MT=Date.now;function FT(t){var e=0,r=0;return function(){var n=MT(),a=LT-(n-r);if(r=n,a>0){if(++e>=RT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function $T(t){return function(){return t}}var Po=function(){try{var t=Mn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),VT=Po?function(t,e){return Po(t,"toString",{configurable:!0,enumerable:!1,value:$T(e),writable:!0})}:Ug,qT=FT(VT);function zT(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var HT=9007199254740991,KT=/^(?:0|[1-9]\d*)$/;function Bl(t,e){var r=typeof t;return e=e??HT,!!e&&(r=="number"||r!="symbol"&&KT.test(t))&&t>-1&&t%1==0&&t<e}function GT(t,e,r){e=="__proto__"&&Po?Po(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Dl(t,e){return t===e||t!==t&&e!==e}var UT=Object.prototype,jT=UT.hasOwnProperty;function WT(t,e,r){var n=t[e];(!(jT.call(t,e)&&Dl(n,r))||r===void 0&&!(e in t))&&GT(t,e,r)}var Yg=Math.max;function YT(t,e,r){return e=Yg(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=Yg(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),AT(t,this,l)}}var ZT=9007199254740991;function Pl(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ZT}function XT(t){return t!=null&&Pl(t.length)&&!jg(t)}var JT=Object.prototype;function QT(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||JT;return t===r}function eN(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var tN="[object Arguments]";function Zg(t){return ma(t)&&ga(t)==tN}var Xg=Object.prototype,rN=Xg.hasOwnProperty,nN=Xg.propertyIsEnumerable,Ol=Zg(function(){return arguments}())?Zg:function(t){return ma(t)&&rN.call(t,"callee")&&!nN.call(t,"callee")};function aN(){return!1}var Jg=typeof Ne=="object"&&Ne&&!Ne.nodeType&&Ne,Qg=Jg&&typeof module=="object"&&module&&!module.nodeType&&module,iN=Qg&&Qg.exports===Jg,em=iN?kr.Buffer:void 0,oN=em?em.isBuffer:void 0,Al=oN||aN,sN="[object Arguments]",lN="[object Array]",uN="[object Boolean]",cN="[object Date]",dN="[object Error]",fN="[object Function]",hN="[object Map]",pN="[object Number]",vN="[object Object]",gN="[object RegExp]",mN="[object Set]",yN="[object String]",bN="[object WeakMap]",wN="[object ArrayBuffer]",CN="[object DataView]",EN="[object Float32Array]",xN="[object Float64Array]",kN="[object Int8Array]",SN="[object Int16Array]",_N="[object Int32Array]",TN="[object Uint8Array]",NN="[object Uint8ClampedArray]",IN="[object Uint16Array]",BN="[object Uint32Array]",We={};We[EN]=We[xN]=We[kN]=We[SN]=We[_N]=We[TN]=We[NN]=We[IN]=We[BN]=!0,We[sN]=We[lN]=We[wN]=We[uN]=We[CN]=We[cN]=We[dN]=We[fN]=We[hN]=We[pN]=We[vN]=We[gN]=We[mN]=We[yN]=We[bN]=!1;function DN(t){return ma(t)&&Pl(t.length)&&!!We[ga(t)]}function PN(t){return function(e){return t(e)}}var tm=typeof Ne=="object"&&Ne&&!Ne.nodeType&&Ne,vi=tm&&typeof module=="object"&&module&&!module.nodeType&&module,ON=vi&&vi.exports===tm,Rl=ON&&Fg.process,rm=function(){try{var t=vi&&vi.require&&vi.require("util").types;return t||Rl&&Rl.binding&&Rl.binding("util")}catch{}}(),nm=rm&&rm.isTypedArray,am=nm?PN(nm):DN,AN=Object.prototype,RN=AN.hasOwnProperty;function LN(t,e){var r=dr(t),n=!r&&Ol(t),a=!r&&!n&&Al(t),i=!r&&!n&&!a&&am(t),o=r||n||a||i,l=o?eN(t.length,String):[],c=l.length;for(var u in t)RN.call(t,u)&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Bl(u,c)))&&l.push(u);return l}function MN(t,e){return function(r){return t(e(r))}}var FN=MN(Object.keys,Object),$N=Object.prototype,VN=$N.hasOwnProperty;function qN(t){if(!QT(t))return FN(t);var e=[];for(var r in Object(t))VN.call(t,r)&&r!="constructor"&&e.push(r);return e}function im(t){return XT(t)?LN(t):qN(t)}var zN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,HN=/^\w*$/;function Ll(t,e){if(dr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Do(t)?!0:HN.test(t)||!zN.test(t)||e!=null&&t in Object(e)}var gi=Mn(Object,"create");function KN(){this.__data__=gi?gi(null):{},this.size=0}function GN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var UN="__lodash_hash_undefined__",jN=Object.prototype,WN=jN.hasOwnProperty;function YN(t){var e=this.__data__;if(gi){var r=e[t];return r===UN?void 0:r}return WN.call(e,t)?e[t]:void 0}var ZN=Object.prototype,XN=ZN.hasOwnProperty;function JN(t){var e=this.__data__;return gi?e[t]!==void 0:XN.call(e,t)}var QN="__lodash_hash_undefined__";function eI(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=gi&&e===void 0?QN:e,this}function Fn(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])}}Fn.prototype.clear=KN,Fn.prototype.delete=GN,Fn.prototype.get=YN,Fn.prototype.has=JN,Fn.prototype.set=eI;function tI(){this.__data__=[],this.size=0}function Oo(t,e){for(var r=t.length;r--;)if(Dl(t[r][0],e))return r;return-1}var rI=Array.prototype,nI=rI.splice;function aI(t){var e=this.__data__,r=Oo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():nI.call(e,r,1),--this.size,!0}function iI(t){var e=this.__data__,r=Oo(e,t);return r<0?void 0:e[r][1]}function oI(t){return Oo(this.__data__,t)>-1}function sI(t,e){var r=this.__data__,n=Oo(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=tI,qr.prototype.delete=aI,qr.prototype.get=iI,qr.prototype.has=oI,qr.prototype.set=sI;var mi=Mn(kr,"Map");function lI(){this.size=0,this.__data__={hash:new Fn,map:new(mi||qr),string:new Fn}}function uI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ao(t,e){var r=t.__data__;return uI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function cI(t){var e=Ao(this,t).delete(t);return this.size-=e?1:0,e}function dI(t){return Ao(this,t).get(t)}function fI(t){return Ao(this,t).has(t)}function hI(t,e){var r=Ao(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=lI,zr.prototype.delete=cI,zr.prototype.get=dI,zr.prototype.has=fI,zr.prototype.set=hI;var pI="Expected a function";function Ml(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(pI);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 vI=500;function gI(t){var e=Ml(t,function(n){return r.size===vI&&r.clear(),n}),r=e.cache;return e}var mI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yI=/\\(\\)?/g,bI=gI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(mI,function(r,n,a,i){e.push(a?i.replace(yI,"$1"):n||r)}),e});function wI(t){return t==null?"":Hg(t)}function Ro(t,e){return dr(t)?t:Ll(t,e)?[t]:bI(wI(t))}var CI=1/0;function yi(t){if(typeof t=="string"||Do(t))return t;var e=t+"";return e=="0"&&1/t==-CI?"-0":e}function Fl(t,e){e=Ro(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[yi(e[r++])];return r&&r==n?t:void 0}function Hr(t,e,r){var n=t==null?void 0:Fl(t,e);return n===void 0?r:n}function om(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var sm=Sr?Sr.isConcatSpreadable:void 0;function EI(t){return dr(t)||Ol(t)||!!(sm&&t&&t[sm])}function xI(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=EI),a||(a=[]);++i<o;){var l=t[i];r(l)?om(a,l):a[a.length]=l}return a}function kI(t){var e=t==null?0:t.length;return e?xI(t):[]}function SI(t){return qT(YT(t,void 0,kI),t+"")}function an(){if(!arguments.length)return[];var t=arguments[0];return dr(t)?t:[t]}function _I(){this.__data__=new qr,this.size=0}function TI(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function NI(t){return this.__data__.get(t)}function II(t){return this.__data__.has(t)}var BI=200;function DI(t,e){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!mi||n.length<BI-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=_I,Kr.prototype.delete=TI,Kr.prototype.get=NI,Kr.prototype.has=II,Kr.prototype.set=DI;function PI(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 OI(){return[]}var AI=Object.prototype,RI=AI.propertyIsEnumerable,lm=Object.getOwnPropertySymbols,LI=lm?function(t){return t==null?[]:(t=Object(t),PI(lm(t),function(e){return RI.call(t,e)}))}:OI;function MI(t,e,r){var n=e(t);return dr(t)?n:om(n,r(t))}function um(t){return MI(t,im,LI)}var $l=Mn(kr,"DataView"),Vl=Mn(kr,"Promise"),ql=Mn(kr,"Set"),cm="[object Map]",FI="[object Object]",dm="[object Promise]",fm="[object Set]",hm="[object WeakMap]",pm="[object DataView]",$I=Ln($l),VI=Ln(mi),qI=Ln(Vl),zI=Ln(ql),HI=Ln(Il),on=ga;($l&&on(new $l(new ArrayBuffer(1)))!=pm||mi&&on(new mi)!=cm||Vl&&on(Vl.resolve())!=dm||ql&&on(new ql)!=fm||Il&&on(new Il)!=hm)&&(on=function(t){var e=ga(t),r=e==FI?t.constructor:void 0,n=r?Ln(r):"";if(n)switch(n){case $I:return pm;case VI:return cm;case qI:return dm;case zI:return fm;case HI:return hm}return e});var vm=kr.Uint8Array,KI="__lodash_hash_undefined__";function GI(t){return this.__data__.set(t,KI),this}function UI(t){return this.__data__.has(t)}function Lo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new zr;++e<r;)this.add(t[e])}Lo.prototype.add=Lo.prototype.push=GI,Lo.prototype.has=UI;function jI(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 WI(t,e){return t.has(e)}var YI=1,ZI=2;function gm(t,e,r,n,a,i){var o=r&YI,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&ZI?new Lo:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(n)var m=o?n(g,p,f,e,t,i):n(p,g,f,t,e,i);if(m!==void 0){if(m)continue;h=!1;break}if(v){if(!jI(e,function(y,b){if(!WI(v,b)&&(p===y||a(p,y,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 XI(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function JI(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var QI=1,eB=2,tB="[object Boolean]",rB="[object Date]",nB="[object Error]",aB="[object Map]",iB="[object Number]",oB="[object RegExp]",sB="[object Set]",lB="[object String]",uB="[object Symbol]",cB="[object ArrayBuffer]",dB="[object DataView]",mm=Sr?Sr.prototype:void 0,zl=mm?mm.valueOf:void 0;function fB(t,e,r,n,a,i,o){switch(r){case dB: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 vm(t),new vm(e)));case tB:case rB:case iB:return Dl(+t,+e);case nB:return t.name==e.name&&t.message==e.message;case oB:case lB:return t==e+"";case aB:var l=XI;case sB:var c=n&QI;if(l||(l=JI),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=eB,o.set(t,e);var d=gm(l(t),l(e),n,a,i,o);return o.delete(t),d;case uB:if(zl)return zl.call(t)==zl.call(e)}return!1}var hB=1,pB=Object.prototype,vB=pB.hasOwnProperty;function gB(t,e,r,n,a,i){var o=r&hB,l=um(t),c=l.length,u=um(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in e:vB.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 m=o;++f<c;){h=l[f];var y=t[h],b=e[h];if(n)var w=o?n(b,y,h,e,t,i):n(y,b,h,t,e,i);if(!(w===void 0?y===b||a(y,b,r,n,i):w)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var C=t.constructor,E=e.constructor;C!=E&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof E=="function"&&E instanceof E)&&(g=!1)}return i.delete(t),i.delete(e),g}var mB=1,ym="[object Arguments]",bm="[object Array]",Mo="[object Object]",yB=Object.prototype,wm=yB.hasOwnProperty;function bB(t,e,r,n,a,i){var o=dr(t),l=dr(e),c=o?bm:on(t),u=l?bm:on(e);c=c==ym?Mo:c,u=u==ym?Mo:u;var d=c==Mo,f=u==Mo,h=c==u;if(h&&Al(t)){if(!Al(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Kr),o||am(t)?gm(t,e,r,n,a,i):fB(t,e,c,r,n,a,i);if(!(r&mB)){var v=d&&wm.call(t,"__wrapped__"),p=f&&wm.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,m=p?e.value():e;return i||(i=new Kr),a(g,m,r,n,i)}}return h?(i||(i=new Kr),gB(t,e,r,n,a,i)):!1}function Fo(t,e,r,n,a){return t===e?!0:t==null||e==null||!ma(t)&&!ma(e)?t!==t&&e!==e:bB(t,e,r,n,Fo,a)}var wB=1,CB=2;function EB(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?Fo(u,c,wB|CB,n,d):f))return!1}}return!0}function Cm(t){return t===t&&!nn(t)}function xB(t){for(var e=im(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,Cm(a)]}return e}function Em(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function kB(t){var e=xB(t);return e.length==1&&e[0][2]?Em(e[0][0],e[0][1]):function(r){return r===t||EB(r,t,e)}}function SB(t,e){return t!=null&&e in Object(t)}function _B(t,e,r){e=Ro(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=yi(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&&Pl(a)&&Bl(o,a)&&(dr(t)||Ol(t)))}function xm(t,e){return t!=null&&_B(t,e,SB)}var TB=1,NB=2;function IB(t,e){return Ll(t)&&Cm(e)?Em(yi(t),e):function(r){var n=Hr(r,t);return n===void 0&&n===e?xm(r,t):Fo(e,n,TB|NB)}}function BB(t){return function(e){return e==null?void 0:e[t]}}function DB(t){return function(e){return Fl(e,t)}}function PB(t){return Ll(t)?BB(yi(t)):DB(t)}function OB(t){return typeof t=="function"?t:t==null?Ug:typeof t=="object"?dr(t)?IB(t[0],t[1]):kB(t):PB(t)}var Hl=function(){return kr.Date.now()},AB="Expected a function",RB=Math.max,LB=Math.min;function km(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(AB);e=Gg(e)||0,nn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?RB(Gg(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var x=n,_=a;return n=a=void 0,u=k,o=t.apply(_,x),o}function p(k){return u=k,l=setTimeout(y,e),d?v(k):o}function g(k){var x=k-c,_=k-u,S=e-x;return f?LB(S,i-_):S}function m(k){var x=k-c,_=k-u;return c===void 0||x>=e||x<0||f&&_>=i}function y(){var k=Hl();if(m(k))return b(k);l=setTimeout(y,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(Hl())}function E(){var k=Hl(),x=m(k);if(n=arguments,a=this,c=k,x){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(y,e),v(c)}return l===void 0&&(l=setTimeout(y,e)),o}return E.cancel=w,E.flush=C,E}function MB(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return zT(t,OB(e),a)}function $o(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 Vo(t,e){return Fo(t,e)}function sn(t){return t==null}function FB(t){return t===void 0}function $B(t,e,r,n){if(!nn(t))return t;e=Ro(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=yi(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=nn(d)?d:Bl(e[a+1])?[]:{})}WT(l,c,u),l=l[c]}return t}function VB(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],l=Fl(t,o);r(l,o)&&$B(i,Ro(o,t),l)}return i}function qB(t,e){return VB(t,e,function(r,n){return xm(t,n)})}var Sm=SI(function(t,e){return t==null?{}:qB(t,e)});const ln=t=>t===void 0,ya=t=>typeof t=="boolean",wt=t=>typeof t=="number",$n=t=>typeof Element>"u"?!1:t instanceof Element,qo=t=>sn(t),zB=t=>Nt(t)?!Number.isNaN(Number(t)):!1,HB=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),_m=t=>Object.keys(t);class Tm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function KB(t,e){throw new Tm(`[${t}] ${e}`)}function nt(t,e){if(process.env.NODE_ENV!=="production"){const r=Nt(t)?new Tm(`[${t}] ${e}`):t;console.warn(r)}}const GB="utils/dom/style",Nm=(t="")=>t.split(" ").filter(e=>!!e.trim()),Kl=(t,e)=>{!t||!e.trim()||t.classList.add(...Nm(e))},Vn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Nm(e))},bi=(t,e)=>{var r;if(!rt||!t||!e)return"";let n=Y_(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 ba(t,e="px"){if(!t)return"";if(wt(t)||zB(t))return`${t}${e}`;if(Nt(t))return t;nt(GB,"binding value must be a string or number")}function UB(t,e){if(!rt)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 Im="__epPropKey",ke=t=>t,jB=t=>bt(t)&&!!t[Im],zo=(t,e)=>{if(!bt(t)||jB(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),Rn(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,[Im]:!0};return Rn(t,"default")&&(c.default=a),c},Fe=t=>$o(Object.entries(t).map(([e,r])=>[e,zo(r,e)])),un=ke([String,Object,Function]),Bm={validating:Te.Loading,success:Te.CircleCheck,error:Te.CircleClose},vt=(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},WB=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Gr=t=>(t.install=hi,t),lt={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"},Ct="update:modelValue",Gl="change",Dm=["","default","small","large"],YB=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),wa=t=>t,ZB=["class","style"],XB=/^on[A-Z]/,JB=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=s.computed(()=>((r==null?void 0:r.value)||[]).concat(ZB)),a=s.getCurrentInstance();return a?s.computed(()=>{var i;return $o(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(e&&XB.test(o))))}):(nt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),s.computed(()=>({})))},Ho=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},o)=>{s.watch(()=>s.unref(o),l=>{l&&nt(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 QB={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 JB=t=>(e,r)=>eD(e,r,s.unref(t)),eD=(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}}`}`}),tD=t=>{const e=s.computed(()=>s.unref(t).name),r=s.isRef(t)?t:s.ref(t);return{lang:e,locale:r,t:JB(t)}},Dm=Symbol("localeContextKey"),wi=t=>{const e=t||s.inject(Dm,s.ref());return tD(s.computed(()=>e.value||QB))},Ko="el",rD="is-",qn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},Pm=Symbol("namespaceContextKey"),Ul=t=>{const e=t||(s.getCurrentInstance()?s.inject(Pm,s.ref(Ko)):s.ref(Ko));return s.computed(()=>s.unref(e)||Ko)},Pe=(t,e)=>{const r=Ul(e);return{namespace:r,b:(g="")=>qn(r.value,t,g,"",""),e:g=>g?qn(r.value,t,"",g,""):"",m:g=>g?qn(r.value,t,"","",g):"",be:(g,m)=>g&&m?qn(r.value,t,g,m,""):"",em:(g,m)=>g&&m?qn(r.value,t,"",g,m):"",bm:(g,m)=>g&&m?qn(r.value,t,g,"",m):"",bem:(g,m,y)=>g&&m&&y?qn(r.value,t,g,m,y):"",is:(g,...m)=>{const y=m.length>=1?m[0]:!0;return g&&y?`${rD}${g}`:""},cssVar:g=>{const m={};for(const y in g)g[y]&&(m[`--${r.value}-${y}`]=g[y]);return m},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const m={};for(const y in g)g[y]&&(m[`--${r.value}-${t}-${y}`]=g[y]);return m},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},nD=zo({type:ke(Boolean),default:null}),aD=zo({type:ke(Function)}),iD=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:nD,[r]:aD};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])),m=s.computed(()=>p[t]===null),y=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&&rt;_&&v(e,!0),(m.value||!_)&&y(E)},C=E=>{if(p.disabled===!0||!rt)return;const _=g.value&&rt;_&&v(e,!1),(m.value||!_)&&b(E)},x=E=>{ma(E)&&(p.disabled&&E?g.value&&v(e,!1):o.value!==E&&(E?y():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}},Om=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 Vt="top",er="bottom",tr="right",qt="left",jl="auto",Ci=[Vt,er,tr,qt],wa="start",Ei="end",oD="clippingParents",Am="viewport",xi="popper",sD="reference",Rm=Ci.reduce(function(t,e){return t.concat([e+"-"+wa,e+"-"+Ei])},[]),Go=[].concat(Ci,[jl]).reduce(function(t,e){return t.concat([e,e+"-"+wa,e+"-"+Ei])},[]),lD="beforeRead",uD="read",cD="afterRead",dD="beforeMain",fD="main",hD="afterMain",pD="beforeWrite",vD="write",gD="afterWrite",mD=[lD,uD,cD,dD,fD,hD,pD,vD,gD];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 Ca(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 Wl(t){if(typeof ShadowRoot>"u")return!1;var e=fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function yD(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 bD(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 Lm={name:"applyStyles",enabled:!0,phase:"write",fn:yD,effect:bD,requires:["computeStyles"]};function Tr(t){return t.split("-")[0]}var zn=Math.max,Uo=Math.min,Ea=Math.round;function xa(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=Ea(r.width)/o||1),i>0&&(a=Ea(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 Yl(t){var e=xa(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 Mm(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Wl(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 wD(t){return["table","td","th"].indexOf(_r(t))>=0}function cn(t){return((Ca(t)?t.ownerDocument:t.document)||window.document).documentElement}function jo(t){return _r(t)==="html"?t:t.assignedSlot||t.parentNode||(Wl(t)?t.host:null)||cn(t)}function Fm(t){return!rr(t)||Ur(t).position==="fixed"?null:t.offsetParent}function CD(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=jo(t);for(Wl(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 ki(t){for(var e=fr(t),r=Fm(t);r&&wD(r)&&Ur(r).position==="static";)r=Fm(r);return r&&(_r(r)==="html"||_r(r)==="body"&&Ur(r).position==="static")?e:r||CD(t)||e}function Zl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Si(t,e,r){return zn(t,Uo(e,r))}function ED(t,e,r){var n=Si(t,e,r);return n>r?r:n}function $m(){return{top:0,right:0,bottom:0,left:0}}function Vm(t){return Object.assign({},$m(),t)}function qm(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var xD=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Vm(typeof t!="number"?t:qm(t,Ci))};function kD(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=Zl(l),u=[qt,tr].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!o)){var f=xD(a.padding,r),h=Yl(i),v=c==="y"?Vt:qt,p=c==="y"?er:tr,g=r.rects.reference[d]+r.rects.reference[c]-o[c]-r.rects.popper[d],m=o[c]-r.rects.reference[c],y=ki(i),b=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,w=g/2-m/2,C=f[v],x=b-h[d]-f[p],k=b/2-h[d]/2+w,E=Si(C,k,x),_=c;r.modifiersData[n]=(e={},e[_]=E,e.centerOffset=E-k,e)}}function SD(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)||!Mm(e.elements.popper,a)||(e.elements.arrow=a))}var _D={name:"arrow",enabled:!0,phase:"main",fn:kD,effect:SD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ka(t){return t.split("-")[1]}var TD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ND(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:Ea(e*a)/a||0,y:Ea(r*a)/a||0}}function zm(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,m=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=m.x,g=m.y;var y=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),w=qt,C=Vt,x=window;if(u){var k=ki(r),E="clientHeight",_="clientWidth";if(k===fr(r)&&(k=cn(r),Ur(k).position!=="static"&&l==="absolute"&&(E="scrollHeight",_="scrollWidth")),k=k,a===Vt||(a===qt||a===tr)&&i===Ei){C=er;var S=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];g-=S-n.height,g*=c?1:-1}if(a===qt||(a===Vt||a===er)&&i===Ei){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&&TD),B=d===!0?ND({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]=y?"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]=y?v+"px":"",e.transform="",e))}function ID(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:ka(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,zm(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,zm(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 Hm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ID,data:{}},Wo={passive:!0};function BD(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,Wo)}),l&&c.addEventListener("resize",r.update,Wo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,Wo)}),l&&c.removeEventListener("resize",r.update,Wo)}}var Km={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:BD,data:{}},DD={left:"right",right:"left",bottom:"top",top:"bottom"};function Yo(t){return t.replace(/left|right|bottom|top/g,function(e){return DD[e]})}var PD={start:"end",end:"start"};function Gm(t){return t.replace(/start|end/g,function(e){return PD[e]})}function Xl(t){var e=fr(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Ql(t){return xa(cn(t)).left+Xl(t).scrollLeft}function OD(t){var e=fr(t),r=cn(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+Ql(t),y:l}}function AD(t){var e,r=cn(t),n=Xl(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=zn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=zn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+Ql(t),c=-n.scrollTop;return Ur(a||r).direction==="rtl"&&(l+=zn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:c}}function Jl(t){var e=Ur(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function Um(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:rr(t)&&Jl(t)?t:Um(jo(t))}function _i(t,e){var r;e===void 0&&(e=[]);var n=Um(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=fr(n),o=a?[i].concat(i.visualViewport||[],Jl(n)?n:[]):n,l=e.concat(o);return a?l:l.concat(_i(jo(o)))}function eu(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function RD(t){var e=xa(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 jm(t,e){return e===Am?eu(OD(t)):Ca(e)?RD(e):eu(AD(cn(t)))}function LD(t){var e=_i(jo(t)),r=["absolute","fixed"].indexOf(Ur(t).position)>=0,n=r&&rr(t)?ki(t):t;return Ca(n)?e.filter(function(a){return Ca(a)&&Mm(a,n)&&_r(a)!=="body"}):[]}function MD(t,e,r){var n=e==="clippingParents"?LD(t):[].concat(e),a=[].concat(n,[r]),i=a[0],o=a.reduce(function(l,c){var u=jm(t,c);return l.top=zn(u.top,l.top),l.right=Uo(u.right,l.right),l.bottom=Uo(u.bottom,l.bottom),l.left=zn(u.left,l.left),l},jm(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 Wm(t){var e=t.reference,r=t.element,n=t.placement,a=n?Tr(n):null,i=n?ka(n):null,o=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case Vt: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 qt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?Zl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case wa:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Ei:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function Ti(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?oD:i,l=r.rootBoundary,c=l===void 0?Am:l,u=r.elementContext,d=u===void 0?xi:u,f=r.altBoundary,h=f===void 0?!1:f,v=r.padding,p=v===void 0?0:v,g=Vm(typeof p!="number"?p:qm(p,Ci)),m=d===xi?sD:xi,y=t.rects.popper,b=t.elements[h?m:d],w=MD(Ca(b)?b:b.contextElement||cn(t.elements.popper),o,c),C=xa(t.elements.reference),x=Wm({reference:C,element:y,strategy:"absolute",placement:a}),k=eu(Object.assign({},y,x)),E=d===xi?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===xi&&S){var T=S[a];Object.keys(_).forEach(function(N){var B=[tr,er].indexOf(N)>=0?1:-1,P=[Vt,er].indexOf(N)>=0?"y":"x";_[N]+=T[P]*B})}return _}function FD(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?Go:c,d=ka(n),f=d?l?Rm:Rm.filter(function(p){return ka(p)===d}):Ci,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]=Ti(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 $D(t){if(Tr(t)===jl)return[];var e=Yo(t);return[Gm(t),e,Gm(e)]}function VD(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,m=e.options.placement,y=Tr(m),b=y===m,w=c||(b||!p?[Yo(m)]:$D(m)),C=[m].concat(w).reduce(function(F,$){return F.concat(Tr($)===jl?FD(e,{placement:$,boundary:d,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:g}):$)},[]),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=ka(N)===wa,D=[Vt,er].indexOf(B)>=0,R=D?"width":"height",O=Ti(e,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),L=D?P?tr:qt:P?er:Vt;x[R]>k[R]&&(L=Yo(L));var A=Yo(L),q=[];if(i&&q.push(O[B]<=0),l&&q.push(O[L]<=0,O[A]<=0),q.every(function(F){return F})){S=N,_=!1;break}E.set(N,q)}if(_)for(var U=p?3:1,z=function(F){var $=C.find(function(V){var G=E.get(V);if(G)return G.slice(0,F).every(function(j){return j})});if($)return S=$,"break"},H=U;H>0;H--){var J=z(H);if(J==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}var qD={name:"flip",enabled:!0,phase:"main",fn:VD,requiresIfExists:["offset"],data:{_skip:!1}};function Ym(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 Zm(t){return[Vt,tr,er,qt].some(function(e){return t[e]>=0})}function zD(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=Ti(e,{elementContext:"reference"}),l=Ti(e,{altBoundary:!0}),c=Ym(o,n),u=Ym(l,a,i),d=Zm(c),f=Zm(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 HD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zD};function KD(t,e,r){var n=Tr(t),a=[qt,Vt].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,[qt,tr].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function GD(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,o=Go.reduce(function(d,f){return d[f]=KD(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 UD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GD};function jD(t){var e=t.state,r=t.name;e.modifiersData[r]=Wm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Xm={name:"popperOffsets",enabled:!0,phase:"read",fn:jD,data:{}};function WD(t){return t==="x"?"y":"x"}function YD(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,m=Ti(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),y=Tr(e.placement),b=ka(e.placement),w=!b,C=Zl(y),x=WD(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"?Vt:qt,R=C==="y"?er:tr,O=C==="y"?"height":"width",L=k[C],A=L+m[D],q=L-m[R],U=v?-_[O]/2:0,z=b===wa?E[O]:_[O],H=b===wa?-_[O]:-E[O],J=e.elements.arrow,F=v&&J?Yl(J):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:$m(),V=$[D],G=$[R],j=Si(0,E[O],F[O]),M=w?E[O]/2-U-j-V-T.mainAxis:z-j-V-T.mainAxis,W=w?-E[O]/2+U+j+G+T.mainAxis:H+j+G+T.mainAxis,Y=e.elements.arrow&&ki(e.elements.arrow),se=Y?C==="y"?Y.clientTop||0:Y.clientLeft||0:0,ce=(P=N==null?void 0:N[C])!=null?P:0,ae=L+M-ce-se,ne=L+W-ce,ue=Si(v?Uo(A,ae):A,L,v?zn(q,ne):q);k[C]=ue,B[C]=ue-L}if(l){var ie,fe=C==="x"?Vt:qt,pe=C==="x"?er:tr,De=k[x],Ie=x==="y"?"height":"width",we=De+m[fe],xe=De-m[pe],re=[Vt,qt].indexOf(y)!==-1,I=(ie=N==null?void 0:N[x])!=null?ie:0,K=re?we:De-E[Ie]-_[Ie]-I+T.altAxis,te=re?De+E[Ie]+_[Ie]-I-T.altAxis:xe,Z=v&&re?ED(K,De,te):Si(v?K:we,De,v?te:xe);k[x]=Z,B[x]=Z-De}e.modifiersData[n]=B}}var ZD={name:"preventOverflow",enabled:!0,phase:"main",fn:YD,requiresIfExists:["offset"]};function XD(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function QD(t){return t===fr(t)||!rr(t)?Xl(t):XD(t)}function JD(t){var e=t.getBoundingClientRect(),r=Ea(e.width)/t.offsetWidth||1,n=Ea(e.height)/t.offsetHeight||1;return r!==1||n!==1}function eP(t,e,r){r===void 0&&(r=!1);var n=rr(e),a=rr(e)&&JD(e),i=cn(e),o=xa(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((_r(e)!=="body"||Jl(i))&&(l=QD(e)),rr(e)?(c=xa(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Ql(i))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function tP(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 rP(t){var e=tP(t);return mD.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function nP(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function aP(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 Qm={placement:"bottom",modifiers:[],strategy:"absolute"};function Jm(){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 tu(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?Qm:a;return function(o,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qm,i),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(g){var m=typeof g=="function"?g(u.options):g;p(),u.options=Object.assign({},i,u.options,m),u.scrollParents={reference:Ca(o)?_i(o):o.contextElement?_i(o.contextElement):[],popper:_i(l)};var y=rP(aP([].concat(n,u.options.modifiers)));return u.orderedModifiers=y.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=u.elements,m=g.reference,y=g.popper;if(Jm(m,y)){u.rects={reference:eP(m,ki(y),u.options.strategy==="fixed"),popper:Yl(y)},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:nP(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!Jm(o,l))return h;h.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.orderedModifiers.forEach(function(g){var m=g.name,y=g.options,b=y===void 0?{}:y,w=g.effect;if(typeof w=="function"){var C=w({state:u,name:m,instance:h,options:b}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}tu();var iP=[Km,Xm,Hm,Lm];tu({defaultModifiers:iP});var oP=[Km,Xm,Hm,Lm,UD,qD,ZD,_D,HD],sP=tu({defaultModifiers:oP});const lP=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=uP(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=sP(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 uP(t){const e=Object.keys(t.elements),r=$o(e.map(a=>[a,t.styles[a]||{}])),n=$o(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function ey(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return Io(()=>r()),{registerTimeout:e,cancelTimeout:r}}const ru={prefix:Math.floor(Math.random()*1e4),current:0},cP=Symbol("elIdInjection"),ty=()=>s.getCurrentInstance()?s.inject(cP,ru):ru,Zo=t=>{const e=ty();!rt&&e===ru&&nt("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 QB={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 eD=t=>(e,r)=>tD(e,r,s.unref(t)),tD=(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}}`}`}),rD=t=>{const e=s.computed(()=>s.unref(t).name),r=s.isRef(t)?t:s.ref(t);return{lang:e,locale:r,t:eD(t)}},Pm=Symbol("localeContextKey"),wi=t=>{const e=t||s.inject(Pm,s.ref());return rD(s.computed(()=>e.value||QB))},Ko="el",nD="is-",qn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},Om=Symbol("namespaceContextKey"),Ul=t=>{const e=t||(s.getCurrentInstance()?s.inject(Om,s.ref(Ko)):s.ref(Ko));return s.computed(()=>s.unref(e)||Ko)},Pe=(t,e)=>{const r=Ul(e);return{namespace:r,b:(g="")=>qn(r.value,t,g,"",""),e:g=>g?qn(r.value,t,"",g,""):"",m:g=>g?qn(r.value,t,"","",g):"",be:(g,m)=>g&&m?qn(r.value,t,g,m,""):"",em:(g,m)=>g&&m?qn(r.value,t,"",g,m):"",bm:(g,m)=>g&&m?qn(r.value,t,g,"",m):"",bem:(g,m,y)=>g&&m&&y?qn(r.value,t,g,m,y):"",is:(g,...m)=>{const y=m.length>=1?m[0]:!0;return g&&y?`${nD}${g}`:""},cssVar:g=>{const m={};for(const y in g)g[y]&&(m[`--${r.value}-${y}`]=g[y]);return m},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const m={};for(const y in g)g[y]&&(m[`--${r.value}-${t}-${y}`]=g[y]);return m},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},aD=zo({type:ke(Boolean),default:null}),iD=zo({type:ke(Function)}),oD=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:aD,[r]:iD};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])),m=s.computed(()=>p[t]===null),y=x=>{o.value!==!0&&(o.value=!0,l&&(l.value=x),Mt(d)&&d(x))},b=x=>{o.value!==!1&&(o.value=!1,l&&(l.value=x),Mt(f)&&f(x))},w=x=>{if(p.disabled===!0||Mt(u)&&!u())return;const _=g.value&&rt;_&&v(e,!0),(m.value||!_)&&y(x)},C=x=>{if(p.disabled===!0||!rt)return;const _=g.value&&rt;_&&v(e,!1),(m.value||!_)&&b(x)},E=x=>{ya(x)&&(p.disabled&&x?g.value&&v(e,!1):o.value!==x&&(x?y():b()))},k=()=>{o.value?C():w()};return s.watch(()=>p[t],E),c&&h.appContext.config.globalProperties.$route!==void 0&&s.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&C()}),s.onMounted(()=>{E(p[t])}),{hide:C,show:w,toggle:k,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},Am=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 Vt="top",er="bottom",tr="right",qt="left",jl="auto",Ci=[Vt,er,tr,qt],Ca="start",Ei="end",sD="clippingParents",Rm="viewport",xi="popper",lD="reference",Lm=Ci.reduce(function(t,e){return t.concat([e+"-"+Ca,e+"-"+Ei])},[]),Go=[].concat(Ci,[jl]).reduce(function(t,e){return t.concat([e,e+"-"+Ca,e+"-"+Ei])},[]),uD="beforeRead",cD="read",dD="afterRead",fD="beforeMain",hD="main",pD="afterMain",vD="beforeWrite",gD="write",mD="afterWrite",yD=[uD,cD,dD,fD,hD,pD,vD,gD,mD];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 Ea(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 Wl(t){if(typeof ShadowRoot>"u")return!1;var e=fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function bD(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 wD(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 Mm={name:"applyStyles",enabled:!0,phase:"write",fn:bD,effect:wD,requires:["computeStyles"]};function Tr(t){return t.split("-")[0]}var zn=Math.max,Uo=Math.min,xa=Math.round;function ka(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=xa(r.width)/o||1),i>0&&(a=xa(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 Yl(t){var e=ka(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 Fm(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Wl(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 CD(t){return["table","td","th"].indexOf(_r(t))>=0}function cn(t){return((Ea(t)?t.ownerDocument:t.document)||window.document).documentElement}function jo(t){return _r(t)==="html"?t:t.assignedSlot||t.parentNode||(Wl(t)?t.host:null)||cn(t)}function $m(t){return!rr(t)||Ur(t).position==="fixed"?null:t.offsetParent}function ED(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=jo(t);for(Wl(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 ki(t){for(var e=fr(t),r=$m(t);r&&CD(r)&&Ur(r).position==="static";)r=$m(r);return r&&(_r(r)==="html"||_r(r)==="body"&&Ur(r).position==="static")?e:r||ED(t)||e}function Zl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Si(t,e,r){return zn(t,Uo(e,r))}function xD(t,e,r){var n=Si(t,e,r);return n>r?r:n}function Vm(){return{top:0,right:0,bottom:0,left:0}}function qm(t){return Object.assign({},Vm(),t)}function zm(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var kD=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,qm(typeof t!="number"?t:zm(t,Ci))};function SD(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=Zl(l),u=[qt,tr].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!o)){var f=kD(a.padding,r),h=Yl(i),v=c==="y"?Vt:qt,p=c==="y"?er:tr,g=r.rects.reference[d]+r.rects.reference[c]-o[c]-r.rects.popper[d],m=o[c]-r.rects.reference[c],y=ki(i),b=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,w=g/2-m/2,C=f[v],E=b-h[d]-f[p],k=b/2-h[d]/2+w,x=Si(C,k,E),_=c;r.modifiersData[n]=(e={},e[_]=x,e.centerOffset=x-k,e)}}function _D(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)||!Fm(e.elements.popper,a)||(e.elements.arrow=a))}var TD={name:"arrow",enabled:!0,phase:"main",fn:SD,effect:_D,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sa(t){return t.split("-")[1]}var ND={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ID(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:xa(e*a)/a||0,y:xa(r*a)/a||0}}function Hm(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,m=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=m.x,g=m.y;var y=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),w=qt,C=Vt,E=window;if(u){var k=ki(r),x="clientHeight",_="clientWidth";if(k===fr(r)&&(k=cn(r),Ur(k).position!=="static"&&l==="absolute"&&(x="scrollHeight",_="scrollWidth")),k=k,a===Vt||(a===qt||a===tr)&&i===Ei){C=er;var S=f&&k===E&&E.visualViewport?E.visualViewport.height:k[x];g-=S-n.height,g*=c?1:-1}if(a===qt||(a===Vt||a===er)&&i===Ei){w=tr;var T=f&&k===E&&E.visualViewport?E.visualViewport.width:k[_];v-=T-n.width,v*=c?1:-1}}var N=Object.assign({position:l},u&&ND),B=d===!0?ID({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]=y?"0":"",P.transform=(E.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]=y?v+"px":"",e.transform="",e))}function BD(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:Sa(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,Hm(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,Hm(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 Km={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BD,data:{}},Wo={passive:!0};function DD(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,Wo)}),l&&c.addEventListener("resize",r.update,Wo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,Wo)}),l&&c.removeEventListener("resize",r.update,Wo)}}var Gm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:DD,data:{}},PD={left:"right",right:"left",bottom:"top",top:"bottom"};function Yo(t){return t.replace(/left|right|bottom|top/g,function(e){return PD[e]})}var OD={start:"end",end:"start"};function Um(t){return t.replace(/start|end/g,function(e){return OD[e]})}function Xl(t){var e=fr(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Jl(t){return ka(cn(t)).left+Xl(t).scrollLeft}function AD(t){var e=fr(t),r=cn(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+Jl(t),y:l}}function RD(t){var e,r=cn(t),n=Xl(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=zn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=zn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+Jl(t),c=-n.scrollTop;return Ur(a||r).direction==="rtl"&&(l+=zn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:c}}function Ql(t){var e=Ur(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function jm(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:rr(t)&&Ql(t)?t:jm(jo(t))}function _i(t,e){var r;e===void 0&&(e=[]);var n=jm(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=fr(n),o=a?[i].concat(i.visualViewport||[],Ql(n)?n:[]):n,l=e.concat(o);return a?l:l.concat(_i(jo(o)))}function eu(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function LD(t){var e=ka(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 Wm(t,e){return e===Rm?eu(AD(t)):Ea(e)?LD(e):eu(RD(cn(t)))}function MD(t){var e=_i(jo(t)),r=["absolute","fixed"].indexOf(Ur(t).position)>=0,n=r&&rr(t)?ki(t):t;return Ea(n)?e.filter(function(a){return Ea(a)&&Fm(a,n)&&_r(a)!=="body"}):[]}function FD(t,e,r){var n=e==="clippingParents"?MD(t):[].concat(e),a=[].concat(n,[r]),i=a[0],o=a.reduce(function(l,c){var u=Wm(t,c);return l.top=zn(u.top,l.top),l.right=Uo(u.right,l.right),l.bottom=Uo(u.bottom,l.bottom),l.left=zn(u.left,l.left),l},Wm(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 Ym(t){var e=t.reference,r=t.element,n=t.placement,a=n?Tr(n):null,i=n?Sa(n):null,o=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case Vt: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 qt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?Zl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Ca:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Ei:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function Ti(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?sD:i,l=r.rootBoundary,c=l===void 0?Rm:l,u=r.elementContext,d=u===void 0?xi:u,f=r.altBoundary,h=f===void 0?!1:f,v=r.padding,p=v===void 0?0:v,g=qm(typeof p!="number"?p:zm(p,Ci)),m=d===xi?lD:xi,y=t.rects.popper,b=t.elements[h?m:d],w=FD(Ea(b)?b:b.contextElement||cn(t.elements.popper),o,c),C=ka(t.elements.reference),E=Ym({reference:C,element:y,strategy:"absolute",placement:a}),k=eu(Object.assign({},y,E)),x=d===xi?k:C,_={top:w.top-x.top+g.top,bottom:x.bottom-w.bottom+g.bottom,left:w.left-x.left+g.left,right:x.right-w.right+g.right},S=t.modifiersData.offset;if(d===xi&&S){var T=S[a];Object.keys(_).forEach(function(N){var B=[tr,er].indexOf(N)>=0?1:-1,P=[Vt,er].indexOf(N)>=0?"y":"x";_[N]+=T[P]*B})}return _}function $D(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?Go:c,d=Sa(n),f=d?l?Lm:Lm.filter(function(p){return Sa(p)===d}):Ci,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]=Ti(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 VD(t){if(Tr(t)===jl)return[];var e=Yo(t);return[Um(t),e,Um(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,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,m=e.options.placement,y=Tr(m),b=y===m,w=c||(b||!p?[Yo(m)]:VD(m)),C=[m].concat(w).reduce(function(F,$){return F.concat(Tr($)===jl?$D(e,{placement:$,boundary:d,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:g}):$)},[]),E=e.rects.reference,k=e.rects.popper,x=new Map,_=!0,S=C[0],T=0;T<C.length;T++){var N=C[T],B=Tr(N),P=Sa(N)===Ca,D=[Vt,er].indexOf(B)>=0,R=D?"width":"height",O=Ti(e,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),L=D?P?tr:qt:P?er:Vt;E[R]>k[R]&&(L=Yo(L));var A=Yo(L),q=[];if(i&&q.push(O[B]<=0),l&&q.push(O[L]<=0,O[A]<=0),q.every(function(F){return F})){S=N,_=!1;break}x.set(N,q)}if(_)for(var U=p?3:1,z=function(F){var $=C.find(function(V){var G=x.get(V);if(G)return G.slice(0,F).every(function(j){return j})});if($)return S=$,"break"},H=U;H>0;H--){var Q=z(H);if(Q==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}var zD={name:"flip",enabled:!0,phase:"main",fn:qD,requiresIfExists:["offset"],data:{_skip:!1}};function Zm(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 Xm(t){return[Vt,tr,er,qt].some(function(e){return t[e]>=0})}function HD(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=Ti(e,{elementContext:"reference"}),l=Ti(e,{altBoundary:!0}),c=Zm(o,n),u=Zm(l,a,i),d=Xm(c),f=Xm(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 KD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:HD};function GD(t,e,r){var n=Tr(t),a=[qt,Vt].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,[qt,tr].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function UD(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,o=Go.reduce(function(d,f){return d[f]=GD(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 jD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:UD};function WD(t){var e=t.state,r=t.name;e.modifiersData[r]=Ym({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Jm={name:"popperOffsets",enabled:!0,phase:"read",fn:WD,data:{}};function YD(t){return t==="x"?"y":"x"}function ZD(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,m=Ti(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),y=Tr(e.placement),b=Sa(e.placement),w=!b,C=Zl(y),E=YD(C),k=e.modifiersData.popperOffsets,x=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"?Vt:qt,R=C==="y"?er:tr,O=C==="y"?"height":"width",L=k[C],A=L+m[D],q=L-m[R],U=v?-_[O]/2:0,z=b===Ca?x[O]:_[O],H=b===Ca?-_[O]:-x[O],Q=e.elements.arrow,F=v&&Q?Yl(Q):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Vm(),V=$[D],G=$[R],j=Si(0,x[O],F[O]),M=w?x[O]/2-U-j-V-T.mainAxis:z-j-V-T.mainAxis,W=w?-x[O]/2+U+j+G+T.mainAxis:H+j+G+T.mainAxis,Y=e.elements.arrow&&ki(e.elements.arrow),se=Y?C==="y"?Y.clientTop||0:Y.clientLeft||0:0,ce=(P=N==null?void 0:N[C])!=null?P:0,ae=L+M-ce-se,ne=L+W-ce,ue=Si(v?Uo(A,ae):A,L,v?zn(q,ne):q);k[C]=ue,B[C]=ue-L}if(l){var ie,fe=C==="x"?Vt:qt,pe=C==="x"?er:tr,De=k[E],Ie=E==="y"?"height":"width",we=De+m[fe],xe=De-m[pe],re=[Vt,qt].indexOf(y)!==-1,I=(ie=N==null?void 0:N[E])!=null?ie:0,K=re?we:De-x[Ie]-_[Ie]-I+T.altAxis,te=re?De+x[Ie]+_[Ie]-I-T.altAxis:xe,Z=v&&re?xD(K,De,te):Si(v?K:we,De,v?te:xe);k[E]=Z,B[E]=Z-De}e.modifiersData[n]=B}}var XD={name:"preventOverflow",enabled:!0,phase:"main",fn:ZD,requiresIfExists:["offset"]};function JD(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function QD(t){return t===fr(t)||!rr(t)?Xl(t):JD(t)}function eP(t){var e=t.getBoundingClientRect(),r=xa(e.width)/t.offsetWidth||1,n=xa(e.height)/t.offsetHeight||1;return r!==1||n!==1}function tP(t,e,r){r===void 0&&(r=!1);var n=rr(e),a=rr(e)&&eP(e),i=cn(e),o=ka(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((_r(e)!=="body"||Ql(i))&&(l=QD(e)),rr(e)?(c=ka(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Jl(i))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function rP(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 nP(t){var e=rP(t);return yD.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function aP(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function iP(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 Qm={placement:"bottom",modifiers:[],strategy:"absolute"};function ey(){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 tu(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?Qm:a;return function(o,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qm,i),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(g){var m=typeof g=="function"?g(u.options):g;p(),u.options=Object.assign({},i,u.options,m),u.scrollParents={reference:Ea(o)?_i(o):o.contextElement?_i(o.contextElement):[],popper:_i(l)};var y=nP(iP([].concat(n,u.options.modifiers)));return u.orderedModifiers=y.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=u.elements,m=g.reference,y=g.popper;if(ey(m,y)){u.rects={reference:tP(m,ki(y),u.options.strategy==="fixed"),popper:Yl(y)},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,E=w.options,k=E===void 0?{}:E,x=w.name;typeof C=="function"&&(u=C({state:u,options:k,name:x,instance:h})||u)}}}},update:aP(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!ey(o,l))return h;h.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.orderedModifiers.forEach(function(g){var m=g.name,y=g.options,b=y===void 0?{}:y,w=g.effect;if(typeof w=="function"){var C=w({state:u,name:m,instance:h,options:b}),E=function(){};d.push(C||E)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}tu();var oP=[Gm,Jm,Km,Mm];tu({defaultModifiers:oP});var sP=[Gm,Jm,Km,Mm,jD,zD,XD,TD,KD],lP=tu({defaultModifiers:sP});const uP=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=cP(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=lP(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 cP(t){const e=Object.keys(t.elements),r=$o(e.map(a=>[a,t.styles[a]||{}])),n=$o(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function ty(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return Io(()=>r()),{registerTimeout:e,cancelTimeout:r}}const ru={prefix:Math.floor(Math.random()*1e4),current:0},dP=Symbol("elIdInjection"),ry=()=>s.getCurrentInstance()?s.inject(dP,ru):ru,Zo=t=>{const e=ry();!rt&&e===ru&&nt("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=Ul();return s.computed(()=>s.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let Sa=[];const ry=t=>{const e=t;e.key===lt.esc&&Sa.forEach(r=>r(e))},dP=t=>{s.onMounted(()=>{Sa.length===0&&document.addEventListener("keydown",ry),rt&&Sa.push(t)}),s.onBeforeUnmount(()=>{Sa=Sa.filter(e=>e!==t),Sa.length===0&&rt&&document.removeEventListener("keydown",ry)})};let ny;const ay=()=>{const t=Ul(),e=ty(),r=s.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=s.computed(()=>`#${r.value}`);return{id:r,selector:n}},fP=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},hP=()=>{const{id:t,selector:e}=ay();return s.onBeforeMount(()=>{rt&&(process.env.NODE_ENV==="test"||!ny||!document.body.querySelector(e.value))&&(ny=fP(t.value))}),{id:t,selector:e}},pP=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),vP=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=ey(),{registerTimeout:o,cancelTimeout:l}=ey();return{onOpen:d=>{i(()=>{n(d);const f=s.unref(r);wt(f)&&f>0&&o(()=>{a(d)},f)},s.unref(t))},onClose:d=>{l(),i(()=>{a(d)},s.unref(e))}}},iy=Symbol("elForwardRef"),gP=t=>{const e=r=>{t.value=r};s.provide(iy,{setForwardRef:e})},mP=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),oy={current:0},sy=s.ref(0),ly=2e3,uy=Symbol("elZIndexContextKey"),cy=Symbol("zIndexContextKey"),dy=t=>{const e=s.getCurrentInstance()?s.inject(uy,oy):oy,r=t||(s.getCurrentInstance()?s.inject(cy,void 0):void 0),n=s.computed(()=>{const o=s.unref(r);return wt(o)?o:ly}),a=s.computed(()=>n.value+sy.value),i=()=>(e.current++,sy.value=e.current,a.value);return!rt&&!s.inject(uy)&&nt("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 yP(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 _a=zo({type:String,values:Bm,required:!1}),fy=Symbol("size"),bP=()=>{const t=s.inject(fy,{});return s.computed(()=>s.unref(t.size)||"")};function nu(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")}),Jt(l,"focus",u,!0),Jt(l,"blur",d,!0),Jt(l,"click",f,!0),process.env.NODE_ENV==="test"&&s.onMounted(()=>{const h=$n(t.value)?t.value:document.querySelector("input,textarea");h&&(Jt(h,"focus",u,!0),Jt(h,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function hy({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=!WB(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 py=Symbol("emptyValuesContextKey"),wP="use-empty-values",CP=["",void 0,null],EP=void 0,xP=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Mt(t)?!t():!t}}),kP=(t,e)=>{const r=s.getCurrentInstance()?s.inject(py,s.ref({})):s.ref({}),n=s.computed(()=>t.emptyValues||r.value.emptyValues||CP),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:EP),i=o=>n.value.includes(o);return n.value.includes(a.value)||nt(wP,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},SP=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),dn=t=>km(SP,t),vy=Symbol(),Xo=s.ref();function au(t,e=void 0){const r=s.getCurrentInstance()?s.inject(vy,Xo):Xo;return t?s.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function _P(t,e){const r=au(),n=Pe(t,s.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||Ko})),a=wi(s.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=dy(s.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||ly})),o=s.computed(()=>{var l;return s.unref(e)||((l=r.value)==null?void 0:l.size)||""});return TP(s.computed(()=>s.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:o}}const TP=(t,e,r=!1)=>{var n;const a=!!s.getCurrentInstance(),i=a?au():void 0,o=(n=void 0)!=null?n:a?s.provide:void 0;if(!o){nt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=s.computed(()=>{const c=s.unref(t);return i!=null&&i.value?NP(i.value,c):c});return o(vy,l),o(Dm,s.computed(()=>l.value.locale)),o(Pm,s.computed(()=>l.value.namespace)),o(cy,s.computed(()=>l.value.zIndex)),o(fy,{size:s.computed(()=>l.value.size||"")}),o(py,s.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!Xo.value)&&(Xo.value=l.value),l},NP=(t,e)=>{const r=[...new Set([...Sm(t),...Sm(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 IP=Fe({size:{type:ke([Number,String])},color:{type:String}}),BP=s.defineComponent({name:"ElIcon",inheritAttrs:!1}),DP=s.defineComponent({...BP,props:IP,setup(t){const e=t,r=Pe("icon"),n=s.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:ln(a)?void 0:ya(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 PP=Be(DP,[["__file","icon.vue"]]);const ut=vt(PP),iu=Symbol("formContextKey"),Ni=Symbol("formItemContextKey"),Hn=(t,e={})=>{const r=s.ref(void 0),n=e.prop?r:Om("size"),a=e.global?r:bP(),i=e.form?{size:void 0}:s.inject(iu,void 0),o=e.formItem?{size:void 0}:s.inject(Ni,void 0);return s.computed(()=>n.value||s.unref(t)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Ii=t=>{const e=Om("disabled"),r=s.inject(iu,void 0);return s.computed(()=>e.value||s.unref(t)||(r==null?void 0:r.disabled)||!1)},Kn=()=>{const t=s.inject(iu,void 0),e=s.inject(Ni,void 0);return{form:t,formItem:e}},Bi=(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:Zo().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 OP=`
11
+ })`);const r=Ul();return s.computed(()=>s.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let _a=[];const ny=t=>{const e=t;e.key===lt.esc&&_a.forEach(r=>r(e))},fP=t=>{s.onMounted(()=>{_a.length===0&&document.addEventListener("keydown",ny),rt&&_a.push(t)}),s.onBeforeUnmount(()=>{_a=_a.filter(e=>e!==t),_a.length===0&&rt&&document.removeEventListener("keydown",ny)})};let ay;const iy=()=>{const t=Ul(),e=ry(),r=s.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=s.computed(()=>`#${r.value}`);return{id:r,selector:n}},hP=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},pP=()=>{const{id:t,selector:e}=iy();return s.onBeforeMount(()=>{rt&&(process.env.NODE_ENV==="test"||!ay||!document.body.querySelector(e.value))&&(ay=hP(t.value))}),{id:t,selector:e}},vP=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),gP=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=ty(),{registerTimeout:o,cancelTimeout:l}=ty();return{onOpen:d=>{i(()=>{n(d);const f=s.unref(r);wt(f)&&f>0&&o(()=>{a(d)},f)},s.unref(t))},onClose:d=>{l(),i(()=>{a(d)},s.unref(e))}}},oy=Symbol("elForwardRef"),mP=t=>{const e=r=>{t.value=r};s.provide(oy,{setForwardRef:e})},yP=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),sy={current:0},ly=s.ref(0),uy=2e3,cy=Symbol("elZIndexContextKey"),dy=Symbol("zIndexContextKey"),fy=t=>{const e=s.getCurrentInstance()?s.inject(cy,sy):sy,r=t||(s.getCurrentInstance()?s.inject(dy,void 0):void 0),n=s.computed(()=>{const o=s.unref(r);return wt(o)?o:uy}),a=s.computed(()=>n.value+ly.value),i=()=>(e.current++,ly.value=e.current,a.value);return!rt&&!s.inject(cy)&&nt("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 bP(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 Ta=zo({type:String,values:Dm,required:!1}),hy=Symbol("size"),wP=()=>{const t=s.inject(hy,{});return s.computed(()=>s.unref(t.size)||"")};function nu(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=$n(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 py({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=!YB(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 vy=Symbol("emptyValuesContextKey"),CP="use-empty-values",EP=["",void 0,null],xP=void 0,kP=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Mt(t)?!t():!t}}),SP=(t,e)=>{const r=s.getCurrentInstance()?s.inject(vy,s.ref({})):s.ref({}),n=s.computed(()=>t.emptyValues||r.value.emptyValues||EP),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:xP),i=o=>n.value.includes(o);return n.value.includes(a.value)||nt(CP,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},_P=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),dn=t=>Sm(_P,t),gy=Symbol(),Xo=s.ref();function au(t,e=void 0){const r=s.getCurrentInstance()?s.inject(gy,Xo):Xo;return t?s.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function TP(t,e){const r=au(),n=Pe(t,s.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||Ko})),a=wi(s.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=fy(s.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||uy})),o=s.computed(()=>{var l;return s.unref(e)||((l=r.value)==null?void 0:l.size)||""});return NP(s.computed(()=>s.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:o}}const NP=(t,e,r=!1)=>{var n;const a=!!s.getCurrentInstance(),i=a?au():void 0,o=(n=void 0)!=null?n:a?s.provide:void 0;if(!o){nt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=s.computed(()=>{const c=s.unref(t);return i!=null&&i.value?IP(i.value,c):c});return o(gy,l),o(Pm,s.computed(()=>l.value.locale)),o(Om,s.computed(()=>l.value.namespace)),o(dy,s.computed(()=>l.value.zIndex)),o(hy,{size:s.computed(()=>l.value.size||"")}),o(vy,s.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!Xo.value)&&(Xo.value=l.value),l},IP=(t,e)=>{const r=[...new Set([..._m(t),..._m(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 BP=Fe({size:{type:ke([Number,String])},color:{type:String}}),DP=s.defineComponent({name:"ElIcon",inheritAttrs:!1}),PP=s.defineComponent({...DP,props:BP,setup(t){const e=t,r=Pe("icon"),n=s.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:ln(a)?void 0:ba(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 OP=Be(PP,[["__file","icon.vue"]]);const ut=vt(OP),iu=Symbol("formContextKey"),Ni=Symbol("formItemContextKey"),Hn=(t,e={})=>{const r=s.ref(void 0),n=e.prop?r:Am("size"),a=e.global?r:wP(),i=e.form?{size:void 0}:s.inject(iu,void 0),o=e.formItem?{size:void 0}:s.inject(Ni,void 0);return s.computed(()=>n.value||s.unref(t)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Ii=t=>{const e=Am("disabled"),r=s.inject(iu,void 0);return s.computed(()=>e.value||s.unref(t)||(r==null?void 0:r.disabled)||!1)},Kn=()=>{const t=s.inject(iu,void 0),e=s.inject(Ni,void 0);return{form:t,formItem:e}},Bi=(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:Zo().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 AP=`
13
13
  height:0 !important;
14
14
  visibility:hidden !important;
15
- ${H_()?"":"overflow:hidden !important;"}
15
+ ${K_()?"":"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
- `,AP=["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 RP(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:AP.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function gy(t,e=1,r){var n;hr||(hr=document.createElement("textarea"),document.body.appendChild(hr));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=RP(t);hr.setAttribute("style",`${l};${OP}`),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(wt(e)){let f=d*e;o==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(wt(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 LP=Fe({id:{type:String,default:void 0},size:_a,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:un},prefixIcon:{type:un},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ba({})},autofocus:Boolean,rows:{type:Number,default:2},...dn(["ariaLabel"])}),MP={[Ct]:t=>Nt(t),input:t=>Nt(t),change:t=>Nt(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},FP=s.defineComponent({name:"ElInput",inheritAttrs:!1}),$P=s.defineComponent({...FP,props:LP,emits:MP,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"?m.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",J.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")]:q.value&&U.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=s.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=XB({excludeKeys:s.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Kn(),{inputId:h}=Bi(n,{formItemContext:f}),v=Hn(),p=Ii(),g=Pe("input"),m=Pe("textarea"),y=s.shallowRef(),b=s.shallowRef(),w=s.ref(!1),C=s.ref(!1),x=s.ref(),k=s.shallowRef(n.inputStyle),E=s.computed(()=>y.value||b.value),{wrapperRef:_,isFocused:S,handleFocus:T,handleBlur:N}=nu(E,{beforeFocus(){return p.value},afterBlur(){var I;n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"blur").catch(K=>nt(K)))}}),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&&Im[P.value]),R=s.computed(()=>C.value?Te.View:Te.Hide),O=s.computed(()=>[a.style]),L=s.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),A=s.computed(()=>sn(n.modelValue)?"":String(n.modelValue)),q=s.computed(()=>n.clearable&&!p.value&&!n.readonly&&!!A.value&&(S.value||w.value)),U=s.computed(()=>n.showPassword&&!p.value&&!n.readonly&&!!A.value&&(!!A.value||S.value)),z=s.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!p.value&&!n.readonly&&!n.showPassword),H=s.computed(()=>A.value.length),J=s.computed(()=>!!z.value&&H.value>Number(n.maxlength)),F=s.computed(()=>!!i.suffix||!!n.suffixIcon||q.value||n.showPassword||z.value||!!P.value&&B.value),[$,V]=yP(y);Vr(b,I=>{if(M(),!z.value||n.resize!=="both")return;const K=I[0],{width:te}=K.contentRect;x.value={right:`calc(100% - ${te+15+6}px)`}});const G=()=>{const{type:I,autosize:K}=n;if(!(!rt||I!=="textarea"||!b.value))if(K){const te=bt(K)?K.minRows:void 0,Z=bt(K)?K.maxRows:void 0,X=gy(b.value,te,Z);k.value={overflowY:"hidden",...X},s.nextTick(()=>{b.value.offsetHeight,k.value=X})}else k.value={minHeight:gy(b.value).minHeight}},M=(I=>{let K=!1;return()=>{var te;if(K||!n.autosize)return;((te=b.value)==null?void 0:te.offsetParent)===null||(I(),K=!0)}})(G),W=()=>{const I=E.value,K=n.formatter?n.formatter(A.value):A.value;!I||I.value===K||(I.value=K)},Y=async I=>{$();let{value:K}=I.target;if(n.formatter&&(K=n.parser?n.parser(K):K),!ce.value){if(K===A.value){W();return}r(Ct,K),r("input",K),await s.nextTick(),W(),V()}},se=I=>{r("change",I.target.value)},{isComposing:ce,handleCompositionStart:ae,handleCompositionUpdate:ne,handleCompositionEnd:ue}=hy({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()},De=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(Ct,""),r("change",""),r("clear"),r("input","")};return s.watch(()=>n.modelValue,()=>{var I;s.nextTick(()=>G()),n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"change").catch(K=>nt(K)))}),s.watch(A,()=>W()),s.watch(()=>n.type,async()=>{await s.nextTick(),W(),G()}),s.onMounted(()=>{!n.formatter&&n.parser&&nt("ElInput","If you set the parser, you also need to set the formatter."),W(),s.nextTick(G)}),e({input:y,textarea:b,ref:E,textareaStyle:L,autosize:s.toRef(n,"autosize"),isComposing:ce,focus:fe,blur:pe,select:xe,clear:re,resizeTextarea:G}),(I,K)=>(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:De}),[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(ut),{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:y,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(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(q)||!s.unref(U)||!s.unref(z)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(I.$slots,"suffix"),I.suffixIcon?(s.openBlock(),s.createBlock(s.unref(ut),{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(q)?(s.openBlock(),s.createBlock(s.unref(ut),{key:1,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("clear")]),onMousedown:s.withModifiers(s.unref(hi),["prevent"]),onClick:re},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(U)?(s.openBlock(),s.createBlock(s.unref(ut),{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(z)?(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(H))+" / "+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(ut),{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(m).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(L),"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(z)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(x.value),class:s.normalizeClass(s.unref(g).e("count"))},s.toDisplayString(s.unref(H))+" / "+s.toDisplayString(I.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var VP=Be($P,[["__file","input.vue"]]);const Di=vt(VP),Ta=4,qP={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"}},zP=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),ou=Symbol("scrollbarContextKey"),HP=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),KP="Thumb";var my=Be(s.defineComponent({__name:"thumb",props:HP,setup(t){const e=t,r=s.inject(ou),n=Pe("scrollbar");r||HB(KP,"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=rt?document.onselectstart:null;const f=s.computed(()=>qP[e.vertical?"vertical":"horizontal"]),h=s.computed(()=>zP({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(),m(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},m=k=>{k.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},y=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",y),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 Jt(s.toRef(r,"scrollbarElement"),"mousemove",w),Jt(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 GP=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var UP=Be(s.defineComponent({__name:"bar",props:GP,setup(t,{expose:e}){const r=t,n=s.inject(ou),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-Ta,p=h.offsetWidth-Ta;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-Ta,p=h.offsetWidth-Ta,g=v**2/h.scrollHeight,m=p**2/h.scrollWidth,y=Math.max(g,r.minSize),b=Math.max(m,r.minSize);c.value=g/(v-g)/(y/(v-y)),u.value=m/(p-m)/(b/(p-b)),l.value=y+Ta<v?`${y}px`:"",o.value=b+Ta<p?`${b}px`:""}}),(h,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(my,{move:a.value,ratio:u.value,size:o.value,always:h.always},null,8,["move","ratio","size","always"]),s.createVNode(my,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const jP=Fe({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,...dn(["ariaLabel","ariaOrientation"])}),WP={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(wt)},su="ElScrollbar",YP=s.defineComponent({name:su}),ZP=s.defineComponent({...YP,props:jP,emits:WP,setup(t,{expose:e,emit:r}){const n=t,a=Pe("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=ya(n.height)),n.maxHeight&&(x.maxHeight=ya(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]),m=()=>{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 y(x,k){bt(x)?d.value.scrollTo(x):wt(x)&&wt(k)&&d.value.scrollTo(x,k)}const b=x=>{if(!wt(x)){nt(su,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!wt(x)){nt(su,"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=Jt("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(ou,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:y,setScrollTop:b,setScrollLeft:w,handleScroll:m}),(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:m},[(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(UP,{key:0,ref_key:"barRef",ref:h,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var XP=Be(ZP,[["__file","scrollbar.vue"]]);const QP=vt(XP),lu=Symbol("popper"),yy=Symbol("popperContent"),by=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),JP=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),eO=s.defineComponent({...JP,props:by,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(lu,c),(u,d)=>s.renderSlot(u.$slots,"default")}});var tO=Be(eO,[["__file","popper.vue"]]);const wy=Fe({arrowOffset:{type:Number,default:5}}),rO=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),nO=s.defineComponent({...rO,props:wy,setup(t,{expose:e}){const r=t,n=Pe("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=s.inject(yy,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 aO=Be(nO,[["__file","arrow.vue"]]);const uu="ElOnlyChild",iO=s.defineComponent({name:uu,setup(t,{slots:e,attrs:r}){var n;const a=s.inject(iy),i=mP((n=a==null?void 0:a.setForwardRef)!=null?n:hi);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,r);if(!l)return null;if(l.length>1)return nt(uu,"requires exact only one valid child."),null;const c=Cy(l);return c?s.withDirectives(s.cloneVNode(c,r),[[i]]):(nt(uu,"no valid child node found"),null)}}});function Cy(t){if(!t)return null;const e=t;for(const r of e){if(bt(r))switch(r.type){case s.Comment:continue;case s.Text:case"svg":return Ey(r);case s.Fragment:return Cy(r.children);default:return r}return Ey(r)}return null}function Ey(t){const e=Pe("only-child");return s.createVNode("span",{class:e.e("content")},[t])}const xy=Fe({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}),oO=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),sO=s.defineComponent({...oO,props:xy,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=s.inject(lu,void 0);gP(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,$n(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)=>{sn(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),$n(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&&$n(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(iO),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 lO=Be(sO,[["__file","trigger.vue"]]);const cu="focus-trap.focus-after-trapped",du="focus-trap.focus-after-released",uO="focus-trap.focusout-prevented",ky={cancelable:!0,bubbles:!1},cO={cancelable:!0,bubbles:!1},Sy="focusAfterTrapped",_y="focusAfterReleased",dO=Symbol("elFocusTrap"),fu=s.ref(),Qo=s.ref(0),hu=s.ref(0);let Jo=0;const Ty=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},Ny=(t,e)=>{for(const r of t)if(!fO(r,e))return r},fO=(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},hO=t=>{const e=Ty(t),r=Ny(e,t),n=Ny(e.reverse(),t);return[r,n]},pO=t=>t instanceof HTMLInputElement&&"select"in t,fn=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),hu.value=window.performance.now(),t!==r&&pO(t)&&e&&t.select()}};function Iy(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const vO=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=Iy(t,n),t.unshift(n)},remove:n=>{var a,i;t=Iy(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},gO=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(fn(n,e),document.activeElement!==r)return},By=vO(),mO=()=>Qo.value>hu.value,es=()=>{fu.value="pointer",Qo.value=window.performance.now()},Dy=()=>{fu.value="keyboard",Qo.value=window.performance.now()},yO=()=>(s.onMounted(()=>{Jo===0&&(document.addEventListener("mousedown",es),document.addEventListener("touchstart",es),document.addEventListener("keydown",Dy)),Jo++}),s.onBeforeUnmount(()=>{Jo--,Jo<=0&&(document.removeEventListener("mousedown",es),document.removeEventListener("touchstart",es),document.removeEventListener("keydown",Dy))}),{focusReason:fu,lastUserFocusTimestamp:Qo,lastAutomatedFocusTimestamp:hu}),ts=t=>new CustomEvent(uO,{...cO,detail:t}),bO=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Sy,_y,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=s.ref();let n,a;const{focusReason:i}=yO();dP(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:m,ctrlKey:y,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:x}=t,k=g===lt.tab&&!m&&!y&&!b,E=document.activeElement;if(k&&E){const _=w,[S,T]=hO(_);if(S&&T){if(!C&&E===T){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&fn(S,!0))}else if(C&&[S,_].includes(E)){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&fn(T,!0))}}else if(E===_){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||p.preventDefault()}}};s.provide(dO,{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(Sy,p)},u=p=>e(_y,p),d=p=>{const g=s.unref(r);if(!g)return;const m=p.target,y=p.relatedTarget,b=m&&g.contains(m);t.trapped||y&&g.contains(y)||(n=y),b&&e("focusin",p),!o.paused&&t.trapped&&(b?a=m:fn(a,!0))},f=p=>{const g=s.unref(r);if(!(o.paused||!g))if(t.trapped){const m=p.relatedTarget;!sn(m)&&!g.contains(m)&&setTimeout(()=>{if(!o.paused&&t.trapped){const y=ts({focusReason:i.value});e("focusout-prevented",y),y.defaultPrevented||fn(a,!0)}},0)}else{const m=p.target;m&&g.contains(m)||e("focusout",p)}};async function h(){await s.nextTick();const p=s.unref(r);if(p){By.push(o);const g=p.contains(document.activeElement)?n:document.activeElement;if(n=g,!p.contains(g)){const y=new Event(cu,ky);p.addEventListener(cu,c),p.dispatchEvent(y),y.defaultPrevented||s.nextTick(()=>{let b=t.focusStartEl;Nt(b)||(fn(b),document.activeElement!==b&&(b="first")),b==="first"&&gO(Ty(p),!0),(document.activeElement===g||b==="container")&&fn(p)})}}}function v(){const p=s.unref(r);if(p){p.removeEventListener(cu,c);const g=new CustomEvent(du,{...ky,detail:{focusReason:i.value}});p.addEventListener(du,u),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!mO()||p.contains(document.activeElement))&&fn(n??document.body),p.removeEventListener(du,u),By.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 wO(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var CO=Be(bO,[["render",wO],["__file","focus-trap.vue"]]);const EO=["fixed","absolute"],xO=Fe({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:Go,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:EO,default:"absolute"}}),Py=Fe({...xO,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,...dn(["ariaLabel"])}),kO={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},SO=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...TO(t),...e]};return NO(i,a==null?void 0:a.modifiers),i},_O=t=>{if(rt)return $r(t)};function TO(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 NO(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const IO=0,BO=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=s.inject(lu,void 0),i=s.ref(),o=s.ref(),l=s.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=s.computed(()=>{var y;const b=s.unref(i),w=(y=s.unref(o))!=null?y:IO;return{name:"arrow",enabled:!MB(b),options:{element:b,padding:w}}}),u=s.computed(()=>({onFirstUpdate:()=>{p()},...SO(t,[s.unref(c),s.unref(l)])})),d=s.computed(()=>_O(t.referenceEl)||s.unref(n)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:m}=lP(d,r,u);return s.watch(m,y=>e.value=y),s.onMounted(()=>{s.watch(()=>{var y;return(y=s.unref(d))==null?void 0:y.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:m,state:h,styles:v,role:a,forceUpdate:g,update:p}},DO=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=dy(),i=Pe("popper"),o=s.computed(()=>s.unref(e).popper),l=s.ref(wt(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=wt(t.zIndex)?t.zIndex:a()}}},PO=(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")}}},OO=s.defineComponent({name:"ElPopperContent"}),AO=s.defineComponent({...OO,props:Py,emits:kO,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=PO(n,r),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:m,update:y}=BO(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:k,updateZIndex:E}=DO(n,{styles:p,attributes:f,role:m}),_=s.inject(Ni,void 0),S=s.ref();s.provide(yy,{arrowStyle:w,arrowRef:h,arrowOffset:S}),_&&s.provide(Ni,{..._,addInputId:hi,removeInputId:hi});let T;const N=(P=!0)=>{y(),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);$n(R)&&(T=s.watch([m,()=>n.ariaLabel,b,()=>n.id],L=>{["role","aria-label","aria-modal","id"].forEach((A,q)=>{sn(L[q])?R.removeAttribute(A):R.setAttribute(A,L[q])})},{immediate:!0})),O!==R&&$n(O)&&["role","aria-label","aria-modal","id"].forEach(L=>{O.removeAttribute(L)})},{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(CO),{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 RO=Be(AO,[["__file","content.vue"]]);const LO=vt(tO),pu=Symbol("elTooltip"),zt=Fe({...pP,...Py,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,...dn(["ariaLabel"])}),Pi=Fe({...xy,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[lt.enter,lt.space]}}),{useModelToggleProps:MO,useModelToggleEmits:FO,useModelToggle:$O}=iD("visible"),VO=Fe({...by,...MO,...zt,...Pi,...wy,showArrow:{type:Boolean,default:!0}}),qO=[...FO,"before-show","before-hide","show","hide","open","close"],zO=(t,e)=>$t(t)?t.includes(e):t===e,Na=(t,e,r)=>n=>{zO(s.unref(t),e)&&r(n)},HO=s.defineComponent({name:"ElTooltipTrigger"}),KO=s.defineComponent({...HO,props:Pi,setup(t,{expose:e}){const r=t,n=Pe("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:c,onToggle:u}=s.inject(pu,void 0),d=s.ref(null),f=()=>{if(s.unref(a)||r.disabled)return!0},h=s.toRef(r,"trigger"),v=Fr(f,Na(h,"hover",l)),p=Fr(f,Na(h,"hover",c)),g=Fr(f,Na(h,"click",C=>{C.button===0&&u(C)})),m=Fr(f,Na(h,"focus",l)),y=Fr(f,Na(h,"focus",c)),b=Fr(f,Na(h,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Fr(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(lO),{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(y),onClick:s.unref(g),onContextmenu:s.unref(b),onFocus:s.unref(m),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 GO=Be(KO,[["__file","trigger.vue"]]);const UO=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var jO=Be(s.defineComponent({__name:"teleport",props:UO,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 WO=vt(jO),YO=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),ZO=s.defineComponent({...YO,props:zt,setup(t,{expose:e}){const r=t,{selector:n}=ay(),a=Pe("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:m}=s.inject(pu,void 0),y=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=Fr(S,()=>{r.enterable&&s.unref(d)==="hover"&&h()}),N=Fr(S,()=>{s.unref(d)==="hover"&&f()}),B=()=>{var O,L;(L=(O=i.value)==null?void 0:O.updatePopper)==null||L.call(O),g==null||g()},P=()=>{m==null||m()},D=()=>{v(),o=D_(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,L;(L=(O=i.value)==null?void 0:O.updatePopper)==null||L.call(O)}),e({contentRef:i}),(O,L)=>(s.openBlock(),s.createBlock(s.unref(WO),{disabled:!O.teleported,to:s.unref(x)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(y),onAfterLeave:_,onBeforeEnter:B,onAfterEnter:D,onBeforeLeave:P},{default:s.withCtx(()=>[s.unref(w)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(RO),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 XO=Be(ZO,[["__file","content.vue"]]);const QO=s.defineComponent({name:"ElTooltip"}),JO=s.defineComponent({...QO,props:VO,emits:qO,setup(t,{expose:e,emit:r}){const n=t;hP();const a=Zo(),i=s.ref(),o=s.ref(),l=()=>{var y;const b=s.unref(i);b&&((y=b.popperInstanceRef)==null||y.update())},c=s.ref(!1),u=s.ref(),{show:d,hide:f,hasUpdateHandler:h}=$O({indicator:c,toggleReason:u}),{onOpen:v,onClose:p}=vP({showAfter:s.toRef(n,"showAfter"),hideAfter:s.toRef(n,"hideAfter"),autoClose:s.toRef(n,"autoClose"),open:d,close:f}),g=s.computed(()=>ma(n.visible)&&!h.value);s.provide(pu,{controlled:g,id:a,open:s.readonly(c),trigger:s.toRef(n,"trigger"),onOpen:y=>{v(y)},onClose:y=>{p(y)},onToggle:y=>{s.unref(c)?p(y):v(y)},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,y=>{y&&c.value&&(c.value=!1)});const m=y=>{var b,w;const C=(w=(b=o.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,x=(y==null?void 0:y.relatedTarget)||document.activeElement;return C&&C.contains(x)};return s.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:m,updatePopper:l,onOpen:v,onClose:p,hide:f}),(y,b)=>(s.openBlock(),s.createBlock(s.unref(LO),{ref_key:"popperRef",ref:i,role:y.role},{default:s.withCtx(()=>[s.createVNode(GO,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:s.withCtx(()=>[y.$slots.default?s.renderSlot(y.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(XO,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:s.withCtx(()=>[s.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(y.content),1))]),y.showArrow?(s.openBlock(),s.createBlock(s.unref(aO),{key:0,"arrow-offset":y.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 eA=Be(JO,[["__file","tooltip.vue"]]);const Oi=vt(eA),Oy=Symbol("buttonGroupContextKey"),tA=(t,e)=>{Ho({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(Oy,void 0),n=au("button"),{form:a}=Kn(),i=Hn(s.computed(()=>r==null?void 0:r.size)),o=Ii(),l=s.ref(),c=s.useSlots(),u=s.computed(()=>t.type||(r==null?void 0:r.type)||""),d=s.computed(()=>{var p,g,m;return(m=(g=t.autoInsertSpace)!=null?g:(p=n.value)==null?void 0:p.autoInsertSpace)!=null?m:!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 m=g[0];if((m==null?void 0:m.type)===s.Text){const y=m.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.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)}}},vu=Fe({size:_a,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:un},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:un,default:()=>Te.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"}}),rA={click:t=>t instanceof MouseEvent};function Et(t,e){nA(t)&&(t="100%");var r=aA(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 rs(t){return Math.min(1,Math.max(0,t))}function nA(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function aA(t){return typeof t=="string"&&t.indexOf("%")!==-1}function Ay(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ns(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Gn(t){return t.length===1?"0"+t:String(t)}function iA(t,e,r){return{r:Et(t,255)*255,g:Et(e,255)*255,b:Et(r,255)*255}}function Ry(t,e,r){t=Et(t,255),e=Et(e,255),r=Et(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 gu(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 oA(t,e,r){var n,a,i;if(t=Et(t,360),e=Et(e,100),r=Et(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=gu(l,o,t+1/3),a=gu(l,o,t),i=gu(l,o,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function Ly(t,e,r){t=Et(t,255),e=Et(e,255),r=Et(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 sA(t,e,r){t=Et(t,360)*6,e=Et(e,100),r=Et(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 My(t,e,r,n){var a=[Gn(Math.round(t).toString(16)),Gn(Math.round(e).toString(16)),Gn(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 lA(t,e,r,n,a){var i=[Gn(Math.round(t).toString(16)),Gn(Math.round(e).toString(16)),Gn(Math.round(r).toString(16)),Gn(uA(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 uA(t){return Math.round(parseFloat(t)*255).toString(16)}function Fy(t){return Wt(t)/255}function Wt(t){return parseInt(t,16)}function cA(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var mu={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 dA(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=pA(t)),typeof t=="object"&&(jr(t.r)&&jr(t.g)&&jr(t.b)?(e=iA(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):jr(t.h)&&jr(t.s)&&jr(t.v)?(n=ns(t.s),a=ns(t.v),e=sA(t.h,n,a),o=!0,l="hsv"):jr(t.h)&&jr(t.s)&&jr(t.l)&&(n=ns(t.s),i=ns(t.l),e=oA(t.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=Ay(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 fA="[-\\+]?\\d+%?",hA="[-\\+]?\\d*\\.\\d+%?",hn="(?:".concat(hA,")|(?:").concat(fA,")"),yu="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),bu="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),pr={CSS_UNIT:new RegExp(hn),rgb:new RegExp("rgb"+yu),rgba:new RegExp("rgba"+bu),hsl:new RegExp("hsl"+yu),hsla:new RegExp("hsla"+bu),hsv:new RegExp("hsv"+yu),hsva:new RegExp("hsva"+bu),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 pA(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(mu[t])t=mu[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:Fy(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:Fy(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 jr(t){return!!pr.CSS_UNIT.exec(String(t))}var vA=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=cA(e)),this.originalInput=e;var a=dA(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=Ay(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=Ly(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=Ly(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=Ry(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=Ry(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),My(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),lA(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(Et(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(Et(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="#"+My(this.r,this.g,this.b,!1),r=0,n=Object.entries(mu);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=rs(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=rs(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=rs(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=rs(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 pn(t,e=20){return t.mix("#141414",e).toString()}function gA(t){const e=Ii(),r=Pe("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 vA(a),l=t.dark?o.tint(20).toString():pn(o,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?pn(o,90):o.tint(90).toString(),"text-color":a,"border-color":t.dark?pn(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?pn(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?pn(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?pn(o,80):o.tint(80).toString());else{const c=t.dark?pn(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?pn(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 mA=s.defineComponent({name:"ElButton"}),yA=s.defineComponent({...mA,props:vu,emits:rA,setup(t,{expose:e,emit:r}){const n=t,a=gA(n),i=Pe("button"),{_ref:o,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=tA(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(ut),{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(ut),{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 bA=Be(yA,[["__file","button.vue"]]);const wA={size:vu.size,type:vu.type},CA=s.defineComponent({name:"ElButtonGroup"}),EA=s.defineComponent({...CA,props:wA,setup(t){const e=t;s.provide(Oy,s.reactive({size:s.toRef(e,"size"),type:s.toRef(e,"type")}));const r=Pe("button");return(n,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(r).b("group"))},[s.renderSlot(n.$slots,"default")],2))}});var $y=Be(EA,[["__file","button-group.vue"]]);const Ht=vt(bA,{ButtonGroup:$y});Gr($y);var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const vn=new Map;if(rt){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of vn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function Vy(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:$n(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 qy={beforeMount(t,e){vn.has(t)||vn.set(t,[]),vn.get(t).push({documentHandler:Vy(t,e),bindingFn:e.value})},updated(t,e){vn.has(t)||vn.set(t,[]);const r=vn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:Vy(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){vn.delete(t)}},kA=Fe({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"}}),SA=s.defineComponent({name:"ElCard"}),_A=s.defineComponent({...SA,props:kA,setup(t){const e=Pe("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 TA=Be(_A,[["__file","card.vue"]]);const NA=vt(TA),zy={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:_a,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...dn(["ariaControls"])},Hy={[Ct]:t=>Nt(t)||wt(t)||ma(t),change:t=>Nt(t)||wt(t)||ma(t)},Ia=Symbol("checkboxGroupContextKey"),IA=({model:t,isChecked:e})=>{const r=s.inject(Ia,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!ln(l)&&t.value.length>=l&&!e.value||!ln(c)&&t.value.length<=c&&e.value});return{isDisabled:Ii(s.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},BA=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const o=s.inject(Ia,void 0),{formItem:l}=Kn(),{emit:c}=s.getCurrentInstance();function u(p){var g,m,y,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(m=(g=t.trueValue)!=null?g:t.trueLabel)!=null?m:!0:(b=(y=t.falseValue)!=null?y: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(y=>y.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=>nt(p)))}),{handleChange:f,onClickRoot:h}},DA=t=>{const e=s.ref(!1),{emit:r}=s.getCurrentInstance(),n=s.inject(Ia,void 0),a=s.computed(()=>ln(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&&$t(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(Ct,l),e.value=l)}});return{model:o,isGroup:a,isLimitExceeded:i}},PA=(t,e,{model:r})=>{const n=s.inject(Ia,void 0),a=s.ref(!1),i=s.computed(()=>qo(t.value)?t.label:t.value),o=s.computed(()=>{const d=r.value;return ma(d)?d:$t(d)?bt(i.value)?d.map(s.toRaw).some(f=>Vo(f,i.value)):d.map(s.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Hn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Hn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=s.computed(()=>!!e.default||!qo(i.value));return{checkboxButtonSize:l,isChecked:o,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},Ky=(t,e)=>{const{formItem:r}=Kn(),{model:n,isGroup:a,isLimitExceeded:i}=DA(t),{isFocused:o,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=PA(t,e,{model:n}),{isDisabled:h}=IA({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=Bi(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:m}=BA(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;$t(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()})(),Ho({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&&qo(t.value))),Ho({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)),Ho({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:m}},OA=s.defineComponent({name:"ElCheckbox"}),AA=s.defineComponent({...OA,props:zy,emits:Hy,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}=Ky(e,r),p=Pe("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)]),m=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(y,b)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(u)&&s.unref(a)?"span":"label"),{class:s.normalizeClass(s.unref(g)),"aria-controls":y.indeterminate?y.ariaControls:null,onClick:s.unref(v)},{default:s.withCtx(()=>{var w,C,x,k;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(m))},[y.trueValue||y.falseValue||y.trueLabel||y.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:y.indeterminate,name:y.name,tabindex:y.tabindex,disabled:s.unref(o),"true-value":(C=(w=y.trueValue)!=null?w:y.trueLabel)!=null?C:!0,"false-value":(k=(x=y.falseValue)!=null?x:y.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:y.indeterminate,disabled:s.unref(o),value:s.unref(f),name:y.name,tabindex:y.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(y.$slots,"default"),y.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(y.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var RA=Be(AA,[["__file","checkbox.vue"]]);const LA=s.defineComponent({name:"ElCheckboxButton"}),MA=s.defineComponent({...LA,props:zy,emits:Hy,setup(t){const e=t,r=s.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:o,model:l,actualValue:c,handleChange:u}=Ky(e,r),d=s.inject(Ia,void 0),f=Pe("checkbox"),h=s.computed(()=>{var p,g,m,y;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(y=(m=d==null?void 0:d.textColor)==null?void 0:m.value)!=null?y:"",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 m,y,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":(y=(m=p.trueValue)!=null?m:p.trueLabel)!=null?y:!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 Gy=Be(MA,[["__file","checkbox-button.vue"]]);const FA=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:_a,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...dn(["ariaLabel"])}),$A={[Ct]:t=>$t(t),change:t=>$t(t)},VA=s.defineComponent({name:"ElCheckboxGroup"}),qA=s.defineComponent({...VA,props:FA,emits:$A,setup(t,{emit:e}){const r=t,n=Pe("checkbox"),{formItem:a}=Kn(),{inputId:i,isLabeledByFormItem:o}=Bi(r,{formItemContext:a}),l=async u=>{e(Ct,u),await s.nextTick(),e("change",u)},c=s.computed({get(){return r.modelValue},set(u){l(u)}});return s.provide(Ia,{...km(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=>nt(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 Uy=Be(qA,[["__file","checkbox-group.vue"]]);const zA=vt(RA,{CheckboxButton:Gy,CheckboxGroup:Uy});Gr(Gy),Gr(Uy);const wu=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Bm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),HA={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},KA=s.defineComponent({name:"ElTag"}),GA=s.defineComponent({...KA,props:wu,emits:HA,setup(t,{emit:e}){const r=t,n=Hn(),a=Pe("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(ut),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.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(ut),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var UA=Be(GA,[["__file","tag.vue"]]);const jA=vt(UA),jy=Symbol("rowContextKey"),WA=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"]}}),YA=s.defineComponent({name:"ElRow"}),ZA=s.defineComponent({...YA,props:WA,setup(t){const e=t,r=Pe("row"),n=s.computed(()=>e.gutter);s.provide(jy,{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 XA=Be(ZA,[["__file","row.vue"]]);const as=vt(XA),QA=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:ke([Number,Object]),default:()=>ba({})},sm:{type:ke([Number,Object]),default:()=>ba({})},md:{type:ke([Number,Object]),default:()=>ba({})},lg:{type:ke([Number,Object]),default:()=>ba({})},xl:{type:ke([Number,Object]),default:()=>ba({})}}),JA=s.defineComponent({name:"ElCol"}),eR=s.defineComponent({...JA,props:QA,setup(t){const e=t,{gutter:r}=s.inject(jy,{gutter:s.computed(()=>0)}),n=Pe("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];wt(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=>{wt(e[u])?o.push(n.b(`${u}-${e[u]}`)):bt(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 tR=Be(eR,[["__file","col.vue"]]);const Ri=vt(tR),rR=s.defineComponent({name:"ElCollapseTransition"}),nR=s.defineComponent({...rR,setup(t){const e=Pe("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 aR=Be(nR,[["__file","collapse-transition.vue"]]);const iR=vt(aR),oR=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Cu=!1;function Li(t,e){if(!rt)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,Cu=!1,(o=e.end)==null||o.call(e,i)},a=function(i){var o;Cu||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),Cu=!0,(o=e.start)==null||o.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const sR=t=>{const e=s.getCurrentInstance(),{t:r}=wi(),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}=_l(f);if(t.vertical){let m=g-v.top;m=Math.max(n.value.offsetHeight/2,m),m=Math.min(m,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((m-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let m=p-v.left;m=Math.max(n.value.offsetWidth/2,m),m=Math.min(m,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((m-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 lt.left:case lt.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case lt.right:case lt.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}},lR=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=s.getCurrentInstance(),i=Pe("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)}};Li(e.value,b),Li(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")),m=s.computed(()=>({background:c.value})),y=s.computed(()=>({left:ya(o.value),top:ya(l.value)}));return{rootKls:v,barKls:p,barStyle:m,thumbKls:g,thumbStyle:y,update:h}},uR=s.defineComponent({name:"ElColorAlphaSlider"}),cR=s.defineComponent({...uR,props:oR,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:o,handleDrag:l,handleClick:c,handleKeydown:u}=sR(r),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=lR(r,{bar:i,thumb:o,handleDrag:l});return e({update:g,bar:i,thumb:o}),(m,y)=>(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":m.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 dR=Be(cR,[["__file","alpha-slider.vue"]]);const fR=s.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Pe("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:m,clientY:y}=_l(v);let b;if(t.vertical){let w=y-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=m-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)}};Li(a.value,v),Li(n.value,v),h()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:o,hueValue:l,handleClick:c,update:h,ns:e}}});function hR(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 pR=Be(fR,[["render",hR],["__file","hue-slider.vue"]]);const vR=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:_a,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:zt.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...dn(["ariaLabel"])}),gR={[Ct]:t=>Nt(t)||sn(t),[Gl]:t=>Nt(t)||sn(t),activeChange:t=>Nt(t)||sn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},Wy=Symbol("colorPickerContextKey"),Yy=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},mR=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},yR=function(t){return typeof t=="string"&&t.includes("%")},Ba=function(t,e){mR(t)&&(t="100%");const r=yR(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)},Zy={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},is=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${Zy[e]||e}${Zy[r]||r}`},Xy=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${is(t)}${is(e)}${is(r)}`},Eu={A:10,B:11,C:12,D:13,E:14,F:15},Un=function(t){return t.length===2?(Eu[t[0].toUpperCase()]||+t[0])*16+(Eu[t[1].toUpperCase()]||+t[1]):Eu[t[1].toUpperCase()]||+t[1]},bR=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}},Qy=(t,e,r)=>{t=Ba(t,255),e=Ba(e,255),r=Ba(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}},Mi=function(t,e,r){t=Ba(t,360)*6,e=Ba(e,100),r=Ba(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 Fi{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)Rn(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)Rn(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 Mi(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}=bR(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}=Qy(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=Un(n[0]+n[0]),i=Un(n[1]+n[1]),o=Un(n[2]+n[2])):(n.length===6||n.length===8)&&(a=Un(n.slice(0,2)),i=Un(n.slice(2,4)),o=Un(n.slice(4,6))),n.length===8?this._alpha=Un(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=Qy(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=Yy(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=`${Xy(Mi(e,r,n))}${is(a*255/100)}`;break}default:{const{r:o,g:l,b:c}=Mi(e,r,n);this.value=`rgba(${o}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const o=Yy(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}=Mi(e,r,n);this.value=`rgb(${o}, ${l}, ${c})`;break}default:this.value=Xy(Mi(e,r,n))}}}const wR=s.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Pe("color-predefine"),{currentColor:r}=s.inject(Wy),n=s.ref(i(t.colors,t.color));s.watch(()=>r.value,o=>{const l=new Fi;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 Fi;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 CR(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 ER=Be(wR,[["render",CR],["__file","predefine.vue"]]);const xR=s.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Pe("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}=_l(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(()=>{Li(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 kR(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 SR=Be(xR,[["render",kR],["__file","sv-panel.vue"]]);const _R=s.defineComponent({name:"ElColorPicker"}),TR=s.defineComponent({..._R,props:vR,emits:gR,setup(t,{expose:e,emit:r}){const n=t,{t:a}=wi(),i=Pe("color"),{formItem:o}=Kn(),l=Hn(),c=Ii(),{inputId:u,isLabeledByFormItem:d}=Bi(n,{formItemContext:o}),f=s.ref(),h=s.ref(),v=s.ref(),p=s.ref(),g=s.ref(),m=s.ref(),{isFocused:y,handleFocus:b,handleBlur:w}=nu(g,{beforeFocus(){return c.value},beforeBlur(M){var W;return(W=p.value)==null?void 0:W.isFocusInsideContent(M)},afterBlur(){R(!1),q()}});let C=!0;const x=s.reactive(new Fi({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",y.value)]);function D(M,W){if(!(M instanceof Fi))throw new TypeError("color should be instance of _color Class");const{r:Y,g:se,b:ce}=M.toRgb();return W?`rgba(${Y}, ${se}, ${ce}, ${M.get("alpha")/100})`:`rgb(${Y}, ${se}, ${ce})`}function R(M){k.value=M}const O=xm(R,100,{leading:!0});function L(){c.value||R(!0)}function A(){O(!1),q()}function q(){s.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",s.nextTick(()=>{E.value=!1}))})}function U(){c.value||O(!k.value)}function z(){x.fromString(_.value)}function H(){const M=x.value;r(Ct,M),r("change",M),n.validateEvent&&(o==null||o.validate("change").catch(W=>nt(W))),O(!1),s.nextTick(()=>{const W=new Fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(W)||q()})}function J(){O(!1),r(Ct,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(o==null||o.validate("change").catch(M=>nt(M))),q()}function F(){k.value&&(A(),y.value&&G())}function $(M){M.preventDefault(),M.stopPropagation(),R(!1),q()}function V(M){switch(M.code){case lt.enter:case lt.space:M.preventDefault(),M.stopPropagation(),L(),m.value.focus();break;case lt.esc:$(M);break}}function G(){g.value.focus()}function j(){g.value.blur()}return s.onMounted(()=>{n.modelValue&&(_.value=T.value)}),s.watch(()=>n.modelValue,M=>{M?M&&M!==x.value&&(C=!1,x.fromString(M)):E.value=!1}),s.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(Ct,x.value)}),s.watch(()=>T.value,M=>{_.value=M,C&&r("activeChange",M),C=!0}),s.watch(()=>x.value,()=>{!n.modelValue&&!E.value&&(E.value=!0)}),s.watch(()=>k.value,()=>{s.nextTick(()=>{var M,W,Y;(M=f.value)==null||M.update(),(W=h.value)==null||W.update(),(Y=v.value)==null||Y.update()})}),s.provide(Wy,{currentColor:T}),e({color:x,show:L,hide:A,focus:G,blur:j}),(M,W)=>(s.openBlock(),s.createBlock(s.unref(Oi),{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"),M.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:M.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($,["esc"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","main-wrapper"))},[s.createVNode(pR,{ref_key:"hue",ref:f,class:"hue-slider",color:s.unref(x),vertical:""},null,8,["color"]),s.createVNode(SR,{ref_key:"sv",ref:h,color:s.unref(x)},null,8,["color"])],2),M.showAlpha?(s.openBlock(),s.createBlock(dR,{key:0,ref_key:"alpha",ref:v,color:s.unref(x)},null,8,["color"])):s.createCommentVNode("v-if",!0),M.predefine?(s.openBlock(),s.createBlock(ER,{key:1,ref:"predefine","enable-alpha":M.showAlpha,color:s.unref(x),colors:M.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(Di),{ref_key:"inputRef",ref:m,modelValue:_.value,"onUpdate:modelValue":Y=>_.value=Y,"validate-event":!1,size:"small",onKeyup:s.withKeys(z,["enter"]),onBlur:z},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:J},{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:H},{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(u),ref_key:"triggerRef",ref:g},M.$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:M.modelValue||""}),"aria-disabled":s.unref(c),tabindex:s.unref(c)?-1:M.tabindex,onKeydown:V,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:U},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(i).be("picker","color"),s.unref(i).is("alpha",M.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(ut),{class:s.normalizeClass([s.unref(i).be("picker","icon"),s.unref(i).is("icon-arrow-down")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.ArrowDown))]),_:1},8,["class"]),[[s.vShow,M.modelValue||E.value]]),s.withDirectives(s.createVNode(s.unref(ut),{class:s.normalizeClass([s.unref(i).be("picker","empty"),s.unref(i).is("icon-close")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.Close))]),_:1},8,["class"]),[[s.vShow,!M.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 NR=Be(TR,[["__file","color-picker.vue"]]);const IR=vt(NR),BR=s.defineComponent({name:"ElContainer"}),DR=s.defineComponent({...BR,props:{direction:{type:String}},setup(t){const e=t,r=s.useSlots(),n=Pe("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 PR=Be(DR,[["__file","container.vue"]]);const OR=s.defineComponent({name:"ElAside"}),AR=s.defineComponent({...OR,props:{width:{type:String,default:null}},setup(t){const e=t,r=Pe("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 Jy=Be(AR,[["__file","aside.vue"]]);const RR=s.defineComponent({name:"ElFooter"}),LR=s.defineComponent({...RR,props:{height:{type:String,default:null}},setup(t){const e=t,r=Pe("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 e0=Be(LR,[["__file","footer.vue"]]);const MR=s.defineComponent({name:"ElHeader"}),FR=s.defineComponent({...MR,props:{height:{type:String,default:null}},setup(t){const e=t,r=Pe("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 t0=Be(FR,[["__file","header.vue"]]);const $R=s.defineComponent({name:"ElMain"}),VR=s.defineComponent({...$R,setup(t){const e=Pe("main");return(r,n)=>(s.openBlock(),s.createElementBlock("main",{class:s.normalizeClass(s.unref(e).b())},[s.renderSlot(r.$slots,"default")],2))}});var r0=Be(VR,[["__file","main.vue"]]);const xu=vt(PR,{Aside:Jy,Footer:e0,Header:t0,Main:r0});Gr(Jy),Gr(e0);const n0=Gr(t0),ku=Gr(r0),qR=s.defineComponent({inheritAttrs:!1});function zR(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var HR=Be(qR,[["render",zR],["__file","collection.vue"]]);const KR=s.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function GR(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var UR=Be(KR,[["render",GR],["__file","collection-item.vue"]]);const jR="data-el-collection-item",WR=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...HR,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(`[${jR}]`));return[...c.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};s.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},o={...UR,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}},Su=Fe({trigger:Pi.trigger,effect:{...zt.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:zt.teleported});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:un}}),Fe({onKeydown:{type:ke(Function)}}),WR("Dropdown");const a0=Symbol("ElSelectGroup"),$i=Symbol("ElSelect");function YR(t,e){const r=s.inject($i),n=s.inject(a0,{disabled:!1}),a=s.computed(()=>d(an(r.props.modelValue),t.value)),i=s.computed(()=>{var v;if(r.props.multiple){const p=an((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||(bt(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(bt(t.value)){const g=r.props.valueKey;return v&&v.some(m=>s.toRaw(Hr(m,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(zB(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:m}=r.props;if(v!==p&&(r.onOptionDestroy(p,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(m&&bt(v)&&bt(p)&&v[m]===p[m])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 ZR=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=Pe("select"),r=Zo(),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}=YR(t,a),{visible:f,hover:h}=s.toRefs(a),v=s.getCurrentInstance().proxy;c.onOptionCreate(v),s.onBeforeUnmount(()=>{const g=v.value,{selected:m}=c.states,b=(c.props.multiple?m:[m]).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 XR(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 _u=Be(ZR,[["render",XR],["__file","option.vue"]]);const QR=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=s.inject($i),e=Pe("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 JR(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 eL=Be(QR,[["render",JR],["__file","select-dropdown.vue"]]);const tL=11,rL=(t,e)=>{const{t:r}=wi(),n=Zo(),a=Pe("select"),i=Pe("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),m=s.ref(null),y=s.ref(null),b=s.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k}=hy({afterComposition:Q=>te(Q)}),{wrapperRef:E,isFocused:_}=nu(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}=Kn(),{inputId:P}=Bi(t,{formItemContext:B}),{valueOnClear:D,isEmptyValue:R}=kP(t),O=s.computed(()=>t.disabled||(N==null?void 0:N.disabled)),L=s.computed(()=>$t(t.modelValue)?t.modelValue.length>0:!R(t.modelValue)),A=s.computed(()=>t.clearable&&!O.value&&o.inputHovering&&L.value),q=s.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),U=s.computed(()=>a.is("reverse",q.value&&S.value)),z=s.computed(()=>(B==null?void 0:B.validateState)||""),H=s.computed(()=>Im[z.value]),J=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&&$.value===0?t.noMatchText||r("el.select.noMatch"):o.options.size===0?t.noDataText||r("el.select.noData"):null),$=s.computed(()=>V.value.filter(Q=>Q.visible).length),V=s.computed(()=>{const Q=Array.from(o.options.values()),he=[];return o.optionValues.forEach(Oe=>{const He=Q.findIndex(Mr=>Mr.value===Oe);He>-1&&he.push(Q[He])}),he.length>=Q.length?he:Q}),G=s.computed(()=>Array.from(o.cachedOptions.values())),j=s.computed(()=>{const Q=V.value.filter(he=>!he.created).some(he=>he.currentLabel===o.inputValue);return t.filterable&&t.allowCreate&&o.inputValue!==""&&!Q}),M=()=>{t.filterable&&Mt(t.filterMethod)||t.filterable&&t.remote&&Mt(t.remoteMethod)||V.value.forEach(Q=>{var he;(he=Q.updateOption)==null||he.call(Q,o.inputValue)})},W=Hn(),Y=s.computed(()=>["small"].includes(W.value)?"small":"default"),se=s.computed({get(){return S.value&&F.value!==!1},set(Q){S.value=Q}}),ce=s.computed(()=>{if(t.multiple&&!ln(t.modelValue))return an(t.modelValue).length===0&&!o.inputValue;const Q=$t(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||ln(Q)?!o.inputValue:!0}),ae=s.computed(()=>{var Q;const he=(Q=t.placeholder)!=null?Q:r("el.select.placeholder");return t.multiple||!L.value?he:o.selectedLabel}),ne=s.computed(()=>Sl?null:"mouseenter");s.watch(()=>t.modelValue,(Q,he)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(o.inputValue="",ue("")),fe(),!Vo(Q,he)&&t.validateEvent&&(B==null||B.validate("change").catch(Oe=>nt(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(!rt)return;const he=((Q=l.value)==null?void 0:Q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!ln(t.modelValue)||!Array.from(he).includes(document.activeElement))&&fe(),t.defaultFirstOption&&(t.filterable||t.remote)&&$.value&&ie()},{flush:"post"}),s.watch(()=>o.hoveringIndex,Q=>{wt(Q)&&Q>-1?T.value=V.value[Q]||{}:T.value={},V.value.forEach(he=>{he.hover=T.value===he})}),s.watchEffect(()=>{o.isBeforeHide||M()});const ue=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)&&$.value?s.nextTick(ie):s.nextTick(De))},ie=()=>{const Q=V.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),he=Q.find(He=>He.created),Oe=Q[0];o.hoveringIndex=ye(V.value,he||Oe)},fe=()=>{if(t.multiple)o.selectedLabel="";else{const he=$t(t.modelValue)?t.modelValue[0]:t.modelValue,Oe=pe(he);o.selectedLabel=Oe.currentLabel,o.selected=[Oe];return}const Q=[];ln(t.modelValue)||an(t.modelValue).forEach(he=>{Q.push(pe(he))}),o.selected=Q},pe=Q=>{let he;const Oe=Tl(Q).toLowerCase()==="object",He=Tl(Q).toLowerCase()==="null",Mr=Tl(Q).toLowerCase()==="undefined";for(let rn=o.cachedOptions.size-1;rn>=0;rn--){const ur=G.value[rn];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 On=Oe?Q.label:!He&&!Mr?Q:"";return{value:Q,currentLabel:On}},De=()=>{o.hoveringIndex=V.value.findIndex(Q=>o.selected.some(he=>Rt(he)===Rt(Q)))},Ie=()=>{o.selectionWidth=c.value.getBoundingClientRect().width},we=()=>{o.calculatorWidth=h.value.getBoundingClientRect().width},xe=()=>{o.collapseItemWidth=y.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)},K=()=>{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 K()},Z=xm(()=>{K()},J.value),X=Q=>{Vo(t.modelValue,Q)||e(Gl,Q)},le=Q=>LB(Q,he=>!o.disabledOptions.has(he)),ee=Q=>{if(t.multiple&&Q.code!==lt.delete&&Q.target.value.length<=0){const he=an(t.modelValue).slice(),Oe=le(he);if(Oe<0)return;const He=he[Oe];he.splice(Oe,1),e(Ct,he),X(he),e("remove-tag",He)}},oe=(Q,he)=>{const Oe=o.selected.indexOf(he);if(Oe>-1&&!O.value){const He=an(t.modelValue).slice();He.splice(Oe,1),e(Ct,He),X(He),e("remove-tag",he.value)}Q.stopPropagation(),it()},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(Ct,he),X(he),o.hoveringIndex=-1,S.value=!1,e("clear"),it()},be=Q=>{var he;if(t.multiple){const Oe=an((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(Ct,Oe),X(Oe),Q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(o.inputValue="")}else e(Ct,Q.value),X(Q.value),S.value=!1;it(),!S.value&&s.nextTick(()=>{_e(Q)})},ye=(Q=[],he)=>{if(!bt(he))return Q.indexOf(he);const Oe=t.valueKey;let He=-1;return Q.some((Mr,On)=>s.toRaw(Hr(Mr,Oe))===Hr(he,Oe)?(He=On,!0):!1),He},_e=Q=>{var he,Oe,He,Mr,On;const fi=$t(Q)?Q[0]:Q;let rn=null;if(fi!=null&&fi.value){const ur=V.value.filter(An=>An.value===fi.value);ur.length>0&&(rn=ur[0].$el)}if(u.value&&rn){const ur=(Mr=(He=(Oe=(he=u.value)==null?void 0:he.popperRef)==null?void 0:Oe.contentRef)==null?void 0:He.querySelector)==null?void 0:Mr.call(He,`.${a.be("dropdown","wrap")}`);ur&&GB(ur,rn)}(On=b.value)==null||On.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))},it=()=>{var Q;(Q=f.value)==null||Q.focus()},ot=()=>{var Q;(Q=f.value)==null||Q.blur()},et=Q=>{me(Q)},At=()=>{S.value=!1,_.value&&ot()},pt=()=>{o.inputValue.length>0?o.inputValue="":S.value=!1},mt=()=>{O.value||(Sl&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:S.value=!S.value)},Qt=()=>{S.value?V.value[o.hoveringIndex]&&be(V.value[o.hoveringIndex]):mt()},Rt=Q=>bt(Q.value)?Hr(Q.value,t.valueKey):Q.value,Lt=s.computed(()=>V.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)&&!Lt.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=V.value[o.hoveringIndex];(he.disabled===!0||he.states.groupDisabled===!0||!he.visible)&&jt(Q),s.nextTick(()=>_e(T.value))}},tt=()=>{if(!c.value)return 0;const Q=window.getComputedStyle(c.value);return Number.parseFloat(Q.gap||"6px")},st=s.computed(()=>{const Q=tt();return{maxWidth:`${y.value&&t.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-Q:o.selectionWidth}px`}}),yt=s.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Pn=s.computed(()=>({width:`${Math.max(o.calculatorWidth,tL)}px`}));return Vr(c,Ie),Vr(h,we),Vr(g,re),Vr(E,re),Vr(m,I),Vr(y,xe),s.onMounted(()=>{fe()}),{inputId:P,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:_,expanded:S,optionsArray:V,hoverOption:T,selectSize:W,filteredOptionsCount:$,resetCalculatorWidth:we,updateTooltip:re,updateTagTooltip:I,debouncedOnInputChange:Z,onInput:te,deletePrevTag:ee,deleteTag:oe,deleteSelected:me,handleOptionSelect:be,scrollToOption:_e,hasModelValue:L,shouldShowPlaceholder:ce,currentPlaceholder:ae,mouseEnterEventName:ne,showClose:A,iconComponent:q,iconReverse:U,validateState:z,validateIcon:H,showNewOption:j,updateOptions:M,collapseTagSize:Y,setSelected:fe,selectDisabled:O,emptyText:F,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k,onOptionCreate:ge,onOptionDestroy:Ce,handleMenuEnter:qe,focus:it,blur:ot,handleClearClick:et,handleClickOutside:At,handleEsc:pt,toggleMenu:mt,selectOption:Qt,getValueKey:Rt,navigateOptions:jt,dropdownMenuVisible:se,showTagList:lr,collapseTagList:Cr,tagStyle:st,collapseTagStyle:yt,inputStyle:Pn,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:m,collapseItemRef:y}};var nL=s.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=s.inject($i);let n=[];return()=>{var a,i;const o=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){$t(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(!Nt(d.children)&&!$t(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):$t(d.children)&&c(d.children)})}return o.length&&c((i=o[0])==null?void 0:i.children),Vo(l,n)||(n=l,r&&(r.states.optionValues=l)),o}}});const aL=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:_a,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:zt.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:un,default:Te.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:un,default:Te.ArrowDown},tagType:{...wu.type,default:"info"},tagEffect:{...wu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:Go,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...xP,...dn(["ariaLabel"])}),i0="ElSelect",iL=s.defineComponent({name:i0,componentName:i0,components:{ElSelectMenu:eL,ElOption:_u,ElOptions:nL,ElTag:jA,ElScrollbar:QP,ElTooltip:Oi,ElIcon:ut},directives:{ClickOutside:qy},props:aL,emits:[Ct,Gl,"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 $t(i)?o?i:l:o?l:i}),n=s.reactive({...s.toRefs(t),modelValue:r}),a=rL(n,e);return s.provide($i,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 oL(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:m=>t.deleteTag(m,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:m=>t.deleteTag(m,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 sL=Be(iL,[["render",oL],["__file","select.vue"]]);const lL=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Pe("select"),r=s.ref(null),n=s.getCurrentInstance(),a=s.ref([]);s.provide(a0,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=an(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()}),F_(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function uL(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 o0=Be(lL,[["render",uL],["__file","option-group.vue"]]);const cL=vt(sL,{Option:_u,OptionGroup:o0}),dL=Gr(_u);Gr(o0);const fL=Fe({trigger:Pi.trigger,placement:Su.placement,disabled:Pi.disabled,visible:zt.visible,transition:zt.transition,popperOptions:Su.popperOptions,tabindex:Su.tabindex,content:zt.content,popperStyle:zt.popperStyle,popperClass:zt.popperClass,enterable:{...zt.enterable,default:!0},effect:{...zt.effect,default:"light"},teleported:zt.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}}),hL={"update:visible":t=>ma(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},pL="onUpdate:visible",vL=s.defineComponent({name:"ElPopover"}),gL=s.defineComponent({...vL,props:fL,emits:hL,setup(t,{expose:e,emit:r}){const n=t,a=s.computed(()=>n[pL]),i=Pe("popover"),o=s.ref(),l=s.computed(()=>{var m;return(m=s.unref(o))==null?void 0:m.popperRef}),c=s.computed(()=>[{width:ya(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 m;(m=o.value)==null||m.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}),(m,y)=>(s.openBlock(),s.createBlock(s.unref(Oi),s.mergeProps({ref_key:"tooltipRef",ref:o},m.$attrs,{trigger:m.trigger,placement:m.placement,disabled:m.disabled,visible:m.visible,transition:m.transition,"popper-options":m.popperOptions,tabindex:m.tabindex,content:m.content,offset:m.offset,"show-after":m.showAfter,"hide-after":m.hideAfter,"auto-close":m.autoClose,"show-arrow":m.showArrow,"aria-label":m.title,effect:m.effect,enterable:m.enterable,"popper-class":s.unref(u),"popper-style":s.unref(c),teleported:m.teleported,persistent:m.persistent,"gpu-acceleration":s.unref(d),"onUpdate:visible":s.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:s.withCtx(()=>[m.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).e("title")),role:"title"},s.toDisplayString(m.title),3)):s.createCommentVNode("v-if",!0),s.renderSlot(m.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(m.content),1)])]),default:s.withCtx(()=>[m.$slots.reference?s.renderSlot(m.$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 mL=Be(gL,[["__file","popover.vue"]]);const s0=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var yL={mounted(t,e){s0(t,e)},updated(t,e){s0(t,e)}};const bL=jB(yL,"popover"),Da=vt(mL,{directive:bL}),Pa="$treeNodeId",l0=function(t,e){!e||e[Pa]||Object.defineProperty(e,Pa,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Tu=function(t,e){return t?e[t]:e[Pa]},Nu=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Iu=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}},Vi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Iu(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||Vi(a)},os=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 wL=0;class jn{constructor(e){this.id=wL++,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)Rn(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=os(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)||l0(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)||l0(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=os(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return os(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return os(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 jn)){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 jn(e)),e instanceof jn&&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||Vi(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}=Iu(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}=Iu(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),Vi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||Vi(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[Pa];!!l&&r.findIndex(u=>u[Pa]===l)>=0?n[l]={index:o,data:i}:a.push({index:o,data:i})}),this.store.lazy||r.forEach(i=>{n[i[Pa]]||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||Vi(this)}}class CL{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)Rn(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new jn({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 jn)return e;const r=bt(e)?Tu(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=qo(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)Rn(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(m=>{m.isLeaf||m.setChecked(!1,!1),v(m)})};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 EL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Pe("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 xL=Be(EL,[["__file","tree-node-content.vue"]]);function u0(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 c0=Symbol("dragEvents");function kL({props:t,ctx:e,el$:r,dropIndicator$:n,store:a}){const i=Pe("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&&Vn(v.$el,i.is("drop-inner"));const p=o.value.draggingNode;if(!p||!h)return;let g=!0,m=!0,y=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=m=t.allowDrop(p.node,h.node,"inner"),y=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=m||g||y?"move":"none",(g||m||y)&&(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||m||y?o.value.dropNode=h:o.value.dropNode=null,h.node.nextSibling===p.node&&(y=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(m=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,m=!1,y=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const k=g?m?.25:y?.45:1:-1,E=y?m?.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":m?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"?Kl(h.$el,i.is("drop-inner")):Vn(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 m;(m=a.value.nodesMap[g.data[a.value.key]])==null||m.setChecked(g.checked,!a.value.checkStrictly)})),Vn(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(c0,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:o}}const SL=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:iR,ElCheckbox:zA,NodeContent:xL,ElIcon:ut,Loading:Te.Loading},props:{node:{type:jn,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=Pe("tree"),{broadcastExpanded:n}=u0(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(c0),f=s.getCurrentInstance();s.provide("NodeInstance",f),a||nt("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=>Tu(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 Nt(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},m=S=>{Nu(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)},y=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:m,handleContextMenu:y,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:Te.CaretRight}}});function _L(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 TL=Be(SL,[["render",_L],["__file","tree-node.vue"]]);function NL({el$:t},e){const r=Pe("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")})}),Jt(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([lt.up,lt.down].includes(u)){if(l.preventDefault(),u===lt.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()}[lt.left,lt.right].includes(u)&&(l.preventDefault(),c.click());const h=c.querySelector('[type="checkbox"]');[lt.enter,lt.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 IL=s.defineComponent({name:"ElTree",components:{ElTreeNode:TL},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:un}},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}=wi(),n=Pe("tree"),a=s.inject($i,null),i=s.ref(new CL({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}=u0(t),{dragState:f}=kL({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});NL({el$:c},i);const h=s.computed(()=>{const{childNodes:A}=o.value,q=a?a.hasFilteredOptions!==0:!1;return(!A||A.length===0||A.every(({visible:U})=>!U))&&!q});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=>Tu(t.nodeKey,A.data),g=A=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const q=i.value.getNode(A);if(!q)return[];const U=[q.data];let z=q.parent;for(;z&&z!==o.value;)U.push(z.data),z=z.parent;return U.reverse()},m=(A,q)=>i.value.getCheckedNodes(A,q),y=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,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(A,q)},x=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(A,q)},k=(A,q,U)=>{i.value.setChecked(A,q,U)},E=()=>i.value.getHalfCheckedNodes(),_=()=>i.value.getHalfCheckedKeys(),S=(A,q=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Nu(i,e.emit,()=>{d(A),i.value.setUserCurrentNode(A,q)})},T=(A,q=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Nu(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(A,q)})},N=A=>i.value.getNode(A),B=A=>{i.value.remove(A)},P=(A,q)=>{i.value.append(A,q)},D=(A,q)=>{i.value.insertBefore(A,q)},R=(A,q)=>{i.value.insertAfter(A,q)},O=(A,q,U)=>{d(q),e.emit("node-expand",A,q,U)},L=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(A,q)};return s.provide("RootTree",{ctx:e,props:t,store:i,root:o,currentNode:l,instance:s.getCurrentInstance()}),s.provide(Ni,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:m,getCheckedKeys:y,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:L}}});function BL(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 DL=Be(IL,[["render",BL],["__file","tree.vue"]]);const PL=vt(DL);function OL(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()):(Vn(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),Vn(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}=_P("loading");return v({ns:p,zIndex:g}),()=>{const m=n.spinner||n.svg,y=s.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...m?{innerHTML:m}:{}},[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")},[y,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 ss;const AL=function(t={}){if(!rt)return;const e=RL(t);if(e.fullscreen&&ss)return ss;const r=OL({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(ss=void 0)}});LL(e,e.parent,r),d0(e,e.parent,r),e.parent.vLoadingAddClassList=()=>d0(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&&(ss=r),r},RL=t=>{var e,r,n,a;let i;return Nt(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}},LL=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=bi(document.body,"position"),r.originalOverflow.value=bi(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.originalPosition.value=bi(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(bi(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else r.originalPosition.value=bi(e,"position");for(const[i,o]of Object.entries(a))r.$el.style[i]=o},d0=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?Vn(e,n.bm("parent","relative")):Kl(e,n.bm("parent","relative")),t.fullscreen&&t.lock?Kl(e,n.bm("parent","hidden")):Vn(e,n.bm("parent","hidden"))},ls=Symbol("ElLoading"),f0=(t,e)=>{var r,n,a,i;const o=e.instance,l=h=>bt(e.value)?e.value[h]:void 0,c=h=>{const v=Nt(h)&&(o==null?void 0:o[h])||h;return v&&s.ref(v)},u=h=>c(l(h)||t.getAttribute(`element-loading-${Z_(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[ls]={options:f,instance:AL(f)}},ML=(t,e)=>{for(const r of Object.keys(e))s.isRef(e[r])&&(e[r].value=t[r])},Bu={mounted(t,e){e.value&&f0(t,e)},updated(t,e){const r=t[ls];e.oldValue!==e.value&&(e.value&&!e.oldValue?f0(t,e):e.value&&e.oldValue?bt(e.value)&&ML(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[ls])==null||e.instance.close(),t[ls]=null}},Yt=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},FL="Copy to clipboard",$L="Copied!",VL={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:FL},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=$L:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},qL={class:"visually-hidden"};function zL(t,e,r,n,a,i){const o=Te.CopyDocument,l=ut,c=Ht,u=Oi;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",qL,s.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick","disabled"])]),_:1},8,["content","hide-after","onHide","append-to"])}const us=Yt(VL,[["render",zL],["__scopeId","data-v-91c822cd"]]),HL={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(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1,this.emitActiveItemChange())},next:function(){this.entryIndex!==this.annotationEntry.length-1&&(this.entryIndex=this.entryIndex+1,this.emitActiveItemChange())},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
+ `,RP=["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 LP(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:RP.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function my(t,e=1,r){var n;hr||(hr=document.createElement("textarea"),document.body.appendChild(hr));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=LP(t);hr.setAttribute("style",`${l};${AP}`),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(wt(e)){let f=d*e;o==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(wt(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 MP=Fe({id:{type:String,default:void 0},size:Ta,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:un},prefixIcon:{type:un},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>wa({})},autofocus:Boolean,rows:{type:Number,default:2},...dn(["ariaLabel"])}),FP={[Ct]:t=>Nt(t),input:t=>Nt(t),change:t=>Nt(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},$P=s.defineComponent({name:"ElInput",inheritAttrs:!1}),VP=s.defineComponent({...$P,props:MP,emits:FP,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"?m.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",Q.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")]:q.value&&U.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=s.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=JB({excludeKeys:s.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Kn(),{inputId:h}=Bi(n,{formItemContext:f}),v=Hn(),p=Ii(),g=Pe("input"),m=Pe("textarea"),y=s.shallowRef(),b=s.shallowRef(),w=s.ref(!1),C=s.ref(!1),E=s.ref(),k=s.shallowRef(n.inputStyle),x=s.computed(()=>y.value||b.value),{wrapperRef:_,isFocused:S,handleFocus:T,handleBlur:N}=nu(x,{beforeFocus(){return p.value},afterBlur(){var I;n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"blur").catch(K=>nt(K)))}}),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&&Bm[P.value]),R=s.computed(()=>C.value?Te.View:Te.Hide),O=s.computed(()=>[a.style]),L=s.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),A=s.computed(()=>sn(n.modelValue)?"":String(n.modelValue)),q=s.computed(()=>n.clearable&&!p.value&&!n.readonly&&!!A.value&&(S.value||w.value)),U=s.computed(()=>n.showPassword&&!p.value&&!n.readonly&&!!A.value&&(!!A.value||S.value)),z=s.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!p.value&&!n.readonly&&!n.showPassword),H=s.computed(()=>A.value.length),Q=s.computed(()=>!!z.value&&H.value>Number(n.maxlength)),F=s.computed(()=>!!i.suffix||!!n.suffixIcon||q.value||n.showPassword||z.value||!!P.value&&B.value),[$,V]=bP(y);Vr(b,I=>{if(M(),!z.value||n.resize!=="both")return;const K=I[0],{width:te}=K.contentRect;E.value={right:`calc(100% - ${te+15+6}px)`}});const G=()=>{const{type:I,autosize:K}=n;if(!(!rt||I!=="textarea"||!b.value))if(K){const te=bt(K)?K.minRows:void 0,Z=bt(K)?K.maxRows:void 0,X=my(b.value,te,Z);k.value={overflowY:"hidden",...X},s.nextTick(()=>{b.value.offsetHeight,k.value=X})}else k.value={minHeight:my(b.value).minHeight}},M=(I=>{let K=!1;return()=>{var te;if(K||!n.autosize)return;((te=b.value)==null?void 0:te.offsetParent)===null||(I(),K=!0)}})(G),W=()=>{const I=x.value,K=n.formatter?n.formatter(A.value):A.value;!I||I.value===K||(I.value=K)},Y=async I=>{$();let{value:K}=I.target;if(n.formatter&&(K=n.parser?n.parser(K):K),!ce.value){if(K===A.value){W();return}r(Ct,K),r("input",K),await s.nextTick(),W(),V()}},se=I=>{r("change",I.target.value)},{isComposing:ce,handleCompositionStart:ae,handleCompositionUpdate:ne,handleCompositionEnd:ue}=py({emit:r,afterComposition:Y}),ie=()=>{C.value=!C.value,fe()},fe=async()=>{var I;await s.nextTick(),(I=x.value)==null||I.focus()},pe=()=>{var I;return(I=x.value)==null?void 0:I.blur()},De=I=>{w.value=!1,r("mouseleave",I)},Ie=I=>{w.value=!0,r("mouseenter",I)},we=I=>{r("keydown",I)},xe=()=>{var I;(I=x.value)==null||I.select()},re=()=>{r(Ct,""),r("change",""),r("clear"),r("input","")};return s.watch(()=>n.modelValue,()=>{var I;s.nextTick(()=>G()),n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"change").catch(K=>nt(K)))}),s.watch(A,()=>W()),s.watch(()=>n.type,async()=>{await s.nextTick(),W(),G()}),s.onMounted(()=>{!n.formatter&&n.parser&&nt("ElInput","If you set the parser, you also need to set the formatter."),W(),s.nextTick(G)}),e({input:y,textarea:b,ref:x,textareaStyle:L,autosize:s.toRef(n,"autosize"),isComposing:ce,focus:fe,blur:pe,select:xe,clear:re,resizeTextarea:G}),(I,K)=>(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:De}),[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(ut),{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:y,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(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(q)||!s.unref(U)||!s.unref(z)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(I.$slots,"suffix"),I.suffixIcon?(s.openBlock(),s.createBlock(s.unref(ut),{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(q)?(s.openBlock(),s.createBlock(s.unref(ut),{key:1,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("clear")]),onMousedown:s.withModifiers(s.unref(hi),["prevent"]),onClick:re},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(U)?(s.openBlock(),s.createBlock(s.unref(ut),{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(z)?(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(H))+" / "+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(ut),{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(m).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(L),"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(z)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(E.value),class:s.normalizeClass(s.unref(g).e("count"))},s.toDisplayString(s.unref(H))+" / "+s.toDisplayString(I.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var qP=Be(VP,[["__file","input.vue"]]);const Di=vt(qP),Na=4,zP={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"}},HP=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),ou=Symbol("scrollbarContextKey"),KP=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),GP="Thumb";var yy=Be(s.defineComponent({__name:"thumb",props:KP,setup(t){const e=t,r=s.inject(ou),n=Pe("scrollbar");r||KB(GP,"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=rt?document.onselectstart:null;const f=s.computed(()=>zP[e.vertical?"vertical":"horizontal"]),h=s.computed(()=>HP({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 x;if(k.stopPropagation(),k.ctrlKey||[1,2].includes(k.button))return;(x=window.getSelection())==null||x.removeAllRanges(),m(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 x=Math.abs(k.target.getBoundingClientRect()[f.value.direction]-k[f.value.client]),_=i.value[f.value.offset]/2,S=(x-_)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},m=k=>{k.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},y=k=>{if(!a.value||!i.value||c===!1)return;const x=o.value[f.value.axis];if(!x)return;const _=(a.value.getBoundingClientRect()[f.value.direction]-k[f.value.client])*-1,S=i.value[f.value.offset]-x,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",y),document.removeEventListener("mouseup",b),E(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};s.onBeforeUnmount(()=>{E(),document.removeEventListener("mouseup",b)});const E=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Qt(s.toRef(r,"scrollbarElement"),"mousemove",w),Qt(s.toRef(r,"scrollbarElement"),"mouseleave",C),(k,x)=>(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 UP=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var jP=Be(s.defineComponent({__name:"bar",props:UP,setup(t,{expose:e}){const r=t,n=s.inject(ou),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-Na,p=h.offsetWidth-Na;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-Na,p=h.offsetWidth-Na,g=v**2/h.scrollHeight,m=p**2/h.scrollWidth,y=Math.max(g,r.minSize),b=Math.max(m,r.minSize);c.value=g/(v-g)/(y/(v-y)),u.value=m/(p-m)/(b/(p-b)),l.value=y+Na<v?`${y}px`:"",o.value=b+Na<p?`${b}px`:""}}),(h,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(yy,{move:a.value,ratio:u.value,size:o.value,always:h.always},null,8,["move","ratio","size","always"]),s.createVNode(yy,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const WP=Fe({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,...dn(["ariaLabel","ariaOrientation"])}),YP={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(wt)},su="ElScrollbar",ZP=s.defineComponent({name:su}),XP=s.defineComponent({...ZP,props:WP,emits:YP,setup(t,{expose:e,emit:r}){const n=t,a=Pe("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 E={};return n.height&&(E.height=ba(n.height)),n.maxHeight&&(E.maxHeight=ba(n.maxHeight)),[n.wrapStyle,E]}),p=s.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=s.computed(()=>[a.e("view"),n.viewClass]),m=()=>{var E;d.value&&((E=h.value)==null||E.handleScroll(d.value),l=d.value.scrollTop,c=d.value.scrollLeft,r("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function y(E,k){bt(E)?d.value.scrollTo(E):wt(E)&&wt(k)&&d.value.scrollTo(E,k)}const b=E=>{if(!wt(E)){nt(su,"value must be a number");return}d.value.scrollTop=E},w=E=>{if(!wt(E)){nt(su,"value must be a number");return}d.value.scrollLeft=E},C=()=>{var E;(E=h.value)==null||E.update()};return s.watch(()=>n.noresize,E=>{E?(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 E;C(),d.value&&((E=h.value)==null||E.handleScroll(d.value))})}),s.provide(ou,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:y,setScrollTop:b,setScrollLeft:w,handleScroll:m}),(E,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:E.tabindex,onScroll:m},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(E.tag),{id:E.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(g)),style:s.normalizeStyle(E.viewStyle),role:E.role,"aria-label":E.ariaLabel,"aria-orientation":E.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(E.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),E.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(jP,{key:0,ref_key:"barRef",ref:h,always:E.always,"min-size":E.minSize},null,8,["always","min-size"]))],2))}});var JP=Be(XP,[["__file","scrollbar.vue"]]);const QP=vt(JP),lu=Symbol("popper"),by=Symbol("popperContent"),wy=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),eO=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),tO=s.defineComponent({...eO,props:wy,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(lu,c),(u,d)=>s.renderSlot(u.$slots,"default")}});var rO=Be(tO,[["__file","popper.vue"]]);const Cy=Fe({arrowOffset:{type:Number,default:5}}),nO=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),aO=s.defineComponent({...nO,props:Cy,setup(t,{expose:e}){const r=t,n=Pe("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=s.inject(by,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 iO=Be(aO,[["__file","arrow.vue"]]);const uu="ElOnlyChild",oO=s.defineComponent({name:uu,setup(t,{slots:e,attrs:r}){var n;const a=s.inject(oy),i=yP((n=a==null?void 0:a.setForwardRef)!=null?n:hi);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,r);if(!l)return null;if(l.length>1)return nt(uu,"requires exact only one valid child."),null;const c=Ey(l);return c?s.withDirectives(s.cloneVNode(c,r),[[i]]):(nt(uu,"no valid child node found"),null)}}});function Ey(t){if(!t)return null;const e=t;for(const r of e){if(bt(r))switch(r.type){case s.Comment:continue;case s.Text:case"svg":return xy(r);case s.Fragment:return Ey(r.children);default:return r}return xy(r)}return null}function xy(t){const e=Pe("only-child");return s.createVNode("span",{class:e.e("content")},[t])}const ky=Fe({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}),sO=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),lO=s.defineComponent({...sO,props:ky,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=s.inject(lu,void 0);mP(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,$n(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)=>{sn(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),$n(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&&$n(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(oO),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 uO=Be(lO,[["__file","trigger.vue"]]);const cu="focus-trap.focus-after-trapped",du="focus-trap.focus-after-released",cO="focus-trap.focusout-prevented",Sy={cancelable:!0,bubbles:!1},dO={cancelable:!0,bubbles:!1},_y="focusAfterTrapped",Ty="focusAfterReleased",fO=Symbol("elFocusTrap"),fu=s.ref(),Jo=s.ref(0),hu=s.ref(0);let Qo=0;const Ny=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},Iy=(t,e)=>{for(const r of t)if(!hO(r,e))return r},hO=(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},pO=t=>{const e=Ny(t),r=Iy(e,t),n=Iy(e.reverse(),t);return[r,n]},vO=t=>t instanceof HTMLInputElement&&"select"in t,fn=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),hu.value=window.performance.now(),t!==r&&vO(t)&&e&&t.select()}};function By(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const gO=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=By(t,n),t.unshift(n)},remove:n=>{var a,i;t=By(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},mO=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(fn(n,e),document.activeElement!==r)return},Dy=gO(),yO=()=>Jo.value>hu.value,es=()=>{fu.value="pointer",Jo.value=window.performance.now()},Py=()=>{fu.value="keyboard",Jo.value=window.performance.now()},bO=()=>(s.onMounted(()=>{Qo===0&&(document.addEventListener("mousedown",es),document.addEventListener("touchstart",es),document.addEventListener("keydown",Py)),Qo++}),s.onBeforeUnmount(()=>{Qo--,Qo<=0&&(document.removeEventListener("mousedown",es),document.removeEventListener("touchstart",es),document.removeEventListener("keydown",Py))}),{focusReason:fu,lastUserFocusTimestamp:Jo,lastAutomatedFocusTimestamp:hu}),ts=t=>new CustomEvent(cO,{...dO,detail:t}),wO=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[_y,Ty,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=s.ref();let n,a;const{focusReason:i}=bO();fP(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:m,ctrlKey:y,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:E}=t,k=g===lt.tab&&!m&&!y&&!b,x=document.activeElement;if(k&&x){const _=w,[S,T]=pO(_);if(S&&T){if(!C&&x===T){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),E&&fn(S,!0))}else if(C&&[S,_].includes(x)){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),E&&fn(T,!0))}}else if(x===_){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||p.preventDefault()}}};s.provide(fO,{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(_y,p)},u=p=>e(Ty,p),d=p=>{const g=s.unref(r);if(!g)return;const m=p.target,y=p.relatedTarget,b=m&&g.contains(m);t.trapped||y&&g.contains(y)||(n=y),b&&e("focusin",p),!o.paused&&t.trapped&&(b?a=m:fn(a,!0))},f=p=>{const g=s.unref(r);if(!(o.paused||!g))if(t.trapped){const m=p.relatedTarget;!sn(m)&&!g.contains(m)&&setTimeout(()=>{if(!o.paused&&t.trapped){const y=ts({focusReason:i.value});e("focusout-prevented",y),y.defaultPrevented||fn(a,!0)}},0)}else{const m=p.target;m&&g.contains(m)||e("focusout",p)}};async function h(){await s.nextTick();const p=s.unref(r);if(p){Dy.push(o);const g=p.contains(document.activeElement)?n:document.activeElement;if(n=g,!p.contains(g)){const y=new Event(cu,Sy);p.addEventListener(cu,c),p.dispatchEvent(y),y.defaultPrevented||s.nextTick(()=>{let b=t.focusStartEl;Nt(b)||(fn(b),document.activeElement!==b&&(b="first")),b==="first"&&mO(Ny(p),!0),(document.activeElement===g||b==="container")&&fn(p)})}}}function v(){const p=s.unref(r);if(p){p.removeEventListener(cu,c);const g=new CustomEvent(du,{...Sy,detail:{focusReason:i.value}});p.addEventListener(du,u),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!yO()||p.contains(document.activeElement))&&fn(n??document.body),p.removeEventListener(du,u),Dy.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 CO(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var EO=Be(wO,[["render",CO],["__file","focus-trap.vue"]]);const xO=["fixed","absolute"],kO=Fe({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:Go,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:xO,default:"absolute"}}),Oy=Fe({...kO,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,...dn(["ariaLabel"])}),SO={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},_O=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...NO(t),...e]};return IO(i,a==null?void 0:a.modifiers),i},TO=t=>{if(rt)return $r(t)};function NO(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 IO(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const BO=0,DO=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=s.inject(lu,void 0),i=s.ref(),o=s.ref(),l=s.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=s.computed(()=>{var y;const b=s.unref(i),w=(y=s.unref(o))!=null?y:BO;return{name:"arrow",enabled:!FB(b),options:{element:b,padding:w}}}),u=s.computed(()=>({onFirstUpdate:()=>{p()},..._O(t,[s.unref(c),s.unref(l)])})),d=s.computed(()=>TO(t.referenceEl)||s.unref(n)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:m}=uP(d,r,u);return s.watch(m,y=>e.value=y),s.onMounted(()=>{s.watch(()=>{var y;return(y=s.unref(d))==null?void 0:y.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:m,state:h,styles:v,role:a,forceUpdate:g,update:p}},PO=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=fy(),i=Pe("popper"),o=s.computed(()=>s.unref(e).popper),l=s.ref(wt(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=wt(t.zIndex)?t.zIndex:a()}}},OO=(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")}}},AO=s.defineComponent({name:"ElPopperContent"}),RO=s.defineComponent({...AO,props:Oy,emits:SO,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=OO(n,r),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:m,update:y}=DO(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:E,contentStyle:k,updateZIndex:x}=PO(n,{styles:p,attributes:f,role:m}),_=s.inject(Ni,void 0),S=s.ref();s.provide(by,{arrowStyle:w,arrowRef:h,arrowOffset:S}),_&&s.provide(Ni,{..._,addInputId:hi,removeInputId:hi});let T;const N=(P=!0)=>{y(),P&&x()},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);$n(R)&&(T=s.watch([m,()=>n.ariaLabel,b,()=>n.id],L=>{["role","aria-label","aria-modal","id"].forEach((A,q)=>{sn(L[q])?R.removeAttribute(A):R.setAttribute(A,L[q])})},{immediate:!0})),O!==R&&$n(O)&&["role","aria-label","aria-modal","id"].forEach(L=>{O.removeAttribute(L)})},{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(E),tabindex:"-1",onMouseenter:R=>P.$emit("mouseenter",R),onMouseleave:R=>P.$emit("mouseleave",R)}),[s.createVNode(s.unref(EO),{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 LO=Be(RO,[["__file","content.vue"]]);const MO=vt(rO),pu=Symbol("elTooltip"),zt=Fe({...vP,...Oy,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,...dn(["ariaLabel"])}),Pi=Fe({...ky,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[lt.enter,lt.space]}}),{useModelToggleProps:FO,useModelToggleEmits:$O,useModelToggle:VO}=oD("visible"),qO=Fe({...wy,...FO,...zt,...Pi,...Cy,showArrow:{type:Boolean,default:!0}}),zO=[...$O,"before-show","before-hide","show","hide","open","close"],HO=(t,e)=>$t(t)?t.includes(e):t===e,Ia=(t,e,r)=>n=>{HO(s.unref(t),e)&&r(n)},KO=s.defineComponent({name:"ElTooltipTrigger"}),GO=s.defineComponent({...KO,props:Pi,setup(t,{expose:e}){const r=t,n=Pe("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:c,onToggle:u}=s.inject(pu,void 0),d=s.ref(null),f=()=>{if(s.unref(a)||r.disabled)return!0},h=s.toRef(r,"trigger"),v=Fr(f,Ia(h,"hover",l)),p=Fr(f,Ia(h,"hover",c)),g=Fr(f,Ia(h,"click",C=>{C.button===0&&u(C)})),m=Fr(f,Ia(h,"focus",l)),y=Fr(f,Ia(h,"focus",c)),b=Fr(f,Ia(h,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Fr(f,C=>{const{code:E}=C;r.triggerKeys.includes(E)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,E)=>(s.openBlock(),s.createBlock(s.unref(uO),{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(y),onClick:s.unref(g),onContextmenu:s.unref(b),onFocus:s.unref(m),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 UO=Be(GO,[["__file","trigger.vue"]]);const jO=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var WO=Be(s.defineComponent({__name:"teleport",props:jO,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 YO=vt(WO),ZO=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),XO=s.defineComponent({...ZO,props:zt,setup(t,{expose:e}){const r=t,{selector:n}=iy(),a=Pe("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:m}=s.inject(pu,void 0),y=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)),E=s.computed(()=>r.appendTo||n.value),k=s.computed(()=>{var O;return(O=r.style)!=null?O:{}}),x=s.ref(!0),_=()=>{p(),x.value=!0},S=()=>{if(s.unref(l))return!0},T=Fr(S,()=>{r.enterable&&s.unref(d)==="hover"&&h()}),N=Fr(S,()=>{s.unref(d)==="hover"&&f()}),B=()=>{var O,L;(L=(O=i.value)==null?void 0:O.updatePopper)==null||L.call(O),g==null||g()},P=()=>{m==null||m()},D=()=>{v(),o=P_(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?x.value=!1:o==null||o()},{flush:"post"}),s.watch(()=>r.content,()=>{var O,L;(L=(O=i.value)==null?void 0:O.updatePopper)==null||L.call(O)}),e({contentRef:i}),(O,L)=>(s.openBlock(),s.createBlock(s.unref(YO),{disabled:!O.teleported,to:s.unref(E)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(y),onAfterLeave:_,onBeforeEnter:B,onAfterEnter:D,onBeforeLeave:P},{default:s.withCtx(()=>[s.unref(w)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(LO),s.mergeProps({key:0,id:s.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":x.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 JO=Be(XO,[["__file","content.vue"]]);const QO=s.defineComponent({name:"ElTooltip"}),eA=s.defineComponent({...QO,props:qO,emits:zO,setup(t,{expose:e,emit:r}){const n=t;pP();const a=Zo(),i=s.ref(),o=s.ref(),l=()=>{var y;const b=s.unref(i);b&&((y=b.popperInstanceRef)==null||y.update())},c=s.ref(!1),u=s.ref(),{show:d,hide:f,hasUpdateHandler:h}=VO({indicator:c,toggleReason:u}),{onOpen:v,onClose:p}=gP({showAfter:s.toRef(n,"showAfter"),hideAfter:s.toRef(n,"hideAfter"),autoClose:s.toRef(n,"autoClose"),open:d,close:f}),g=s.computed(()=>ya(n.visible)&&!h.value);s.provide(pu,{controlled:g,id:a,open:s.readonly(c),trigger:s.toRef(n,"trigger"),onOpen:y=>{v(y)},onClose:y=>{p(y)},onToggle:y=>{s.unref(c)?p(y):v(y)},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,y=>{y&&c.value&&(c.value=!1)});const m=y=>{var b,w;const C=(w=(b=o.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,E=(y==null?void 0:y.relatedTarget)||document.activeElement;return C&&C.contains(E)};return s.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:m,updatePopper:l,onOpen:v,onClose:p,hide:f}),(y,b)=>(s.openBlock(),s.createBlock(s.unref(MO),{ref_key:"popperRef",ref:i,role:y.role},{default:s.withCtx(()=>[s.createVNode(UO,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:s.withCtx(()=>[y.$slots.default?s.renderSlot(y.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(JO,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:s.withCtx(()=>[s.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(y.content),1))]),y.showArrow?(s.openBlock(),s.createBlock(s.unref(iO),{key:0,"arrow-offset":y.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 tA=Be(eA,[["__file","tooltip.vue"]]);const Oi=vt(tA),Ay=Symbol("buttonGroupContextKey"),rA=(t,e)=>{Ho({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(Ay,void 0),n=au("button"),{form:a}=Kn(),i=Hn(s.computed(()=>r==null?void 0:r.size)),o=Ii(),l=s.ref(),c=s.useSlots(),u=s.computed(()=>t.type||(r==null?void 0:r.type)||""),d=s.computed(()=>{var p,g,m;return(m=(g=t.autoInsertSpace)!=null?g:(p=n.value)==null?void 0:p.autoInsertSpace)!=null?m:!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 m=g[0];if((m==null?void 0:m.type)===s.Text){const y=m.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.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)}}},vu=Fe({size:Ta,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:un},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:un,default:()=>Te.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"}}),nA={click:t=>t instanceof MouseEvent};function Et(t,e){aA(t)&&(t="100%");var r=iA(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 rs(t){return Math.min(1,Math.max(0,t))}function aA(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function iA(t){return typeof t=="string"&&t.indexOf("%")!==-1}function Ry(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ns(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Gn(t){return t.length===1?"0"+t:String(t)}function oA(t,e,r){return{r:Et(t,255)*255,g:Et(e,255)*255,b:Et(r,255)*255}}function Ly(t,e,r){t=Et(t,255),e=Et(e,255),r=Et(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 gu(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 sA(t,e,r){var n,a,i;if(t=Et(t,360),e=Et(e,100),r=Et(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=gu(l,o,t+1/3),a=gu(l,o,t),i=gu(l,o,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function My(t,e,r){t=Et(t,255),e=Et(e,255),r=Et(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 lA(t,e,r){t=Et(t,360)*6,e=Et(e,100),r=Et(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 Fy(t,e,r,n){var a=[Gn(Math.round(t).toString(16)),Gn(Math.round(e).toString(16)),Gn(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 uA(t,e,r,n,a){var i=[Gn(Math.round(t).toString(16)),Gn(Math.round(e).toString(16)),Gn(Math.round(r).toString(16)),Gn(cA(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 cA(t){return Math.round(parseFloat(t)*255).toString(16)}function $y(t){return Wt(t)/255}function Wt(t){return parseInt(t,16)}function dA(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var mu={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 fA(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=vA(t)),typeof t=="object"&&(jr(t.r)&&jr(t.g)&&jr(t.b)?(e=oA(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):jr(t.h)&&jr(t.s)&&jr(t.v)?(n=ns(t.s),a=ns(t.v),e=lA(t.h,n,a),o=!0,l="hsv"):jr(t.h)&&jr(t.s)&&jr(t.l)&&(n=ns(t.s),i=ns(t.l),e=sA(t.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=Ry(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 hA="[-\\+]?\\d+%?",pA="[-\\+]?\\d*\\.\\d+%?",hn="(?:".concat(pA,")|(?:").concat(hA,")"),yu="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),bu="[\\s|\\(]+(".concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")[,|\\s]+(").concat(hn,")\\s*\\)?"),pr={CSS_UNIT:new RegExp(hn),rgb:new RegExp("rgb"+yu),rgba:new RegExp("rgba"+bu),hsl:new RegExp("hsl"+yu),hsla:new RegExp("hsla"+bu),hsv:new RegExp("hsv"+yu),hsva:new RegExp("hsva"+bu),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 vA(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(mu[t])t=mu[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:$y(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:$y(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 jr(t){return!!pr.CSS_UNIT.exec(String(t))}var gA=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=dA(e)),this.originalInput=e;var a=fA(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=Ry(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=My(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=My(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=Ly(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=Ly(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),Fy(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),uA(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(Et(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(Et(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="#"+Fy(this.r,this.g,this.b,!1),r=0,n=Object.entries(mu);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=rs(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=rs(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=rs(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=rs(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 pn(t,e=20){return t.mix("#141414",e).toString()}function mA(t){const e=Ii(),r=Pe("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 gA(a),l=t.dark?o.tint(20).toString():pn(o,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?pn(o,90):o.tint(90).toString(),"text-color":a,"border-color":t.dark?pn(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?pn(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?pn(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?pn(o,80):o.tint(80).toString());else{const c=t.dark?pn(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?pn(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 yA=s.defineComponent({name:"ElButton"}),bA=s.defineComponent({...yA,props:vu,emits:nA,setup(t,{expose:e,emit:r}){const n=t,a=mA(n),i=Pe("button"),{_ref:o,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=rA(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(ut),{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(ut),{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 wA=Be(bA,[["__file","button.vue"]]);const CA={size:vu.size,type:vu.type},EA=s.defineComponent({name:"ElButtonGroup"}),xA=s.defineComponent({...EA,props:CA,setup(t){const e=t;s.provide(Ay,s.reactive({size:s.toRef(e,"size"),type:s.toRef(e,"type")}));const r=Pe("button");return(n,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(r).b("group"))},[s.renderSlot(n.$slots,"default")],2))}});var Vy=Be(xA,[["__file","button-group.vue"]]);const Ht=vt(wA,{ButtonGroup:Vy});Gr(Vy);var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const vn=new Map;if(rt){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of vn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function qy(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:$n(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 zy={beforeMount(t,e){vn.has(t)||vn.set(t,[]),vn.get(t).push({documentHandler:qy(t,e),bindingFn:e.value})},updated(t,e){vn.has(t)||vn.set(t,[]);const r=vn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:qy(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){vn.delete(t)}},SA=Fe({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"}),TA=s.defineComponent({..._A,props:SA,setup(t){const e=Pe("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 NA=Be(TA,[["__file","card.vue"]]);const IA=vt(NA),Hy={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:Ta,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...dn(["ariaControls"])},Ky={[Ct]:t=>Nt(t)||wt(t)||ya(t),change:t=>Nt(t)||wt(t)||ya(t)},Ba=Symbol("checkboxGroupContextKey"),BA=({model:t,isChecked:e})=>{const r=s.inject(Ba,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!ln(l)&&t.value.length>=l&&!e.value||!ln(c)&&t.value.length<=c&&e.value});return{isDisabled:Ii(s.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},DA=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const o=s.inject(Ba,void 0),{formItem:l}=Kn(),{emit:c}=s.getCurrentInstance();function u(p){var g,m,y,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(m=(g=t.trueValue)!=null?g:t.trueLabel)!=null?m:!0:(b=(y=t.falseValue)!=null?y: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(y=>y.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=>nt(p)))}),{handleChange:f,onClickRoot:h}},PA=t=>{const e=s.ref(!1),{emit:r}=s.getCurrentInstance(),n=s.inject(Ba,void 0),a=s.computed(()=>ln(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&&$t(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(Ct,l),e.value=l)}});return{model:o,isGroup:a,isLimitExceeded:i}},OA=(t,e,{model:r})=>{const n=s.inject(Ba,void 0),a=s.ref(!1),i=s.computed(()=>qo(t.value)?t.label:t.value),o=s.computed(()=>{const d=r.value;return ya(d)?d:$t(d)?bt(i.value)?d.map(s.toRaw).some(f=>Vo(f,i.value)):d.map(s.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Hn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Hn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=s.computed(()=>!!e.default||!qo(i.value));return{checkboxButtonSize:l,isChecked:o,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},Gy=(t,e)=>{const{formItem:r}=Kn(),{model:n,isGroup:a,isLimitExceeded:i}=PA(t),{isFocused:o,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=OA(t,e,{model:n}),{isDisabled:h}=BA({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=Bi(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:m}=DA(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;$t(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()})(),Ho({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&&qo(t.value))),Ho({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)),Ho({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:m}},AA=s.defineComponent({name:"ElCheckbox"}),RA=s.defineComponent({...AA,props:Hy,emits:Ky,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}=Gy(e,r),p=Pe("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)]),m=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(y,b)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(u)&&s.unref(a)?"span":"label"),{class:s.normalizeClass(s.unref(g)),"aria-controls":y.indeterminate?y.ariaControls:null,onClick:s.unref(v)},{default:s.withCtx(()=>{var w,C,E,k;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(m))},[y.trueValue||y.falseValue||y.trueLabel||y.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(n),"onUpdate:modelValue":x=>s.isRef(d)?d.value=x:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:y.indeterminate,name:y.name,tabindex:y.tabindex,disabled:s.unref(o),"true-value":(C=(w=y.trueValue)!=null?w:y.trueLabel)!=null?C:!0,"false-value":(k=(E=y.falseValue)!=null?E:y.falseLabel)!=null?k:!1,onChange:s.unref(h),onFocus:x=>l.value=!0,onBlur:x=>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":x=>s.isRef(d)?d.value=x:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:y.indeterminate,disabled:s.unref(o),value:s.unref(f),name:y.name,tabindex:y.tabindex,onChange:s.unref(h),onFocus:x=>l.value=!0,onBlur:x=>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(y.$slots,"default"),y.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(y.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var LA=Be(RA,[["__file","checkbox.vue"]]);const MA=s.defineComponent({name:"ElCheckboxButton"}),FA=s.defineComponent({...MA,props:Hy,emits:Ky,setup(t){const e=t,r=s.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:o,model:l,actualValue:c,handleChange:u}=Gy(e,r),d=s.inject(Ba,void 0),f=Pe("checkbox"),h=s.computed(()=>{var p,g,m,y;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(y=(m=d==null?void 0:d.textColor)==null?void 0:m.value)!=null?y:"",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 m,y,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":(y=(m=p.trueValue)!=null?m:p.trueLabel)!=null?y:!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 Uy=Be(FA,[["__file","checkbox-button.vue"]]);const $A=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Ta,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...dn(["ariaLabel"])}),VA={[Ct]:t=>$t(t),change:t=>$t(t)},qA=s.defineComponent({name:"ElCheckboxGroup"}),zA=s.defineComponent({...qA,props:$A,emits:VA,setup(t,{emit:e}){const r=t,n=Pe("checkbox"),{formItem:a}=Kn(),{inputId:i,isLabeledByFormItem:o}=Bi(r,{formItemContext:a}),l=async u=>{e(Ct,u),await s.nextTick(),e("change",u)},c=s.computed({get(){return r.modelValue},set(u){l(u)}});return s.provide(Ba,{...Sm(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=>nt(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 jy=Be(zA,[["__file","checkbox-group.vue"]]);const HA=vt(LA,{CheckboxButton:Uy,CheckboxGroup:jy});Gr(Uy),Gr(jy);const wu=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Dm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),KA={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},GA=s.defineComponent({name:"ElTag"}),UA=s.defineComponent({...GA,props:wu,emits:KA,setup(t,{emit:e}){const r=t,n=Hn(),a=Pe("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(ut),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.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(ut),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var jA=Be(UA,[["__file","tag.vue"]]);const WA=vt(jA),Wy=Symbol("rowContextKey"),YA=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"]}}),ZA=s.defineComponent({name:"ElRow"}),XA=s.defineComponent({...ZA,props:YA,setup(t){const e=t,r=Pe("row"),n=s.computed(()=>e.gutter);s.provide(Wy,{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 JA=Be(XA,[["__file","row.vue"]]);const as=vt(JA),QA=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:ke([Number,Object]),default:()=>wa({})},sm:{type:ke([Number,Object]),default:()=>wa({})},md:{type:ke([Number,Object]),default:()=>wa({})},lg:{type:ke([Number,Object]),default:()=>wa({})},xl:{type:ke([Number,Object]),default:()=>wa({})}}),eR=s.defineComponent({name:"ElCol"}),tR=s.defineComponent({...eR,props:QA,setup(t){const e=t,{gutter:r}=s.inject(Wy,{gutter:s.computed(()=>0)}),n=Pe("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];wt(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=>{wt(e[u])?o.push(n.b(`${u}-${e[u]}`)):bt(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 rR=Be(tR,[["__file","col.vue"]]);const Ri=vt(rR),nR=s.defineComponent({name:"ElCollapseTransition"}),aR=s.defineComponent({...nR,setup(t){const e=Pe("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 iR=Be(aR,[["__file","collapse-transition.vue"]]);const oR=vt(iR),sR=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Cu=!1;function Li(t,e){if(!rt)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,Cu=!1,(o=e.end)==null||o.call(e,i)},a=function(i){var o;Cu||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),Cu=!0,(o=e.start)==null||o.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const lR=t=>{const e=s.getCurrentInstance(),{t:r}=wi(),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}=_l(f);if(t.vertical){let m=g-v.top;m=Math.max(n.value.offsetHeight/2,m),m=Math.min(m,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((m-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let m=p-v.left;m=Math.max(n.value.offsetWidth/2,m),m=Math.min(m,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((m-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 lt.left:case lt.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case lt.right:case lt.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}},uR=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=s.getCurrentInstance(),i=Pe("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)}};Li(e.value,b),Li(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")),m=s.computed(()=>({background:c.value})),y=s.computed(()=>({left:ba(o.value),top:ba(l.value)}));return{rootKls:v,barKls:p,barStyle:m,thumbKls:g,thumbStyle:y,update:h}},cR=s.defineComponent({name:"ElColorAlphaSlider"}),dR=s.defineComponent({...cR,props:sR,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:o,handleDrag:l,handleClick:c,handleKeydown:u}=lR(r),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=uR(r,{bar:i,thumb:o,handleDrag:l});return e({update:g,bar:i,thumb:o}),(m,y)=>(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":m.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 fR=Be(dR,[["__file","alpha-slider.vue"]]);const hR=s.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Pe("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:m,clientY:y}=_l(v);let b;if(t.vertical){let w=y-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=m-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)}};Li(a.value,v),Li(n.value,v),h()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:o,hueValue:l,handleClick:c,update:h,ns:e}}});function pR(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 vR=Be(hR,[["render",pR],["__file","hue-slider.vue"]]);const gR=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:Ta,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:zt.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...dn(["ariaLabel"])}),mR={[Ct]:t=>Nt(t)||sn(t),[Gl]:t=>Nt(t)||sn(t),activeChange:t=>Nt(t)||sn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},Yy=Symbol("colorPickerContextKey"),Zy=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},yR=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},bR=function(t){return typeof t=="string"&&t.includes("%")},Da=function(t,e){yR(t)&&(t="100%");const r=bR(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)},Xy={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},is=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${Xy[e]||e}${Xy[r]||r}`},Jy=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${is(t)}${is(e)}${is(r)}`},Eu={A:10,B:11,C:12,D:13,E:14,F:15},Un=function(t){return t.length===2?(Eu[t[0].toUpperCase()]||+t[0])*16+(Eu[t[1].toUpperCase()]||+t[1]):Eu[t[1].toUpperCase()]||+t[1]},wR=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}},Qy=(t,e,r)=>{t=Da(t,255),e=Da(e,255),r=Da(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}},Mi=function(t,e,r){t=Da(t,360)*6,e=Da(e,100),r=Da(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 Fi{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)Rn(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)Rn(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 Mi(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}=wR(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}=Qy(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=Un(n[0]+n[0]),i=Un(n[1]+n[1]),o=Un(n[2]+n[2])):(n.length===6||n.length===8)&&(a=Un(n.slice(0,2)),i=Un(n.slice(2,4)),o=Un(n.slice(4,6))),n.length===8?this._alpha=Un(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=Qy(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=Zy(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=`${Jy(Mi(e,r,n))}${is(a*255/100)}`;break}default:{const{r:o,g:l,b:c}=Mi(e,r,n);this.value=`rgba(${o}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const o=Zy(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}=Mi(e,r,n);this.value=`rgb(${o}, ${l}, ${c})`;break}default:this.value=Jy(Mi(e,r,n))}}}const CR=s.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Pe("color-predefine"),{currentColor:r}=s.inject(Yy),n=s.ref(i(t.colors,t.color));s.watch(()=>r.value,o=>{const l=new Fi;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 Fi;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 ER(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 xR=Be(CR,[["render",ER],["__file","predefine.vue"]]);const kR=s.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Pe("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}=_l(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(()=>{Li(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 SR(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(kR,[["render",SR],["__file","sv-panel.vue"]]);const TR=s.defineComponent({name:"ElColorPicker"}),NR=s.defineComponent({...TR,props:gR,emits:mR,setup(t,{expose:e,emit:r}){const n=t,{t:a}=wi(),i=Pe("color"),{formItem:o}=Kn(),l=Hn(),c=Ii(),{inputId:u,isLabeledByFormItem:d}=Bi(n,{formItemContext:o}),f=s.ref(),h=s.ref(),v=s.ref(),p=s.ref(),g=s.ref(),m=s.ref(),{isFocused:y,handleFocus:b,handleBlur:w}=nu(g,{beforeFocus(){return c.value},beforeBlur(M){var W;return(W=p.value)==null?void 0:W.isFocusInsideContent(M)},afterBlur(){R(!1),q()}});let C=!0;const E=s.reactive(new Fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=s.ref(!1),x=s.ref(!1),_=s.ref(""),S=s.computed(()=>!n.modelValue&&!x.value?"transparent":D(E,n.showAlpha)),T=s.computed(()=>!n.modelValue&&!x.value?"":E.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",y.value)]);function D(M,W){if(!(M instanceof Fi))throw new TypeError("color should be instance of _color Class");const{r:Y,g:se,b:ce}=M.toRgb();return W?`rgba(${Y}, ${se}, ${ce}, ${M.get("alpha")/100})`:`rgb(${Y}, ${se}, ${ce})`}function R(M){k.value=M}const O=km(R,100,{leading:!0});function L(){c.value||R(!0)}function A(){O(!1),q()}function q(){s.nextTick(()=>{n.modelValue?E.fromString(n.modelValue):(E.value="",s.nextTick(()=>{x.value=!1}))})}function U(){c.value||O(!k.value)}function z(){E.fromString(_.value)}function H(){const M=E.value;r(Ct,M),r("change",M),n.validateEvent&&(o==null||o.validate("change").catch(W=>nt(W))),O(!1),s.nextTick(()=>{const W=new Fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});E.compare(W)||q()})}function Q(){O(!1),r(Ct,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(o==null||o.validate("change").catch(M=>nt(M))),q()}function F(){k.value&&(A(),y.value&&G())}function $(M){M.preventDefault(),M.stopPropagation(),R(!1),q()}function V(M){switch(M.code){case lt.enter:case lt.space:M.preventDefault(),M.stopPropagation(),L(),m.value.focus();break;case lt.esc:$(M);break}}function G(){g.value.focus()}function j(){g.value.blur()}return s.onMounted(()=>{n.modelValue&&(_.value=T.value)}),s.watch(()=>n.modelValue,M=>{M?M&&M!==E.value&&(C=!1,E.fromString(M)):x.value=!1}),s.watch(()=>[n.colorFormat,n.showAlpha],()=>{E.enableAlpha=n.showAlpha,E.format=n.colorFormat||E.format,E.doOnChange(),r(Ct,E.value)}),s.watch(()=>T.value,M=>{_.value=M,C&&r("activeChange",M),C=!0}),s.watch(()=>E.value,()=>{!n.modelValue&&!x.value&&(x.value=!0)}),s.watch(()=>k.value,()=>{s.nextTick(()=>{var M,W,Y;(M=f.value)==null||M.update(),(W=h.value)==null||W.update(),(Y=v.value)==null||Y.update()})}),s.provide(Yy,{currentColor:T}),e({color:E,show:L,hide:A,focus:G,blur:j}),(M,W)=>(s.openBlock(),s.createBlock(s.unref(Oi),{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"),M.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:M.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($,["esc"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","main-wrapper"))},[s.createVNode(vR,{ref_key:"hue",ref:f,class:"hue-slider",color:s.unref(E),vertical:""},null,8,["color"]),s.createVNode(_R,{ref_key:"sv",ref:h,color:s.unref(E)},null,8,["color"])],2),M.showAlpha?(s.openBlock(),s.createBlock(fR,{key:0,ref_key:"alpha",ref:v,color:s.unref(E)},null,8,["color"])):s.createCommentVNode("v-if",!0),M.predefine?(s.openBlock(),s.createBlock(xR,{key:1,ref:"predefine","enable-alpha":M.showAlpha,color:s.unref(E),colors:M.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(Di),{ref_key:"inputRef",ref:m,modelValue:_.value,"onUpdate:modelValue":Y=>_.value=Y,"validate-event":!1,size:"small",onKeyup:s.withKeys(z,["enter"]),onBlur:z},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:Q},{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:H},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[s.unref(zy),F]])]),default:s.withCtx(()=>[s.createElementVNode("div",s.mergeProps({id:s.unref(u),ref_key:"triggerRef",ref:g},M.$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:M.modelValue||""}),"aria-disabled":s.unref(c),tabindex:s.unref(c)?-1:M.tabindex,onKeydown:V,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:U},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(i).be("picker","color"),s.unref(i).is("alpha",M.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(ut),{class:s.normalizeClass([s.unref(i).be("picker","icon"),s.unref(i).is("icon-arrow-down")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.ArrowDown))]),_:1},8,["class"]),[[s.vShow,M.modelValue||x.value]]),s.withDirectives(s.createVNode(s.unref(ut),{class:s.normalizeClass([s.unref(i).be("picker","empty"),s.unref(i).is("icon-close")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Te.Close))]),_:1},8,["class"]),[[s.vShow,!M.modelValue&&!x.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 IR=Be(NR,[["__file","color-picker.vue"]]);const BR=vt(IR),DR=s.defineComponent({name:"ElContainer"}),PR=s.defineComponent({...DR,props:{direction:{type:String}},setup(t){const e=t,r=s.useSlots(),n=Pe("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 OR=Be(PR,[["__file","container.vue"]]);const AR=s.defineComponent({name:"ElAside"}),RR=s.defineComponent({...AR,props:{width:{type:String,default:null}},setup(t){const e=t,r=Pe("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 e0=Be(RR,[["__file","aside.vue"]]);const LR=s.defineComponent({name:"ElFooter"}),MR=s.defineComponent({...LR,props:{height:{type:String,default:null}},setup(t){const e=t,r=Pe("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 t0=Be(MR,[["__file","footer.vue"]]);const FR=s.defineComponent({name:"ElHeader"}),$R=s.defineComponent({...FR,props:{height:{type:String,default:null}},setup(t){const e=t,r=Pe("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 r0=Be($R,[["__file","header.vue"]]);const VR=s.defineComponent({name:"ElMain"}),qR=s.defineComponent({...VR,setup(t){const e=Pe("main");return(r,n)=>(s.openBlock(),s.createElementBlock("main",{class:s.normalizeClass(s.unref(e).b())},[s.renderSlot(r.$slots,"default")],2))}});var n0=Be(qR,[["__file","main.vue"]]);const xu=vt(OR,{Aside:e0,Footer:t0,Header:r0,Main:n0});Gr(e0),Gr(t0);const a0=Gr(r0),ku=Gr(n0),zR=s.defineComponent({inheritAttrs:!1});function HR(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var KR=Be(zR,[["render",HR],["__file","collection.vue"]]);const GR=s.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function UR(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var jR=Be(GR,[["render",UR],["__file","collection-item.vue"]]);const WR="data-el-collection-item",YR=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...KR,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(`[${WR}]`));return[...c.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};s.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},o={...jR,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}},Su=Fe({trigger:Pi.trigger,effect:{...zt.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:zt.teleported});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:un}}),Fe({onKeydown:{type:ke(Function)}}),YR("Dropdown");const i0=Symbol("ElSelectGroup"),$i=Symbol("ElSelect");function ZR(t,e){const r=s.inject($i),n=s.inject(i0,{disabled:!1}),a=s.computed(()=>d(an(r.props.modelValue),t.value)),i=s.computed(()=>{var v;if(r.props.multiple){const p=an((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||(bt(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(bt(t.value)){const g=r.props.valueKey;return v&&v.some(m=>s.toRaw(Hr(m,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(HB(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:m}=r.props;if(v!==p&&(r.onOptionDestroy(p,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(m&&bt(v)&&bt(p)&&v[m]===p[m])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 XR=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=Pe("select"),r=Zo(),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}=ZR(t,a),{visible:f,hover:h}=s.toRefs(a),v=s.getCurrentInstance().proxy;c.onOptionCreate(v),s.onBeforeUnmount(()=>{const g=v.value,{selected:m}=c.states,b=(c.props.multiple?m:[m]).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 JR(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 _u=Be(XR,[["render",JR],["__file","option.vue"]]);const QR=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=s.inject($i),e=Pe("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 eL(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 tL=Be(QR,[["render",eL],["__file","select-dropdown.vue"]]);const rL=11,nL=(t,e)=>{const{t:r}=wi(),n=Zo(),a=Pe("select"),i=Pe("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),m=s.ref(null),y=s.ref(null),b=s.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:E,handleCompositionEnd:k}=py({afterComposition:J=>te(J)}),{wrapperRef:x,isFocused:_}=nu(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(J){var he,Oe;return((he=u.value)==null?void 0:he.isFocusInsideContent(J))||((Oe=d.value)==null?void 0:Oe.isFocusInsideContent(J))},afterBlur(){S.value=!1,o.menuVisibleOnFocus=!1}}),S=s.ref(!1),T=s.ref(),{form:N,formItem:B}=Kn(),{inputId:P}=Bi(t,{formItemContext:B}),{valueOnClear:D,isEmptyValue:R}=SP(t),O=s.computed(()=>t.disabled||(N==null?void 0:N.disabled)),L=s.computed(()=>$t(t.modelValue)?t.modelValue.length>0:!R(t.modelValue)),A=s.computed(()=>t.clearable&&!O.value&&o.inputHovering&&L.value),q=s.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),U=s.computed(()=>a.is("reverse",q.value&&S.value)),z=s.computed(()=>(B==null?void 0:B.validateState)||""),H=s.computed(()=>Bm[z.value]),Q=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&&$.value===0?t.noMatchText||r("el.select.noMatch"):o.options.size===0?t.noDataText||r("el.select.noData"):null),$=s.computed(()=>V.value.filter(J=>J.visible).length),V=s.computed(()=>{const J=Array.from(o.options.values()),he=[];return o.optionValues.forEach(Oe=>{const He=J.findIndex(Mr=>Mr.value===Oe);He>-1&&he.push(J[He])}),he.length>=J.length?he:J}),G=s.computed(()=>Array.from(o.cachedOptions.values())),j=s.computed(()=>{const J=V.value.filter(he=>!he.created).some(he=>he.currentLabel===o.inputValue);return t.filterable&&t.allowCreate&&o.inputValue!==""&&!J}),M=()=>{t.filterable&&Mt(t.filterMethod)||t.filterable&&t.remote&&Mt(t.remoteMethod)||V.value.forEach(J=>{var he;(he=J.updateOption)==null||he.call(J,o.inputValue)})},W=Hn(),Y=s.computed(()=>["small"].includes(W.value)?"small":"default"),se=s.computed({get(){return S.value&&F.value!==!1},set(J){S.value=J}}),ce=s.computed(()=>{if(t.multiple&&!ln(t.modelValue))return an(t.modelValue).length===0&&!o.inputValue;const J=$t(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||ln(J)?!o.inputValue:!0}),ae=s.computed(()=>{var J;const he=(J=t.placeholder)!=null?J:r("el.select.placeholder");return t.multiple||!L.value?he:o.selectedLabel}),ne=s.computed(()=>Sl?null:"mouseenter");s.watch(()=>t.modelValue,(J,he)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(o.inputValue="",ue("")),fe(),!Vo(J,he)&&t.validateEvent&&(B==null||B.validate("change").catch(Oe=>nt(Oe)))},{flush:"post",deep:!0}),s.watch(()=>S.value,J=>{J?ue(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",J)}),s.watch(()=>o.options.entries(),()=>{var J;if(!rt)return;const he=((J=l.value)==null?void 0:J.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!ln(t.modelValue)||!Array.from(he).includes(document.activeElement))&&fe(),t.defaultFirstOption&&(t.filterable||t.remote)&&$.value&&ie()},{flush:"post"}),s.watch(()=>o.hoveringIndex,J=>{wt(J)&&J>-1?T.value=V.value[J]||{}:T.value={},V.value.forEach(he=>{he.hover=T.value===he})}),s.watchEffect(()=>{o.isBeforeHide||M()});const ue=J=>{o.previousQuery===J||w.value||(o.previousQuery=J,t.filterable&&Mt(t.filterMethod)?t.filterMethod(J):t.filterable&&t.remote&&Mt(t.remoteMethod)&&t.remoteMethod(J),t.defaultFirstOption&&(t.filterable||t.remote)&&$.value?s.nextTick(ie):s.nextTick(De))},ie=()=>{const J=V.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),he=J.find(He=>He.created),Oe=J[0];o.hoveringIndex=ye(V.value,he||Oe)},fe=()=>{if(t.multiple)o.selectedLabel="";else{const he=$t(t.modelValue)?t.modelValue[0]:t.modelValue,Oe=pe(he);o.selectedLabel=Oe.currentLabel,o.selected=[Oe];return}const J=[];ln(t.modelValue)||an(t.modelValue).forEach(he=>{J.push(pe(he))}),o.selected=J},pe=J=>{let he;const Oe=Tl(J).toLowerCase()==="object",He=Tl(J).toLowerCase()==="null",Mr=Tl(J).toLowerCase()==="undefined";for(let rn=o.cachedOptions.size-1;rn>=0;rn--){const ur=G.value[rn];if(Oe?Hr(ur.value,t.valueKey)===Hr(J,t.valueKey):ur.value===J){he={value:J,currentLabel:ur.currentLabel,get isDisabled(){return ur.isDisabled}};break}}if(he)return he;const On=Oe?J.label:!He&&!Mr?J:"";return{value:J,currentLabel:On}},De=()=>{o.hoveringIndex=V.value.findIndex(J=>o.selected.some(he=>Rt(he)===Rt(J)))},Ie=()=>{o.selectionWidth=c.value.getBoundingClientRect().width},we=()=>{o.calculatorWidth=h.value.getBoundingClientRect().width},xe=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},re=()=>{var J,he;(he=(J=u.value)==null?void 0:J.updatePopper)==null||he.call(J)},I=()=>{var J,he;(he=(J=d.value)==null?void 0:J.updatePopper)==null||he.call(J)},K=()=>{o.inputValue.length>0&&!S.value&&(S.value=!0),ue(o.inputValue)},te=J=>{if(o.inputValue=J.target.value,t.remote)Z();else return K()},Z=km(()=>{K()},Q.value),X=J=>{Vo(t.modelValue,J)||e(Gl,J)},le=J=>MB(J,he=>!o.disabledOptions.has(he)),ee=J=>{if(t.multiple&&J.code!==lt.delete&&J.target.value.length<=0){const he=an(t.modelValue).slice(),Oe=le(he);if(Oe<0)return;const He=he[Oe];he.splice(Oe,1),e(Ct,he),X(he),e("remove-tag",He)}},oe=(J,he)=>{const Oe=o.selected.indexOf(he);if(Oe>-1&&!O.value){const He=an(t.modelValue).slice();He.splice(Oe,1),e(Ct,He),X(He),e("remove-tag",he.value)}J.stopPropagation(),it()},me=J=>{J.stopPropagation();const he=t.multiple?[]:D.value;if(t.multiple)for(const Oe of o.selected)Oe.isDisabled&&he.push(Oe.value);e(Ct,he),X(he),o.hoveringIndex=-1,S.value=!1,e("clear"),it()},be=J=>{var he;if(t.multiple){const Oe=an((he=t.modelValue)!=null?he:[]).slice(),He=ye(Oe,J.value);He>-1?Oe.splice(He,1):(t.multipleLimit<=0||Oe.length<t.multipleLimit)&&Oe.push(J.value),e(Ct,Oe),X(Oe),J.created&&ue(""),t.filterable&&!t.reserveKeyword&&(o.inputValue="")}else e(Ct,J.value),X(J.value),S.value=!1;it(),!S.value&&s.nextTick(()=>{_e(J)})},ye=(J=[],he)=>{if(!bt(he))return J.indexOf(he);const Oe=t.valueKey;let He=-1;return J.some((Mr,On)=>s.toRaw(Hr(Mr,Oe))===Hr(he,Oe)?(He=On,!0):!1),He},_e=J=>{var he,Oe,He,Mr,On;const fi=$t(J)?J[0]:J;let rn=null;if(fi!=null&&fi.value){const ur=V.value.filter(An=>An.value===fi.value);ur.length>0&&(rn=ur[0].$el)}if(u.value&&rn){const ur=(Mr=(He=(Oe=(he=u.value)==null?void 0:he.popperRef)==null?void 0:Oe.contentRef)==null?void 0:He.querySelector)==null?void 0:Mr.call(He,`.${a.be("dropdown","wrap")}`);ur&&UB(ur,rn)}(On=b.value)==null||On.handleScroll()},ge=J=>{o.options.set(J.value,J),o.cachedOptions.set(J.value,J),J.disabled&&o.disabledOptions.set(J.value,J)},Ce=(J,he)=>{o.options.get(J)===he&&o.options.delete(J)},je=s.computed(()=>{var J,he;return(he=(J=u.value)==null?void 0:J.popperRef)==null?void 0:he.contentRef}),qe=()=>{o.isBeforeHide=!1,s.nextTick(()=>_e(o.selected))},it=()=>{var J;(J=f.value)==null||J.focus()},ot=()=>{var J;(J=f.value)==null||J.blur()},et=J=>{me(J)},At=()=>{S.value=!1,_.value&&ot()},pt=()=>{o.inputValue.length>0?o.inputValue="":S.value=!1},mt=()=>{O.value||(Sl&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:S.value=!S.value)},Jt=()=>{S.value?V.value[o.hoveringIndex]&&be(V.value[o.hoveringIndex]):mt()},Rt=J=>bt(J.value)?Hr(J.value,t.valueKey):J.value,Lt=s.computed(()=>V.value.filter(J=>J.visible).every(J=>J.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=J=>{if(!S.value){S.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Lt.value){J==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):J==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const he=V.value[o.hoveringIndex];(he.disabled===!0||he.states.groupDisabled===!0||!he.visible)&&jt(J),s.nextTick(()=>_e(T.value))}},tt=()=>{if(!c.value)return 0;const J=window.getComputedStyle(c.value);return Number.parseFloat(J.gap||"6px")},st=s.computed(()=>{const J=tt();return{maxWidth:`${y.value&&t.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-J:o.selectionWidth}px`}}),yt=s.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Pn=s.computed(()=>({width:`${Math.max(o.calculatorWidth,rL)}px`}));return Vr(c,Ie),Vr(h,we),Vr(g,re),Vr(x,re),Vr(m,I),Vr(y,xe),s.onMounted(()=>{fe()}),{inputId:P,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:_,expanded:S,optionsArray:V,hoverOption:T,selectSize:W,filteredOptionsCount:$,resetCalculatorWidth:we,updateTooltip:re,updateTagTooltip:I,debouncedOnInputChange:Z,onInput:te,deletePrevTag:ee,deleteTag:oe,deleteSelected:me,handleOptionSelect:be,scrollToOption:_e,hasModelValue:L,shouldShowPlaceholder:ce,currentPlaceholder:ae,mouseEnterEventName:ne,showClose:A,iconComponent:q,iconReverse:U,validateState:z,validateIcon:H,showNewOption:j,updateOptions:M,collapseTagSize:Y,setSelected:fe,selectDisabled:O,emptyText:F,handleCompositionStart:C,handleCompositionUpdate:E,handleCompositionEnd:k,onOptionCreate:ge,onOptionDestroy:Ce,handleMenuEnter:qe,focus:it,blur:ot,handleClearClick:et,handleClickOutside:At,handleEsc:pt,toggleMenu:mt,selectOption:Jt,getValueKey:Rt,navigateOptions:jt,dropdownMenuVisible:se,showTagList:lr,collapseTagList:Cr,tagStyle:st,collapseTagStyle:yt,inputStyle:Pn,popperRef:je,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:x,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:m,collapseItemRef:y}};var aL=s.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=s.inject($i);let n=[];return()=>{var a,i;const o=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){$t(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(!Nt(d.children)&&!$t(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):$t(d.children)&&c(d.children)})}return o.length&&c((i=o[0])==null?void 0:i.children),Vo(l,n)||(n=l,r&&(r.states.optionValues=l)),o}}});const iL=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Ta,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:zt.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:un,default:Te.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:un,default:Te.ArrowDown},tagType:{...wu.type,default:"info"},tagEffect:{...wu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:Go,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...kP,...dn(["ariaLabel"])}),o0="ElSelect",oL=s.defineComponent({name:o0,componentName:o0,components:{ElSelectMenu:tL,ElOption:_u,ElOptions:aL,ElTag:WA,ElScrollbar:QP,ElTooltip:Oi,ElIcon:ut},directives:{ClickOutside:zy},props:iL,emits:[Ct,Gl,"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 $t(i)?o?i:l:o?l:i}),n=s.reactive({...s.toRefs(t),modelValue:r}),a=nL(n,e);return s.provide($i,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 sL(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:m=>t.deleteTag(m,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:m=>t.deleteTag(m,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 lL=Be(oL,[["render",sL],["__file","select.vue"]]);const uL=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Pe("select"),r=s.ref(null),n=s.getCurrentInstance(),a=s.ref([]);s.provide(i0,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=an(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()}),$_(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function cL(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 s0=Be(uL,[["render",cL],["__file","option-group.vue"]]);const dL=vt(lL,{Option:_u,OptionGroup:s0}),fL=Gr(_u);Gr(s0);const hL=Fe({trigger:Pi.trigger,placement:Su.placement,disabled:Pi.disabled,visible:zt.visible,transition:zt.transition,popperOptions:Su.popperOptions,tabindex:Su.tabindex,content:zt.content,popperStyle:zt.popperStyle,popperClass:zt.popperClass,enterable:{...zt.enterable,default:!0},effect:{...zt.effect,default:"light"},teleported:zt.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}}),pL={"update:visible":t=>ya(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},vL="onUpdate:visible",gL=s.defineComponent({name:"ElPopover"}),mL=s.defineComponent({...gL,props:hL,emits:pL,setup(t,{expose:e,emit:r}){const n=t,a=s.computed(()=>n[vL]),i=Pe("popover"),o=s.ref(),l=s.computed(()=>{var m;return(m=s.unref(o))==null?void 0:m.popperRef}),c=s.computed(()=>[{width:ba(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 m;(m=o.value)==null||m.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}),(m,y)=>(s.openBlock(),s.createBlock(s.unref(Oi),s.mergeProps({ref_key:"tooltipRef",ref:o},m.$attrs,{trigger:m.trigger,placement:m.placement,disabled:m.disabled,visible:m.visible,transition:m.transition,"popper-options":m.popperOptions,tabindex:m.tabindex,content:m.content,offset:m.offset,"show-after":m.showAfter,"hide-after":m.hideAfter,"auto-close":m.autoClose,"show-arrow":m.showArrow,"aria-label":m.title,effect:m.effect,enterable:m.enterable,"popper-class":s.unref(u),"popper-style":s.unref(c),teleported:m.teleported,persistent:m.persistent,"gpu-acceleration":s.unref(d),"onUpdate:visible":s.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:s.withCtx(()=>[m.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).e("title")),role:"title"},s.toDisplayString(m.title),3)):s.createCommentVNode("v-if",!0),s.renderSlot(m.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(m.content),1)])]),default:s.withCtx(()=>[m.$slots.reference?s.renderSlot(m.$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 yL=Be(mL,[["__file","popover.vue"]]);const l0=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var bL={mounted(t,e){l0(t,e)},updated(t,e){l0(t,e)}};const wL=WB(bL,"popover"),Pa=vt(yL,{directive:wL}),Oa="$treeNodeId",u0=function(t,e){!e||e[Oa]||Object.defineProperty(e,Oa,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Tu=function(t,e){return t?e[t]:e[Oa]},Nu=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Iu=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}},Vi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Iu(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||Vi(a)},os=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 CL=0;class jn{constructor(e){this.id=CL++,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)Rn(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=os(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)||u0(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)||u0(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=os(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return os(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return os(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 jn)){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 jn(e)),e instanceof jn&&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||Vi(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}=Iu(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}=Iu(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),Vi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||Vi(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[Oa];!!l&&r.findIndex(u=>u[Oa]===l)>=0?n[l]={index:o,data:i}:a.push({index:o,data:i})}),this.store.lazy||r.forEach(i=>{n[i[Oa]]||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||Vi(this)}}class EL{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)Rn(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new jn({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 jn)return e;const r=bt(e)?Tu(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=qo(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)Rn(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(m=>{m.isLeaf||m.setChecked(!1,!1),v(m)})};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 xL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Pe("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 kL=Be(xL,[["__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 d0=Symbol("dragEvents");function SL({props:t,ctx:e,el$:r,dropIndicator$:n,store:a}){const i=Pe("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&&Vn(v.$el,i.is("drop-inner"));const p=o.value.draggingNode;if(!p||!h)return;let g=!0,m=!0,y=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=m=t.allowDrop(p.node,h.node,"inner"),y=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=m||g||y?"move":"none",(g||m||y)&&(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||m||y?o.value.dropNode=h:o.value.dropNode=null,h.node.nextSibling===p.node&&(y=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(m=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,m=!1,y=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let E;const k=g?m?.25:y?.45:1:-1,x=y?m?.75:g?.55:0:1;let _=-9999;const S=d.clientY-w.top;S<w.height*k?E="before":S>w.height*x?E="after":m?E="inner":E="none";const T=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),N=n.value;E==="before"?_=T.top-C.top:E==="after"&&(_=T.bottom-C.top),N.style.top=`${_}px`,N.style.left=`${T.right-C.left}px`,E==="inner"?Kl(h.$el,i.is("drop-inner")):Vn(h.$el,i.is("drop-inner")),o.value.showDropIndicator=E==="before"||E==="after",o.value.allowDrop=o.value.showDropIndicator||b,o.value.dropType=E,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 m;(m=a.value.nodesMap[g.data[a.value.key]])==null||m.setChecked(g.checked,!a.value.checkStrictly)})),Vn(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(d0,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:o}}const _L=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:oR,ElCheckbox:HA,NodeContent:kL,ElIcon:ut,Loading:Te.Loading},props:{node:{type:jn,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=Pe("tree"),{broadcastExpanded:n}=c0(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(d0),f=s.getCurrentInstance();s.provide("NodeInstance",f),a||nt("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=>Tu(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 Nt(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},m=S=>{Nu(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)},y=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:m,handleContextMenu:y,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:Te.CaretRight}}});function TL(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 NL=Be(_L,[["render",TL],["__file","tree-node.vue"]]);function IL({el$:t},e){const r=Pe("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([lt.up,lt.down].includes(u)){if(l.preventDefault(),u===lt.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()}[lt.left,lt.right].includes(u)&&(l.preventDefault(),c.click());const h=c.querySelector('[type="checkbox"]');[lt.enter,lt.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 BL=s.defineComponent({name:"ElTree",components:{ElTreeNode:NL},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:un}},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}=wi(),n=Pe("tree"),a=s.inject($i,null),i=s.ref(new EL({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}=c0(t),{dragState:f}=SL({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});IL({el$:c},i);const h=s.computed(()=>{const{childNodes:A}=o.value,q=a?a.hasFilteredOptions!==0:!1;return(!A||A.length===0||A.every(({visible:U})=>!U))&&!q});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=>Tu(t.nodeKey,A.data),g=A=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const q=i.value.getNode(A);if(!q)return[];const U=[q.data];let z=q.parent;for(;z&&z!==o.value;)U.push(z.data),z=z.parent;return U.reverse()},m=(A,q)=>i.value.getCheckedNodes(A,q),y=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,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(A,q)},E=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(A,q)},k=(A,q,U)=>{i.value.setChecked(A,q,U)},x=()=>i.value.getHalfCheckedNodes(),_=()=>i.value.getHalfCheckedKeys(),S=(A,q=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Nu(i,e.emit,()=>{d(A),i.value.setUserCurrentNode(A,q)})},T=(A,q=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Nu(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(A,q)})},N=A=>i.value.getNode(A),B=A=>{i.value.remove(A)},P=(A,q)=>{i.value.append(A,q)},D=(A,q)=>{i.value.insertBefore(A,q)},R=(A,q)=>{i.value.insertAfter(A,q)},O=(A,q,U)=>{d(q),e.emit("node-expand",A,q,U)},L=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(A,q)};return s.provide("RootTree",{ctx:e,props:t,store:i,root:o,currentNode:l,instance:s.getCurrentInstance()}),s.provide(Ni,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:m,getCheckedKeys:y,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:E,setChecked:k,getHalfCheckedNodes:x,getHalfCheckedKeys:_,setCurrentNode:S,setCurrentKey:T,t:r,getNode:N,remove:B,append:P,insertBefore:D,insertAfter:R,handleNodeExpand:O,updateKeyChildren:L}}});function DL(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 PL=Be(BL,[["render",DL],["__file","tree.vue"]]);const OL=vt(PL);function AL(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()):(Vn(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),Vn(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}=TP("loading");return v({ns:p,zIndex:g}),()=>{const m=n.spinner||n.svg,y=s.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...m?{innerHTML:m}:{}},[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")},[y,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 ss;const RL=function(t={}){if(!rt)return;const e=LL(t);if(e.fullscreen&&ss)return ss;const r=AL({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(ss=void 0)}});ML(e,e.parent,r),f0(e,e.parent,r),e.parent.vLoadingAddClassList=()=>f0(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&&(ss=r),r},LL=t=>{var e,r,n,a;let i;return Nt(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}},ML=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=bi(document.body,"position"),r.originalOverflow.value=bi(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.originalPosition.value=bi(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(bi(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else r.originalPosition.value=bi(e,"position");for(const[i,o]of Object.entries(a))r.$el.style[i]=o},f0=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?Vn(e,n.bm("parent","relative")):Kl(e,n.bm("parent","relative")),t.fullscreen&&t.lock?Kl(e,n.bm("parent","hidden")):Vn(e,n.bm("parent","hidden"))},ls=Symbol("ElLoading"),h0=(t,e)=>{var r,n,a,i;const o=e.instance,l=h=>bt(e.value)?e.value[h]:void 0,c=h=>{const v=Nt(h)&&(o==null?void 0:o[h])||h;return v&&s.ref(v)},u=h=>c(l(h)||t.getAttribute(`element-loading-${X_(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[ls]={options:f,instance:RL(f)}},FL=(t,e)=>{for(const r of Object.keys(e))s.isRef(e[r])&&(e[r].value=t[r])},Bu={mounted(t,e){e.value&&h0(t,e)},updated(t,e){const r=t[ls];e.oldValue!==e.value&&(e.value&&!e.oldValue?h0(t,e):e.value&&e.oldValue?bt(e.value)&&FL(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[ls])==null||e.instance.close(),t[ls]=null}},Yt=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},$L="Copy to clipboard",VL="Copied!",qL={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:$L},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=VL:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},zL={class:"visually-hidden"};function HL(t,e,r,n,a,i){const o=Te.CopyDocument,l=ut,c=Ht,u=Oi;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",zL,s.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick","disabled"])]),_:1},8,["content","hide-after","onHide","append-to"])}const us=Yt(qL,[["render",HL],["__scopeId","data-v-91c822cd"]]),KL={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(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1,this.emitActiveItemChange())},next:function(){this.entryIndex!==this.annotationEntry.length-1&&(this.entryIndex=this.entryIndex+1,this.emitActiveItemChange())},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,33 @@ 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>`)}},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()})}},Wn=t=>(s.pushScopeId("data-v-52f81058"),t=t(),s.popScopeId(),t),KL={key:0,class:"toggle-button"},GL={class:"block"},UL=Wn(()=>s.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),jL={class:"title-buttons"},WL={key:0},YL=["href"],ZL=Wn(()=>s.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),XL=Wn(()=>s.createElementVNode("strong",null,"Evidence:  ",-1)),QL=["href"],JL={key:1},eM={key:2},tM=Wn(()=>s.createElementVNode("strong",null,"Comment:  ",-1)),rM=Wn(()=>s.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),nM=Wn(()=>s.createElementVNode("strong",null,"Evidence:",-1)),aM=Wn(()=>s.createElementVNode("strong",null,"Comment:",-1)),iM={class:"sub-title"};function oM(t,e,r,n,a,i){const o=Ht,l=Da,c=us,u=as,d=Te.ArrowUp,f=ut,h=Te.ArrowDown,v=Te.Edit,p=Te.Delete,g=Te.Finished,m=Ri,y=Te.Close,b=dL,w=cL,C=Di,x=ku;return s.openBlock(),s.createBlock(x,{class:"main"},{default:s.withCtx(()=>[r.annotationEntry.length>1?(s.openBlock(),s.createElementBlock("div",KL,[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",GL,[s.createVNode(u,{class:"info-field"},{default:s.withCtx(()=>[UL,s.createElementVNode("div",jL,[s.createVNode(c,{content:i.updatedCopyContent},null,8,["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",WL,s.toDisplayString(i.entry[k]),1)):(s.openBlock(),s.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},s.toDisplayString(i.entry[k]),9,YL))]),_: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(()=>[ZL]),_: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(()=>[XL,(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,QL)):(s.openBlock(),s.createElementBlock("span",JL,s.toDisplayString(_),1)),S!==k.body.evidence.length-1?(s.openBlock(),s.createElementBlock("span",eM,", ")):s.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[tM,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(()=>[rM]),_:1}),i.isDeleted?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[nM]),_: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(m,{span:20},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.evidence[E]),1)]),_:2},1024),s.createVNode(m,{span:4},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(y,{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(m,{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(()=>[aM]),_: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",iM,s.toDisplayString(t.errorMessage),1)]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)])]),_:1})}const h0=Yt(HL,[["render",oM],["__scopeId","data-v-52f81058"]]),sM={name:"CreateTooltipContent",components:{Button:Ht,Col:Ri,Container:xu,Header:n0,Input:Di,Main:ku},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=t,e!==void 0&&this.$emit("cancel-create")},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:"__annotation/"+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")}}},lM=(t=>(s.pushScopeId("data-v-d61c5879"),t=t(),s.popScopeId(),t))(()=>s.createElementVNode("span",{class:"create-text"}," Primitives will be created in the __annotation region ",-1));function uM(t,e,r,n,a,i){const o=n0,l=Ri,c=as,u=Di,d=Ht,f=ku,h=xu;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,"Create "+s.toDisplayString(r.createData.shape),1)]),_:1}),s.createVNode(f,{class:"slides-block"},{default:s.withCtx(()=>[lM,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,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_: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,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_: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},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_: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 cM=Yt(sM,[["render",uM],["__scopeId","data-v-d61c5879"]]);function ct(t){"@babel/helpers - typeof";return ct=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},ct(t)}function Du(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dM(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 Pu(t,e,r){return e&&dM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function p0(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 fM(t)||hM(t,e)||v0(t,e)||pM()}function fM(t){if(Array.isArray(t))return t}function hM(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 v0(t,e){if(t){if(typeof t=="string")return g0(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 g0(t,e)}}function g0(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 pM(){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 m0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=v0(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 dt=typeof window>"u"?null:window,y0=dt?dt.navigator:null;dt&&dt.document;var vM=ct(""),b0=ct({}),gM=ct(function(){}),mM=typeof HTMLElement>"u"?"undefined":ct(HTMLElement),qi=function(e){return e&&e.instanceString&&Xe(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&ct(e)==vM},Xe=function(e){return e!=null&&ct(e)===gM},Ke=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ae=function(e){return e!=null&&ct(e)===b0&&!Ke(e)&&e.constructor===Object},yM=function(e){return e!=null&&ct(e)===b0},de=function(e){return e!=null&&ct(e)===ct(1)&&!isNaN(e)},bM=function(e){return de(e)&&Math.floor(e)===e},cs=function(e){if(mM!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return zi(e)||w0(e)},zi=function(e){return qi(e)==="collection"&&e._private.single},w0=function(e){return qi(e)==="collection"&&!e._private.single},Ou=function(e){return qi(e)==="core"},C0=function(e){return qi(e)==="stylesheet"},wM=function(e){return qi(e)==="event"},gn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},CM=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},EM=function(e){return Ae(e)&&de(e.x1)&&de(e.x2)&&de(e.y1)&&de(e.y2)},xM=function(e){return yM(e)&&Xe(e.then)},kM=function(){return y0&&y0.userAgent.match(/msie|trident|edge/i)},Hi=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},Au=Hi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ds=Hi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),E0=Hi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),x0=function(e){return gn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ft="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",SM="rgb[a]?\\(("+ft+"[%]?)\\s*,\\s*("+ft+"[%]?)\\s*,\\s*("+ft+"[%]?)(?:\\s*,\\s*("+ft+"))?\\)",_M="rgb[a]?\\((?:"+ft+"[%]?)\\s*,\\s*(?:"+ft+"[%]?)\\s*,\\s*(?:"+ft+"[%]?)(?:\\s*,\\s*(?:"+ft+"))?\\)",TM="hsl[a]?\\(("+ft+")\\s*,\\s*("+ft+"[%])\\s*,\\s*("+ft+"[%])(?:\\s*,\\s*("+ft+"))?\\)",NM="hsl[a]?\\((?:"+ft+")\\s*,\\s*(?:"+ft+"[%])\\s*,\\s*(?:"+ft+"[%])(?:\\s*,\\s*(?:"+ft+"))?\\)",IM="\\#[0-9a-fA-F]{3}",BM="\\#[0-9a-fA-F]{6}",k0=function(e,r){return e<r?-1:e>r?1:0},DM=function(e,r){return-1*k0(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},PM=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]}},OM=function(e){var r,n,a,i,o,l,c,u;function d(p,g,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(g-p)*6*m:m<1/2?g:m<2/3?p+(g-p)*(2/3-m)*6:p}var f=new RegExp("^"+TM+"$").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},AM=function(e){var r,n=new RegExp("^"+SM+"$").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},RM=function(e){return MM[e.toLowerCase()]},LM=function(e){return(Ke(e)?e:null)||RM(e)||PM(e)||AM(e)||OM(e)},MM={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]},S0=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}},_0=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 FM(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Yn=FM,Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $M(t,e){return e={exports:{}},t(e,e.exports),e.exports}var VM=typeof Ki=="object"&&Ki&&Ki.Object===Object&&Ki,qM=VM,zM=typeof self=="object"&&self&&self.Object===Object&&self,HM=qM||zM||Function("return this")(),fs=HM,KM=function(){return fs.Date.now()},Ru=KM,GM=/\s/;function UM(t){for(var e=t.length;e--&&GM.test(t.charAt(e)););return e}var jM=UM,WM=/^\s+/;function YM(t){return t&&t.slice(0,jM(t)+1).replace(WM,"")}var ZM=YM,XM=fs.Symbol,Oa=XM,T0=Object.prototype,QM=T0.hasOwnProperty,JM=T0.toString,Gi=Oa?Oa.toStringTag:void 0;function eF(t){var e=QM.call(t,Gi),r=t[Gi];try{t[Gi]=void 0;var n=!0}catch{}var a=JM.call(t);return n&&(e?t[Gi]=r:delete t[Gi]),a}var tF=eF,rF=Object.prototype,nF=rF.toString;function aF(t){return nF.call(t)}var iF=aF,oF="[object Null]",sF="[object Undefined]",N0=Oa?Oa.toStringTag:void 0;function lF(t){return t==null?t===void 0?sF:oF:N0&&N0 in Object(t)?tF(t):iF(t)}var I0=lF;function uF(t){return t!=null&&typeof t=="object"}var cF=uF,dF="[object Symbol]";function fF(t){return typeof t=="symbol"||cF(t)&&I0(t)==dF}var Ui=fF,B0=NaN,hF=/^[-+]0x[0-9a-f]+$/i,pF=/^0b[01]+$/i,vF=/^0o[0-7]+$/i,gF=parseInt;function mF(t){if(typeof t=="number")return t;if(Ui(t))return B0;if(Yn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Yn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=ZM(t);var r=pF.test(t);return r||vF.test(t)?gF(t.slice(2),r?2:8):hF.test(t)?B0:+t}var D0=mF,yF="Expected a function",bF=Math.max,wF=Math.min;function CF(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(yF);e=D0(e)||0,Yn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?bF(D0(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(y,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?wF(S,i-_):S}function m(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function y(){var k=Ru();if(m(k))return b(k);l=setTimeout(y,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(Ru())}function x(){var k=Ru(),E=m(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(y,e),v(c)}return l===void 0&&(l=setTimeout(y,e)),o}return x.cancel=w,x.flush=C,x}var hs=CF,Lu=dt?dt.performance:null,P0=Lu&&Lu.now?function(){return Lu.now()}:function(){return Date.now()},EF=function(){if(dt){if(dt.requestAnimationFrame)return function(t){dt.requestAnimationFrame(t)};if(dt.mozRequestAnimationFrame)return function(t){dt.mozRequestAnimationFrame(t)};if(dt.webkitRequestAnimationFrame)return function(t){dt.webkitRequestAnimationFrame(t)};if(dt.msRequestAnimationFrame)return function(t){dt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(P0())},1e3/60)}}(),ps=function(e){return EF(e)},Wr=P0,Aa=9261,O0=65599,ji=5381,A0=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Aa,n=r,a;a=e.next(),!a.done;)n=n*O0+a.value|0;return n},Wi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Aa;return r*O0+e|0},Yi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ji;return(r<<5)+r+e|0},xF=function(e,r){return e*2097152+r},mn=function(e){return e[0]*2097152+e[1]},vs=function(e,r){return[Wi(e[0],r[0]),Yi(e[1],r[1])]},kF=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 A0(o,r)},Zn=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 A0(o,r)},R0=function(){return SF(arguments)},SF=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Zn(a):r=Zn(a,r)}return r},L0=!0,_F=console.warn!=null,TF=console.trace!=null,Mu=Number.MAX_SAFE_INTEGER||9007199254740991,M0=function(){return!0},gs=function(){return!1},F0=function(){return 0},Fu=function(){},Qe=function(e){throw new Error(e)},$0=function(e){if(e!==void 0)L0=!!e;else return L0},$e=function(e){$0()&&(_F?console.warn(e):(console.log(e),TF&&console.trace()))},NF=function(e){return Se({},e)},Nr=function(e){return e==null?e:Ke(e)?e.slice():Ae(e)?NF(e):e},IF=function(e){return e.slice()},V0=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},BF={},q0=function(){return BF},xt=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}},yn=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},$u=function(e){e.splice(0,e.length)},DF=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=E0(n,r)),e[r]},bn=function(e,r,n,a){n&&(r=E0(n,r)),e[r]=a},PF=function(){function t(){Du(this,t),this._obj={}}return Pu(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:PF,OF="undefined",AF=function(){function t(e){if(Du(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 Pu(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}(),Ra=(typeof Set>"u"?"undefined":ct(Set))!==OF?Set:AF,ms=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ou(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 Ra,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()},z0=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,m=this.byGroup(),y=m.nodes,b=m.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],L=O!=null?O.source():null,A=O!=null?O.target():null,q=O==null?void 0:P.same(L)?A[0]:L[0],U=void 0;if(U=a(P,O,q,p++,R),U===!0)return g=P,"break";if(U===!1)return"break";for(var z=P.connectedEdges().filter(function(V){return(!i||V.source().same(P))&&b.has(V)}),H=0;H<z.length;H++){var J=z[H],F=J.connectedNodes().filter(function(V){return!V.same(P)&&y.has(V)}),$=F.id();F.length!==0&&!v[$]&&(F=F[0],u.push(F),e.bfs&&(v[$]=!0,d.push(F)),f[$]=J,h[$]=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)}}},Zi={breadthFirstSearch:z0({bfs:!0}),depthFirstSearch:z0({dfs:!0})};Zi.bfs=Zi.breadthFirstSearch,Zi.dfs=Zi.depthFirstSearch;var RF=$M(function(t,e){(function(){var r,n,a,i,o,l,c,u,d,f,h,v,p,g,m;a=Math.floor,f=Math.min,n=function(y,b){return y<b?-1:y>b?1:0},d=function(y,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=y.length);w<C;)k=a((w+C)/2),x(b,y[k])<0?C=k:w=k+1;return[].splice.apply(y,[w,w-w].concat(b)),b},l=function(y,b,w){return w==null&&(w=n),y.push(b),g(y,0,y.length-1,w)},o=function(y,b){var w,C;return b==null&&(b=n),w=y.pop(),y.length?(C=y[0],y[0]=w,m(y,0,b)):C=w,C},u=function(y,b,w){var C;return w==null&&(w=n),C=y[0],y[0]=b,m(y,0,w),C},c=function(y,b,w){var C;return w==null&&(w=n),y.length&&w(y[0],b)<0&&(C=[y[0],b],b=C[0],y[0]=C[1],m(y,0,w)),b},i=function(y,b){var w,C,x,k,E,_;for(b==null&&(b=n),k=(function(){_=[];for(var S=0,T=a(y.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(m(y,w,b));return E},p=function(y,b,w){var C;if(w==null&&(w=n),C=y.indexOf(b),C!==-1)return g(y,0,C,w),m(y,C,w)},h=function(y,b,w){var C,x,k,E,_;if(w==null&&(w=n),x=y.slice(0,b),!x.length)return x;for(i(x,w),_=y.slice(b),k=0,E=_.length;k<E;k++)C=_[k],c(x,C,w);return x.sort(w).reverse()},v=function(y,b,w){var C,x,k,E,_,S,T,N,B;if(w==null&&(w=n),b*10<=y.length){if(k=y.slice(0,b).sort(w),!k.length)return k;for(x=k[k.length-1],T=y.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(y,w),B=[],_=0,N=f(b,y.length);0<=N?_<N:_>N;0<=N?++_:--_)B.push(o(y,w));return B},g=function(y,b,w,C){var x,k,E;for(C==null&&(C=n),x=y[w];w>b;){if(E=w-1>>1,k=y[E],C(x,k)<0){y[w]=k,w=E;continue}break}return y[w]=x},m=function(y,b,w){var C,x,k,E,_;for(w==null&&(w=n),x=y.length,_=b,k=y[b],C=2*b+1;C<x;)E=C+1,E<x&&!(w(y[C],y[E])<0)&&(C=E),y[b]=y[C],b=C,C=2*b+1;return y[b]=k,g(y,_,b,w)},r=function(){y.push=l,y.pop=o,y.replace=u,y.pushpop=c,y.heapify=i,y.updateItem=p,y.nlargest=h,y.nsmallest=v;function y(b){this.cmp=b??n,this.nodes=[]}return y.prototype.push=function(b){return l(this.nodes,b,this.cmp)},y.prototype.pop=function(){return o(this.nodes,this.cmp)},y.prototype.peek=function(){return this.nodes[0]},y.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},y.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return i(this.nodes,this.cmp)},y.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},y.prototype.clear=function(){return this.nodes=[]},y.prototype.empty=function(){return this.nodes.length===0},y.prototype.size=function(){return this.nodes.length},y.prototype.clone=function(){var b;return b=new y,b.nodes=this.nodes.slice(0),b},y.prototype.toArray=function(){return this.nodes.slice(0)},y.prototype.insert=y.prototype.push,y.prototype.top=y.prototype.peek,y.prototype.front=y.prototype.peek,y.prototype.has=y.prototype.contains,y.prototype.copy=y.prototype.clone,y}(),function(y,b){return t.exports=b()}(this,function(){return r})}).call(Ki)}),Xi=RF,LF=xt({root:null,weight:function(e){return 1},directed:!1}),MF={dijkstra:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=LF(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 m=function(O){return d[O.id()]},y=function(O,L){d[O.id()]=L,b.updateItem(O)},b=new Xi(function(R,O){return m(R)-m(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,L){for(var A=(o?O.edgesTo(L):O.edgesWith(L)).intersect(g),q=1/0,U,z=0;z<A.length;z++){var H=A[z],J=c(H);(J<q||!U)&&(q=J,U=H)}return{edge:U,dist:q}};b.size()>0;){var k=b.pop(),E=m(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<m(N)&&(y(N,D),f[B]={node:k,edge:P.edge})}}return{distanceTo:function(O){var L=Ee(O)?p.filter(O)[0]:O[0];return h[L.id()]},pathTo:function(O){var L=Ee(O)?p.filter(O)[0]:O[0],A=[],q=L,U=q.id();if(L.length>0)for(A.unshift(L);f[U];){var z=f[U];A.unshift(z.edge),A.unshift(z.node),q=z.node,U=q.id()}return l.spawn(A)}}}},FF={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),m=c(p),y=o[g],b=o[m];g!==m&&(l.merge(h),y.merge(b),o.splice(m,1))}return l}},$F=xt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),VF={aStar:function(e){var r=this.cy(),n=$F(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 Xi(function(U,z){return h[U.id()]-h[z.id()]}),g=new Ra,m={},y={},b=function(z,H){p.push(z),g.add(H)},w,C,x=function(){w=p.pop(),C=w.id(),g.delete(C)},k=function(z){return g.has(z)};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=y[T];_.unshift(S),N!=null&&_.unshift(N),S=m[T],S!=null;)T=S.id(),N=y[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(),L=R.id()!==C?R:O,A=L.id();if(this.hasElementWithId(A)&&!v[A]){var q=f[C]+c(D);if(!k(A)){f[A]=q,h[A]=q+o(L),b(L,A),m[A]=w,y[A]=D;continue}q<f[A]&&(f[A]=q,h[A]=q+o(L),m[A]=w,y[A]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},qF=xt({weight:function(e){return 1},directed:!1}),zF={floydWarshall:function(e){for(var r=this.cy(),n=qF(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(J){return c.indexOf(J)},v=function(J){return c[J]},p=new Array(f),g=0;g<f;g++){var m=g%d,y=(g-m)/d;y===m?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 L=D*d+O,A=P*d+O;p[R]+p[A]<p[L]&&(p[L]=p[R]+p[A],b[L]=b[R])}var q=function(J){return(Ee(J)?r.filter(J):J)[0]},U=function(J){return h(q(J))},z={distance:function(J,F){var $=U(J),V=U(F);return p[$*d+V]},path:function(J,F){var $=U(J),V=U(F),G=v($);if($===V)return G.collection();if(b[$*d+V]==null)return r.collection();var j=r.collection(),M=$,W;for(j.merge(G);$!==V;)M=$,$=b[$*d+V],W=w[M*d+$],j.merge(W),j.merge(v($));return j}};return z}},HF=xt({weight:function(e){return 1},directed:!1,root:null}),KF={bellmanFord:function(e){var r=this,n=HF(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,m=[];o=u.collection(o)[0],f.unmergeBy(function(ie){return ie.isLoop()});for(var y=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,De=w(fe),Ie=[],we=De;;){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,De,Ie,we,xe){var re=Ie.dist+xe;re<we.dist&&!De.same(Ie.edge)&&(we.dist=re,we.pred=fe,we.edge=De,S=!0)},N=1;N<v;N++){S=!1;for(var B=0;B<y;B++){var P=f[B],D=P.source(),R=P.target(),O=l(P),L=b(D),A=b(R);T(D,R,P,L,A,O),i||T(R,D,P,A,L,O)}if(!S)break}if(S)for(var q=[],U=0;U<y;U++){var z=f[U],H=z.source(),J=z.target(),F=l(z),$=b(H).dist,V=b(J).dist;if($+F<V||!i&&V+F<$)if(g||($e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var G=[];$+F<V&&G.push(H),!i&&V+F<$&&G.push(J);for(var j=G.length,M=0;M<j;M++){var W=G[M],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 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(",");q.indexOf(ue)===-1&&(m.push(c.spawn(Y)),q.push(ue))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:m}}},GF=Math.sqrt(2),UF=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],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 m=0;m<r.length;m++)r[m]===c&&(r[m]=l);return u},Vu=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=UF(i,e,r),n--}return r},jF={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/GF);if(i<2){Qe("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),m=new Array(i),y=function(q,U){for(var z=0;z<i;z++)U[z]=q[z]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=Vu(g,u.slice(),i,c),x=C.slice();y(g,m);var k=Vu(g,C,c,2),E=Vu(m,x,c,2);k.length<=E.length&&k.length<h?(h=k.length,v=k,y(g,p)):E.length<=k.length&&E.length<h&&(h=E.length,v=E,y(m,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(q){var U=e.spawn();return q.forEach(function(z){U.merge(z),z.connectedEdges().forEach(function(H){e.contains(H)&&!_.contains(H)&&U.merge(H)})}),U},O=[R(S),R(T)],L={cut:_,components:O,partition1:S,partition2:T};return L}},WF=function(e){return{x:e.x,y:e.y}},ys=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},H0=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},La=function(e){return{x:e[0],y:e[1]}},YF=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},ZF=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},XF=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},QF=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},JF=function(e){return Math.PI*e/180},bs=function(e,r){return Math.atan2(r,e)-Math.PI/2},qu=Math.log2||function(t){return Math.log(t)/Math.log(2)},K0=function(e){return e>0?1:e<0?-1:0},Xn=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},e5=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},gt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},Ma=function(e,r,n,a){return{x:gt(e.x,r.x,n.x,a),y:gt(e.y,r.y,n.y,a)}},t5=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=Xn(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}},Qi=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}}},r5=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},n5=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},a5=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}},G0=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},i5=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},ws=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},Cs=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},U0=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},zu=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)},Fa=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},o5=function(e,r){return Fa(e,r.x,r.y)},j0=function(e,r){return Fa(e,r.x1,r.y1)&&Fa(e,r.x2,r.y2)},W0=function(e,r,n,a,i,o,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?ea(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,m=a-f-l,y=n+d-u+l,b=m;if(p=wn(e,r,n,a,g,m,y,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=wn(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=wn(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=wn(e,r,n,a,N,B,P,D,!1),p.length>0)return p}var R;{var O=n-d+u,L=a-f+u;if(R=Ji(e,r,n,a,O,L,u+l),R.length>0&&R[0]<=O&&R[1]<=L)return[R[0],R[1]]}{var A=n+d-u,q=a-f+u;if(R=Ji(e,r,n,a,A,q,u+l),R.length>0&&R[0]>=A&&R[1]<=q)return[R[0],R[1]]}{var U=n+d-u,z=a+f-u;if(R=Ji(e,r,n,a,U,z,u+l),R.length>0&&R[0]>=U&&R[1]>=z)return[R[0],R[1]]}{var H=n-d+u,J=a+f-u;if(R=Ji(e,r,n,a,H,J,u+l),R.length>0&&R[0]<=H&&R[1]>=J)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},l5=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)},u5=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]},c5=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)},d5=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=[];c5(u,d,f,h,v);for(var p=1e-7,g=[],m=0;m<6;m+=2)Math.abs(v[m+1])<p&&v[m]>=0&&v[m]<=1&&g.push(v[m]);g.push(1),g.push(0);for(var y=-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),y>=0?C<y&&(y=C):y=C;return y},f5=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},Yr=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 m=xs(d,-u);g=Es(m)}else g=d;return Gt(e,r,g)},h5=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)},Es=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=wn(n,a,i,o,l,c,u,d,!0);r[f*2]=h[0],r[f*2+1]=h[1]}return r},xs=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]},Jn=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},Ji=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),m=Math.min(p,g),y=Math.max(p,g),b=[];if(m>=0&&m<=1&&b.push(m),y>=0&&y<=1&&b.push(y),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]},Hu=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},wn=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,m=h*v-g*d,y=f*v-p*d,b=g*f-h*p;if(b!==0){var w=m/b,C=y/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 m===0||y===0?Hu(e,n,l)===l?[l,c]:Hu(e,n,i)===i?[i,o]:Hu(i,l,n)===n?[n,a]:[]:[]},eo=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=xs(f,-c);v=Es(g)}else v=f}else v=n;for(var m,y,b,w,C=0;C<v.length/2;C++)m=v[C*2],y=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=wn(e,r,a,i,m,y,b,w),d.length!==0&&u.push(d[0],d[1]);return u},v5=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=Ji(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=wn(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),m=1;m<d.length/2;m++){var y=Math.pow(d[m*2]-e,2)+Math.pow(d[m*2+1]-r,2);y<=g&&(p[0]=d[m*2],p[1]=d[m*2+1],g=y)}return p}return d},ks=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]]},Ft=function(e,r){var n=Ku(e,r);return n=Y0(n),n},Y0=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},Ku=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},ea=function(e,r){return Math.min(e/4,r/4,8)},Z0=function(e,r){return Math.min(e/10,r/10,8)},Gu=function(){return 8},g5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Uu=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},m5=xt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),y5={pageRank:function(e){for(var r=m5(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),m=(1-n)/f,y=0;y<f;y++){for(var b=0;b<f;b++){var w=y*f+b;p[w]=0}g[y]=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+m,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 L=O*f+P;p[L]=p[L]/g[P]+m}for(var A=new Array(f),q=new Array(f),U,z=0;z<f;z++)A[z]=1;for(var H=0;H<i;H++){for(var J=0;J<f;J++)q[J]=0;for(var F=0;F<f;F++)for(var $=0;$<f;$++){var V=F*f+$;q[F]+=p[V]*A[$]}e5(q),U=A,A=q,q=U;for(var G=0,j=0;j<f;j++){var M=U[j]-A[j];G+=M*M}if(G<a)break}var W={rank:function(se){return se=l.collection(se)[0],A[u.indexOf(se)]}};return W}},X0=xt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),$a={degreeCentralityNormalized:function(e){e=X0(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],m=g.id();e.root=g;var y=this.degreeCentrality(e);h<y.indegree&&(h=y.indegree),v<y.outdegree&&(v=y.outdegree),d[m]=y.indegree,f[m]=y.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=X0(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)}),m=p.length,y=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(m,1-c)*Math.pow(b,c),outdegree:Math.pow(y,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)}}}};$a.dc=$a.degreeCentrality,$a.dcn=$a.degreeCentralityNormalised=$a.degreeCentralityNormalized;var Q0=xt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Va={closenessCentralityNormalized:function(e){for(var r=Q0(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(y){return c==0?0:(Ee(y)?y=o.filter(y)[0].id():y=y.id(),l[y]/c)}}},closenessCentrality:function(e){var r=Q0(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}};Va.cc=Va.closenessCentrality,Va.ccn=Va.closenessCentralityNormalised=Va.closenessCentralityNormalized;var b5=xt({weight:null,directed:!1}),ju={betweennessCentrality:function(e){for(var r=b5(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 Xi(function($,V){return _[$]-_[V]}),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 L=a(O);D=D.id(),_[D]>_[B]+L&&(_[D]=_[B]+L,S.nodes.indexOf(D)<0?S.push(D):S.updateItem(D),E[D]=0,k[D]=[]),_[D]==_[B]+L&&(E[D]=E[D]+E[B],k[D].push(B))}else for(var A=0;A<c[B].length;A++){var q=c[B][A].id();_[q]==1/0&&(S.push(q),_[q]=_[B]+1),_[q]==_[B]+1&&(E[q]=E[q]+E[B],k[q].push(B))}}for(var U={},z=0;z<l.length;z++)U[l[z].id()]=0;for(;x.length>0;){for(var H=x.pop(),J=0;J<k[H].length;J++){var F=k[H][J];U[F]=U[F]+E[F]/E[H]*(1+U[H])}H!=l[w].id()&&f.set(H,f.get(H)+U[H])}},m=0;m<l.length;m++)g(m);var y={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 y.betweennessNormalised=y.betweennessNormalized,y}};ju.bc=ju.betweennessCentrality;var w5=xt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),C5=function(e){return w5(e)},E5=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},x5=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},J0=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}},k5=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},S5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=k5(e,a,r);return e},_5=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 J0(a,r),a},T5=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},N5=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},I5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},B5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&I5(e[r],e[n])&&e.splice(n,1);return e},eb=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=C5(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()],m=o[p.target().id()],y=E5(p,i.attributes);d[g*c+m]+=y,d[m*c+g]+=y}x5(d,c,i.multFactor),J0(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=S5(d,c,i.expandFactor),d=_5(f,c,i.inflateFactor),T5(d,f,u,4)||(b=!0),w++;var C=N5(d,c,r,a);return C=B5(C),C},D5={markovClustering:eb,mcl:eb},P5=function(e){return e},tb=function(e,r){return Math.abs(r-e)},rb=function(e,r,n){return e+tb(r,n)},nb=function(e,r,n){return e+Math.pow(n-r,2)},O5=function(e){return Math.sqrt(e)},A5=function(e,r,n){return Math.max(e,tb(r,n))},to=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:P5,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return o(l)},qa={euclidean:function(e,r,n){return e>=2?to(e,r,n,0,nb,O5):to(e,r,n,0,rb)},squaredEuclidean:function(e,r,n){return to(e,r,n,0,nb)},manhattan:function(e,r,n){return to(e,r,n,0,rb)},max:function(e,r,n){return to(e,r,n,-1/0,A5)}};qa["squared-euclidean"]=qa.squaredEuclidean,qa.squaredeuclidean=qa.squaredEuclidean;function Ss(t,e,r,n,a,i){var o;return Xe(t)?o=t:o=qa[t]||qa.euclidean,e===0&&Xe(t)?o(a,i):o(e,r,n,a,i)}var R5=xt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Wu=function(e){return R5(e)},_s=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 Ss(e,a.length,l,c,u,d)},Yu=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},ab=function(e,r,n,a,i){for(var o=1/0,l=0,c=0;c<r.length;c++){var u=_s(n,e,r[c],a,i);u<o&&(o=u,l=c)}return l},ib=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},L5=function(e,r,n){return Math.abs(r-e)<=n},M5=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},F5=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},ob=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)];F5(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},sb=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=_s("manhattan",r[i],e,n,"kMedoids");return a},$5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Wu(e),o=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=Yu(n,i.k,i.attributes)):ct(i.testCentroids)==="object"?c=i.testCentroids:c=Yu(n,i.k,i.attributes):c=Yu(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()]=ab(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var v=ib(h,n,l);if(v.length!==0){for(var p=i.attributes.length,g=c[h],m=new Array(p),y=new Array(p),b=0;b<p;b++){y[b]=0;for(var w=0;w<v.length;w++)a=v[w],y[b]+=i.attributes[b](a);m[b]=y[b]/v.length,L5(m[b],g[b],i.sensitivityThreshold)||(u=!0)}c[h]=m,o[h]=r.collection(v)}}d++}return o},V5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Wu(e),o=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ct(i.testCentroids)==="object"?l=i.testCentroids:l=ob(n,i.k)):l=ob(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()]=ab(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=ib(p,n,c);if(g.length!==0){d[p]=sb(l[p],g,i.attributes);for(var m=0;m<g.length;m++)u=sb(g[m],g,i.attributes),u<d[p]&&(d[p]=u,l[p]=g[m],f=!0);o[p]=r.collection(g)}}h++}return o},q5=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}},z5=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=_s(i.distance,a[h],n[f],i.attributes,"cmeans"),u=_s(i.distance,a[h],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[h][f]=1/l}},H5=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},lb=function(e){var r=this.cy(),n=this.nodes(),a=Wu(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 m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);u=new Array(n.length);for(var y=0;y<n.length;y++)u[y]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,q5(o,n,l,u,a),z5(l,c,o,n,a),M5(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=H5(n,l,a,r),{clusters:i,degreeOfMembership:l}},K5={kMeans:$5,kMedoids:V5,fuzzyCMeans:lb,fcm:lb},G5=xt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),U5={single:"min",complete:"max"},j5=function(e){var r=G5(e),n=U5[r.linkage];return n!=null&&(r.linkage=n),r},ub=function(e,r,n,a,i){for(var o=0,l=1/0,c,u=i.attributes,d=function(S,T){return Ss(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]],m;i.mode==="dendrogram"?m={left:p,right:g,key:p.key}:m={value:p.value.concat(g.value),key:p.key},e[p.index]=m,e.splice(g.index,1),r[p.key]=m;for(var y=0;y<e.length;y++){var b=e[y];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},Ts=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},W5=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()},Y5=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&Ts(e.left,a),e.right&&Ts(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&Ts(e.left,a),e.right&&Ts(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))},cb=function(e){for(var r=this.cy(),n=this.nodes(),a=j5(e),i=a.attributes,o=function(w,C){return Ss(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 m=ub(l,d,c,u,a);m;)m=ub(l,d,c,u,a);var y;return a.mode==="dendrogram"?(y=Y5(l[0],a.dendrogramDepth,r),a.addDendrogram&&W5(l[0],r)):(y=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,y[w]=r.collection(b.value)})),y},Z5={hierarchicalClustering:cb,hca:cb},X5=xt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Q5=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)),X5(e)},J5=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-Ss(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},e$=function(e,r){var n=null;return r==="median"?n=QF(e):r==="mean"?n=XF(e):r==="min"?n=YF(e):r==="max"?n=ZF(e):n=r,n},t$=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},db=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},r$=function(e,r,n){for(var a=db(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=db(e,r,n),a},fb=function(e){for(var r=this.cy(),n=this.nodes(),a=Q5(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]=J5(a.distance,n[p],n[g],a.attributes));d=e$(u,a.preference);for(var m=0;m<l;m++)u[m*l+m]=d;f=new Array(c);for(var y=0;y<c;y++)f[y]=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 L=0;L<l;L++){for(var A=0,q=0;q<l;q++)w[q]=h[q*l+L],C[q]=Math.max(0,f[q*l+L]),A+=C[q];A-=C[L],C[L]=f[L*l+L],A+=C[L];for(var U=0;U<l;U++)h[U*l+L]=(1-a.damping)*Math.min(0,A-C[U])+a.damping*w[U];h[L*l+L]=(1-a.damping)*(A-C[L])+a.damping*w[L]}for(var z=0,H=0;H<l;H++){var J=h[H*l+H]+f[H*l+H]>0?1:0;E[S%a.minIterations*l+H]=J,z+=J}if(z>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var F=0,$=0;$<l;$++){x[$]=0;for(var V=0;V<a.minIterations;V++)x[$]+=E[V*l+$];(x[$]===0||x[$]===a.minIterations)&&F++}if(F===l)break}}for(var G=t$(l,f,h),j=r$(l,u,G),M={},W=0;W<G.length;W++)M[G[W]]=[];for(var Y=0;Y<n.length;Y++){var se=i[n[Y].id()],ce=j[se];ce!=null&&M[ce].push(n[Y])}for(var ae=new Array(G.length),ne=0;ne<G.length;ne++)ae[ne]=r.collection(M[G[ne]]);return ae},n$={affinityPropagation:fb,ap:fb},a$=xt({root:void 0,directed:!1}),i$={hierholzer:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=a$(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=[],m=[];for(m=p(d);m.length!=1;)f[m[0]].length==0?(g.unshift(o.getElementById(m.shift())),g.unshift(o.getElementById(m.shift()))):m=p(m.shift()).concat(m);g.unshift(o.getElementById(m.shift()));for(var y in f)if(f[y].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Ns=function(){var e=this,r={},n=0,a=0,i=[],o=[],l={},c=function(h,v){for(var p=o.length-1,g=[],m=e.spawn();o[p].x!=h||o[p].y!=v;)g.push(o.pop().edge),p--;g.push(o.pop().edge),g.forEach(function(y){var b=y.connectedNodes().intersection(e);m.merge(y),b.forEach(function(w){var C=w.id(),x=w.connectedEdges().intersection(e);m.merge(w),r[C].cutVertex?m.merge(x.filter(function(k){return k.isLoop()})):m.merge(x)})}),i.push(m)},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 m,y,b,w;g.forEach(function(C){m=C.source().id(),y=C.target().id(),b=m===v?y:m,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}},o$={hopcroftTarjanBiconnected:Ns,htbc:Ns,htb:Ns,hopcroftTarjanBiconnectedComponents:Ns},Is=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 m=g.target().id();m!==u&&(m in r||c(m),r[m].explored||(r[u].low=Math.min(r[u].low,r[m].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:Is,tsc:Is,tscc:Is,tarjanStronglyConnectedComponents:Is},hb={};[Zi,MF,FF,VF,zF,KF,jF,y5,$a,Va,ju,D5,K5,Z5,n$,i$,o$,s$].forEach(function(t){Se(hb,t)});/*!
29
+ <br>`)}},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()})}},Wn=t=>(s.pushScopeId("data-v-52f81058"),t=t(),s.popScopeId(),t),GL={key:0,class:"toggle-button"},UL={class:"block"},jL=Wn(()=>s.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),WL={class:"title-buttons"},YL={key:0},ZL=["href"],XL=Wn(()=>s.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),JL=Wn(()=>s.createElementVNode("strong",null,"Evidence:  ",-1)),QL=["href"],eM={key:1},tM={key:2},rM=Wn(()=>s.createElementVNode("strong",null,"Comment:  ",-1)),nM=Wn(()=>s.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),aM=Wn(()=>s.createElementVNode("strong",null,"Evidence:",-1)),iM=Wn(()=>s.createElementVNode("strong",null,"Comment:",-1)),oM={class:"sub-title"};function sM(t,e,r,n,a,i){const o=Ht,l=Pa,c=us,u=as,d=Te.ArrowUp,f=ut,h=Te.ArrowDown,v=Te.Edit,p=Te.Delete,g=Te.Finished,m=Ri,y=Te.Close,b=fL,w=dL,C=Di,E=ku;return s.openBlock(),s.createBlock(E,{class:"main"},{default:s.withCtx(()=>[r.annotationEntry.length>1?(s.openBlock(),s.createElementBlock("div",GL,[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",UL,[s.createVNode(u,{class:"info-field"},{default:s.withCtx(()=>[jL,s.createElementVNode("div",WL,[s.createVNode(c,{content:i.updatedCopyContent},null,8,["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,x)=>s.withDirectives((s.openBlock(),s.createBlock(u,{class:"dialog-text",key:k},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(x)+": ",1),s.createTextVNode("  "),x!=="Ontology"?(s.openBlock(),s.createElementBlock("span",YL,s.toDisplayString(i.entry[k]),1)):(s.openBlock(),s.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},s.toDisplayString(i.entry[k]),9,ZL))]),_: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(()=>[XL]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.prevSubs,(k,x)=>(s.openBlock(),s.createElementBlock("div",{class:"entry",key:x},[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(()=>[JL,(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,QL)):(s.openBlock(),s.createElementBlock("span",eM,s.toDisplayString(_),1)),S!==k.body.evidence.length-1?(s.openBlock(),s.createElementBlock("span",tM,", ")):s.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[rM,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(()=>[nM]),_:1}),i.isDeleted?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[aM]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidence,(k,x)=>(s.openBlock(),s.createBlock(u,{key:k},{default:s.withCtx(()=>[s.createVNode(m,{span:20},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.evidence[x]),1)]),_:2},1024),s.createVNode(m,{span:4},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(y,{onClick:_=>i.removeEvidence(x)},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(m,{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(()=>[iM]),_: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",oM,s.toDisplayString(t.errorMessage),1)]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)])]),_:1})}const p0=Yt(KL,[["render",sM],["__scopeId","data-v-52f81058"]]),lM={name:"CreateTooltipContent",components:{Button:Ht,Col:Ri,Container:xu,Header:a0,Input:Di,Main:ku},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=t,e!==void 0&&this.$emit("cancel-create")},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:"__annotation/"+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")}}},uM=(t=>(s.pushScopeId("data-v-d61c5879"),t=t(),s.popScopeId(),t))(()=>s.createElementVNode("span",{class:"create-text"}," Primitives will be created in the __annotation region ",-1));function cM(t,e,r,n,a,i){const o=a0,l=Ri,c=as,u=Di,d=Ht,f=ku,h=xu;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,"Create "+s.toDisplayString(r.createData.shape),1)]),_:1}),s.createVNode(f,{class:"slides-block"},{default:s.withCtx(()=>[uM,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,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_: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,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_: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},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_: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=Yt(lM,[["render",cM],["__scopeId","data-v-d61c5879"]]);function ct(t){"@babel/helpers - typeof";return ct=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},ct(t)}function Du(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fM(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 Pu(t,e,r){return e&&fM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function v0(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 hM(t)||pM(t,e)||g0(t,e)||vM()}function hM(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(c){i=!0,l=c}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function g0(t,e){if(t){if(typeof t=="string")return m0(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 m0(t,e)}}function m0(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 vM(){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 y0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=g0(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 dt=typeof window>"u"?null:window,b0=dt?dt.navigator:null;dt&&dt.document;var gM=ct(""),w0=ct({}),mM=ct(function(){}),yM=typeof HTMLElement>"u"?"undefined":ct(HTMLElement),qi=function(e){return e&&e.instanceString&&Xe(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&ct(e)==gM},Xe=function(e){return e!=null&&ct(e)===mM},Ke=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ae=function(e){return e!=null&&ct(e)===w0&&!Ke(e)&&e.constructor===Object},bM=function(e){return e!=null&&ct(e)===w0},de=function(e){return e!=null&&ct(e)===ct(1)&&!isNaN(e)},wM=function(e){return de(e)&&Math.floor(e)===e},cs=function(e){if(yM!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return zi(e)||C0(e)},zi=function(e){return qi(e)==="collection"&&e._private.single},C0=function(e){return qi(e)==="collection"&&!e._private.single},Ou=function(e){return qi(e)==="core"},E0=function(e){return qi(e)==="stylesheet"},CM=function(e){return qi(e)==="event"},gn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},EM=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},xM=function(e){return Ae(e)&&de(e.x1)&&de(e.x2)&&de(e.y1)&&de(e.y2)},kM=function(e){return bM(e)&&Xe(e.then)},SM=function(){return b0&&b0.userAgent.match(/msie|trident|edge/i)},Hi=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},Au=Hi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ds=Hi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),x0=Hi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),k0=function(e){return gn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ft="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",_M="rgb[a]?\\(("+ft+"[%]?)\\s*,\\s*("+ft+"[%]?)\\s*,\\s*("+ft+"[%]?)(?:\\s*,\\s*("+ft+"))?\\)",TM="rgb[a]?\\((?:"+ft+"[%]?)\\s*,\\s*(?:"+ft+"[%]?)\\s*,\\s*(?:"+ft+"[%]?)(?:\\s*,\\s*(?:"+ft+"))?\\)",NM="hsl[a]?\\(("+ft+")\\s*,\\s*("+ft+"[%])\\s*,\\s*("+ft+"[%])(?:\\s*,\\s*("+ft+"))?\\)",IM="hsl[a]?\\((?:"+ft+")\\s*,\\s*(?:"+ft+"[%])\\s*,\\s*(?:"+ft+"[%])(?:\\s*,\\s*(?:"+ft+"))?\\)",BM="\\#[0-9a-fA-F]{3}",DM="\\#[0-9a-fA-F]{6}",S0=function(e,r){return e<r?-1:e>r?1:0},PM=function(e,r){return-1*S0(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},OM=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]}},AM=function(e){var r,n,a,i,o,l,c,u;function d(p,g,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(g-p)*6*m:m<1/2?g:m<2/3?p+(g-p)*(2/3-m)*6:p}var f=new RegExp("^"+NM+"$").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},RM=function(e){var r,n=new RegExp("^"+_M+"$").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},LM=function(e){return FM[e.toLowerCase()]},MM=function(e){return(Ke(e)?e:null)||LM(e)||OM(e)||RM(e)||AM(e)},FM={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]},_0=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}},T0=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 $M(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Yn=$M,Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VM(t,e){return e={exports:{}},t(e,e.exports),e.exports}var qM=typeof Ki=="object"&&Ki&&Ki.Object===Object&&Ki,zM=qM,HM=typeof self=="object"&&self&&self.Object===Object&&self,KM=zM||HM||Function("return this")(),fs=KM,GM=function(){return fs.Date.now()},Ru=GM,UM=/\s/;function jM(t){for(var e=t.length;e--&&UM.test(t.charAt(e)););return e}var WM=jM,YM=/^\s+/;function ZM(t){return t&&t.slice(0,WM(t)+1).replace(YM,"")}var XM=ZM,JM=fs.Symbol,Aa=JM,N0=Object.prototype,QM=N0.hasOwnProperty,eF=N0.toString,Gi=Aa?Aa.toStringTag:void 0;function tF(t){var e=QM.call(t,Gi),r=t[Gi];try{t[Gi]=void 0;var n=!0}catch{}var a=eF.call(t);return n&&(e?t[Gi]=r:delete t[Gi]),a}var rF=tF,nF=Object.prototype,aF=nF.toString;function iF(t){return aF.call(t)}var oF=iF,sF="[object Null]",lF="[object Undefined]",I0=Aa?Aa.toStringTag:void 0;function uF(t){return t==null?t===void 0?lF:sF:I0&&I0 in Object(t)?rF(t):oF(t)}var B0=uF;function cF(t){return t!=null&&typeof t=="object"}var dF=cF,fF="[object Symbol]";function hF(t){return typeof t=="symbol"||dF(t)&&B0(t)==fF}var Ui=hF,D0=NaN,pF=/^[-+]0x[0-9a-f]+$/i,vF=/^0b[01]+$/i,gF=/^0o[0-7]+$/i,mF=parseInt;function yF(t){if(typeof t=="number")return t;if(Ui(t))return D0;if(Yn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Yn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=XM(t);var r=vF.test(t);return r||gF.test(t)?mF(t.slice(2),r?2:8):pF.test(t)?D0:+t}var P0=yF,bF="Expected a function",wF=Math.max,CF=Math.min;function EF(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(bF);e=P0(e)||0,Yn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?wF(P0(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var x=n,_=a;return n=a=void 0,u=k,o=t.apply(_,x),o}function p(k){return u=k,l=setTimeout(y,e),d?v(k):o}function g(k){var x=k-c,_=k-u,S=e-x;return f?CF(S,i-_):S}function m(k){var x=k-c,_=k-u;return c===void 0||x>=e||x<0||f&&_>=i}function y(){var k=Ru();if(m(k))return b(k);l=setTimeout(y,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(Ru())}function E(){var k=Ru(),x=m(k);if(n=arguments,a=this,c=k,x){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(y,e),v(c)}return l===void 0&&(l=setTimeout(y,e)),o}return E.cancel=w,E.flush=C,E}var hs=EF,Lu=dt?dt.performance:null,O0=Lu&&Lu.now?function(){return Lu.now()}:function(){return Date.now()},xF=function(){if(dt){if(dt.requestAnimationFrame)return function(t){dt.requestAnimationFrame(t)};if(dt.mozRequestAnimationFrame)return function(t){dt.mozRequestAnimationFrame(t)};if(dt.webkitRequestAnimationFrame)return function(t){dt.webkitRequestAnimationFrame(t)};if(dt.msRequestAnimationFrame)return function(t){dt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(O0())},1e3/60)}}(),ps=function(e){return xF(e)},Wr=O0,Ra=9261,A0=65599,ji=5381,R0=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ra,n=r,a;a=e.next(),!a.done;)n=n*A0+a.value|0;return n},Wi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ra;return r*A0+e|0},Yi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ji;return(r<<5)+r+e|0},kF=function(e,r){return e*2097152+r},mn=function(e){return e[0]*2097152+e[1]},vs=function(e,r){return[Wi(e[0],r[0]),Yi(e[1],r[1])]},SF=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 R0(o,r)},Zn=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 R0(o,r)},L0=function(){return _F(arguments)},_F=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Zn(a):r=Zn(a,r)}return r},M0=!0,TF=console.warn!=null,NF=console.trace!=null,Mu=Number.MAX_SAFE_INTEGER||9007199254740991,F0=function(){return!0},gs=function(){return!1},$0=function(){return 0},Fu=function(){},Je=function(e){throw new Error(e)},V0=function(e){if(e!==void 0)M0=!!e;else return M0},$e=function(e){V0()&&(TF?console.warn(e):(console.log(e),NF&&console.trace()))},IF=function(e){return Se({},e)},Nr=function(e){return e==null?e:Ke(e)?e.slice():Ae(e)?IF(e):e},BF=function(e){return e.slice()},q0=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},DF={},z0=function(){return DF},xt=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}},yn=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},$u=function(e){e.splice(0,e.length)},PF=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=x0(n,r)),e[r]},bn=function(e,r,n,a){n&&(r=x0(n,r)),e[r]=a},OF=function(){function t(){Du(this,t),this._obj={}}return Pu(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:OF,AF="undefined",RF=function(){function t(e){if(Du(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 Pu(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}(),La=(typeof Set>"u"?"undefined":ct(Set))!==AF?Set:RF,ms=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ou(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 La,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()},H0=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,m=this.byGroup(),y=m.nodes,b=m.edges,w=0;w<c.length;w++){var C=c[w],E=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(v[E]=!0,d.push(C)),h[E]=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],L=O!=null?O.source():null,A=O!=null?O.target():null,q=O==null?void 0:P.same(L)?A[0]:L[0],U=void 0;if(U=a(P,O,q,p++,R),U===!0)return g=P,"break";if(U===!1)return"break";for(var z=P.connectedEdges().filter(function(V){return(!i||V.source().same(P))&&b.has(V)}),H=0;H<z.length;H++){var Q=z[H],F=Q.connectedNodes().filter(function(V){return!V.same(P)&&y.has(V)}),$=F.id();F.length!==0&&!v[$]&&(F=F[0],u.push(F),e.bfs&&(v[$]=!0,d.push(F)),f[$]=Q,h[$]=h[D]+1)}};u.length!==0;){var x=k();if(x!=="continue"&&x==="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)}}},Zi={breadthFirstSearch:H0({bfs:!0}),depthFirstSearch:H0({dfs:!0})};Zi.bfs=Zi.breadthFirstSearch,Zi.dfs=Zi.depthFirstSearch;var LF=VM(function(t,e){(function(){var r,n,a,i,o,l,c,u,d,f,h,v,p,g,m;a=Math.floor,f=Math.min,n=function(y,b){return y<b?-1:y>b?1:0},d=function(y,b,w,C,E){var k;if(w==null&&(w=0),E==null&&(E=n),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=y.length);w<C;)k=a((w+C)/2),E(b,y[k])<0?C=k:w=k+1;return[].splice.apply(y,[w,w-w].concat(b)),b},l=function(y,b,w){return w==null&&(w=n),y.push(b),g(y,0,y.length-1,w)},o=function(y,b){var w,C;return b==null&&(b=n),w=y.pop(),y.length?(C=y[0],y[0]=w,m(y,0,b)):C=w,C},u=function(y,b,w){var C;return w==null&&(w=n),C=y[0],y[0]=b,m(y,0,w),C},c=function(y,b,w){var C;return w==null&&(w=n),y.length&&w(y[0],b)<0&&(C=[y[0],b],b=C[0],y[0]=C[1],m(y,0,w)),b},i=function(y,b){var w,C,E,k,x,_;for(b==null&&(b=n),k=(function(){_=[];for(var S=0,T=a(y.length/2);0<=T?S<T:S>T;0<=T?S++:S--)_.push(S);return _}).apply(this).reverse(),x=[],C=0,E=k.length;C<E;C++)w=k[C],x.push(m(y,w,b));return x},p=function(y,b,w){var C;if(w==null&&(w=n),C=y.indexOf(b),C!==-1)return g(y,0,C,w),m(y,C,w)},h=function(y,b,w){var C,E,k,x,_;if(w==null&&(w=n),E=y.slice(0,b),!E.length)return E;for(i(E,w),_=y.slice(b),k=0,x=_.length;k<x;k++)C=_[k],c(E,C,w);return E.sort(w).reverse()},v=function(y,b,w){var C,E,k,x,_,S,T,N,B;if(w==null&&(w=n),b*10<=y.length){if(k=y.slice(0,b).sort(w),!k.length)return k;for(E=k[k.length-1],T=y.slice(b),x=0,S=T.length;x<S;x++)C=T[x],w(C,E)<0&&(d(k,C,0,null,w),k.pop(),E=k[k.length-1]);return k}for(i(y,w),B=[],_=0,N=f(b,y.length);0<=N?_<N:_>N;0<=N?++_:--_)B.push(o(y,w));return B},g=function(y,b,w,C){var E,k,x;for(C==null&&(C=n),E=y[w];w>b;){if(x=w-1>>1,k=y[x],C(E,k)<0){y[w]=k,w=x;continue}break}return y[w]=E},m=function(y,b,w){var C,E,k,x,_;for(w==null&&(w=n),E=y.length,_=b,k=y[b],C=2*b+1;C<E;)x=C+1,x<E&&!(w(y[C],y[x])<0)&&(C=x),y[b]=y[C],b=C,C=2*b+1;return y[b]=k,g(y,_,b,w)},r=function(){y.push=l,y.pop=o,y.replace=u,y.pushpop=c,y.heapify=i,y.updateItem=p,y.nlargest=h,y.nsmallest=v;function y(b){this.cmp=b??n,this.nodes=[]}return y.prototype.push=function(b){return l(this.nodes,b,this.cmp)},y.prototype.pop=function(){return o(this.nodes,this.cmp)},y.prototype.peek=function(){return this.nodes[0]},y.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},y.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return i(this.nodes,this.cmp)},y.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},y.prototype.clear=function(){return this.nodes=[]},y.prototype.empty=function(){return this.nodes.length===0},y.prototype.size=function(){return this.nodes.length},y.prototype.clone=function(){var b;return b=new y,b.nodes=this.nodes.slice(0),b},y.prototype.toArray=function(){return this.nodes.slice(0)},y.prototype.insert=y.prototype.push,y.prototype.top=y.prototype.peek,y.prototype.front=y.prototype.peek,y.prototype.has=y.prototype.contains,y.prototype.copy=y.prototype.clone,y}(),function(y,b){return t.exports=b()}(this,function(){return r})}).call(Ki)}),Xi=LF,MF=xt({root:null,weight:function(e){return 1},directed:!1}),FF={dijkstra:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=MF(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 m=function(O){return d[O.id()]},y=function(O,L){d[O.id()]=L,b.updateItem(O)},b=new Xi(function(R,O){return m(R)-m(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 E=function(O,L){for(var A=(o?O.edgesTo(L):O.edgesWith(L)).intersect(g),q=1/0,U,z=0;z<A.length;z++){var H=A[z],Q=c(H);(Q<q||!U)&&(q=Q,U=H)}return{edge:U,dist:q}};b.size()>0;){var k=b.pop(),x=m(k),_=k.id();if(h[_]=x,x!==1/0)for(var S=k.neighborhood().intersect(p),T=0;T<S.length;T++){var N=S[T],B=N.id(),P=E(k,N),D=x+P.dist;D<m(N)&&(y(N,D),f[B]={node:k,edge:P.edge})}}return{distanceTo:function(O){var L=Ee(O)?p.filter(O)[0]:O[0];return h[L.id()]},pathTo:function(O){var L=Ee(O)?p.filter(O)[0]:O[0],A=[],q=L,U=q.id();if(L.length>0)for(A.unshift(L);f[U];){var z=f[U];A.unshift(z.edge),A.unshift(z.node),q=z.node,U=q.id()}return l.spawn(A)}}}},$F={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 E=0;E<o.length;E++){var k=o[E];if(k.has(C))return E}},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),m=c(p),y=o[g],b=o[m];g!==m&&(l.merge(h),y.merge(b),o.splice(m,1))}return l}},VF=xt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),qF={aStar:function(e){var r=this.cy(),n=VF(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 Xi(function(U,z){return h[U.id()]-h[z.id()]}),g=new La,m={},y={},b=function(z,H){p.push(z),g.add(H)},w,C,E=function(){w=p.pop(),C=w.id(),g.delete(C)},k=function(z){return g.has(z)};b(a,u),f[u]=0,h[u]=o(a);for(var x=0;p.size()>0;){if(E(),x++,C===d){for(var _=[],S=i,T=d,N=y[T];_.unshift(S),N!=null&&_.unshift(N),S=m[T],S!=null;)T=S.id(),N=y[T];return{found:!0,distance:f[C],path:this.spawn(_),steps:x}}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(),L=R.id()!==C?R:O,A=L.id();if(this.hasElementWithId(A)&&!v[A]){var q=f[C]+c(D);if(!k(A)){f[A]=q,h[A]=q+o(L),b(L,A),m[A]=w,y[A]=D;continue}q<f[A]&&(f[A]=q,h[A]=q+o(L),m[A]=w,y[A]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},zF=xt({weight:function(e){return 1},directed:!1}),HF={floydWarshall:function(e){for(var r=this.cy(),n=zF(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(Q){return c.indexOf(Q)},v=function(Q){return c[Q]},p=new Array(f),g=0;g<f;g++){var m=g%d,y=(g-m)/d;y===m?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var E=u[C],k=E.source()[0],x=E.target()[0];if(k!==x){var _=h(k),S=h(x),T=_*d+S,N=o(E);if(p[T]>N&&(p[T]=N,b[T]=S,w[T]=E),!i){var B=S*d+_;!i&&p[B]>N&&(p[B]=N,b[B]=_,w[B]=E)}}}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 L=D*d+O,A=P*d+O;p[R]+p[A]<p[L]&&(p[L]=p[R]+p[A],b[L]=b[R])}var q=function(Q){return(Ee(Q)?r.filter(Q):Q)[0]},U=function(Q){return h(q(Q))},z={distance:function(Q,F){var $=U(Q),V=U(F);return p[$*d+V]},path:function(Q,F){var $=U(Q),V=U(F),G=v($);if($===V)return G.collection();if(b[$*d+V]==null)return r.collection();var j=r.collection(),M=$,W;for(j.merge(G);$!==V;)M=$,$=b[$*d+V],W=w[M*d+$],j.merge(W),j.merge(v($));return j}};return z}},KF=xt({weight:function(e){return 1},directed:!1,root:null}),GF={bellmanFord:function(e){var r=this,n=KF(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,m=[];o=u.collection(o)[0],f.unmergeBy(function(ie){return ie.isLoop()});for(var y=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},E=function(fe){for(var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,De=w(fe),Ie=[],we=De;;){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 x=h[k],_=b(x);x.same(o)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var S=!1,T=function(fe,pe,De,Ie,we,xe){var re=Ie.dist+xe;re<we.dist&&!De.same(Ie.edge)&&(we.dist=re,we.pred=fe,we.edge=De,S=!0)},N=1;N<v;N++){S=!1;for(var B=0;B<y;B++){var P=f[B],D=P.source(),R=P.target(),O=l(P),L=b(D),A=b(R);T(D,R,P,L,A,O),i||T(R,D,P,A,L,O)}if(!S)break}if(S)for(var q=[],U=0;U<y;U++){var z=f[U],H=z.source(),Q=z.target(),F=l(z),$=b(H).dist,V=b(Q).dist;if($+F<V||!i&&V+F<$)if(g||($e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var G=[];$+F<V&&G.push(H),!i&&V+F<$&&G.push(Q);for(var j=G.length,M=0;M<j;M++){var W=G[M],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 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(",");q.indexOf(ue)===-1&&(m.push(c.spawn(Y)),q.push(ue))}}else break}return{distanceTo:C,pathTo:E,hasNegativeWeightCycle:g,negativeWeightCycles:m}}},UF=Math.sqrt(2),jF=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 m=0;m<r.length;m++)r[m]===c&&(r[m]=l);return u},Vu=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=jF(i,e,r),n--}return r},WF={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/UF);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),m=new Array(i),y=function(q,U){for(var z=0;z<i;z++)U[z]=q[z]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=Vu(g,u.slice(),i,c),E=C.slice();y(g,m);var k=Vu(g,C,c,2),x=Vu(m,E,c,2);k.length<=x.length&&k.length<h?(h=k.length,v=k,y(g,p)):x.length<=k.length&&x.length<h&&(h=x.length,v=x,y(m,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(q){var U=e.spawn();return q.forEach(function(z){U.merge(z),z.connectedEdges().forEach(function(H){e.contains(H)&&!_.contains(H)&&U.merge(H)})}),U},O=[R(S),R(T)],L={cut:_,components:O,partition1:S,partition2:T};return L}},YF=function(e){return{x:e.x,y:e.y}},ys=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},K0=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Ma=function(e){return{x:e[0],y:e[1]}},ZF=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},XF=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},JF=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},QF=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},e5=function(e){return Math.PI*e/180},bs=function(e,r){return Math.atan2(r,e)-Math.PI/2},qu=Math.log2||function(t){return Math.log(t)/Math.log(2)},G0=function(e){return e>0?1:e<0?-1:0},Xn=function(e,r){return Math.sqrt(Jn(e,r))},Jn=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},t5=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},gt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},Fa=function(e,r,n,a){return{x:gt(e.x,r.x,n.x,a),y:gt(e.y,r.y,n.y,a)}},r5=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=Xn(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}},Ji=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}}},n5=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},a5=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},i5=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}},U0=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},o5=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},ws=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},Cs=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},j0=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},zu=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)},$a=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},s5=function(e,r){return $a(e,r.x,r.y)},W0=function(e,r){return $a(e,r.x1,r.y1)&&$a(e,r.x2,r.y2)},Y0=function(e,r,n,a,i,o,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?ea(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,m=a-f-l,y=n+d-u+l,b=m;if(p=wn(e,r,n,a,g,m,y,b,!1),p.length>0)return p}if(v){var w=n+d+l,C=a-f+u-l,E=w,k=a+f-u+l;if(p=wn(e,r,n,a,w,C,E,k,!1),p.length>0)return p}if(h){var x=n-d+u-l,_=a+f+l,S=n+d-u+l,T=_;if(p=wn(e,r,n,a,x,_,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=wn(e,r,n,a,N,B,P,D,!1),p.length>0)return p}var R;{var O=n-d+u,L=a-f+u;if(R=Qi(e,r,n,a,O,L,u+l),R.length>0&&R[0]<=O&&R[1]<=L)return[R[0],R[1]]}{var A=n+d-u,q=a-f+u;if(R=Qi(e,r,n,a,A,q,u+l),R.length>0&&R[0]>=A&&R[1]<=q)return[R[0],R[1]]}{var U=n+d-u,z=a+f-u;if(R=Qi(e,r,n,a,U,z,u+l),R.length>0&&R[0]>=U&&R[1]>=z)return[R[0],R[1]]}{var H=n-d+u,Q=a+f-u;if(R=Qi(e,r,n,a,H,Q,u+l),R.length>0&&R[0]<=H&&R[1]>=Q)return[R[0],R[1]]}return[]},l5=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},u5=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)},c5=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]},d5=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)},f5=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=[];d5(u,d,f,h,v);for(var p=1e-7,g=[],m=0;m<6;m+=2)Math.abs(v[m+1])<p&&v[m]>=0&&v[m]<=1&&g.push(v[m]);g.push(1),g.push(0);for(var y=-1,b,w,C,E=0;E<g.length;E++)b=Math.pow(1-g[E],2)*n+2*(1-g[E])*g[E]*i+g[E]*g[E]*l,w=Math.pow(1-g[E],2)*a+2*(1-g[E])*g[E]*o+g[E]*g[E]*c,C=Math.pow(b-e,2)+Math.pow(w-r,2),y>=0?C<y&&(y=C):y=C;return y},h5=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},Yr=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 m=xs(d,-u);g=Es(m)}else g=d;return Gt(e,r,g)},p5=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)},Es=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=wn(n,a,i,o,l,c,u,d,!0);r[f*2]=h[0],r[f*2+1]=h[1]}return r},xs=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},v5=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]},Qn=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},Qi=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),m=Math.min(p,g),y=Math.max(p,g),b=[];if(m>=0&&m<=1&&b.push(m),y>=0&&y<=1&&b.push(y),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 E=b[1]*c[0]+e,k=b[1]*c[1]+r;return[w,C,E,k]}else return[w,C]},Hu=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},wn=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,m=h*v-g*d,y=f*v-p*d,b=g*f-h*p;if(b!==0){var w=m/b,C=y/b,E=.001,k=0-E,x=1+E;return k<=w&&w<=x&&k<=C&&C<=x?[e+w*f,r+w*p]:u?[e+w*f,r+w*p]:[]}else return m===0||y===0?Hu(e,n,l)===l?[l,c]:Hu(e,n,i)===i?[i,o]:Hu(i,l,n)===n?[n,a]:[]:[]},eo=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=xs(f,-c);v=Es(g)}else v=f}else v=n;for(var m,y,b,w,C=0;C<v.length/2;C++)m=v[C*2],y=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=wn(e,r,a,i,m,y,b,w),d.length!==0&&u.push(d[0],d[1]);return u},g5=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=Qi(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=wn(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),m=1;m<d.length/2;m++){var y=Math.pow(d[m*2]-e,2)+Math.pow(d[m*2+1]-r,2);y<=g&&(p[0]=d[m*2],p[1]=d[m*2+1],g=y)}return p}return d},ks=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]]},Ft=function(e,r){var n=Ku(e,r);return n=Z0(n),n},Z0=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},Ku=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},ea=function(e,r){return Math.min(e/4,r/4,8)},X0=function(e,r){return Math.min(e/10,r/10,8)},Gu=function(){return 8},m5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Uu=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},y5=xt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),b5={pageRank:function(e){for(var r=y5(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),m=(1-n)/f,y=0;y<f;y++){for(var b=0;b<f;b++){var w=y*f+b;p[w]=0}g[y]=0}for(var C=0;C<v;C++){var E=d[C],k=E.data("source"),x=E.data("target");if(k!==x){var _=u.indexOfId(k),S=u.indexOfId(x),T=o(E),N=S*f+_;p[N]+=T,g[_]+=T}}for(var B=1/f+m,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 L=O*f+P;p[L]=p[L]/g[P]+m}for(var A=new Array(f),q=new Array(f),U,z=0;z<f;z++)A[z]=1;for(var H=0;H<i;H++){for(var Q=0;Q<f;Q++)q[Q]=0;for(var F=0;F<f;F++)for(var $=0;$<f;$++){var V=F*f+$;q[F]+=p[V]*A[$]}t5(q),U=A,A=q,q=U;for(var G=0,j=0;j<f;j++){var M=U[j]-A[j];G+=M*M}if(G<a)break}var W={rank:function(se){return se=l.collection(se)[0],A[u.indexOf(se)]}};return W}},J0=xt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Va={degreeCentralityNormalized:function(e){e=J0(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],m=g.id();e.root=g;var y=this.degreeCentrality(e);h<y.indegree&&(h=y.indegree),v<y.outdegree&&(v=y.outdegree),d[m]=y.indegree,f[m]=y.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=J0(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)}),m=p.length,y=g.length,b=0,w=0,C=0;C<p.length;C++)b+=o(p[C]);for(var E=0;E<g.length;E++)w+=o(g[E]);return{indegree:Math.pow(m,1-c)*Math.pow(b,c),outdegree:Math.pow(y,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)}}}};Va.dc=Va.degreeCentrality,Va.dcn=Va.degreeCentralityNormalised=Va.degreeCentralityNormalized;var Q0=xt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),qa={closenessCentralityNormalized:function(e){for(var r=Q0(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(y){return c==0?0:(Ee(y)?y=o.filter(y)[0].id():y=y.id(),l[y]/c)}}},closenessCentrality:function(e){var r=Q0(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}};qa.cc=qa.closenessCentrality,qa.ccn=qa.closenessCentralityNormalised=qa.closenessCentralityNormalized;var w5=xt({weight:null,directed:!1}),ju={betweennessCentrality:function(e){for(var r=w5(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(),E=[],k={},x={},_={},S=new Xi(function($,V){return _[$]-_[V]}),T=0;T<l.length;T++){var N=l[T].id();k[N]=[],x[N]=0,_[N]=1/0}for(x[C]=1,_[C]=0,S.push(C);!S.empty();){var B=S.pop();if(E.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 L=a(O);D=D.id(),_[D]>_[B]+L&&(_[D]=_[B]+L,S.nodes.indexOf(D)<0?S.push(D):S.updateItem(D),x[D]=0,k[D]=[]),_[D]==_[B]+L&&(x[D]=x[D]+x[B],k[D].push(B))}else for(var A=0;A<c[B].length;A++){var q=c[B][A].id();_[q]==1/0&&(S.push(q),_[q]=_[B]+1),_[q]==_[B]+1&&(x[q]=x[q]+x[B],k[q].push(B))}}for(var U={},z=0;z<l.length;z++)U[l[z].id()]=0;for(;E.length>0;){for(var H=E.pop(),Q=0;Q<k[H].length;Q++){var F=k[H][Q];U[F]=U[F]+x[F]/x[H]*(1+U[H])}H!=l[w].id()&&f.set(H,f.get(H)+U[H])}},m=0;m<l.length;m++)g(m);var y={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 y.betweennessNormalised=y.betweennessNormalized,y}};ju.bc=ju.betweennessCentrality;var C5=xt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),E5=function(e){return C5(e)},x5=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},eb=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}},S5=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},_5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=S5(e,a,r);return e},T5=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 eb(a,r),a},N5=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},I5=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},B5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},D5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&B5(e[r],e[n])&&e.splice(n,1);return e},tb=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=E5(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()],m=o[p.target().id()],y=x5(p,i.attributes);d[g*c+m]+=y,d[m*c+g]+=y}k5(d,c,i.multFactor),eb(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=_5(d,c,i.expandFactor),d=T5(f,c,i.inflateFactor),N5(d,f,u,4)||(b=!0),w++;var C=I5(d,c,r,a);return C=D5(C),C},P5={markovClustering:tb,mcl:tb},O5=function(e){return e},rb=function(e,r){return Math.abs(r-e)},nb=function(e,r,n){return e+rb(r,n)},ab=function(e,r,n){return e+Math.pow(n-r,2)},A5=function(e){return Math.sqrt(e)},R5=function(e,r,n){return Math.max(e,rb(r,n))},to=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:O5,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return o(l)},za={euclidean:function(e,r,n){return e>=2?to(e,r,n,0,ab,A5):to(e,r,n,0,nb)},squaredEuclidean:function(e,r,n){return to(e,r,n,0,ab)},manhattan:function(e,r,n){return to(e,r,n,0,nb)},max:function(e,r,n){return to(e,r,n,-1/0,R5)}};za["squared-euclidean"]=za.squaredEuclidean,za.squaredeuclidean=za.squaredEuclidean;function Ss(t,e,r,n,a,i){var o;return Xe(t)?o=t:o=za[t]||za.euclidean,e===0&&Xe(t)?o(a,i):o(e,r,n,a,i)}var L5=xt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Wu=function(e){return L5(e)},_s=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 Ss(e,a.length,l,c,u,d)},Yu=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},ib=function(e,r,n,a,i){for(var o=1/0,l=0,c=0;c<r.length;c++){var u=_s(n,e,r[c],a,i);u<o&&(o=u,l=c)}return l},ob=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},M5=function(e,r,n){return Math.abs(r-e)<=n},F5=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},$5=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},sb=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)];$5(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},lb=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=_s("manhattan",r[i],e,n,"kMedoids");return a},V5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Wu(e),o=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=Yu(n,i.k,i.attributes)):ct(i.testCentroids)==="object"?c=i.testCentroids:c=Yu(n,i.k,i.attributes):c=Yu(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()]=ib(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var v=ob(h,n,l);if(v.length!==0){for(var p=i.attributes.length,g=c[h],m=new Array(p),y=new Array(p),b=0;b<p;b++){y[b]=0;for(var w=0;w<v.length;w++)a=v[w],y[b]+=i.attributes[b](a);m[b]=y[b]/v.length,M5(m[b],g[b],i.sensitivityThreshold)||(u=!0)}c[h]=m,o[h]=r.collection(v)}}d++}return o},q5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Wu(e),o=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ct(i.testCentroids)==="object"?l=i.testCentroids:l=sb(n,i.k)):l=sb(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()]=ib(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=ob(p,n,c);if(g.length!==0){d[p]=lb(l[p],g,i.attributes);for(var m=0;m<g.length;m++)u=lb(g[m],g,i.attributes),u<d[p]&&(d[p]=u,l[p]=g[m],f=!0);o[p]=r.collection(g)}}h++}return o},z5=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}},H5=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=_s(i.distance,a[h],n[f],i.attributes,"cmeans"),u=_s(i.distance,a[h],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[h][f]=1/l}},K5=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},ub=function(e){var r=this.cy(),n=this.nodes(),a=Wu(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 m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);u=new Array(n.length);for(var y=0;y<n.length;y++)u[y]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,z5(o,n,l,u,a),H5(l,c,o,n,a),F5(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=K5(n,l,a,r),{clusters:i,degreeOfMembership:l}},G5={kMeans:V5,kMedoids:q5,fuzzyCMeans:ub,fcm:ub},U5=xt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),j5={single:"min",complete:"max"},W5=function(e){var r=U5(e),n=j5[r.linkage];return n!=null&&(r.linkage=n),r},cb=function(e,r,n,a,i){for(var o=0,l=1/0,c,u=i.attributes,d=function(S,T){return Ss(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]],m;i.mode==="dendrogram"?m={left:p,right:g,key:p.key}:m={value:p.value.concat(g.value),key:p.key},e[p.index]=m,e.splice(g.index,1),r[p.key]=m;for(var y=0;y<e.length;y++){var b=e[y];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 E=C,k=0;k<e.length;k++){var x=e[k].key;n[C][x]<n[C][E]&&(E=x)}a[C]=E}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Ts=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},Y5=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()},Z5=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&Ts(e.left,a),e.right&&Ts(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&Ts(e.left,a),e.right&&Ts(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))},db=function(e){for(var r=this.cy(),n=this.nodes(),a=W5(e),i=a.attributes,o=function(w,C){return Ss(a.distance,i.length,function(E){return i[E](w)},function(E){return i[E](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 m=cb(l,d,c,u,a);m;)m=cb(l,d,c,u,a);var y;return a.mode==="dendrogram"?(y=Z5(l[0],a.dendrogramDepth,r),a.addDendrogram&&Y5(l[0],r)):(y=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,y[w]=r.collection(b.value)})),y},X5={hierarchicalClustering:db,hca:db},J5=xt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Q5=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)),J5(e)},e$=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-Ss(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},t$=function(e,r){var n=null;return r==="median"?n=QF(e):r==="mean"?n=JF(e):r==="min"?n=ZF(e):r==="max"?n=XF(e):n=r,n},r$=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},fb=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},n$=function(e,r,n){for(var a=fb(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=fb(e,r,n),a},hb=function(e){for(var r=this.cy(),n=this.nodes(),a=Q5(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]=e$(a.distance,n[p],n[g],a.attributes));d=t$(u,a.preference);for(var m=0;m<l;m++)u[m*l+m]=d;f=new Array(c);for(var y=0;y<c;y++)f[y]=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),E=new Array(l),k=0;k<l;k++)w[k]=0,C[k]=0,E[k]=0;for(var x=new Array(l*a.minIterations),_=0;_<x.length;_++)x[_]=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 L=0;L<l;L++){for(var A=0,q=0;q<l;q++)w[q]=h[q*l+L],C[q]=Math.max(0,f[q*l+L]),A+=C[q];A-=C[L],C[L]=f[L*l+L],A+=C[L];for(var U=0;U<l;U++)h[U*l+L]=(1-a.damping)*Math.min(0,A-C[U])+a.damping*w[U];h[L*l+L]=(1-a.damping)*(A-C[L])+a.damping*w[L]}for(var z=0,H=0;H<l;H++){var Q=h[H*l+H]+f[H*l+H]>0?1:0;x[S%a.minIterations*l+H]=Q,z+=Q}if(z>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var F=0,$=0;$<l;$++){E[$]=0;for(var V=0;V<a.minIterations;V++)E[$]+=x[V*l+$];(E[$]===0||E[$]===a.minIterations)&&F++}if(F===l)break}}for(var G=r$(l,f,h),j=n$(l,u,G),M={},W=0;W<G.length;W++)M[G[W]]=[];for(var Y=0;Y<n.length;Y++){var se=i[n[Y].id()],ce=j[se];ce!=null&&M[ce].push(n[Y])}for(var ae=new Array(G.length),ne=0;ne<G.length;ne++)ae[ne]=r.collection(M[G[ne]]);return ae},a$={affinityPropagation:hb,ap:hb},i$=xt({root:void 0,directed:!1}),o$={hierholzer:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=i$(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),E=b.outdegree(!0),k=C-E,x=E-C;k==1?c?l=!0:c=w:x==1?u?l=!0:u=w:(x>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(E){return f[w].push(E.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,E=[w],k,x,_;f[C].length;)k=f[C].shift(),x=h[k][0],_=h[k][1],C!=_?(f[_]=f[_].filter(function(S){return S!=k}),C=_):!i&&C!=x&&(f[x]=f[x].filter(function(S){return S!=k}),C=x),E.unshift(k),E.unshift(C);return E},g=[],m=[];for(m=p(d);m.length!=1;)f[m[0]].length==0?(g.unshift(o.getElementById(m.shift())),g.unshift(o.getElementById(m.shift()))):m=p(m.shift()).concat(m);g.unshift(o.getElementById(m.shift()));for(var y in f)if(f[y].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Ns=function(){var e=this,r={},n=0,a=0,i=[],o=[],l={},c=function(h,v){for(var p=o.length-1,g=[],m=e.spawn();o[p].x!=h||o[p].y!=v;)g.push(o.pop().edge),p--;g.push(o.pop().edge),g.forEach(function(y){var b=y.connectedNodes().intersection(e);m.merge(y),b.forEach(function(w){var C=w.id(),E=w.connectedEdges().intersection(e);m.merge(w),r[C].cutVertex?m.merge(E.filter(function(k){return k.isLoop()})):m.merge(E)})}),i.push(m)},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 m,y,b,w;g.forEach(function(C){m=C.source().id(),y=C.target().id(),b=m===v?y:m,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}},s$={hopcroftTarjanBiconnected:Ns,htbc:Ns,htb:Ns,hopcroftTarjanBiconnectedComponents:Ns},Is=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 m=g.target().id();m!==u&&(m in r||c(m),r[m].explored||(r[u].low=Math.min(r[u].low,r[m].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}},l$={tarjanStronglyConnected:Is,tsc:Is,tscc:Is,tarjanStronglyConnectedComponents:Is},pb={};[Zi,FF,$F,qF,HF,GF,WF,b5,Va,qa,ju,P5,G5,X5,a$,o$,s$,l$].forEach(function(t){Se(pb,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 pb=0,vb=1,gb=2,Zr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=pb,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))};Zr.prototype={fulfill:function(e){return mb(this,vb,"fulfillValue",e)},reject:function(e){return mb(this,gb,"rejectReason",e)},then:function(e,r){var n=this,a=new Zr;return n.onFulfilled.push(wb(e,a,"fulfill")),n.onRejected.push(wb(r,a,"reject")),yb(n),a.proxy}};var mb=function(e,r,n,a){return e.state===pb&&(e.state=r,e[n]=a,yb(e)),e},yb=function(e){e.state===vb?bb(e,"onFulfilled",e.fulfillValue):e.state===gb&&bb(e,"onRejected",e.rejectReason)},bb=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)}},wb=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}l$(r,i)}}},l$=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ct(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)};Zr.all=function(t){return new Zr(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)})},Zr.resolve=function(t){return new Zr(function(e,r){e(t)})},Zr.reject=function(t){return new Zr(function(e,r){r(t)})};var za=typeof Promise<"u"?Promise:Zr,Zu=function(e,r,n){var a=Ou(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},ta=Zu.prototype;Se(ta,{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 za(function(a,i){n.push(function(){a()})})}}),ta.complete=ta.completed,ta.run=ta.play,ta.running=ta.playing;var u$={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 Zu(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=H0(h,p,v)}if(c&&r.panBy!=null){var g=r.panBy,m=l.pan();r.pan={x:m.x+g.x,y:m.y+g.y}}var y=r.center||r.centre;if(c&&y!=null){var b=l.getCenterPan(y.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 Zu(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}}},c$=Array.isArray,Bs=c$,d$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f$=/^\w*$/;function h$(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ui(t)?!0:f$.test(t)||!d$.test(t)||e!=null&&t in Object(e)}var p$=h$,v$="[object AsyncFunction]",g$="[object Function]",m$="[object GeneratorFunction]",y$="[object Proxy]";function b$(t){if(!Yn(t))return!1;var e=I0(t);return e==g$||e==m$||e==v$||e==y$}var w$=b$,C$=fs["__core-js_shared__"],Xu=C$,Cb=function(){var t=/[^.]+$/.exec(Xu&&Xu.keys&&Xu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function E$(t){return!!Cb&&Cb in t}var x$=E$,k$=Function.prototype,S$=k$.toString;function _$(t){if(t!=null){try{return S$.call(t)}catch{}try{return t+""}catch{}}return""}var T$=_$,N$=/[\\^$.*+?()[\]{}|]/g,I$=/^\[object .+?Constructor\]$/,B$=Function.prototype,D$=Object.prototype,P$=B$.toString,O$=D$.hasOwnProperty,A$=RegExp("^"+P$.call(O$).replace(N$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function R$(t){if(!Yn(t)||x$(t))return!1;var e=w$(t)?A$:I$;return e.test(T$(t))}var L$=R$;function M$(t,e){return t==null?void 0:t[e]}var F$=M$;function $$(t,e){var r=F$(t,e);return L$(r)?r:void 0}var Qu=$$,V$=Qu(Object,"create"),ro=V$;function q$(){this.__data__=ro?ro(null):{},this.size=0}var z$=q$;function H$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var K$=H$,G$="__lodash_hash_undefined__",U$=Object.prototype,j$=U$.hasOwnProperty;function W$(t){var e=this.__data__;if(ro){var r=e[t];return r===G$?void 0:r}return j$.call(e,t)?e[t]:void 0}var Y$=W$,Z$=Object.prototype,X$=Z$.hasOwnProperty;function Q$(t){var e=this.__data__;return ro?e[t]!==void 0:X$.call(e,t)}var J$=Q$,eV="__lodash_hash_undefined__";function tV(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ro&&e===void 0?eV:e,this}var rV=tV;function Ha(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])}}Ha.prototype.clear=z$,Ha.prototype.delete=K$,Ha.prototype.get=Y$,Ha.prototype.has=J$,Ha.prototype.set=rV;var Eb=Ha;function nV(){this.__data__=[],this.size=0}var aV=nV;function iV(t,e){return t===e||t!==t&&e!==e}var xb=iV;function oV(t,e){for(var r=t.length;r--;)if(xb(t[r][0],e))return r;return-1}var Ds=oV,sV=Array.prototype,lV=sV.splice;function uV(t){var e=this.__data__,r=Ds(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():lV.call(e,r,1),--this.size,!0}var cV=uV;function dV(t){var e=this.__data__,r=Ds(e,t);return r<0?void 0:e[r][1]}var fV=dV;function hV(t){return Ds(this.__data__,t)>-1}var pV=hV;function vV(t,e){var r=this.__data__,n=Ds(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var gV=vV;function Ka(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])}}Ka.prototype.clear=aV,Ka.prototype.delete=cV,Ka.prototype.get=fV,Ka.prototype.has=pV,Ka.prototype.set=gV;var mV=Ka,yV=Qu(fs,"Map"),bV=yV;function wV(){this.size=0,this.__data__={hash:new Eb,map:new(bV||mV),string:new Eb}}var CV=wV;function EV(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var xV=EV;function kV(t,e){var r=t.__data__;return xV(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ps=kV;function SV(t){var e=Ps(this,t).delete(t);return this.size-=e?1:0,e}var _V=SV;function TV(t){return Ps(this,t).get(t)}var NV=TV;function IV(t){return Ps(this,t).has(t)}var BV=IV;function DV(t,e){var r=Ps(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var PV=DV;function Ga(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])}}Ga.prototype.clear=CV,Ga.prototype.delete=_V,Ga.prototype.get=NV,Ga.prototype.has=BV,Ga.prototype.set=PV;var kb=Ga,OV="Expected a function";function Ju(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(OV);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(Ju.Cache||kb),r}Ju.Cache=kb;var AV=Ju,RV=500;function LV(t){var e=AV(t,function(n){return r.size===RV&&r.clear(),n}),r=e.cache;return e}var MV=LV,FV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$V=/\\(\\)?/g,VV=MV(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(FV,function(r,n,a,i){e.push(a?i.replace($V,"$1"):n||r)}),e}),Sb=VV;function qV(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 _b=qV,zV=1/0,Tb=Oa?Oa.prototype:void 0,Nb=Tb?Tb.toString:void 0;function Ib(t){if(typeof t=="string")return t;if(Bs(t))return _b(t,Ib)+"";if(Ui(t))return Nb?Nb.call(t):"";var e=t+"";return e=="0"&&1/t==-zV?"-0":e}var HV=Ib;function KV(t){return t==null?"":HV(t)}var Bb=KV;function GV(t,e){return Bs(t)?t:p$(t,e)?[t]:Sb(Bb(t))}var Db=GV,UV=1/0;function jV(t){if(typeof t=="string"||Ui(t))return t;var e=t+"";return e=="0"&&1/t==-UV?"-0":e}var ec=jV;function WV(t,e){e=Db(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[ec(e[r++])];return r&&r==n?t:void 0}var YV=WV;function ZV(t,e,r){var n=t==null?void 0:YV(t,e);return n===void 0?r:n}var XV=ZV,QV=function(){try{var t=Qu(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Pb=QV;function JV(t,e,r){e=="__proto__"&&Pb?Pb(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var eq=JV,tq=Object.prototype,rq=tq.hasOwnProperty;function nq(t,e,r){var n=t[e];(!(rq.call(t,e)&&xb(n,r))||r===void 0&&!(e in t))&&eq(t,e,r)}var aq=nq,iq=9007199254740991,oq=/^(?:0|[1-9]\d*)$/;function sq(t,e){var r=typeof t;return e=e??iq,!!e&&(r=="number"||r!="symbol"&&oq.test(t))&&t>-1&&t%1==0&&t<e}var lq=sq;function uq(t,e,r,n){if(!Yn(t))return t;e=Db(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=ec(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=Yn(d)?d:lq(e[a+1])?[]:{})}aq(l,c,u),l=l[c]}return t}var cq=uq;function dq(t,e,r){return t==null?t:cq(t,e,r)}var fq=dq;function hq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var pq=hq;function vq(t){return Bs(t)?_b(t,ec):Ui(t)?[t]:pq(Sb(Bb(t)))}var gq=vq,mq={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&&gq(a);if(o.allowGetting&&i===void 0){var v;return d&&(o.beforeGet(d),h&&d._private[o.field][a]===void 0?v=XV(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=p0({},a,i);o.beforeSet(l,g);for(var m=0,y=u.length;m<y;m++){var b=u[m];o.canSet(b)&&(h&&d._private[o.field][a]===void 0?fq(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(!gn(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 m=0,y=c.length;m<y;m++)for(var b=c[m]._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}}},yq={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 za(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={};[u$,mq,yq].forEach(function(t){Se(Ve,t)});var bq={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},Os={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 Ra(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}};Os.className=Os.classNames=Os.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ft,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},tc=[{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 DM(t.selector,e.selector)}),wq=function(){for(var t={},e,r=0;r<tc.length;r++)e=tc[r],t[e.selector]=e.matches;return t}(),Cq=function(e,r){return wq[e](r)},Eq="("+tc.map(function(t){return t.selector}).join("|")+")",Ua=function(e){return e.replace(new RegExp("\\\\("+Re.metaChar+")","g"),function(r,n){return n})},Cn=function(e,r,n){e[e.length-1]=n},rc=[{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:Eq,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:Ua(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:Ua(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:Ua(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:Ua(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:Ua(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:Ua(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}),Cn(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}),Cn(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]}),Cn(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}),Cn(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}),Cn(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}),Cn(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}),Cn(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}),Cn(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)}}];rc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var xq=function(e){for(var r,n,a,i=0;i<rc.length;i++){var o=rc[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}},kq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Sq=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=kq(n);;){var i=xq(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},_q=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,m=d.operator;return"["+g+n(e(m))+r(v)+"]"}case ve.DATA_BOOL:{var y=d.operator,b=d.field;return"["+e(y)+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},Tq={parse:Sq,toString:_q},Ob=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},Nq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Iq=function(e){return e!==void 0},nc=function(e,r){return e.data(r)},Bq=function(e,r){return e[r]()},Je=[],Ye=function(e,r){return e.checks.every(function(n){return Je[n.type](n,r)})};Je[ve.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Je[ve.STATE]=function(t,e){var r=t.value;return Cq(r,e)},Je[ve.ID]=function(t,e){var r=t.value;return e.id()===r},Je[ve.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Je[ve.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Ob(Bq(e,r),n,a)},Je[ve.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Ob(nc(e,r),n,a)},Je[ve.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Nq(nc(e,r),n)},Je[ve.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Iq(nc(e,r))},Je[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)},Je[ve.NODE_NEIGHBOR]=function(t,e){return Ye(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ye(t.neighbor,r)})},Je[ve.DIRECTED_EDGE]=function(t,e){return Ye(t.source,e.source())&&Ye(t.target,e.target())},Je[ve.NODE_SOURCE]=function(t,e){return Ye(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ye(t.target,r)})},Je[ve.NODE_TARGET]=function(t,e){return Ye(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ye(t.source,r)})},Je[ve.CHILD]=function(t,e){return Ye(t.child,e)&&Ye(t.parent,e.parent())},Je[ve.PARENT]=function(t,e){return Ye(t.parent,e)&&e.children().some(function(r){return Ye(t.child,r)})},Je[ve.DESCENDANT]=function(t,e){return Ye(t.descendant,e)&&e.ancestors().some(function(r){return Ye(t.ancestor,r)})},Je[ve.ANCESTOR]=function(t,e){return Ye(t.ancestor,e)&&e.descendants().some(function(r){return Ye(t.descendant,r)})},Je[ve.COMPOUND_SPLIT]=function(t,e){return Ye(t.subject,e)&&Ye(t.left,e)&&Ye(t.right,e)},Je[ve.TRUE]=function(){return!0},Je[ve.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},Je[ve.FILTER]=function(t,e){var r=t.value;return r(e)};var Dq=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)},Pq=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ye(a,e))return!0}return!1},Oq={matches:Pq,filter:Dq},En=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):Qe("A selector must be created from a string; found "))},xn=En.prototype;[Tq,Oq].forEach(function(t){return Se(xn,t)}),xn.text=function(){return this.inputText},xn.size=function(){return this.length},xn.eq=function(t){return this[t]},xn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},xn.addQuery=function(t){this[this.length++]=t},xn.selector=xn.toString;var kn={allAre:function(e){var r=new En(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new En(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())})}};kn.allAreNeighbours=kn.allAreNeighbors,kn.has=kn.contains,kn.equal=kn.equals=kn.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=Zn(d),g=v[p];return g||(v[p]=e.call(u,a,i,o,l))}else return e.call(u,a,i,o,l)}},ja={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 ac(t,e,r,n){for(var a=[],i=new Ra,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 Ab(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)}}ja.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Ab)};function Rb(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}ja.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Rb)};function Aq(t,e,r){Rb(t,e,r),Ab(t,e,r)}ja.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Aq)},ja.ancestors=ja.parents;var no,Lb;no=Lb={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}},no.attr=no.data,no.removeAttr=no.removeData;var Rq=Lb,As={};function ic(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(As,{degree:ic(function(t,e){return e.source().same(e.target())?2:1}),indegree:ic(function(t,e){return e.target().same(t)?1:0}),outdegree:ic(function(t,e){return e.source().same(t)?1:0})});function Wa(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(As,{minDegree:Wa("degree",function(t,e){return t<e}),maxDegree:Wa("degree",function(t,e){return t>e}),minIndegree:Wa("indegree",function(t,e){return t<e}),maxIndegree:Wa("indegree",function(t,e){return t>e}),minOutdegree:Wa("outdegree",function(t,e){return t<e}),maxOutdegree:Wa("outdegree",function(t,e){return t>e})}),Se(As,{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,Mb,Fb=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()}}},$b={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){Fb(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=Mb={position:Ve.data($b),silentPosition:Ve.data(Se({},$b,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Fb(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(H0(l,i,o))}else{var f=n.position();return l=ys(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,m=g&&g.length>0,y=m;m&&(g=g[0]);var b=y?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 Lq=Mb,Ya,Sn;Ya=Sn={},Sn.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}},Sn.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)},Sn.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 m=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(m=m*100/d.width.val);var y=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(y=y*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,m),C=w.biasDiff,x=w.biasComplementDiff,k=v(d.height.val-f.h,y,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)},ra=function(e,r){return r==null?e:yr(e,r.x1,r.y1,r.x2,r.y2)},ao=function(e,r,n){return gr(e,r,n)},Rs=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,ws(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},oc=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=ao(o,"labelWidth",n),f=ao(o,"labelHeight",n),h=ao(o,"labelX",n),v=ao(o,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,m=r.isEdge(),y=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(m)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,L=O[R]=O[R]||{};L.x1=N,L.y1=P,L.x2=B,L.y2=D,L.w=B-N,L.h=D-P;var A=m&&y.strValue==="autorotate",q=y.pfValue!=null&&y.pfValue!==0;if(A||q){var U=A?ao(i.rstyle,"labelAngle",n):y.pfValue,z=Math.cos(U),H=Math.sin(U),J=(N+B)/2,F=(P+D)/2;if(!m){switch(c.value){case"left":J=B;break;case"right":J=N;break}switch(u.value){case"top":F=D;break;case"bottom":F=P;break}}var $=function(ce,ae){return ce=ce-J,ae=ae-F,{x:ce*z-ae*H+J,y:ce*H+ae*z+F}},V=$(N,P),G=$(N,D),j=$(B,P),M=$(B,D);N=Math.min(V.x,G.x,j.x,M.x),B=Math.max(V.x,G.x,j.x,M.x),P=Math.min(V.y,G.y,j.y,M.y),D=Math.max(V.y,G.y,j.y,M.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}},Mq=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(Cs(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=a5(e,d,f);G0(e,p)}}}},Fq=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,m=l.rstyle,y=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.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&&Mq(o,e)}else if(u&&r.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(m.srcX,m.midX,m.tgtX),f=Math.max(m.srcX,m.midX,m.tgtX),h=Math.min(m.srcY,m.midY,m.tgtY),v=Math.max(m.srcY,m.midY,m.tgtY),d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v),O==="haystack"){var L=m.haystackPts;if(L&&L.length===2){if(d=L[0].x,h=L[0].y,f=L[1].x,v=L[1].y,d>f){var A=d;d=f,f=A}if(h>v){var q=h;h=v,v=q}yr(o,d-T,h-T,f+T,v+T)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var U;switch(O){case"bezier":case"unbundled-bezier":U=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":U=m.linePts;break}if(U!=null)for(var z=0;z<U.length;z++){var H=U[z];d=H.x-T,f=H.x+T,h=H.y-T,v=H.y+T,yr(o,d,h,f,v)}}}else{var J=e.source(),F=J.position(),$=e.target(),V=$.position();if(d=F.x,f=V.x,h=F.y,v=V.y,d>f){var G=d;d=f,f=G}if(h>v){var j=h;h=v,v=j}d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v)}if(a&&r.includeEdges&&u&&(Rs(o,e,"mid-source"),Rs(o,e,"mid-target"),Rs(o,e,"source"),Rs(o,e,"target")),a){var M=e.pstyle("ghost").value==="yes";if(M){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||{};U0(se,o),Cs(se,y),ws(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||{};U0(ce,o),Cs(ce,y),ws(ce,1);var ae=l.labelBounds=l.labelBounds||{};ae.all!=null?n5(ae.all):ae.all=Kt(),a&&r.includeLabels&&(r.includeMainLabels&&oc(o,e,null),u&&(r.includeSourceLabels&&oc(o,e,"source"),r.includeTargetLabels&&oc(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&&(Cs(o,y),ws(o,1)),o},Vb=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 kF([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},zb=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?Hb:Vb(r),l=o===Hb,c=qb(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=Fq(e,io),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=Kt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?ra(a,n.overlayBounds):ra(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?ra(a,n.labelBounds.all):(r.includeMainLabels&&ra(a,n.labelBounds.mainRot),r.includeSourceLabels&&ra(a,n.labelBounds.sourceRot),r.includeTargetLabels&&ra(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},io={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Hb=Vb(io),Kb=xt(io);Sn.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=io:t=Kb(t),e=zb(this[0],t);else{e=Kt(),t=t||io;var r=Kb(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=qb(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];ra(e,zb(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},Sn.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},Sn.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=r5(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Ya.boundingbox=Ya.bb=Ya.boundingBox,Ya.renderedBoundingbox=Ya.renderedBoundingBox;var $q=Sn,oo,so;oo=so={};var Gb=function(e){e.uppercaseName=x0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=x0(e.outerName),oo[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},oo["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},oo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},oo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};Gb({name:"width"}),Gb({name:"height"}),so.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},so.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},so.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Vq=so,qq=function(e,r){if(e.isEdge())return r(e)},zq=function(e,r){if(e.isEdge()){var n=e.cy();return ys(r(e),n.zoom(),n.pan())}},Hq=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return ys(o,i,a)})}},Kq=function(e){return e.renderer().getControlPoints(e)},Gq=function(e){return e.renderer().getSegmentPoints(e)},Uq=function(e){return e.renderer().getSourceEndpoint(e)},jq=function(e){return e.renderer().getTargetEndpoint(e)},Wq=function(e){return e.renderer().getEdgeMidpoint(e)},Ub={controlPoints:{get:Kq,mult:!0},segmentPoints:{get:Gq,mult:!0},sourceEndpoint:{get:Uq},targetEndpoint:{get:jq},midpoint:{get:Wq}},Yq=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Zq=Object.keys(Ub).reduce(function(t,e){var r=Ub[e],n=Yq(e);return t[e]=function(){return qq(this,r.get)},r.mult?t[n]=function(){return Hq(this,r.get)}:t[n]=function(){return zq(this,r.get)},t},{}),Xq=Se({},Lq,$q,Vq,Zq);/*!
35
+ */var vb=0,gb=1,mb=2,Zr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=vb,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))};Zr.prototype={fulfill:function(e){return yb(this,gb,"fulfillValue",e)},reject:function(e){return yb(this,mb,"rejectReason",e)},then:function(e,r){var n=this,a=new Zr;return n.onFulfilled.push(Cb(e,a,"fulfill")),n.onRejected.push(Cb(r,a,"reject")),bb(n),a.proxy}};var yb=function(e,r,n,a){return e.state===vb&&(e.state=r,e[n]=a,bb(e)),e},bb=function(e){e.state===gb?wb(e,"onFulfilled",e.fulfillValue):e.state===mb&&wb(e,"onRejected",e.rejectReason)},wb=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)}},Cb=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}u$(r,i)}}},u$=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ct(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)};Zr.all=function(t){return new Zr(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)})},Zr.resolve=function(t){return new Zr(function(e,r){e(t)})},Zr.reject=function(t){return new Zr(function(e,r){r(t)})};var Ha=typeof Promise<"u"?Promise:Zr,Zu=function(e,r,n){var a=Ou(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},ta=Zu.prototype;Se(ta,{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 Ha(function(a,i){n.push(function(){a()})})}}),ta.complete=ta.completed,ta.run=ta.play,ta.running=ta.playing;var c$={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 Zu(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=K0(h,p,v)}if(c&&r.panBy!=null){var g=r.panBy,m=l.pan();r.pan={x:m.x+g.x,y:m.y+g.y}}var y=r.center||r.centre;if(c&&y!=null){var b=l.getCenterPan(y.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 E=l.getZoomedViewport(r.zoom);E!=null?(E.zoomed&&(r.zoom=E.zoom),E.panned&&(r.pan=E.pan)):r.zoom=null}return new Zu(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}}},d$=Array.isArray,Bs=d$,f$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,h$=/^\w*$/;function p$(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ui(t)?!0:h$.test(t)||!f$.test(t)||e!=null&&t in Object(e)}var v$=p$,g$="[object AsyncFunction]",m$="[object Function]",y$="[object GeneratorFunction]",b$="[object Proxy]";function w$(t){if(!Yn(t))return!1;var e=B0(t);return e==m$||e==y$||e==g$||e==b$}var C$=w$,E$=fs["__core-js_shared__"],Xu=E$,Eb=function(){var t=/[^.]+$/.exec(Xu&&Xu.keys&&Xu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function x$(t){return!!Eb&&Eb in t}var k$=x$,S$=Function.prototype,_$=S$.toString;function T$(t){if(t!=null){try{return _$.call(t)}catch{}try{return t+""}catch{}}return""}var N$=T$,I$=/[\\^$.*+?()[\]{}|]/g,B$=/^\[object .+?Constructor\]$/,D$=Function.prototype,P$=Object.prototype,O$=D$.toString,A$=P$.hasOwnProperty,R$=RegExp("^"+O$.call(A$).replace(I$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L$(t){if(!Yn(t)||k$(t))return!1;var e=C$(t)?R$:B$;return e.test(N$(t))}var M$=L$;function F$(t,e){return t==null?void 0:t[e]}var $$=F$;function V$(t,e){var r=$$(t,e);return M$(r)?r:void 0}var Ju=V$,q$=Ju(Object,"create"),ro=q$;function z$(){this.__data__=ro?ro(null):{},this.size=0}var H$=z$;function K$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var G$=K$,U$="__lodash_hash_undefined__",j$=Object.prototype,W$=j$.hasOwnProperty;function Y$(t){var e=this.__data__;if(ro){var r=e[t];return r===U$?void 0:r}return W$.call(e,t)?e[t]:void 0}var Z$=Y$,X$=Object.prototype,J$=X$.hasOwnProperty;function Q$(t){var e=this.__data__;return ro?e[t]!==void 0:J$.call(e,t)}var eV=Q$,tV="__lodash_hash_undefined__";function rV(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ro&&e===void 0?tV:e,this}var nV=rV;function Ka(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])}}Ka.prototype.clear=H$,Ka.prototype.delete=G$,Ka.prototype.get=Z$,Ka.prototype.has=eV,Ka.prototype.set=nV;var xb=Ka;function aV(){this.__data__=[],this.size=0}var iV=aV;function oV(t,e){return t===e||t!==t&&e!==e}var kb=oV;function sV(t,e){for(var r=t.length;r--;)if(kb(t[r][0],e))return r;return-1}var Ds=sV,lV=Array.prototype,uV=lV.splice;function cV(t){var e=this.__data__,r=Ds(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():uV.call(e,r,1),--this.size,!0}var dV=cV;function fV(t){var e=this.__data__,r=Ds(e,t);return r<0?void 0:e[r][1]}var hV=fV;function pV(t){return Ds(this.__data__,t)>-1}var vV=pV;function gV(t,e){var r=this.__data__,n=Ds(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var mV=gV;function Ga(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])}}Ga.prototype.clear=iV,Ga.prototype.delete=dV,Ga.prototype.get=hV,Ga.prototype.has=vV,Ga.prototype.set=mV;var yV=Ga,bV=Ju(fs,"Map"),wV=bV;function CV(){this.size=0,this.__data__={hash:new xb,map:new(wV||yV),string:new xb}}var EV=CV;function xV(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var kV=xV;function SV(t,e){var r=t.__data__;return kV(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ps=SV;function _V(t){var e=Ps(this,t).delete(t);return this.size-=e?1:0,e}var TV=_V;function NV(t){return Ps(this,t).get(t)}var IV=NV;function BV(t){return Ps(this,t).has(t)}var DV=BV;function PV(t,e){var r=Ps(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var OV=PV;function Ua(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])}}Ua.prototype.clear=EV,Ua.prototype.delete=TV,Ua.prototype.get=IV,Ua.prototype.has=DV,Ua.prototype.set=OV;var Sb=Ua,AV="Expected a function";function Qu(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(AV);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(Qu.Cache||Sb),r}Qu.Cache=Sb;var RV=Qu,LV=500;function MV(t){var e=RV(t,function(n){return r.size===LV&&r.clear(),n}),r=e.cache;return e}var FV=MV,$V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,VV=/\\(\\)?/g,qV=FV(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace($V,function(r,n,a,i){e.push(a?i.replace(VV,"$1"):n||r)}),e}),_b=qV;function zV(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 Tb=zV,HV=1/0,Nb=Aa?Aa.prototype:void 0,Ib=Nb?Nb.toString:void 0;function Bb(t){if(typeof t=="string")return t;if(Bs(t))return Tb(t,Bb)+"";if(Ui(t))return Ib?Ib.call(t):"";var e=t+"";return e=="0"&&1/t==-HV?"-0":e}var KV=Bb;function GV(t){return t==null?"":KV(t)}var Db=GV;function UV(t,e){return Bs(t)?t:v$(t,e)?[t]:_b(Db(t))}var Pb=UV,jV=1/0;function WV(t){if(typeof t=="string"||Ui(t))return t;var e=t+"";return e=="0"&&1/t==-jV?"-0":e}var ec=WV;function YV(t,e){e=Pb(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[ec(e[r++])];return r&&r==n?t:void 0}var ZV=YV;function XV(t,e,r){var n=t==null?void 0:ZV(t,e);return n===void 0?r:n}var JV=XV,QV=function(){try{var t=Ju(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ob=QV;function eq(t,e,r){e=="__proto__"&&Ob?Ob(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var tq=eq,rq=Object.prototype,nq=rq.hasOwnProperty;function aq(t,e,r){var n=t[e];(!(nq.call(t,e)&&kb(n,r))||r===void 0&&!(e in t))&&tq(t,e,r)}var iq=aq,oq=9007199254740991,sq=/^(?:0|[1-9]\d*)$/;function lq(t,e){var r=typeof t;return e=e??oq,!!e&&(r=="number"||r!="symbol"&&sq.test(t))&&t>-1&&t%1==0&&t<e}var uq=lq;function cq(t,e,r,n){if(!Yn(t))return t;e=Pb(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=ec(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=Yn(d)?d:uq(e[a+1])?[]:{})}iq(l,c,u),l=l[c]}return t}var dq=cq;function fq(t,e,r){return t==null?t:dq(t,e,r)}var hq=fq;function pq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var vq=pq;function gq(t){return Bs(t)?Tb(t,ec):Ui(t)?[t]:vq(_b(Db(t)))}var mq=gq,yq={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&&mq(a);if(o.allowGetting&&i===void 0){var v;return d&&(o.beforeGet(d),h&&d._private[o.field][a]===void 0?v=JV(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=v0({},a,i);o.beforeSet(l,g);for(var m=0,y=u.length;m<y;m++){var b=u[m];o.canSet(b)&&(h&&d._private[o.field][a]===void 0?hq(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,E,k=Object.keys(w);o.beforeSet(l,w);for(var x=0;x<k.length;x++){C=k[x],E=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]=E)}}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(!gn(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 m=0,y=c.length;m<y;m++)for(var b=c[m]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var E=w[C],k=!i.immutableKeys[E];k&&(b[E]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},bq={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 Ha(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={};[c$,yq,bq].forEach(function(t){Se(Ve,t)});var wq={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},Os={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 La(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}};Os.className=Os.classNames=Os.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ft,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},tc=[{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 PM(t.selector,e.selector)}),Cq=function(){for(var t={},e,r=0;r<tc.length;r++)e=tc[r],t[e.selector]=e.matches;return t}(),Eq=function(e,r){return Cq[e](r)},xq="("+tc.map(function(t){return t.selector}).join("|")+")",ja=function(e){return e.replace(new RegExp("\\\\("+Re.metaChar+")","g"),function(r,n){return n})},Cn=function(e,r,n){e[e.length-1]=n},rc=[{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:xq,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:ja(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:ja(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:ja(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:ja(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:ja(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:ja(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}),Cn(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}),Cn(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]}),Cn(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}),Cn(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}),Cn(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}),Cn(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}),Cn(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}),Cn(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)}}];rc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var kq=function(e){for(var r,n,a,i=0;i<rc.length;i++){var o=rc[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}},Sq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},_q=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=Sq(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 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},Tq=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,m=d.operator;return"["+g+n(e(m))+r(v)+"]"}case ve.DATA_BOOL:{var y=d.operator,b=d.field;return"["+e(y)+b+"]"}case ve.DATA_EXIST:{var w=d.field;return"["+w+"]"}case ve.META_COMPARE:{var C=d.operator,E=d.field;return"[["+E+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),x=i(d.subject,f),_=i(d.right,f);return k+(k.length>0?" ":"")+x+_}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},Nq={parse:_q,toString:Tq},Ab=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},Iq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Bq=function(e){return e!==void 0},nc=function(e,r){return e.data(r)},Dq=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 Eq(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 Ab(Dq(e,r),n,a)},Qe[ve.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Ab(nc(e,r),n,a)},Qe[ve.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Iq(nc(e,r),n)},Qe[ve.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Bq(nc(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 Pq=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)},Oq=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ye(a,e))return!0}return!1},Aq={matches:Oq,filter:Pq},En=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 "))},xn=En.prototype;[Nq,Aq].forEach(function(t){return Se(xn,t)}),xn.text=function(){return this.inputText},xn.size=function(){return this.length},xn.eq=function(t){return this[t]},xn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},xn.addQuery=function(t){this[this.length++]=t},xn.selector=xn.toString;var kn={allAre:function(e){var r=new En(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new En(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())})}};kn.allAreNeighbours=kn.allAreNeighbors,kn.has=kn.contains,kn.equal=kn.equals=kn.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=Zn(d),g=v[p];return g||(v[p]=e.call(u,a,i,o,l))}else return e.call(u,a,i,o,l)}},Wa={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 ac(t,e,r,n){for(var a=[],i=new La,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 Rb(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)}}Wa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Rb)};function Lb(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Wa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Lb)};function Rq(t,e,r){Lb(t,e,r),Rb(t,e,r)}Wa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Rq)},Wa.ancestors=Wa.parents;var no,Mb;no=Mb={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}},no.attr=no.data,no.removeAttr=no.removeData;var Lq=Mb,As={};function ic(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(As,{degree:ic(function(t,e){return e.source().same(e.target())?2:1}),indegree:ic(function(t,e){return e.target().same(t)?1:0}),outdegree:ic(function(t,e){return e.source().same(t)?1:0})});function Ya(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(As,{minDegree:Ya("degree",function(t,e){return t<e}),maxDegree:Ya("degree",function(t,e){return t>e}),minIndegree:Ya("indegree",function(t,e){return t<e}),maxIndegree:Ya("indegree",function(t,e){return t>e}),minOutdegree:Ya("outdegree",function(t,e){return t<e}),maxOutdegree:Ya("outdegree",function(t,e){return t>e})}),Se(As,{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,Fb,$b=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()}}},Vb={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){$b(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=Fb={position:Ve.data(Vb),silentPosition:Ve.data(Se({},Vb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){$b(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(K0(l,i,o))}else{var f=n.position();return l=ys(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,m=g&&g.length>0,y=m;m&&(g=g[0]);var b=y?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 Mq=Fb,Za,Sn;Za=Sn={},Sn.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}},Sn.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)},Sn.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 m=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(m=m*100/d.width.val);var y=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(y=y*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,m),C=w.biasDiff,E=w.biasComplementDiff,k=v(d.height.val-f.h,y,b),x=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+E)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-x+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)},ra=function(e,r){return r==null?e:yr(e,r.x1,r.y1,r.x2,r.y2)},ao=function(e,r,n){return gr(e,r,n)},Rs=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,ws(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},oc=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=ao(o,"labelWidth",n),f=ao(o,"labelHeight",n),h=ao(o,"labelX",n),v=ao(o,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,m=r.isEdge(),y=r.pstyle(a+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,C=w/2,E=r.pstyle("text-background-padding").pfValue,k=2,x=f,_=d,S=_/2,T=x/2,N,B,P,D;if(m)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-x,D=v;break;case"center":P=v-T,D=v+T;break;case"bottom":P=v,D=v+x;break}}N+=p-Math.max(b,C)-E-k,B+=p+Math.max(b,C)+E+k,P+=g-Math.max(b,C)-E-k,D+=g+Math.max(b,C)+E+k;var R=n||"main",O=i.labelBounds,L=O[R]=O[R]||{};L.x1=N,L.y1=P,L.x2=B,L.y2=D,L.w=B-N,L.h=D-P;var A=m&&y.strValue==="autorotate",q=y.pfValue!=null&&y.pfValue!==0;if(A||q){var U=A?ao(i.rstyle,"labelAngle",n):y.pfValue,z=Math.cos(U),H=Math.sin(U),Q=(N+B)/2,F=(P+D)/2;if(!m){switch(c.value){case"left":Q=B;break;case"right":Q=N;break}switch(u.value){case"top":F=D;break;case"bottom":F=P;break}}var $=function(ce,ae){return ce=ce-Q,ae=ae-F,{x:ce*z-ae*H+Q,y:ce*H+ae*z+F}},V=$(N,P),G=$(N,D),j=$(B,P),M=$(B,D);N=Math.min(V.x,G.x,j.x,M.x),B=Math.max(V.x,G.x,j.x,M.x),P=Math.min(V.y,G.y,j.y,M.y),D=Math.max(V.y,G.y,j.y,M.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}},Fq=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(Cs(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=i5(e,d,f);U0(e,p)}}}},$q=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,m=l.rstyle,y=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var C=0,E=0;a&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(E=e.pstyle("overlay-padding").value));var k=0,x=0;a&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(x=e.pstyle("underlay-padding").value));var _=Math.max(E,x),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&&Fq(o,e)}else if(u&&r.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(m.srcX,m.midX,m.tgtX),f=Math.max(m.srcX,m.midX,m.tgtX),h=Math.min(m.srcY,m.midY,m.tgtY),v=Math.max(m.srcY,m.midY,m.tgtY),d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v),O==="haystack"){var L=m.haystackPts;if(L&&L.length===2){if(d=L[0].x,h=L[0].y,f=L[1].x,v=L[1].y,d>f){var A=d;d=f,f=A}if(h>v){var q=h;h=v,v=q}yr(o,d-T,h-T,f+T,v+T)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var U;switch(O){case"bezier":case"unbundled-bezier":U=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":U=m.linePts;break}if(U!=null)for(var z=0;z<U.length;z++){var H=U[z];d=H.x-T,f=H.x+T,h=H.y-T,v=H.y+T,yr(o,d,h,f,v)}}}else{var Q=e.source(),F=Q.position(),$=e.target(),V=$.position();if(d=F.x,f=V.x,h=F.y,v=V.y,d>f){var G=d;d=f,f=G}if(h>v){var j=h;h=v,v=j}d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v)}if(a&&r.includeEdges&&u&&(Rs(o,e,"mid-source"),Rs(o,e,"mid-target"),Rs(o,e,"source"),Rs(o,e,"target")),a){var M=e.pstyle("ghost").value==="yes";if(M){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||{};j0(se,o),Cs(se,y),ws(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||{};j0(ce,o),Cs(ce,y),ws(ce,1);var ae=l.labelBounds=l.labelBounds||{};ae.all!=null?a5(ae.all):ae.all=Kt(),a&&r.includeLabels&&(r.includeMainLabels&&oc(o,e,null),u&&(r.includeSourceLabels&&oc(o,e,"source"),r.includeTargetLabels&&oc(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&&(Cs(o,y),ws(o,1)),o},qb=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},zb=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(o){return Math.round(o)};return SF([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},Hb=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?Kb:qb(r),l=o===Kb,c=zb(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=$q(e,io),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=Kt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?ra(a,n.overlayBounds):ra(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?ra(a,n.labelBounds.all):(r.includeMainLabels&&ra(a,n.labelBounds.mainRot),r.includeSourceLabels&&ra(a,n.labelBounds.sourceRot),r.includeTargetLabels&&ra(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},io={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Kb=qb(io),Gb=xt(io);Sn.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=io:t=Gb(t),e=Hb(this[0],t);else{e=Kt(),t=t||io;var r=Gb(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=zb(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];ra(e,Hb(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},Sn.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},Sn.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=n5(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Za.boundingbox=Za.bb=Za.boundingBox,Za.renderedBoundingbox=Za.renderedBoundingBox;var Vq=Sn,oo,so;oo=so={};var Ub=function(e){e.uppercaseName=k0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=k0(e.outerName),oo[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},oo["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},oo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},oo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};Ub({name:"width"}),Ub({name:"height"}),so.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},so.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},so.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var qq=so,zq=function(e,r){if(e.isEdge())return r(e)},Hq=function(e,r){if(e.isEdge()){var n=e.cy();return ys(r(e),n.zoom(),n.pan())}},Kq=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return ys(o,i,a)})}},Gq=function(e){return e.renderer().getControlPoints(e)},Uq=function(e){return e.renderer().getSegmentPoints(e)},jq=function(e){return e.renderer().getSourceEndpoint(e)},Wq=function(e){return e.renderer().getTargetEndpoint(e)},Yq=function(e){return e.renderer().getEdgeMidpoint(e)},jb={controlPoints:{get:Gq,mult:!0},segmentPoints:{get:Uq,mult:!0},sourceEndpoint:{get:jq},targetEndpoint:{get:Wq},midpoint:{get:Yq}},Zq=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Xq=Object.keys(jb).reduce(function(t,e){var r=jb[e],n=Zq(e);return t[e]=function(){return zq(this,r.get)},r.mult?t[n]=function(){return Kq(this,r.get)}:t[n]=function(){return Hq(this,r.get)},t},{}),Jq=Se({},Mq,Vq,qq,Xq);/*!
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 jb=function(e,r){this.recycle(e,r)};function lo(){return!1}function Ls(){return!0}jb.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=lo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ls:lo):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=Ls;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ls;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ls,this.stopPropagation()},isDefaultPrevented:lo,isPropagationStopped:lo,isImmediatePropagationStopped:lo};var Wb=/^([^.]+)(\.(?:[^.]+))?$/,Qq=".*",Yb={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},Zb=Object.keys(Yb),Jq={};function Ms(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jq,e=arguments.length>1?arguments[1]:void 0,r=0;r<Zb.length;r++){var n=Zb[r];this[n]=t[n]||Yb[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var _n=Ms.prototype,Xb=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(!gn(d)){var f=d.match(Wb);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}}}},Qb=function(e,r){return e.addEventFields(e.context,r),new jb(r.type,r)},ez=function(e,r,n){if(wM(n)){r(e,n);return}else if(Ae(n)){r(e,Qb(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!gn(o)){var l=o.match(Wb);if(l){var c=l[1],u=l[2]?l[2]:null,d=Qb(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};_n.on=_n.addListener=function(t,e,r,n,a){return Xb(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},_n.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},_n.removeListener=_n.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=IF(this.listeners));for(var i=this.listeners,o=function(u){var d=i[u];Xb(a,function(f,h,v,p,g,m){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!m||d.callback===m))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)o(l);return this},_n.removeAllListeners=function(){return this.removeListener("*")},_n.emit=_n.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),ez(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===Qq)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&DF(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 tz={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&&zi(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()}},Fs=function(e){return Ee(e)?new En(e):e},Jb={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Ms(tz,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=Fs(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=Fs(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=Fs(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=Fs(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(Jb);var e1={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 En(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,m=f.hasElementWithId(g);m?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=e1;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 rz={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}},t1=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"?Mu: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()},$s={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(t1)},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:Mu-1}else{var i=r.source,o=r.target,l=i.zDepth(),c=o.zDepth();return Math.max(l,c,0)}}}};$s.each=$s.forEach;var nz=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ct(Symbol))!=e&&ct(Symbol.iterator)!=e;r&&($s[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return p0({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};nz();var az=xt({nodeDimensionsIncludeLabels:!1}),Vs={layoutDimensions:function(e){e=az(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=Hi(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);i5(k,S.x,S.y)}return k},h=f(),v=Hi(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],m=v(g,p),y=r.animateFilter==null||r.animateFilter(g,p);if(y){var b=g.animation({position:m,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(m)}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}),za.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}))}};Vs.createLayout=Vs.makeLayout=Vs.layout;function r1(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 qs(t,e){return t=Zn(t),function(n){return r1(t,e,n)}}function zs(t,e){t=Zn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return r1(t,r,a)}}var kt={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 sc(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 lc(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||sc(i,n);var c=l.source,u=l.target;return r(c)&&(!o||sc(c,r))&&(c===u||r(u)&&(!o||sc(u,r)))}}}var Za=qs("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});kt.takesUpSpace=zs("takesUpSpace",lc({ok:Za}));var iz=qs("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Za(t)}),oz=qs("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Za(t)});kt.interactive=zs("interactive",lc({ok:iz,parentOk:oz,edgeOkViaNode:Za})),kt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var sz=qs("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Za(t)}),lz=Za;kt.visible=zs("visible",lc({ok:sz,edgeOkViaNode:lz})),kt.hidden=function(){var t=this[0];if(t)return!t.visible()},kt.isBundledBezier=zs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),kt.bypass=kt.css=kt.style,kt.renderedCss=kt.renderedStyle,kt.removeBypass=kt.removeCss=kt.removeStyle,kt.pstyle=kt.parsedStyle;var Tn={};function n1(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 Xa(t){Tn[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]}},Tn[t.on]=n1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Tn[t.off]=n1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Xa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Xa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Xa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Xa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Tn.deselect=Tn.unselect,Tn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Xa({field:"active",on:"activate",off:"unactivate"}),Xa({field:"pannable",on:"panify",off:"unpanify"}),Tn.inactive=function(){var t=this[0];if(t)return!t._private.active};var It={},a1=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)}},i1=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)}},o1=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)}};It.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Se(It,{roots:a1({noIncomingEdges:!0}),leaves:a1({noOutgoingEdges:!0}),outgoers:nr(i1({outgoing:!0}),"outgoers"),successors:o1({outgoing:!0}),incomers:nr(i1({incoming:!0}),"incomers"),predecessors:o1({incoming:!0})}),Se(It,{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)}}),It.neighbourhood=It.neighborhood,It.closedNeighbourhood=It.closedNeighborhood,It.openNeighbourhood=It.openNeighborhood,Se(It,{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:s1({attr:"source"}),targets:s1({attr:"target"})});function s1(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(It,{edgesWith:nr(l1(),"edgesWith"),edgesTo:nr(l1({thisIsSrc:!0}),"edgesTo")});function l1(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(It,{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(u1(),"parallelEdges"),codirectedEdges:nr(u1({codirected:!0}),"codirectedEdges")});function u1(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],m=g._private.data,y=m.target,b=m.source,w=y===h&&b===f,C=f===y&&h===b;(o.codirected&&w||!o.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}Se(It,{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]}}),It.componentsOf=It.components;var St=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&&Ae(r[0])&&!zi(r[0])){o=!0;for(var l=[],c=new Ra,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=V0();else if(e.hasElementWithId(h.id)||c.has(h.id))continue;var v=new ms(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 m=r[p][0];if(m!=null){var y=m._private.data.id;(!n||!i.has(y))&&(n&&i.set(y,{index:this.length,ele:m}),this[this.length]=m,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=ms.prototype=St.prototype=Object.create(Array.prototype);Ge.instanceString=function(){return"collection"},Ge.spawn=function(t,e){return new St(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 w0(this)?this:new St(this._private.cy,[this])},Ge.unique=function(){return new St(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 St(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,m,y){var b=t[g];b!=null&&b!==n[g]&&(b?e[m]():e[y]())};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 ms(t,a,!1);e.push(i)}return new St(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=V0();else if(de(g.id))g.id=""+g.id;else if(gn(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 m=g.id;if(v.isNode()){var y=p.position;y.x==null&&(y.x=0),y.y==null&&(y.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 `"+m+"` with unspecified "+E),x=!0):n.hasElementWithId(_)||(Qe("Can not create edge `"+m+"` 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(m,{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 L=!1,A=O;!A.empty();){if(B.same(A)){L=!0,P.parent=void 0;break}A=A.parent()}L||(O[0]._private.children.push(B),B._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var q=l.length===r.length?r:new St(n,l),U=0;U<q.length;U++){var z=q[U];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}var H;a.hasCompoundNodes?H=n.collection().merge(q).merge(q.connectedNodes()).merge(q.parent()):H=q,H.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?q.emitAndNotify("add"):e&&q.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;yn(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,L=D.id();yn(O,R),R._private.parent=null,p.ids[L]||(p.ids[L]=!0,p.push(D))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var y=n[m];if(y.isEdge()){var b=y.source()[0],w=y.target()[0];h(b,y),h(w,y);for(var C=y.parallelEdges(),x=0;x<C.length;x++){var k=C[x];v(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var E=y.parent();E.length!==0&&g(E,y)}e&&(y._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 St(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],m=g._private.data;g.isNode()&&(m.parent=h)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[hb,bq,Os,kn,ja,Rq,As,Xq,Jb,e1,rz,$s,Vs,kt,Tn,It].forEach(function(t){Se(Ge,t)});var uz={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 St(n,i)}}else if(Ke(e)){var c=e;r=new St(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 m=0,y=g.length;m<y;m++){var b=Se({group:p},g[m]);d.push(b)}}r=new St(n,d)}else{var w=e;r=new ms(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 cz(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 m(T,N,B){return((v(N,B)*T+p(N,B))*T+g(N))*T}function y(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=y(N,t,r);if(P===0)return N;var D=m(N,t,r)-T;N-=D/P}return N}function w(){for(var T=0;T<c;++T)h[T]=m(T*u,t,r)}function C(T,N,B){var P,D,R=0;do D=N+(B-N)/2,P=m(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=y(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:m(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 dz=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=cz(e,r,n,a);return function(o,l,c){return o+(l-o)*i(c)}},Hs={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 Hs.linear;var a=dz(e,r,n);return function(i,o,l){return i+(o-i)*a(l)}},"cubic-bezier":Ue};function c1(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 d1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Qa(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=d1(t,a),l=d1(e,a);if(de(o)&&de(l))return c1(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=c1(i,d,f,r,n);c.push(h)}else c.push(f)}return c}}function fz(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=Hs.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(q){return+q})),p.length>0?(v==="spring"&&p.push(o.duration),o.easingImpl=Hs[v].apply(null,p)):o.easingImpl=Hs[v]}var g=o.easingImpl,m;if(o.duration===0?m=1:m=(r-c)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var y=o.startPosition,b=o.position;if(b&&a&&!t.locked()){var w={};uo(y.x,b.x)&&(w.x=Qa(y.x,b.x,m,g)),uo(y.y,b.y)&&(w.y=Qa(y.y,b.y,m,g)),t.position(w)}var C=o.startPan,x=o.pan,k=i.pan,E=x!=null&&n;E&&(uo(C.x,x.x)&&(k.x=Qa(C.x,x.x,m,g)),uo(C.y,x.y)&&(k.y=Qa(C.y,x.y,m,g)),t.emit("pan"));var _=o.startZoom,S=o.zoom,T=S!=null&&n;T&&(uo(_,S)&&(i.zoom=Qi(i.minZoom,Qa(_,S,m,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],L=d.properties[O.name],A=Qa(O,R,m,g,L);d.overrideBypass(t,D,A)}t.emit("style")}}return o.progress=m,m}function uo(t,e){return t==null||e==null?!1:de(t)&&de(e)?!0:!!(t&&e)}function hz(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function f1(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 m=p.shift();m&&v.push(m)}for(var y=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,y(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||hz(d,w,t),fz(d,w,t,f),C.applying&&(C.applying=!1),y(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,y(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&&ps(function(i){f1(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){f1(o,e)},n.beforeRenderPriorities.animations):r()}},vz={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&&zi(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}},Ks=function(e){return Ee(e)?new En(e):e},h1={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ms(vz,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Ks(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Ks(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Ks(r),n),this},once:function(e,r,n){return this.emitter().one(e,Ks(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(h1);var uc={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)}};uc.jpeg=uc.jpg;var Gs={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(Se({},e,{cy:r,eles:i}));return o}};Gs.createLayout=Gs.makeLayout=Gs.layout;var gz={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)}})}},mz=xt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),cc={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=mz(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)}};cc.invalidateDimensions=cc.resize;var Us={collection:function(e,r){return Ee(e)?this.$(e):Zt(e)?e.collection():Ke(e)?(r||(r={}),new St(this,e,r.unique,r.removed)):new St(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}};Us.elements=Us.filter=Us.$;var Bt={},co="t",yz="f";Bt.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},Bt.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]===co,f=e[c]===co,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 m=p[g],y=m.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],x=e[w]===co;if(x&&(b=C.properties[m.name]!=null,b))break}!l[y]&&!b&&(l[y]=!0,o.push(y))}}}return n[a]=o,o},Bt.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+=co:r+=yz}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Bt.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]===co;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},Bt.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}},Bt.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",c=t._private.style;n=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[Aa,ji]}for(var f=function(Y,se){return e.styleKeys[se][0]=Wi(Y,e.styleKeys[se][0])},h=function(Y,se){return e.styleKeys[se][1]=Yi(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,m=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?g-(Y*1024|0):Y},y=0;y<n.length;y++){var b=n[y],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(m(P),k),!S&&B!=null&&p(B,k)}else p(w.strValue,k)}}for(var D=[Aa,ji],R=0;R<a.length;R++){var O=a[R],L=e.styleKeys[O];D[0]=Wi(L[0],D[0]),D[1]=Yi(L[1],D[1])}e.styleKey=xF(D[0],D[1]);var A=e.styleKeys;e.labelDimsKey=mn(A.labelDimensions);var q=i(t,["label"],A.labelDimensions);if(e.labelKey=mn(q),e.labelStyleKey=mn(vs(A.commonLabel,q)),!l){var U=i(t,["source-label"],A.labelDimensions);e.sourceLabelKey=mn(U),e.sourceLabelStyleKey=mn(vs(A.commonLabel,U));var z=i(t,["target-label"],A.labelDimensions);e.targetLabelKey=mn(z),e.targetLabelStyleKey=mn(vs(A.commonLabel,z))}if(l){var H=e.styleKeys,J=H.nodeBody,F=H.nodeBorder,$=H.nodeOutline,V=H.backgroundImage,G=H.compound,j=H.pie,M=[J,F,$,V,G,j].filter(function(W){return W!=null}).reduce(vs,[Aa,ji]);e.nodeKey=mn(M),e.hasPie=j!=null&&j[0]!==Aa&&j[1]!==ji}return o!==e.styleKey},Bt.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},Bt.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(J){return J==null?null:J.pfValue!=null?J.pfValue:J.value},p=function(){var J=v(u),F=v(n);r.checkTriggers(t,n.name,J,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",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 m=n.field.split("."),y=f.data,b=0;b<m.length&&y;b++){var w=m[b];y=y[w]}if(y==null)return g(),!1;var C;if(de(y)){var x=n.fieldMax-n.fieldMin;x===0?C=0:C=(y-n.fieldMin)/x}else return $e("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` 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("."),L=f.data,A=0;A<O.length&&L;A++){var q=O[A];L=L[q]}if(L!=null&&(i=this.parse(n.name,L,n.bypass,h)),!i)return g(),!1;i.mapping=n,n=i;break}case o.fn:{var U=n.value,z=n.fnValue!=null?n.fnValue:U(t);if(n.prevFnValue=z,z==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,z,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},Bt.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)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.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,m=!1,y=void 0,b=1e-6;p&&(de(p.pfValue)&&de(g.pfValue)?(m=g.pfValue-p.pfValue,y=p.pfValue+b*m):de(p.value)&&de(g.value)?(m=g.value-p.value,y=p.value+b*m):Ke(p.value)&&Ke(g.value)&&(m=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],y=p.strValue),m&&(l[d]=g.strValue,this.applyBypass(t,d,y),c=!0))}}if(!c)return;n.transitioning=!0,new za(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)},Bt.checkTrigger=function(t,e,r,n,a,i){var o=this.properties[e],l=a(o);l!=null&&l(r,n)&&i(o)},Bt.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)})},Bt.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()})})},Bt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var fo={};fo.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],m=h[g];if(m===void 0&&(m=h[ds(g)]),m!==void 0){var y=this.parse(g,m,!0);y&&i.push(y)}}}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},fo.overrideBypass=function(t,e,r){e=Au(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)}},fo.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},fo.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 dc={};dc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},dc.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[ds(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(m){return m*d},h=function(m,y){return f(m)+y},v=Ke(l),p=v?c.every(function(g){return g!=null}):c!=null;return p?v?l.map(function(g,m){return h(g,c[m])}).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[Au(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]=Wi(l,n[0]),n[1]=Yi(l,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)l=o.charCodeAt(u),n[0]=Wi(l,n[0]),n[1]=Yi(l,n[1]);return n},Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var js={};js.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},js.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},js.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 fc={};fc.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 En(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 m=i.match(/^\s*$/);if(m)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){$e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}o=y[0];var b=y[1],w=y[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},fc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var _t={};(function(){var t=ft,e=_M,r=NM,n=IM,a=BM,i=function(M){return"^"+M+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(M){var W=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+M+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];_t.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(M,W){switch(M.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Ee(M[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(M){var W=M.length;return W===1||W===2||W===4}}};var c={zeroNonZero:function(M,W){return(M==null||W==null)&&M!==W||M==0&&W!=0?!0:M!=0&&W==0},any:function(M,W){return M!=W},emptyNonEmpty:function(M,W){var Y=gn(M),se=gn(W);return Y&&!se||!Y&&se}},u=_t.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}],m=[{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}],y=[{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(M,W){return W.value==="label"?-M.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=[];_t.pieBackgroundN=16,P.push({name:"pie-size",type:u.sizeMaybePercent});for(var D=1;D<=_t.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=_t.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(j){O.forEach(function(M){var W=M+"-"+j.name,Y=j.type,se=j.triggersBounds;R.push({name:W,type:Y,triggersBounds:se})})},{});var L=_t.properties=[].concat(g,w,m,y,b,N,p,v,d,f,h,x,k,E,_,P,S,T,R,B),A=_t.propertyGroups={behavior:g,transition:w,visibility:m,overlay:y,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},q=_t.propertyGroupNames={},U=_t.propertyGroupKeys=Object.keys(A);U.forEach(function(j){q[j]=A[j].map(function(M){return M.name}),A[j].forEach(function(M){return M.groupKey=j})});var z=_t.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"}];_t.propertyNames=L.map(function(j){return j.name});for(var H=0;H<L.length;H++){var J=L[H];L[J.name]=J}for(var F=0;F<z.length;F++){var $=z[F],V=L[$.pointsTo],G={name:$.name,alias:!0,pointsTo:V};L.push(G),L[$.name]=G}})(),_t.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},_t.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<=_t.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 _t.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},_t.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 Ws={};Ws.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=R0(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},Ws.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},Ws.parseImpl=function(t,e,r,n){var a=this;t=Au(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 m=p.value,y=g.value,b=m[0]===y[0]&&m[1]===y[1]&&m[2]===y[2]&&(m[3]===y[3]||(m[3]==null||m[3]===1)&&(y[3]==null||y[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 M=0;M<u.enums.length;M++){var W=u.enums[M];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("^("+ft+")("+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&&!bM(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:JF(e)),B==="%"&&(O.pfValue=e/100),O}else if(u.propList){var L=[],A=""+e;if(A!=="none"){for(var q=A.split(/\s*,\s*|\s+/),U=0;U<q.length;U++){var z=q[U].trim();a.properties[z]?L.push(z):$e("`"+z+"` is not a valid property name")}if(L.length===0)return null}return{name:t,value:L,strValue:L.length===0?"none":L.join(" "),bypass:r}}else if(u.color){var H=LM(e);return H?{name:t,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var J=N();if(J)return J}for(var F=u.regexes?u.regexes:[u.regex],$=0;$<F.length;$++){var V=new RegExp(F[$]),G=V.exec(e);if(G)return{name:t,value:u.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?N():null};var Dt=function t(e){if(!(this instanceof t))return new t(e);if(!Ou(e)){Qe("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Pt=Dt.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 En(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[ds(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 C0(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this},Dt.fromJson=function(t,e){var r=new Dt(t);return r.fromJson(e),r},Dt.fromString=function(t,e){return new Dt(t).fromString(e)},[Bt,fo,dc,Br,js,fc,_t,Ws].forEach(function(t){Se(Pt,t)}),Dt.types=Pt.types,Dt.properties=Pt.properties,Dt.propertyGroups=Pt.propertyGroups,Dt.propertyGroupNames=Pt.propertyGroupNames,Dt.propertyGroupKeys=Pt.propertyGroupKeys;var bz={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return C0(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Dt.fromJson(this,e):Ee(e)?r.style=Dt.fromString(this,e):r.style=Dt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},wz="single",na={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=wz),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(EM(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=ys(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}};na.centre=na.center,na.autolockNodes=na.autolock,na.autoungrabifyNodes=na.autoungrabify;var ho={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})};ho.attr=ho.data,ho.removeAttr=ho.removeData;var po=function(e){var r=this;e=Se({},e);var n=e.container;n&&!cs(n)&&cs(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=dt!==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,m){return g!==void 0?g:m!==void 0?m:p},u=this._private={container:n,ready:!1,options:l,elements:new St(this),listeners:[],aniEles:new St(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 m=p.some(xM);if(m)return za.all(p).then(g);g(p)};u.styleEnabled&&r.setStyle([]);var f=Se({},l,l.renderer);r.initRenderer(f);var h=function(p,g,m){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.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",m),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 m=0;m<i.length;m++){var y=i[m];r.on("ready",y)}a&&(a.readies=[]),r.emit("ready")},l.done)})},Ys=po.prototype;Se(Ys,{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 dt;var r=this._private.container.ownerDocument;return r===void 0||r==null?dt:r.defaultView||dt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!cs(e)&&cs(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 m=!!e,y={};m?y.elements=this.elements().map(function(w){return w.json()}):(y.elements={},a.forEach(function(w){var C=w.group();y.elements[C]||(y.elements[C]=[]),y.elements[C].push(w.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=Nr(r.data());var b=n.options;return y.zoomingEnabled=n.zoomingEnabled,y.userZoomingEnabled=n.userZoomingEnabled,y.zoom=n.zoom,y.minZoom=n.minZoom,y.maxZoom=n.maxZoom,y.panningEnabled=n.panningEnabled,y.userPanningEnabled=n.userPanningEnabled,y.pan=Nr(n.pan),y.boxSelectionEnabled=n.boxSelectionEnabled,y.renderer=Nr(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}}),Ys.$id=Ys.getElementById,[uz,pz,h1,uc,Gs,gz,cc,Us,bz,na,ho].forEach(function(t){Se(Ys,t)});var Cz={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}},Ez={maximal:!1,acyclic:!1},Ja=function(e){return e.scratch("breadthfirst")},p1=function(e,r){return e.scratch("breadthfirst",r)};function v1(t){this.options=Se({},Cz,Ez,t)}v1.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 ue=p[ne],ie=ue.maxDegree(!1),fe=ue.filter(function(pe){return pe.degree(!1)===ie});u=u.add(fe)},m=0;m<p.length;m++)g(m)}var y=[],b={},w=function(ne,ue){y[ue]==null&&(y[ue]=[]);var ie=y[ue].length;y[ue].push(ne),p1(ne,{index:ie,depth:ue})},C=function(ne,ue){var ie=Ja(ne),fe=ie.depth,pe=ie.index;y[fe][pe]=null,w(ne,ue)};i.bfs({roots:u,directed:e.directed,visit:function(ne,ue,ie,fe,pe){var De=ne[0],Ie=De.id();w(De,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=y[ne],ie=0;ie<ue.length;ie++){var fe=ue[ie];if(fe==null){ue.splice(ie,1),ie--;continue}p1(fe,{depth:ne,index:ie})}},S=function(){for(var ne=0;ne<y.length;ne++)_(ne)},T=function(ne,ue){for(var ie=Ja(ne),fe=ne.incomers().filter(function(I){return I.isNode()&&n.has(I)}),pe=-1,De=ne.id(),Ie=0;Ie<fe.length;Ie++){var we=fe[Ie],xe=Ja(we);pe=Math.max(pe,xe.depth)}if(ie.depth<=pe){if(!e.acyclic&&ue[De])return null;var re=pe+1;return C(ne,re),ue[De]=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 L=0;if(e.avoidOverlap)for(var A=0;A<a.length;A++){var q=a[A],U=q.layoutDimensions(e),z=U.w,H=U.h;L=Math.max(L,z,H)}var J={},F=function(ne){if(J[ne.id()])return J[ne.id()];for(var ue=Ja(ne).depth,ie=ne.neighborhood(),fe=0,pe=0,De=0;De<ie.length;De++){var Ie=ie[De];if(!(Ie.isEdge()||Ie.isParent()||!a.has(Ie))){var we=Ja(Ie);if(we!=null){var xe=we.index,re=we.depth;if(!(xe==null||re==null)){var I=y[re].length;re<ue&&(fe+=xe/I,pe++)}}}}return pe=Math.max(1,pe),fe=fe/pe,pe===0&&(fe=0),J[ne.id()]=fe,fe},$=function(ne,ue){var ie=F(ne),fe=F(ue),pe=ie-fe;return pe===0?k0(ne.id(),ue.id()):pe};e.depthSort!==void 0&&($=e.depthSort);for(var V=0;V<y.length;V++)y[V].sort($),_(V);for(var G=[],j=0;j<x.length;j++)G.push(x[j]);y.unshift(G),S();for(var M=0,W=0;W<y.length;W++)M=Math.max(y[W].length,M);var Y={x:c.x1+c.w/2,y:c.x1+c.h/2},se=y.reduce(function(ae,ne){return Math.max(ae,ne.length)},0),ce=function(ne){var ue=Ja(ne),ie=ue.depth,fe=ue.index,pe=y[ie].length,De=Math.max(c.w/((e.grid?se:pe)+1),L),Ie=Math.max(c.h/(y.length+1),L),we=Math.min(c.w/2/y.length,c.h/2/y.length);if(we=Math.max(we,L),e.circle){var re=we*ie+we-(y.length>0&&y[0].length<=3?we/2:0),I=2*Math.PI/y[ie].length*fe;return ie===0&&y[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)*De,y:(ie+1)*Ie};return xe}};return n.nodes().layoutPositions(this,e,ce),this};var xz={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 g1(t){this.options=Se({},xz,t)}g1.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,m=p.h;f=Math.max(f,g,m)}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 y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(y*y+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 kz={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 m1(t){this.options=Se({},kz,t)}m1.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 m=e.levelWidth(i),y=[[]],b=y[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>=m&&(b=[],y.push(b))}b.push(C)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var E=y.length>0&&y[0].length>1,_=Math.min(o.w,o.h)/2-k,S=_/(y.length+E?1:0);k=Math.min(k,S)}for(var T=0,N=0;N<y.length;N++){var B=y[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),L=Math.sqrt(k*k/(R*R+O*O));T=Math.max(L,T)}B.r=T,T+=k}if(e.equidistant){for(var A=0,q=0,U=0;U<y.length;U++){var z=y[U],H=z.r-q;A=Math.max(A,H)}q=0;for(var J=0;J<y.length;J++){var F=y[J];J===0&&(q=F.r),F.r=q,q+=A}}for(var $={},V=0;V<y.length;V++)for(var G=y[V],j=G.dTheta,M=G.r,W=0;W<G.length;W++){var Y=G[W],se=e.startAngle+(r?1:-1)*j*W,ce={x:l.x+M*Math.cos(se),y:l.y+M*Math.sin(se)};$[Y.node.id()]=ce}return a.nodes().layoutPositions(this,e,function(ae){var ne=ae.id();return $[ne]}),this};var hc,Sz={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 Zs(t){this.options=Se({},Sz,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)}Zs.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?hc=!0:hc=!1;var n=_z(e,r,t);hc&&Iz(n),t.randomize&&Bz(n);var a=Wr(),i=function(){Dz(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(Pz(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=y1(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)w1(n,t),l();else{var v=Wr();v-a>=t.animationThreshold&&i(),ps(f)}};d()}else{for(;u;)u=o(c),c++;w1(n,t),l()}return this},Zs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Zs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var _z=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),m={};m.isLocked=p.locked(),m.id=p.data("id"),m.parentId=p.data("parent"),m.cmptId=u[p.id()],m.children=[],m.positionX=p.position("x"),m.positionY=p.position("y"),m.offsetX=0,m.offsetY=0,m.height=g.w,m.width=g.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(p.style("padding")),m.padRight=parseFloat(p.style("padding")),m.padTop=parseFloat(p.style("padding")),m.padBottom=parseFloat(p.style("padding")),m.nodeRepulsion=Xe(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,l.layoutNodes.push(m),l.idToIndex[m.id]=d}for(var y=[],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):(y[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var k=y[b++],E=l.idToIndex[k],v=l.layoutNodes[E],_=v.children;if(_.length>0){l.graphSet.push(_);for(var d=0;d<_.length;d++)y[++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],L=l.indexToGraph[R],A=l.indexToGraph[O];if(L!=A){for(var q=Tz(B.sourceId,B.targetId,l),U=l.graphSet[q],z=0,m=l.layoutNodes[R];U.indexOf(m.id)===-1;)m=l.layoutNodes[l.idToIndex[m.parentId]],z++;for(m=l.layoutNodes[O];U.indexOf(m.id)===-1;)m=l.layoutNodes[l.idToIndex[m.parentId]],z++;P*=z*n.nestingFactor}B.idealLength=P,B.elasticity=D,l.layoutEdges.push(B)}return l},Tz=function(e,r,n){var a=Nz(e,r,0,n);return 2>a.count?0:a.graph},Nz=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}},Iz,Bz=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)}},y1=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}}},Dz=function(e,r,n){var a=n.layout,i=n.eles.nodes(),o=y1(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Pz=function(e,r,n){Oz(e,r),Lz(e),Mz(e,r),Fz(e),$z(e)},Oz=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]]];Az(l,u,e,r)}},b1=function(e){return-e+2*e*Math.random()},Az=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=b1(u),c=b1(u));var d=Rz(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=Xs(e,l,c),m=Xs(r,-1*l,-1*c),y=m.x-g.x,b=m.y-g.y,w=y*y+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*y/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},Rz=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},Xs=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)},Lz=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=Xs(o,u,d),h=Xs(c,-1*u,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),m=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var y=m*v/g,b=m*p/g;else var y=0,b=0;o.isLocked||(o.offsetX+=y,o.offsetY+=b),c.isLocked||(c.offsetX-=y,c.offsetY-=b)}}},Mz=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 m=r.gravity*v/g,y=r.gravity*p/g;h.offsetX+=m,h.offsetY+=y}}}}},Fz=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}}},$z=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=Vz(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,qz(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)}},Vz=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},qz=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)}},w1=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,m=0,y=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,m=Math.max(m,d.h),g>y&&(p+=m+r.componentSpacing,v=0,g=0,m=0)}}},zz={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 C1(t){this.options=Se({},zz,t)}C1.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(J){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(F){if(F==null)return Math.min(c,u);var $=Math.min(c,u);$==c?c=F:u=F},f=function(F){if(F==null)return Math.max(c,u);var $=Math.max(c,u);$==c?c=F:u=F},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 m=d(),y=f();(y+1)*m>=o?f(y+1):d(m+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(F,$){return!!N["c-"+F+"-"+$]},P=function(F,$){N["c-"+F+"-"+$]=!0},D=0,R=0,O=function(){R++,R>=u&&(R=0,D++)},L={},A=0;A<a.length;A++){var q=a[A],U=e.position(q);if(U&&(U.row!==void 0||U.col!==void 0)){var z={row:U.row,col:U.col};if(z.col===void 0)for(z.col=0;B(z.row,z.col);)z.col++;else if(z.row===void 0)for(z.row=0;B(z.row,z.col);)z.row++;L[q.id()]=z,P(z.row,z.col)}}var H=function(F,$){var V,G;if(F.locked()||F.isParent())return!1;var j=L[F.id()];if(j)V=j.col*b+b/2+i.x1,G=j.row*w+w/2+i.y1;else{for(;B(D,R);)O();V=R*b+b/2+i.x1,G=D*w+w/2+i.y1,P(D,R),O()}return{x:V,y:G}};a.layoutPositions(this,e,H)}return this};var Hz={ready:function(){},stop:function(){}};function pc(t){this.options=Se({},Hz,t)}pc.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},pc.prototype.stop=function(){return this};var Kz={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 E1(t){this.options=Se({},Kz,t)}E1.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 WF(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 Gz={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 x1(t){this.options=Se({},Gz,t)}x1.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 Uz=[{name:"breadthfirst",impl:v1},{name:"circle",impl:g1},{name:"concentric",impl:m1},{name:"cose",impl:Zs},{name:"grid",impl:C1},{name:"null",impl:pc},{name:"preset",impl:E1},{name:"random",impl:x1}];function k1(t){this.options=t,this.notifications=0}var S1=function(){},_1=function(){throw new Error("A headless instance can not render images")};k1.prototype={recalculateRenderedStyle:S1,notify:function(){this.notifications++},init:S1,isHeadless:function(){return!0},png:_1,jpg:_1};var vc={};vc.arrowShapeWidth=.3,vc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,h,v,p,g){var m=v.x-f/2-g,y=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=m<=u&&u<=y&&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),m=p*f,y=g*f,b=m+v.x,w=y+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],m=u[p+1];v.push(n(g,m,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,m,y){var b=i(a(this.points,p+2*y,g,m)),w=Gt(h,v,b);return w},roughCollide:r,draw:function(h,v,p,g){var m=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,m)},spacing:function(h){return 0},gap:o},d)};l("none",{collide:gs,roughCollide:gs,draw:Fu,spacing:F0,gap:F0}),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,m=n(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(u,p,m)},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 m=i(a(this.points,f+2*g,h,v)),y=i(a(this.pointsTee,f+2*g,h,v)),b=Gt(u,d,m)||Gt(u,d,y);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 m=v,y=Math.pow(m.x-u,2)+Math.pow(m.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)||y},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 m=i(a(this.points,f+2*g,h,v)),y=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Gt(u,d,m)||Gt(u,d,y);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 m=v,y=Math.pow(m.x-u,2)+Math.pow(m.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return y},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 aa={};aa.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]},aa.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(y){return parseFloat(r.getPropertyValue(y))},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]},aa.invalidateContainerClientCoordsCache=function(){this.containerBB=null},aa.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},aa.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 m(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 y(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 m(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,q=_.target,R;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,L=0;L+3<O.length;L+=2)if(s5(t,e,O[L],O[L+1],O[L+2],O[L+3],D)&&P>(R=f5(t,e,O[L],O[L+1],O[L+2],O[L+3])))return m(E,R),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,L=0;L+5<S.allpts.length;L+=4)if(l5(t,e,O[L],O[L+1],O[L+2],O[L+3],O[L+4],O[L+5],D)&&P>(R=d5(t,e,O[L],O[L+1],O[L+2],O[L+3],O[L+4],O[L+5])))return m(E,R),!0}for(var A=A||_.source,q=q||_.target,U=a.getArrowWidth(T,N),z=[{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}],L=0;L<z.length;L++){var H=z[L],J=i.arrowShapes[E.pstyle(H.name+"-arrow-shape").value],F=E.pstyle("width").pfValue;if(J.roughCollide(t,e,U,H.angle,{x:H.x,y:H.y},F,d)&&J.collide(t,e,U,H.angle,{x:H.x,y:H.y},F,d))return m(E),!0}u&&l.length>0&&(y(A),y(q))}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",_),L=w(S.rscratch,"labelAngle",_),A=E.pstyle(N+"text-margin-x").pfValue,q=E.pstyle(N+"text-margin-y").pfValue,U=B.x1-T-A,z=B.x2+T-A,H=B.y1-T-q,J=B.y2+T-q;if(L){var F=Math.cos(L),$=Math.sin(L),V=function(ce,ae){return ce=ce-R,ae=ae-O,{x:ce*F-ae*$+R,y:ce*$+ae*F+O}},G=V(U,H),j=V(U,J),M=V(z,H),W=V(z,J),Y=[G.x+A,G.y+q,M.x+A,M.y+q,W.x+A,W.y+q,j.x+A,j.y+q];if(Gt(t,e,Y))return m(E),!0}else if(Fa(B,t,e))return m(E),!0}}for(var x=o.length-1;x>=0;x--){var k=o[x];k.isNode()?y(k)||C(k):b(k)||C(k)||C(k,"source")||C(k,"target")}return l},aa.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});zu(d,p)&&!j0(p,d)&&i.push(v)}else{var g=h,m=g._private,y=m.rscratch;if(y.startX!=null&&y.startY!=null&&!Fa(d,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!Fa(d,y.endX,y.endY))continue;if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){for(var b=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!o5(d,b[C])){w=!1;break}w&&i.push(g)}else(y.edgeType==="haystack"||y.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,y,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),y=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=gt(p[0],p[2],p[4],.1),m=gt(p[1],p[3],p[5],.1);c=d-g,u=f-m}else c=d-y,u=f-b;e.srcArrowAngle=bs(c,u);var y=e.midX,b=e.midY;if(r&&(y=(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=gt(p[T],p[N],p[B],0),E=gt(p[T+1],p[N+1],p[B+1],0),_=gt(p[T],p[N],p[B],1e-4),S=gt(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=gt(p[T],p[N],p[B],.4999),E=gt(p[T+1],p[N+1],p[B+1],.4999),_=gt(p[T],p[N],p[B],.5),S=gt(p[T+1],p[N+1],p[B+1],.5)}c=_-k,u=S-E}if(e.midtgtArrowAngle=bs(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=bs(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=gt(p[D-6],p[D-4],p[D-2],.9),m=gt(p[D-5],p[D-3],p[D-1],.9);c=h-g,u=v-m}else c=h-y,u=v-b;e.tgtArrowAngle=bs(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 gc,mc,Dr={},ir={},T1,N1,ia,Js,Xr,oa,sa,Pr,ei,el,I1,B1,yc,bc,D1,P1=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)},jz=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},Wz=function(e,r,n,a,i){if(e!==D1?P1(r,e,Dr):jz(ir,Dr),P1(r,n,ir),T1=Dr.nx*ir.ny-Dr.ny*ir.nx,N1=Dr.nx*ir.nx-Dr.ny*-ir.ny,Xr=Math.asin(Math.max(-1,Math.min(1,T1))),Math.abs(Xr)<1e-6){gc=r.x,mc=r.y,sa=ei=0;return}ia=1,Js=!1,N1<0?Xr<0?Xr=Math.PI+Xr:(Xr=Math.PI-Xr,ia=-1,Js=!0):Xr>0&&(ia=-1,Js=!0),r.radius!==void 0?ei=r.radius:ei=a,oa=Xr/2,el=Math.min(Dr.len/2,ir.len/2),i?(Pr=Math.abs(Math.cos(oa)*ei/Math.sin(oa)),Pr>el?(Pr=el,sa=Math.abs(Pr*Math.sin(oa)/Math.cos(oa))):sa=ei):(Pr=Math.min(el,ei),sa=Math.abs(Pr*Math.sin(oa)/Math.cos(oa))),yc=r.x+ir.nx*Pr,bc=r.y+ir.ny*Pr,gc=yc-ir.ny*sa*ia,mc=bc+ir.nx*sa*ia,I1=r.x+Dr.nx*Pr,B1=r.y+Dr.ny*Pr,D1=r};function O1(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 wc(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}:(Wz(t,e,r,n,a),{cx:gc,cy:mc,radius:sa,startX:I1,startY:B1,stopX:yc,stopY:bc,startAngle:Dr.ang+Math.PI/2*ia,endAngle:ir.ang-Math.PI/2*ia,counterClockwise:Js})}var Ot={};Ot.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),m=vr(g,2),y=m[0],b=m[1],w={x1:v,y1:p,x2:y,y2:b};a=u(v,p,y,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}},Ot.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)}},Ot.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),m=g.midptPts,y=g.vectorNormInverse,b={x:m.x1*v+m.x2*p,y:m.y1*v+m.y2*p};r.segpts.push(b.x+y.x*h,b.y+y.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")}},Ot.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,m=p+d/2,y=u+"_"+d;h=i[y]===void 0?i[y]=0:++i[y],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(m)*1.4*v*(h/3+1),o.y+Math.sin(m)*1.4*v*(h/3+1)]},Ot.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 m=50,y={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(y.x,b.x),y:Math.min(y.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(m,1.12)/100)*g*(p/3+1)*x,w.x-(1+Math.pow(m,1.12)/100)*g*(p/3+1)*k,w.y]},Ot.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},Ot.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,m=K0(p);h&&(d=l?l.pfValue[v]:o,f=c.value[v]),n?g=d:g=d!==void 0?m*d:void 0;var y=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*y,E.y+k.y*y)}},Ot.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,m=g!=="node-position",y=t.pstyle("taxi-direction").value,b=y,w=t.pstyle("taxi-turn"),C=w.units==="%",x=w.pfValue,k=x<0,E=t.pstyle("taxi-turn-min-distance").pfValue,_=m?(f+v)/2:0,S=m?(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?y=Math.abs(P)>Math.abs(D)?a:n:b===c||b===l?(y=n,R=!0):(b===i||b===o)&&(y=a,R=!0);var O=y===n,L=O?D:P,A=O?N:T,q=K0(A),U=!1;!(R&&(C||k))&&(b===l&&A<0||b===c&&A>0||b===i&&A>0||b===o&&A<0)&&(q*=-1,L=q*Math.abs(L),U=!0);var z;if(C){var H=x<0?1+x:x;z=H*L}else{var J=x<0?L:0;z=J+x*q}var F=function(me){return Math.abs(me)<E||Math.abs(me)>=Math.abs(L)},$=F(z),V=F(Math.abs(L)-Math.abs(z)),G=$||V;if(G&&!U)if(O){var j=Math.abs(A)<=h/2,M=Math.abs(T)<=v/2;if(j){var W=(d.x1+d.x2)/2,Y=d.y1,se=d.y2;r.segpts=[W,Y,W,se]}else if(M){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(A)<=f/2,ie=Math.abs(N)<=p/2;if(ue){var fe=(d.y1+d.y2)/2,pe=d.x1,De=d.x2;r.segpts=[pe,fe,De,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+z+(m?h/2*q:0),I=d.x1,K=d.x2;r.segpts=[I,re,K,re]}else{var te=d.x1+z+(m?f/2*q:0),Z=d.y1,X=d.y2;r.segpts=[te,Z,te,X]}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)}},Ot.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),m=!de(r.arrowStartX)||!de(r.arrowStartY),y=!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=Xn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=k<x,_=Xn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=_<x,T=!1;if(g||m||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(y||b||S){T=!0;var L={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},A=Math.sqrt(L.x*L.x+L.y*L.y),q={x:L.x/A,y:L.y/A},U=Math.max(i,o),z={x:r.ctrlpts[0]+q.x*2*U,y:r.ctrlpts[1]+q.y*2*U},H=d.intersectLine(a.x,a.y,l,c,z.x,z.y,0,h,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+q.x*(x-_),r.ctrlpts[1]=r.ctrlpts[1]+q.y*(x-_)):(r.ctrlpts[0]=H[0]+q.x*x,r.ctrlpts[1]=H[1]+q.y*x)}T&&this.findEndpoints(t)}},Ot.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=gt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=gt(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(wc({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}}}},Ot.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."))},Ot.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,m=p.poolIndex(),y=g.poolIndex(),b=[m,y].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()});$u(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(),L=S.tgtPos=D.position(),A=S.srcW=P.outerWidth(),q=S.srcH=P.outerHeight(),U=S.tgtW=D.outerWidth(),z=S.tgtH=D.outerHeight(),H=S.srcShape=r.nodeShapes[e.getNodeShape(P)],J=S.tgtShape=r.nodeShapes[e.getNodeShape(D)],F=S.srcCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,$=S.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,V=S.tgtRs=D._private.rscratch,G=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 j=0;j<S.eles.length;j++){var M=S.eles[j],W=M[0]._private.rscratch,Y=M.pstyle("curve-style").value,se=Y==="unbundled-bezier"||Y.endsWith("segments")||Y.endsWith("taxi"),ce=!P.same(M.source());if(!S.calculatedIntersection&&P!==D&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ae=H.intersectLine(O.x,O.y,A,q,L.x,L.y,0,F,G),ne=S.srcIntn=ae,ue=J.intersectLine(L.x,L.y,U,z,O.x,O.y,0,$,V),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:L.x,y1:O.y,y2:L.y},De=ue[1]-ae[1],Ie=ue[0]-ae[0],we=Math.sqrt(Ie*Ie+De*De),xe=S.vector={x:Ie,y:De},re=S.vectorNorm={x:xe.x/we,y:xe.y/we},I={x:-re.y,y:re.x};S.nodesOverlap=!de(we)||J.checkPoint(ae[0],ae[1],0,U,z,L.x,L.y,$,V)||H.checkPoint(ue[0],ue[1],0,A,q,O.x,O.y,F,G),S.vectorNormInverse=I,T={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:L,tgtPos:O,srcW:U,srcH:z,tgtW:A,tgtH:q,srcIntn:ie,tgtIntn:ne,srcShape:J,tgtShape:H,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 K=ce?T:S;W.nodesOverlap=K.nodesOverlap,W.srcIntn=K.srcIntn,W.tgtIntn=K.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(M,K,j,se):P===D?e.findLoopPoints(M,K,j,se):Y.endsWith("segments")?e.findSegmentsPoints(M,K):Y.endsWith("taxi")?e.findTaxiPoints(M,K):Y==="straight"||!se&&S.eles.length%2===1&&j===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(M):e.findBezierPoints(M,K,j,se,ce),e.findEndpoints(M),e.tryToCorrectInvalidPoints(M,K),e.checkForInvalidEdgeWarning(M),e.storeAllpts(M),e.storeEdgeProjections(M),e.calculateArrowAngles(M),e.recalculateEdgeLabelProjections(M),e.calculateLabelAngles(M)}},x=0;x<o.length;x++)C(x);this.findHaystackPoints(l)}};function A1(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}}Ot.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),A1(e.segpts)},Ot.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),A1(e.ctrlpts)},Ot.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var vo={};vo.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)}},vo.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,m=v==="taxi",y=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||y,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",k=b||w||C,E=y||m,_=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,L;if(b){var A=[p.ctrlpts[0],p.ctrlpts[1]],q=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:A;D=q,R=A}else if(C){var U=x?p.segpts.slice(0,2):[o.x,o.y],z=x?p.segpts.slice(p.segpts.length-2):[i.x,i.y];D=z,R=U}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 H=a._private.rscratch,J=H.labelWidth,F=H.labelHeight,$=H.labelX,V=H.labelY,G=J/2,j=F/2,M=a.pstyle("text-valign").value;M==="top"?V-=j:M==="bottom"&&(V+=j);var W=a.pstyle("text-halign").value;W==="left"?$-=G:W==="right"&&($+=G);var Y=eo(O[0],O[1],[$-G,V-j,$+G,V-j,$+G,V+j,$-G,V+j],o.x,o.y);if(Y.length>0){var se=i,ce=Qn(se,La(r)),ae=Qn(se,La(Y)),ne=ce;if(ae<ce&&(r=Y,ne=ae),Y.length>2){var ue=Qn(se,{x:Y[2],y:Y[3]});ue<ne&&(r=[Y[2],Y[3]])}}}var ie=ks(r,D,e.arrowShapes[l].spacing(t)+u),fe=ks(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"?L=R:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(L=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),L[0],L[1],0,T,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var pe=n._private.rscratch,De=pe.labelWidth,Ie=pe.labelHeight,we=pe.labelX,xe=pe.labelY,re=De/2,I=Ie/2,K=n.pstyle("text-valign").value;K==="top"?xe-=I:K==="bottom"&&(xe+=I);var te=n.pstyle("text-halign").value;te==="left"?we-=re:te==="right"&&(we+=re);var Z=eo(L[0],L[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 X=o,le=Qn(X,La(r)),ee=Qn(X,La(Z)),oe=le;if(ee<le&&(r=[Z[0],Z[1]],oe=ee),Z.length>2){var me=Qn(X,{x:Z[2],y:Z[3]});me<oe&&(r=[Z[2],Z[3]])}}}var be=ks(r,R,e.arrowShapes[c].spacing(t)+d),ye=ks(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)},vo.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}}},vo.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 Cc={};function Yz(t,e,r){for(var n=function(u,d,f,h){return gt(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)})}}Cc.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)Yz(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},Cc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Or={};Or.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!gn(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 R1=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},L1=function(e,r){var n=r.x-e.x,a=r.y-e.y;return R1(n,a)},Zz=function(e,r,n,a){var i=Qi(0,a-.001,1),o=Qi(0,a+.001,1),l=Ma(e,r,n,i),c=Ma(e,r,n,o);return L1(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){bn(r.rscratch,f,h,v),bn(r.rstyle,f,h,v)};o("labelX",null,e.x),o("labelY",null,e.y);var l=R1(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 m=r.rstyle.bezierPts,y=a.bezierProjPcts.length;function b(E,_,S,T,N){var B=Xn(_,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,m[w*y],0,a.bezierProjPcts[0]);for(var k=0;k<y-1;k++)b(C,m[w*y+k],m[w*y+k+1],a.bezierProjPcts[k],a.bezierProjPcts[k+1]);b(C,m[w*y+y-1],C.p2,a.bezierProjPcts[y-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(),m,y=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(y=b,b+=k.length,b>=p||E){m={cp:C,segment:k};break}}if(m)break}var _=m.cp,S=m.segment,T=(p-y)/S.length,N=S.t1-S.t0,B=v?S.t0+N*T:S.t1-N*T;B=Qi(0,B,1),e=Ma(_.p0,_.p1,_.p2,B),h=Zz(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var P=0,D,R,O,L,A=n.allpts.length,q=0;q+3<A&&(v?(O={x:n.allpts[q],y:n.allpts[q+1]},L={x:n.allpts[q+2],y:n.allpts[q+3]}):(O={x:n.allpts[A-2-q],y:n.allpts[A-1-q]},L={x:n.allpts[A-4-q],y:n.allpts[A-3-q]}),D=Xn(O,L),R=P,P+=D,!(P>=p));q+=2);var U=p-R,z=U/D;z=Qi(0,z,1),e=t5(O,L,z),h=L1(O,L);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;bn(r.rstyle,"labelWidth",e,f),bn(r.rscratch,"labelWidth",e,f),bn(r.rstyle,"labelHeight",e,h),bn(r.rscratch,"labelHeight",e,h),bn(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(J,F){return F?(bn(r.rscratch,J,e,F),F):gr(r.rscratch,J,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,m=0;m<d.length;m++){var y=d[m],b=this.calculateLabelDimensions(t,y),w=b.width;if(v){var C=y.split("").join(u);y=C}if(w>f){var x=y.matchAll(g),k="",E=0,_=m0(x),S;try{for(_.s();!(S=_.n()).done;){var T=S.value,N=T[0],B=y.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(H){_.e(H)}finally{_.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(y)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
41
+ */var Wb=function(e,r){this.recycle(e,r)};function lo(){return!1}function Ls(){return!0}Wb.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=lo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ls:lo):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=Ls;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ls;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ls,this.stopPropagation()},isDefaultPrevented:lo,isPropagationStopped:lo,isImmediatePropagationStopped:lo};var Yb=/^([^.]+)(\.(?:[^.]+))?$/,Qq=".*",Zb={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},Xb=Object.keys(Zb),ez={};function Ms(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ez,e=arguments.length>1?arguments[1]:void 0,r=0;r<Xb.length;r++){var n=Xb[r];this[n]=t[n]||Zb[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var _n=Ms.prototype,Jb=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(!gn(d)){var f=d.match(Yb);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}}}},Qb=function(e,r){return e.addEventFields(e.context,r),new Wb(r.type,r)},tz=function(e,r,n){if(CM(n)){r(e,n);return}else if(Ae(n)){r(e,Qb(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!gn(o)){var l=o.match(Yb);if(l){var c=l[1],u=l[2]?l[2]:null,d=Qb(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};_n.on=_n.addListener=function(t,e,r,n,a){return Jb(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},_n.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},_n.removeListener=_n.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=BF(this.listeners));for(var i=this.listeners,o=function(u){var d=i[u];Jb(a,function(f,h,v,p,g,m){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!m||d.callback===m))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)o(l);return this},_n.removeAllListeners=function(){return this.removeListener("*")},_n.emit=_n.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),tz(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===Qq)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&PF(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 rz={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&&zi(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()}},Fs=function(e){return Ee(e)?new En(e):e},e1={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Ms(rz,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=Fs(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=Fs(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=Fs(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=Fs(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(e1);var t1={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 En(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,m=f.hasElementWithId(g);m?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=t1;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 nz={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}},r1=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"?Mu: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()},$s={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(r1)},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:Mu-1}else{var i=r.source,o=r.target,l=i.zDepth(),c=o.zDepth();return Math.max(l,c,0)}}}};$s.each=$s.forEach;var az=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ct(Symbol))!=e&&ct(Symbol.iterator)!=e;r&&($s[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return v0({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};az();var iz=xt({nodeDimensionsIncludeLabels:!1}),Vs={layoutDimensions:function(e){e=iz(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(E){return!E.isParent()}),i=this.cy(),o=r.eles,l=function(k){return k.id()},c=Hi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(k,x,_){var S={x:x.x1+x.w/2,y:x.y1+x.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(),x=0;x<a.length;x++){var _=a[x],S=c(_,x);o5(k,S.x,S.y)}return k},h=f(),v=Hi(function(E,k){var x=c(E,k);if(d){var _=Math.abs(r.spacingFactor);x=u(_,h,x)}return r.transform!=null&&(x=r.transform(E,x)),x},l);if(r.animate){for(var p=0;p<a.length;p++){var g=a[p],m=v(g,p),y=r.animateFilter==null||r.animateFilter(g,p);if(y){var b=g.animation({position:m,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(m)}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(E){return E.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Ha.all(e.animations.map(function(E){return E.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}))}};Vs.createLayout=Vs.makeLayout=Vs.layout;function n1(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 qs(t,e){return t=Zn(t),function(n){return n1(t,e,n)}}function zs(t,e){t=Zn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return n1(t,r,a)}}var kt={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 sc(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 lc(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||sc(i,n);var c=l.source,u=l.target;return r(c)&&(!o||sc(c,r))&&(c===u||r(u)&&(!o||sc(u,r)))}}}var Xa=qs("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});kt.takesUpSpace=zs("takesUpSpace",lc({ok:Xa}));var oz=qs("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Xa(t)}),sz=qs("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Xa(t)});kt.interactive=zs("interactive",lc({ok:oz,parentOk:sz,edgeOkViaNode:Xa})),kt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var lz=qs("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Xa(t)}),uz=Xa;kt.visible=zs("visible",lc({ok:lz,edgeOkViaNode:uz})),kt.hidden=function(){var t=this[0];if(t)return!t.visible()},kt.isBundledBezier=zs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),kt.bypass=kt.css=kt.style,kt.renderedCss=kt.renderedStyle,kt.removeBypass=kt.removeCss=kt.removeStyle,kt.pstyle=kt.parsedStyle;var Tn={};function a1(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 Ja(t){Tn[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]}},Tn[t.on]=a1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Tn[t.off]=a1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Ja({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Ja({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Ja({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Ja({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Tn.deselect=Tn.unselect,Tn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Ja({field:"active",on:"activate",off:"unactivate"}),Ja({field:"pannable",on:"panify",off:"unpanify"}),Tn.inactive=function(){var t=this[0];if(t)return!t._private.active};var It={},i1=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)}},o1=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)}},s1=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)}};It.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Se(It,{roots:i1({noIncomingEdges:!0}),leaves:i1({noOutgoingEdges:!0}),outgoers:nr(o1({outgoing:!0}),"outgoers"),successors:s1({outgoing:!0}),incomers:nr(o1({incoming:!0}),"incomers"),predecessors:s1({incoming:!0})}),Se(It,{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)}}),It.neighbourhood=It.neighborhood,It.closedNeighbourhood=It.closedNeighborhood,It.openNeighbourhood=It.openNeighborhood,Se(It,{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:l1({attr:"source"}),targets:l1({attr:"target"})});function l1(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(It,{edgesWith:nr(u1(),"edgesWith"),edgesTo:nr(u1({thisIsSrc:!0}),"edgesTo")});function u1(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(It,{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=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],m=g._private.data,y=m.target,b=m.source,w=y===h&&b===f,C=f===y&&h===b;(o.codirected&&w||!o.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}Se(It,{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]}}),It.componentsOf=It.components;var St=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])&&!zi(r[0])){o=!0;for(var l=[],c=new La,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=q0();else if(e.hasElementWithId(h.id)||c.has(h.id))continue;var v=new ms(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 m=r[p][0];if(m!=null){var y=m._private.data.id;(!n||!i.has(y))&&(n&&i.set(y,{index:this.length,ele:m}),this[this.length]=m,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,E=0;E<C.length;E++){var k=C[E];w.set(k.id(),{index:E,ele:k})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ge=ms.prototype=St.prototype=Object.create(Array.prototype);Ge.instanceString=function(){return"collection"},Ge.spawn=function(t,e){return new St(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 C0(this)?this:new St(this._private.cy,[this])},Ge.unique=function(){return new St(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 St(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,m,y){var b=t[g];b!=null&&b!==n[g]&&(b?e[m]():e[y]())};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 ms(t,a,!1);e.push(i)}return new St(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=q0();else if(de(g.id))g.id=""+g.id;else if(gn(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 m=g.id;if(v.isNode()){var y=p.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,E=!1,k=0;k<C;k++){var x=w[k],_=g[x];de(_)&&(_=g[x]=""+g[x]),_==null||_===""?(Je("Can not create edge `"+m+"` with unspecified "+x),E=!0):n.hasElementWithId(_)||(Je("Can not create edge `"+m+"` with nonexistant "+x+" `"+_+"`"),E=!0)}if(E){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(m,{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 L=!1,A=O;!A.empty();){if(B.same(A)){L=!0,P.parent=void 0;break}A=A.parent()}L||(O[0]._private.children.push(B),B._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var q=l.length===r.length?r:new St(n,l),U=0;U<q.length;U++){var z=q[U];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}var H;a.hasCompoundNodes?H=n.collection().merge(q).merge(q.connectedNodes()).merge(q.parent()):H=q,H.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?q.emitAndNotify("add"):e&&q.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;yn(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,L=D.id();yn(O,R),R._private.parent=null,p.ids[L]||(p.ids[L]=!0,p.push(D))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var y=n[m];if(y.isEdge()){var b=y.source()[0],w=y.target()[0];h(b,y),h(w,y);for(var C=y.parallelEdges(),E=0;E<C.length;E++){var k=C[E];v(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var x=y.parent();x.length!==0&&g(x,y)}e&&(y._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 St(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],m=g._private.data;g.isNode()&&(m.parent=h)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[pb,wq,Os,kn,Wa,Lq,As,Jq,e1,t1,nz,$s,Vs,kt,Tn,It].forEach(function(t){Se(Ge,t)});var cz={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 St(n,i)}}else if(Ke(e)){var c=e;r=new St(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 m=0,y=g.length;m<y;m++){var b=Se({group:p},g[m]);d.push(b)}}r=new St(n,d)}else{var w=e;r=new ms(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,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 m(T,N,B){return((v(N,B)*T+p(N,B))*T+g(N))*T}function y(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=y(N,t,r);if(P===0)return N;var D=m(N,t,r)-T;N-=D/P}return N}function w(){for(var T=0;T<c;++T)h[T]=m(T*u,t,r)}function C(T,N,B){var P,D,R=0;do D=N+(B-N)/2,P=m(D,t,r)-T,P>0?B=D:N=D;while(Math.abs(P)>o&&++R<l);return D}function E(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=y(R,t,r);return O>=i?b(T,R):O===0?R:C(T,N,N+u)}var k=!1;function x(){k=!0,(t!==e||r!==n)&&w()}var _=function(N){return k||x(),t===e&&r===n?N:N===0?0:N===1?1:m(E(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 fz=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=dz(e,r,n,a);return function(o,l,c){return o+(l-o)*i(c)}},Hs={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 Hs.linear;var a=fz(e,r,n);return function(i,o,l){return i+(o-i)*a(l)}},"cubic-bezier":Ue};function d1(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 f1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Qa(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=f1(t,a),l=f1(e,a);if(de(o)&&de(l))return d1(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=d1(i,d,f,r,n);c.push(h)}else c.push(f)}return c}}function hz(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=Hs.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(q){return+q})),p.length>0?(v==="spring"&&p.push(o.duration),o.easingImpl=Hs[v].apply(null,p)):o.easingImpl=Hs[v]}var g=o.easingImpl,m;if(o.duration===0?m=1:m=(r-c)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var y=o.startPosition,b=o.position;if(b&&a&&!t.locked()){var w={};uo(y.x,b.x)&&(w.x=Qa(y.x,b.x,m,g)),uo(y.y,b.y)&&(w.y=Qa(y.y,b.y,m,g)),t.position(w)}var C=o.startPan,E=o.pan,k=i.pan,x=E!=null&&n;x&&(uo(C.x,E.x)&&(k.x=Qa(C.x,E.x,m,g)),uo(C.y,E.y)&&(k.y=Qa(C.y,E.y,m,g)),t.emit("pan"));var _=o.startZoom,S=o.zoom,T=S!=null&&n;T&&(uo(_,S)&&(i.zoom=Ji(i.minZoom,Qa(_,S,m,g),i.maxZoom)),t.emit("zoom")),(x||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],L=d.properties[O.name],A=Qa(O,R,m,g,L);d.overrideBypass(t,D,A)}t.emit("style")}}return o.progress=m,m}function uo(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 h1(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 m=p.shift();m&&v.push(m)}for(var y=function(k){for(var x=k.length-1;x>=0;x--){var _=k[x];_()}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,y(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||pz(d,w,t),hz(d,w,t,f),C.applying&&(C.applying=!1),y(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,y(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 vz={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&&ps(function(i){h1(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){h1(o,e)},n.beforeRenderPriorities.animations):r()}},gz={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&&zi(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}},Ks=function(e){return Ee(e)?new En(e):e},p1={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ms(gz,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Ks(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Ks(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Ks(r),n),this},once:function(e,r,n){return this.emitter().one(e,Ks(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(p1);var uc={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)}};uc.jpeg=uc.jpg;var Gs={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}};Gs.createLayout=Gs.makeLayout=Gs.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)}})}},yz=xt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),cc={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=yz(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)}};cc.invalidateDimensions=cc.resize;var Us={collection:function(e,r){return Ee(e)?this.$(e):Zt(e)?e.collection():Ke(e)?(r||(r={}),new St(this,e,r.unique,r.removed)):new St(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}};Us.elements=Us.filter=Us.$;var Bt={},co="t",bz="f";Bt.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},Bt.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]===co,f=e[c]===co,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 m=p[g],y=m.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],E=e[w]===co;if(E&&(b=C.properties[m.name]!=null,b))break}!l[y]&&!b&&(l[y]=!0,o.push(y))}}}return n[a]=o,o},Bt.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+=co:r+=bz}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Bt.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]===co;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},Bt.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}},Bt.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",c=t._private.style;n=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[Ra,ji]}for(var f=function(Y,se){return e.styleKeys[se][0]=Wi(Y,e.styleKeys[se][0])},h=function(Y,se){return e.styleKeys[se][1]=Yi(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,m=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?g-(Y*1024|0):Y},y=0;y<n.length;y++){var b=n[y],w=c[b];if(w!=null){var C=this.properties[b],E=C.type,k=C.groupKey,x=void 0;C.hashOverride!=null?x=C.hashOverride(t,w):w.pfValue!=null&&(x=w.pfValue);var _=C.enums==null?w.value:null,S=x!=null,T=_!=null,N=S||T,B=w.units;if(E.number&&N&&!E.multiple){var P=S?x:_;v(m(P),k),!S&&B!=null&&p(B,k)}else p(w.strValue,k)}}for(var D=[Ra,ji],R=0;R<a.length;R++){var O=a[R],L=e.styleKeys[O];D[0]=Wi(L[0],D[0]),D[1]=Yi(L[1],D[1])}e.styleKey=kF(D[0],D[1]);var A=e.styleKeys;e.labelDimsKey=mn(A.labelDimensions);var q=i(t,["label"],A.labelDimensions);if(e.labelKey=mn(q),e.labelStyleKey=mn(vs(A.commonLabel,q)),!l){var U=i(t,["source-label"],A.labelDimensions);e.sourceLabelKey=mn(U),e.sourceLabelStyleKey=mn(vs(A.commonLabel,U));var z=i(t,["target-label"],A.labelDimensions);e.targetLabelKey=mn(z),e.targetLabelStyleKey=mn(vs(A.commonLabel,z))}if(l){var H=e.styleKeys,Q=H.nodeBody,F=H.nodeBorder,$=H.nodeOutline,V=H.backgroundImage,G=H.compound,j=H.pie,M=[Q,F,$,V,G,j].filter(function(W){return W!=null}).reduce(vs,[Ra,ji]);e.nodeKey=mn(M),e.hasPie=j!=null&&j[0]!==Ra&&j[1]!==ji}return o!==e.styleKey},Bt.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},Bt.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(Q){return Q==null?null:Q.pfValue!=null?Q.pfValue:Q.value},p=function(){var Q=v(u),F=v(n);r.checkTriggers(t,n.name,Q,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",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 m=n.field.split("."),y=f.data,b=0;b<m.length&&y;b++){var w=m[b];y=y[w]}if(y==null)return g(),!1;var C;if(de(y)){var E=n.fieldMax-n.fieldMin;E===0?C=0:C=(y-n.fieldMin)/E}else return $e("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var k=n.valueMin[0],x=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+(x-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("."),L=f.data,A=0;A<O.length&&L;A++){var q=O[A];L=L[q]}if(L!=null&&(i=this.parse(n.name,L,n.bypass,h)),!i)return g(),!1;i.mapping=n,n=i;break}case o.fn:{var U=n.value,z=n.fnValue!=null?n.fnValue:U(t);if(n.prevFnValue=z,z==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,z,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},Bt.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)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.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,m=!1,y=void 0,b=1e-6;p&&(de(p.pfValue)&&de(g.pfValue)?(m=g.pfValue-p.pfValue,y=p.pfValue+b*m):de(p.value)&&de(g.value)?(m=g.value-p.value,y=p.value+b*m):Ke(p.value)&&Ke(g.value)&&(m=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],y=p.strValue),m&&(l[d]=g.strValue,this.applyBypass(t,d,y),c=!0))}}if(!c)return;n.transitioning=!0,new Ha(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)},Bt.checkTrigger=function(t,e,r,n,a,i){var o=this.properties[e],l=a(o);l!=null&&l(r,n)&&i(o)},Bt.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)})},Bt.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()})})},Bt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var fo={};fo.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],m=h[g];if(m===void 0&&(m=h[ds(g)]),m!==void 0){var y=this.parse(g,m,!0);y&&i.push(y)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],E={},k=void 0,x=0;x<i.length;x++){var _=i[x];if(n){var S=C.pstyle(_.name);k=E[_.name]={prev:S}}b=this.applyParsedProperty(C,Nr(_))||b,n&&(k.next=C.pstyle(_.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,E,o)}return b},fo.overrideBypass=function(t,e,r){e=Au(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)}},fo.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},fo.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 dc={};dc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},dc.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[ds(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(m){return m*d},h=function(m,y){return f(m)+y},v=Ke(l),p=v?c.every(function(g){return g!=null}):c!=null;return p?v?l.map(function(g,m){return h(g,c[m])}).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[Au(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]=Wi(l,n[0]),n[1]=Yi(l,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)l=o.charCodeAt(u),n[0]=Wi(l,n[0]),n[1]=Yi(l,n[1]);return n},Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var js={};js.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},js.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},js.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 fc={};fc.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 En(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 m=i.match(/^\s*$/);if(m)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){$e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}o=y[0];var b=y[1],w=y[2],C=e.properties[b];if(!C){$e("Skipping property: Invalid property name in: "+o),c();continue}var E=r.parse(b,w);if(!E){$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 x=g[k];r.css(x.name,x.val)}l()}return r},fc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var _t={};(function(){var t=ft,e=TM,r=IM,n=BM,a=DM,i=function(M){return"^"+M+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(M){var W=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+M+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];_t.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(M,W){switch(M.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Ee(M[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(M){var W=M.length;return W===1||W===2||W===4}}};var c={zeroNonZero:function(M,W){return(M==null||W==null)&&M!==W||M==0&&W!=0?!0:M!=0&&W==0},any:function(M,W){return M!=W},emptyNonEmpty:function(M,W){var Y=gn(M),se=gn(W);return Y&&!se||!Y&&se}},u=_t.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}],m=[{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}],y=[{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(M,W){return W.value==="label"?-M.poolIndex():W.pfValue},E=[{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}],x=[{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=[];_t.pieBackgroundN=16,P.push({name:"pie-size",type:u.sizeMaybePercent});for(var D=1;D<=_t.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=_t.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(j){O.forEach(function(M){var W=M+"-"+j.name,Y=j.type,se=j.triggersBounds;R.push({name:W,type:Y,triggersBounds:se})})},{});var L=_t.properties=[].concat(g,w,m,y,b,N,p,v,d,f,h,E,k,x,_,P,S,T,R,B),A=_t.propertyGroups={behavior:g,transition:w,visibility:m,overlay:y,underlay:b,ghost:N,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:E,nodeBorder:k,nodeOutline:x,backgroundImage:_,pie:P,compound:S,edgeLine:T,edgeArrow:R,core:B},q=_t.propertyGroupNames={},U=_t.propertyGroupKeys=Object.keys(A);U.forEach(function(j){q[j]=A[j].map(function(M){return M.name}),A[j].forEach(function(M){return M.groupKey=j})});var z=_t.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"}];_t.propertyNames=L.map(function(j){return j.name});for(var H=0;H<L.length;H++){var Q=L[H];L[Q.name]=Q}for(var F=0;F<z.length;F++){var $=z[F],V=L[$.pointsTo],G={name:$.name,alias:!0,pointsTo:V};L.push(G),L[$.name]=G}})(),_t.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},_t.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<=_t.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 _t.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},_t.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 Ws={};Ws.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=L0(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},Ws.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},Ws.parseImpl=function(t,e,r,n){var a=this;t=Au(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 m=p.value,y=g.value,b=m[0]===y[0]&&m[1]===y[1]&&m[2]===y[2]&&(m[3]===y[3]||(m[3]==null||m[3]===1)&&(y[3]==null||y[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=[],E=[],k=[],x="",_=!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),E.push(T.units),x+=(S>0?" ":"")+T.strValue}return u.validate&&!u.validate(C,E)?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:x,bypass:r,units:E}}var N=function(){for(var M=0;M<u.enums.length;M++){var W=u.enums[M];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("^("+ft+")("+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&&!wM(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:e5(e)),B==="%"&&(O.pfValue=e/100),O}else if(u.propList){var L=[],A=""+e;if(A!=="none"){for(var q=A.split(/\s*,\s*|\s+/),U=0;U<q.length;U++){var z=q[U].trim();a.properties[z]?L.push(z):$e("`"+z+"` is not a valid property name")}if(L.length===0)return null}return{name:t,value:L,strValue:L.length===0?"none":L.join(" "),bypass:r}}else if(u.color){var H=MM(e);return H?{name:t,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var Q=N();if(Q)return Q}for(var F=u.regexes?u.regexes:[u.regex],$=0;$<F.length;$++){var V=new RegExp(F[$]),G=V.exec(e);if(G)return{name:t,value:u.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?N():null};var Dt=function t(e){if(!(this instanceof t))return new t(e);if(!Ou(e)){Je("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Pt=Dt.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 En(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[ds(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 E0(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this},Dt.fromJson=function(t,e){var r=new Dt(t);return r.fromJson(e),r},Dt.fromString=function(t,e){return new Dt(t).fromString(e)},[Bt,fo,dc,Br,js,fc,_t,Ws].forEach(function(t){Se(Pt,t)}),Dt.types=Pt.types,Dt.properties=Pt.properties,Dt.propertyGroups=Pt.propertyGroups,Dt.propertyGroupNames=Pt.propertyGroupNames,Dt.propertyGroupKeys=Pt.propertyGroupKeys;var wz={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return E0(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Dt.fromJson(this,e):Ee(e)?r.style=Dt.fromString(this,e):r.style=Dt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Cz="single",na={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=Cz),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(xM(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=ys(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}};na.centre=na.center,na.autolockNodes=na.autolock,na.autoungrabifyNodes=na.autoungrabify;var ho={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})};ho.attr=ho.data,ho.removeAttr=ho.removeData;var po=function(e){var r=this;e=Se({},e);var n=e.container;n&&!cs(n)&&cs(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=dt!==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,m){return g!==void 0?g:m!==void 0?m:p},u=this._private={container:n,ready:!1,options:l,elements:new St(this),listeners:[],aniEles:new St(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 m=p.some(kM);if(m)return Ha.all(p).then(g);g(p)};u.styleEnabled&&r.setStyle([]);var f=Se({},l,l.renderer);r.initRenderer(f);var h=function(p,g,m){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.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",m),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 m=0;m<i.length;m++){var y=i[m];r.on("ready",y)}a&&(a.readies=[]),r.emit("ready")},l.done)})},Ys=po.prototype;Se(Ys,{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 dt;var r=this._private.container.ownerDocument;return r===void 0||r==null?dt:r.defaultView||dt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!cs(e)&&cs(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,E){for(var k=[],x=[],_=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?x.push({ele:N,json:S}):(E&&(S.group=E),k.push(S))}r.add(k);for(var B=0;B<x.length;B++){var P=x[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 m=!!e,y={};m?y.elements=this.elements().map(function(w){return w.json()}):(y.elements={},a.forEach(function(w){var C=w.group();y.elements[C]||(y.elements[C]=[]),y.elements[C].push(w.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=Nr(r.data());var b=n.options;return y.zoomingEnabled=n.zoomingEnabled,y.userZoomingEnabled=n.userZoomingEnabled,y.zoom=n.zoom,y.minZoom=n.minZoom,y.maxZoom=n.maxZoom,y.panningEnabled=n.panningEnabled,y.userPanningEnabled=n.userPanningEnabled,y.pan=Nr(n.pan),y.boxSelectionEnabled=n.boxSelectionEnabled,y.renderer=Nr(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}}),Ys.$id=Ys.getElementById,[cz,vz,p1,uc,Gs,mz,cc,Us,wz,na,ho].forEach(function(t){Se(Ys,t)});var Ez={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}},xz={maximal:!1,acyclic:!1},ei=function(e){return e.scratch("breadthfirst")},v1=function(e,r){return e.scratch("breadthfirst",r)};function g1(t){this.options=Se({},Ez,xz,t)}g1.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 ue=p[ne],ie=ue.maxDegree(!1),fe=ue.filter(function(pe){return pe.degree(!1)===ie});u=u.add(fe)},m=0;m<p.length;m++)g(m)}var y=[],b={},w=function(ne,ue){y[ue]==null&&(y[ue]=[]);var ie=y[ue].length;y[ue].push(ne),v1(ne,{index:ie,depth:ue})},C=function(ne,ue){var ie=ei(ne),fe=ie.depth,pe=ie.index;y[fe][pe]=null,w(ne,ue)};i.bfs({roots:u,directed:e.directed,visit:function(ne,ue,ie,fe,pe){var De=ne[0],Ie=De.id();w(De,pe),b[Ie]=!0}});for(var E=[],k=0;k<a.length;k++){var x=a[k];b[x.id()]||E.push(x)}var _=function(ne){for(var ue=y[ne],ie=0;ie<ue.length;ie++){var fe=ue[ie];if(fe==null){ue.splice(ie,1),ie--;continue}v1(fe,{depth:ne,index:ie})}},S=function(){for(var ne=0;ne<y.length;ne++)_(ne)},T=function(ne,ue){for(var ie=ei(ne),fe=ne.incomers().filter(function(I){return I.isNode()&&n.has(I)}),pe=-1,De=ne.id(),Ie=0;Ie<fe.length;Ie++){var we=fe[Ie],xe=ei(we);pe=Math.max(pe,xe.depth)}if(ie.depth<=pe){if(!e.acyclic&&ue[De])return null;var re=pe+1;return C(ne,re),ue[De]=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 L=0;if(e.avoidOverlap)for(var A=0;A<a.length;A++){var q=a[A],U=q.layoutDimensions(e),z=U.w,H=U.h;L=Math.max(L,z,H)}var Q={},F=function(ne){if(Q[ne.id()])return Q[ne.id()];for(var ue=ei(ne).depth,ie=ne.neighborhood(),fe=0,pe=0,De=0;De<ie.length;De++){var Ie=ie[De];if(!(Ie.isEdge()||Ie.isParent()||!a.has(Ie))){var we=ei(Ie);if(we!=null){var xe=we.index,re=we.depth;if(!(xe==null||re==null)){var I=y[re].length;re<ue&&(fe+=xe/I,pe++)}}}}return pe=Math.max(1,pe),fe=fe/pe,pe===0&&(fe=0),Q[ne.id()]=fe,fe},$=function(ne,ue){var ie=F(ne),fe=F(ue),pe=ie-fe;return pe===0?S0(ne.id(),ue.id()):pe};e.depthSort!==void 0&&($=e.depthSort);for(var V=0;V<y.length;V++)y[V].sort($),_(V);for(var G=[],j=0;j<E.length;j++)G.push(E[j]);y.unshift(G),S();for(var M=0,W=0;W<y.length;W++)M=Math.max(y[W].length,M);var Y={x:c.x1+c.w/2,y:c.x1+c.h/2},se=y.reduce(function(ae,ne){return Math.max(ae,ne.length)},0),ce=function(ne){var ue=ei(ne),ie=ue.depth,fe=ue.index,pe=y[ie].length,De=Math.max(c.w/((e.grid?se:pe)+1),L),Ie=Math.max(c.h/(y.length+1),L),we=Math.min(c.w/2/y.length,c.h/2/y.length);if(we=Math.max(we,L),e.circle){var re=we*ie+we-(y.length>0&&y[0].length<=3?we/2:0),I=2*Math.PI/y[ie].length*fe;return ie===0&&y[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)*De,y:(ie+1)*Ie};return xe}};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 m1(t){this.options=Se({},kz,t)}m1.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,m=p.h;f=Math.max(f,g,m)}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 y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(y*y+b*b));d=Math.max(w,d)}var C=function(k,x){var _=e.startAngle+x*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 Sz={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 y1(t){this.options=Se({},Sz,t)}y1.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 m=e.levelWidth(i),y=[[]],b=y[0],w=0;w<c.length;w++){var C=c[w];if(b.length>0){var E=Math.abs(b[0].value-C.value);E>=m&&(b=[],y.push(b))}b.push(C)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var x=y.length>0&&y[0].length>1,_=Math.min(o.w,o.h)/2-k,S=_/(y.length+x?1:0);k=Math.min(k,S)}for(var T=0,N=0;N<y.length;N++){var B=y[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),L=Math.sqrt(k*k/(R*R+O*O));T=Math.max(L,T)}B.r=T,T+=k}if(e.equidistant){for(var A=0,q=0,U=0;U<y.length;U++){var z=y[U],H=z.r-q;A=Math.max(A,H)}q=0;for(var Q=0;Q<y.length;Q++){var F=y[Q];Q===0&&(q=F.r),F.r=q,q+=A}}for(var $={},V=0;V<y.length;V++)for(var G=y[V],j=G.dTheta,M=G.r,W=0;W<G.length;W++){var Y=G[W],se=e.startAngle+(r?1:-1)*j*W,ce={x:l.x+M*Math.cos(se),y:l.y+M*Math.sin(se)};$[Y.node.id()]=ce}return a.nodes().layoutPositions(this,e,function(ae){var ne=ae.id();return $[ne]}),this};var hc,_z={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 Zs(t){this.options=Se({},_z,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)}Zs.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?hc=!0:hc=!1;var n=Tz(e,r,t);hc&&Bz(n),t.randomize&&Dz(n);var a=Wr(),i=function(){Pz(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(Oz(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)}},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)C1(n,t),l();else{var v=Wr();v-a>=t.animationThreshold&&i(),ps(f)}};d()}else{for(;u;)u=o(c),c++;C1(n,t),l()}return this},Zs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Zs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Tz=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),m={};m.isLocked=p.locked(),m.id=p.data("id"),m.parentId=p.data("parent"),m.cmptId=u[p.id()],m.children=[],m.positionX=p.position("x"),m.positionY=p.position("y"),m.offsetX=0,m.offsetY=0,m.height=g.w,m.width=g.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(p.style("padding")),m.padRight=parseFloat(p.style("padding")),m.padTop=parseFloat(p.style("padding")),m.padBottom=parseFloat(p.style("padding")),m.nodeRepulsion=Xe(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,l.layoutNodes.push(m),l.idToIndex[m.id]=d}for(var y=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var p=l.layoutNodes[d],E=p.parentId;E!=null?l.layoutNodes[l.idToIndex[E]].children.push(p.id):(y[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var k=y[b++],x=l.idToIndex[k],v=l.layoutNodes[x],_=v.children;if(_.length>0){l.graphSet.push(_);for(var d=0;d<_.length;d++)y[++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],L=l.indexToGraph[R],A=l.indexToGraph[O];if(L!=A){for(var q=Nz(B.sourceId,B.targetId,l),U=l.graphSet[q],z=0,m=l.layoutNodes[R];U.indexOf(m.id)===-1;)m=l.layoutNodes[l.idToIndex[m.parentId]],z++;for(m=l.layoutNodes[O];U.indexOf(m.id)===-1;)m=l.layoutNodes[l.idToIndex[m.parentId]],z++;P*=z*n.nestingFactor}B.idealLength=P,B.elasticity=D,l.layoutEdges.push(B)}return l},Nz=function(e,r,n){var a=Iz(e,r,0,n);return 2>a.count?0:a.graph},Iz=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}},Bz,Dz=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 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}}},Pz=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}))},Oz=function(e,r,n){Az(e,r),Mz(e),Fz(e,r),$z(e),Vz(e)},Az=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]]];Rz(l,u,e,r)}},w1=function(e){return-e+2*e*Math.random()},Rz=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=w1(u),c=w1(u));var d=Lz(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=Xs(e,l,c),m=Xs(r,-1*l,-1*c),y=m.x-g.x,b=m.y-g.y,w=y*y+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*y/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},Lz=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},Xs=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)},Mz=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=Xs(o,u,d),h=Xs(c,-1*u,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),m=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var y=m*v/g,b=m*p/g;else var y=0,b=0;o.isLocked||(o.offsetX+=y,o.offsetY+=b),c.isLocked||(c.offsetX-=y,c.offsetY-=b)}}},Fz=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 m=r.gravity*v/g,y=r.gravity*p/g;h.offsetX+=m,h.offsetY+=y}}}}},$z=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}}},Vz=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=qz(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,zz(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)}},qz=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},zz=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)}},C1=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,m=0,y=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,m=Math.max(m,d.h),g>y&&(p+=m+r.componentSpacing,v=0,g=0,m=0)}}},Hz={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 E1(t){this.options=Se({},Hz,t)}E1.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(Q){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(F){if(F==null)return Math.min(c,u);var $=Math.min(c,u);$==c?c=F:u=F},f=function(F){if(F==null)return Math.max(c,u);var $=Math.max(c,u);$==c?c=F:u=F},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 m=d(),y=f();(y+1)*m>=o?f(y+1):d(m+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 E=a[C],k=E._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var x=E.layoutDimensions(e),_=e.avoidOverlapPadding,S=x.w+_,T=x.h+_;b=Math.max(b,S),w=Math.max(w,T)}for(var N={},B=function(F,$){return!!N["c-"+F+"-"+$]},P=function(F,$){N["c-"+F+"-"+$]=!0},D=0,R=0,O=function(){R++,R>=u&&(R=0,D++)},L={},A=0;A<a.length;A++){var q=a[A],U=e.position(q);if(U&&(U.row!==void 0||U.col!==void 0)){var z={row:U.row,col:U.col};if(z.col===void 0)for(z.col=0;B(z.row,z.col);)z.col++;else if(z.row===void 0)for(z.row=0;B(z.row,z.col);)z.row++;L[q.id()]=z,P(z.row,z.col)}}var H=function(F,$){var V,G;if(F.locked()||F.isParent())return!1;var j=L[F.id()];if(j)V=j.col*b+b/2+i.x1,G=j.row*w+w/2+i.y1;else{for(;B(D,R);)O();V=R*b+b/2+i.x1,G=D*w+w/2+i.y1,P(D,R),O()}return{x:V,y:G}};a.layoutPositions(this,e,H)}return this};var Kz={ready:function(){},stop:function(){}};function pc(t){this.options=Se({},Kz,t)}pc.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},pc.prototype.stop=function(){return this};var Gz={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 x1(t){this.options=Se({},Gz,t)}x1.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 YF(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 Uz={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 k1(t){this.options=Se({},Uz,t)}k1.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 jz=[{name:"breadthfirst",impl:g1},{name:"circle",impl:m1},{name:"concentric",impl:y1},{name:"cose",impl:Zs},{name:"grid",impl:E1},{name:"null",impl:pc},{name:"preset",impl:x1},{name:"random",impl:k1}];function S1(t){this.options=t,this.notifications=0}var _1=function(){},T1=function(){throw new Error("A headless instance can not render images")};S1.prototype={recalculateRenderedStyle:_1,notify:function(){this.notifications++},init:_1,isHeadless:function(){return!0},png:T1,jpg:T1};var vc={};vc.arrowShapeWidth=.3,vc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,h,v,p,g){var m=v.x-f/2-g,y=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=m<=u&&u<=y&&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),m=p*f,y=g*f,b=m+v.x,w=y+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],m=u[p+1];v.push(n(g,m,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,m,y){var b=i(a(this.points,p+2*y,g,m)),w=Gt(h,v,b);return w},roughCollide:r,draw:function(h,v,p,g){var m=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,m)},spacing:function(h){return 0},gap:o},d)};l("none",{collide:gs,roughCollide:gs,draw:Fu,spacing:$0,gap:$0}),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,m=n(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(u,p,m)},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 m=i(a(this.points,f+2*g,h,v)),y=i(a(this.pointsTee,f+2*g,h,v)),b=Gt(u,d,m)||Gt(u,d,y);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 m=v,y=Math.pow(m.x-u,2)+Math.pow(m.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)||y},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 m=i(a(this.points,f+2*g,h,v)),y=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Gt(u,d,m)||Gt(u,d,y);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 m=v,y=Math.pow(m.x-u,2)+Math.pow(m.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return y},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 aa={};aa.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]},aa.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(y){return parseFloat(r.getPropertyValue(y))},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]},aa.invalidateContainerClientCoordsCache=function(){this.containerBB=null},aa.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},aa.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 m(x,_){if(x.isNode()){if(g)return;g=x,l.push(x)}if(x.isEdge()&&(_==null||_<v))if(p){if(p.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=x,p=x,v=_??v;break}}}else l.push(x),p=x,v=_??v}function y(x){var _=x.outerWidth()+2*f,S=x.outerHeight()+2*f,T=_/2,N=S/2,B=x.position(),P=x.pstyle("corner-radius").value==="auto"?"auto":x.pstyle("corner-radius").pfValue,D=x._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(x)];if(R.checkPoint(t,e,0,_,S,B.x,B.y,P,D))return m(x,0),!0}}function b(x){var _=x._private,S=_.rscratch,T=x.pstyle("width").pfValue,N=x.pstyle("arrow-scale").value,B=T/2+d,P=B*B,D=B*2,A=_.source,q=_.target,R;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,L=0;L+3<O.length;L+=2)if(l5(t,e,O[L],O[L+1],O[L+2],O[L+3],D)&&P>(R=h5(t,e,O[L],O[L+1],O[L+2],O[L+3])))return m(x,R),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,L=0;L+5<S.allpts.length;L+=4)if(u5(t,e,O[L],O[L+1],O[L+2],O[L+3],O[L+4],O[L+5],D)&&P>(R=f5(t,e,O[L],O[L+1],O[L+2],O[L+3],O[L+4],O[L+5])))return m(x,R),!0}for(var A=A||_.source,q=q||_.target,U=a.getArrowWidth(T,N),z=[{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}],L=0;L<z.length;L++){var H=z[L],Q=i.arrowShapes[x.pstyle(H.name+"-arrow-shape").value],F=x.pstyle("width").pfValue;if(Q.roughCollide(t,e,U,H.angle,{x:H.x,y:H.y},F,d)&&Q.collide(t,e,U,H.angle,{x:H.x,y:H.y},F,d))return m(x),!0}u&&l.length>0&&(y(A),y(q))}function w(x,_,S){return gr(x,_,S)}function C(x,_){var S=x._private,T=h,N;_?N=_+"-":N="",x.boundingBox();var B=S.labelBounds[_||"main"],P=x.pstyle(N+"label").value,D=x.pstyle("text-events").strValue==="yes";if(!(!D||!P)){var R=w(S.rscratch,"labelX",_),O=w(S.rscratch,"labelY",_),L=w(S.rscratch,"labelAngle",_),A=x.pstyle(N+"text-margin-x").pfValue,q=x.pstyle(N+"text-margin-y").pfValue,U=B.x1-T-A,z=B.x2+T-A,H=B.y1-T-q,Q=B.y2+T-q;if(L){var F=Math.cos(L),$=Math.sin(L),V=function(ce,ae){return ce=ce-R,ae=ae-O,{x:ce*F-ae*$+R,y:ce*$+ae*F+O}},G=V(U,H),j=V(U,Q),M=V(z,H),W=V(z,Q),Y=[G.x+A,G.y+q,M.x+A,M.y+q,W.x+A,W.y+q,j.x+A,j.y+q];if(Gt(t,e,Y))return m(x),!0}else if($a(B,t,e))return m(x),!0}}for(var E=o.length-1;E>=0;E--){var k=o[E];k.isNode()?y(k)||C(k):b(k)||C(k)||C(k,"source")||C(k,"target")}return l},aa.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});zu(d,p)&&!W0(p,d)&&i.push(v)}else{var g=h,m=g._private,y=m.rscratch;if(y.startX!=null&&y.startY!=null&&!$a(d,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!$a(d,y.endX,y.endY))continue;if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){for(var b=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!s5(d,b[C])){w=!1;break}w&&i.push(g)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&i.push(g)}}return i};var Js={};Js.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,y,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),y=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=gt(p[0],p[2],p[4],.1),m=gt(p[1],p[3],p[5],.1);c=d-g,u=f-m}else c=d-y,u=f-b;e.srcArrowAngle=bs(c,u);var y=e.midX,b=e.midY;if(r&&(y=(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,E=e.ctrlpts,k,x,_,S;if(E.length/2%2===0){var T=p.length/2-1,N=T+2,B=N+2;k=gt(p[T],p[N],p[B],0),x=gt(p[T+1],p[N+1],p[B+1],0),_=gt(p[T],p[N],p[B],1e-4),S=gt(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=gt(p[T],p[N],p[B],.4999),x=gt(p[T+1],p[N+1],p[B+1],.4999),_=gt(p[T],p[N],p[B],.5),S=gt(p[T+1],p[N+1],p[B+1],.5)}c=_-k,u=S-x}if(e.midtgtArrowAngle=bs(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=bs(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=gt(p[D-6],p[D-4],p[D-2],.9),m=gt(p[D-5],p[D-3],p[D-1],.9);c=h-g,u=v-m}else c=h-y,u=v-b;e.tgtArrowAngle=bs(c,u)},Js.getArrowWidth=Js.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 gc,mc,Dr={},ir={},N1,I1,ia,Qs,Xr,oa,sa,Pr,ti,el,B1,D1,yc,bc,P1,O1=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)},Wz=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},Yz=function(e,r,n,a,i){if(e!==P1?O1(r,e,Dr):Wz(ir,Dr),O1(r,n,ir),N1=Dr.nx*ir.ny-Dr.ny*ir.nx,I1=Dr.nx*ir.nx-Dr.ny*-ir.ny,Xr=Math.asin(Math.max(-1,Math.min(1,N1))),Math.abs(Xr)<1e-6){gc=r.x,mc=r.y,sa=ti=0;return}ia=1,Qs=!1,I1<0?Xr<0?Xr=Math.PI+Xr:(Xr=Math.PI-Xr,ia=-1,Qs=!0):Xr>0&&(ia=-1,Qs=!0),r.radius!==void 0?ti=r.radius:ti=a,oa=Xr/2,el=Math.min(Dr.len/2,ir.len/2),i?(Pr=Math.abs(Math.cos(oa)*ti/Math.sin(oa)),Pr>el?(Pr=el,sa=Math.abs(Pr*Math.sin(oa)/Math.cos(oa))):sa=ti):(Pr=Math.min(el,ti),sa=Math.abs(Pr*Math.sin(oa)/Math.cos(oa))),yc=r.x+ir.nx*Pr,bc=r.y+ir.ny*Pr,gc=yc-ir.ny*sa*ia,mc=bc+ir.nx*sa*ia,B1=r.x+Dr.nx*Pr,D1=r.y+Dr.ny*Pr,P1=r};function A1(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 wc(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}:(Yz(t,e,r,n,a),{cx:gc,cy:mc,radius:sa,startX:B1,startY:D1,stopX:yc,stopY:bc,startAngle:Dr.ang+Math.PI/2*ia,endAngle:ir.ang-Math.PI/2*ia,counterClockwise:Qs})}var Ot={};Ot.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(E,k,x,_){var S=_-k,T=x-E,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),m=vr(g,2),y=m[0],b=m[1],w={x1:v,y1:p,x2:y,y2:b};a=u(v,p,y,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}},Ot.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)}},Ot.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),m=g.midptPts,y=g.vectorNormInverse,b={x:m.x1*v+m.x2*p,y:m.y1*v+m.y2*p};r.segpts.push(b.x+y.x*h,b.y+y.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")}},Ot.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,m=p+d/2,y=u+"_"+d;h=i[y]===void 0?i[y]=0:++i[y],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(m)*1.4*v*(h/3+1),o.y+Math.sin(m)*1.4*v*(h/3+1)]},Ot.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 m=50,y={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(y.x,b.x),y:Math.min(y.y,b.y)},C=.5,E=Math.max(C,Math.log(l*.01)),k=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(m,1.12)/100)*g*(p/3+1)*E,w.x-(1+Math.pow(m,1.12)/100)*g*(p/3+1)*k,w.y]},Ot.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},Ot.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,m=G0(p);h&&(d=l?l.pfValue[v]:o,f=c.value[v]),n?g=d:g=d!==void 0?m*d:void 0;var y=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),E=C.midptPts,k=C.vectorNormInverse,x={x:E.x1*b+E.x2*w,y:E.y1*b+E.y2*w};i.ctrlpts.push(x.x+k.x*y,x.y+k.y*y)}},Ot.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,m=g!=="node-position",y=t.pstyle("taxi-direction").value,b=y,w=t.pstyle("taxi-turn"),C=w.units==="%",E=w.pfValue,k=E<0,x=t.pstyle("taxi-turn-min-distance").pfValue,_=m?(f+v)/2:0,S=m?(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?y=Math.abs(P)>Math.abs(D)?a:n:b===c||b===l?(y=n,R=!0):(b===i||b===o)&&(y=a,R=!0);var O=y===n,L=O?D:P,A=O?N:T,q=G0(A),U=!1;!(R&&(C||k))&&(b===l&&A<0||b===c&&A>0||b===i&&A>0||b===o&&A<0)&&(q*=-1,L=q*Math.abs(L),U=!0);var z;if(C){var H=E<0?1+E:E;z=H*L}else{var Q=E<0?L:0;z=Q+E*q}var F=function(me){return Math.abs(me)<x||Math.abs(me)>=Math.abs(L)},$=F(z),V=F(Math.abs(L)-Math.abs(z)),G=$||V;if(G&&!U)if(O){var j=Math.abs(A)<=h/2,M=Math.abs(T)<=v/2;if(j){var W=(d.x1+d.x2)/2,Y=d.y1,se=d.y2;r.segpts=[W,Y,W,se]}else if(M){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(A)<=f/2,ie=Math.abs(N)<=p/2;if(ue){var fe=(d.y1+d.y2)/2,pe=d.x1,De=d.x2;r.segpts=[pe,fe,De,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+z+(m?h/2*q:0),I=d.x1,K=d.x2;r.segpts=[I,re,K,re]}else{var te=d.x1+z+(m?f/2*q:0),Z=d.y1,X=d.y2;r.segpts=[te,Z,te,X]}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)}},Ot.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),m=!de(r.arrowStartX)||!de(r.arrowStartY),y=!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,E=w*C,k=Xn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),x=k<E,_=Xn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=_<E,T=!1;if(g||m||x){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);x?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(E-k),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(E-k)):(r.ctrlpts[0]=O[0]+P.x*E,r.ctrlpts[1]=O[1]+P.y*E)}if(y||b||S){T=!0;var L={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},A=Math.sqrt(L.x*L.x+L.y*L.y),q={x:L.x/A,y:L.y/A},U=Math.max(i,o),z={x:r.ctrlpts[0]+q.x*2*U,y:r.ctrlpts[1]+q.y*2*U},H=d.intersectLine(a.x,a.y,l,c,z.x,z.y,0,h,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+q.x*(E-_),r.ctrlpts[1]=r.ctrlpts[1]+q.y*(E-_)):(r.ctrlpts[0]=H[0]+q.x*E,r.ctrlpts[1]=H[1]+q.y*E)}T&&this.findEndpoints(t)}},Ot.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=gt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=gt(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(wc({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}}}},Ot.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."))},Ot.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(x){var _=this.map.get(x[0]);return _!=null?_.get(x[1]):null},set:function(x,_){var S=this.map.get(x[0]);S==null&&(S=new Ir,this.map.set(x[0],S)),S.set(x[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,m=p.poolIndex(),y=g.poolIndex(),b=[m,y].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(x){var _=o[x],S=i.get(_),T=void 0;if(!S.hasUnbundled){var N=S.eles[0].parallelEdges().filter(function(te){return te.isBundledBezier()});$u(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(),L=S.tgtPos=D.position(),A=S.srcW=P.outerWidth(),q=S.srcH=P.outerHeight(),U=S.tgtW=D.outerWidth(),z=S.tgtH=D.outerHeight(),H=S.srcShape=r.nodeShapes[e.getNodeShape(P)],Q=S.tgtShape=r.nodeShapes[e.getNodeShape(D)],F=S.srcCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,$=S.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,V=S.tgtRs=D._private.rscratch,G=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 j=0;j<S.eles.length;j++){var M=S.eles[j],W=M[0]._private.rscratch,Y=M.pstyle("curve-style").value,se=Y==="unbundled-bezier"||Y.endsWith("segments")||Y.endsWith("taxi"),ce=!P.same(M.source());if(!S.calculatedIntersection&&P!==D&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ae=H.intersectLine(O.x,O.y,A,q,L.x,L.y,0,F,G),ne=S.srcIntn=ae,ue=Q.intersectLine(L.x,L.y,U,z,O.x,O.y,0,$,V),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:L.x,y1:O.y,y2:L.y},De=ue[1]-ae[1],Ie=ue[0]-ae[0],we=Math.sqrt(Ie*Ie+De*De),xe=S.vector={x:Ie,y:De},re=S.vectorNorm={x:xe.x/we,y:xe.y/we},I={x:-re.y,y:re.x};S.nodesOverlap=!de(we)||Q.checkPoint(ae[0],ae[1],0,U,z,L.x,L.y,$,V)||H.checkPoint(ue[0],ue[1],0,A,q,O.x,O.y,F,G),S.vectorNormInverse=I,T={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:L,tgtPos:O,srcW:U,srcH:z,tgtW:A,tgtH:q,srcIntn:ie,tgtIntn:ne,srcShape:Q,tgtShape:H,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 K=ce?T:S;W.nodesOverlap=K.nodesOverlap,W.srcIntn=K.srcIntn,W.tgtIntn=K.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(M,K,j,se):P===D?e.findLoopPoints(M,K,j,se):Y.endsWith("segments")?e.findSegmentsPoints(M,K):Y.endsWith("taxi")?e.findTaxiPoints(M,K):Y==="straight"||!se&&S.eles.length%2===1&&j===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(M):e.findBezierPoints(M,K,j,se,ce),e.findEndpoints(M),e.tryToCorrectInvalidPoints(M,K),e.checkForInvalidEdgeWarning(M),e.storeAllpts(M),e.storeEdgeProjections(M),e.calculateArrowAngles(M),e.recalculateEdgeLabelProjections(M),e.calculateLabelAngles(M)}},E=0;E<o.length;E++)C(E);this.findHaystackPoints(l)}};function R1(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}}Ot.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),R1(e.segpts)},Ot.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),R1(e.ctrlpts)},Ot.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var vo={};vo.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)}},vo.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,m=v==="taxi",y=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||y,w=g!=="bezier",C=g==="straight"||g==="segments",E=g==="segments",k=b||w||C,x=y||m,_=t.pstyle("source-endpoint"),S=x?"outside-to-node":_.value,T=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),B=x?"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,L;if(b){var A=[p.ctrlpts[0],p.ctrlpts[1]],q=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:A;D=q,R=A}else if(C){var U=E?p.segpts.slice(0,2):[o.x,o.y],z=E?p.segpts.slice(p.segpts.length-2):[i.x,i.y];D=z,R=U}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 H=a._private.rscratch,Q=H.labelWidth,F=H.labelHeight,$=H.labelX,V=H.labelY,G=Q/2,j=F/2,M=a.pstyle("text-valign").value;M==="top"?V-=j:M==="bottom"&&(V+=j);var W=a.pstyle("text-halign").value;W==="left"?$-=G:W==="right"&&($+=G);var Y=eo(O[0],O[1],[$-G,V-j,$+G,V-j,$+G,V+j,$-G,V+j],o.x,o.y);if(Y.length>0){var se=i,ce=Jn(se,Ma(r)),ae=Jn(se,Ma(Y)),ne=ce;if(ae<ce&&(r=Y,ne=ae),Y.length>2){var ue=Jn(se,{x:Y[2],y:Y[3]});ue<ne&&(r=[Y[2],Y[3]])}}}var ie=ks(r,D,e.arrowShapes[l].spacing(t)+u),fe=ks(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"?L=R:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(L=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),L[0],L[1],0,T,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var pe=n._private.rscratch,De=pe.labelWidth,Ie=pe.labelHeight,we=pe.labelX,xe=pe.labelY,re=De/2,I=Ie/2,K=n.pstyle("text-valign").value;K==="top"?xe-=I:K==="bottom"&&(xe+=I);var te=n.pstyle("text-halign").value;te==="left"?we-=re:te==="right"&&(we+=re);var Z=eo(L[0],L[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 X=o,le=Jn(X,Ma(r)),ee=Jn(X,Ma(Z)),oe=le;if(ee<le&&(r=[Z[0],Z[1]],oe=ee),Z.length>2){var me=Jn(X,{x:Z[2],y:Z[3]});me<oe&&(r=[Z[2],Z[3]])}}}var be=ks(r,R,e.arrowShapes[c].spacing(t)+d),ye=ks(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)},vo.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}}},vo.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 Cc={};function Zz(t,e,r){for(var n=function(u,d,f,h){return gt(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)})}}Cc.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)Zz(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},Cc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Or={};Or.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!gn(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 L1=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},M1=function(e,r){var n=r.x-e.x,a=r.y-e.y;return L1(n,a)},Xz=function(e,r,n,a){var i=Ji(0,a-.001,1),o=Ji(0,a+.001,1),l=Fa(e,r,n,i),c=Fa(e,r,n,o);return M1(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){bn(r.rscratch,f,h,v),bn(r.rstyle,f,h,v)};o("labelX",null,e.x),o("labelY",null,e.y);var l=L1(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 m=r.rstyle.bezierPts,y=a.bezierProjPcts.length;function b(x,_,S,T,N){var B=Xn(_,S),P=x.segments[x.segments.length-1],D={p0:_,p1:S,t0:T,t1:N,startDist:P?P.startDist+P.length:0,length:B};x.segments.push(D),x.length+=B}for(var w=0;w<f.length;w++){var C=f[w],E=f[w-1];E&&(C.startDist=E.startDist+E.length),b(C,C.p0,m[w*y],0,a.bezierProjPcts[0]);for(var k=0;k<y-1;k++)b(C,m[w*y+k],m[w*y+k+1],a.bezierProjPcts[k],a.bezierProjPcts[k+1]);b(C,m[w*y+y-1],C.p2,a.bezierProjPcts[y-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(),m,y=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],E=0;E<C.segments.length;E++){var k=C.segments[v?E:C.segments.length-1-E],x=w===g.length-1&&E===C.segments.length-1;if(y=b,b+=k.length,b>=p||x){m={cp:C,segment:k};break}}if(m)break}var _=m.cp,S=m.segment,T=(p-y)/S.length,N=S.t1-S.t0,B=v?S.t0+N*T:S.t1-N*T;B=Ji(0,B,1),e=Fa(_.p0,_.p1,_.p2,B),h=Xz(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var P=0,D,R,O,L,A=n.allpts.length,q=0;q+3<A&&(v?(O={x:n.allpts[q],y:n.allpts[q+1]},L={x:n.allpts[q+2],y:n.allpts[q+3]}):(O={x:n.allpts[A-2-q],y:n.allpts[A-1-q]},L={x:n.allpts[A-4-q],y:n.allpts[A-3-q]}),D=Xn(O,L),R=P,P+=D,!(P>=p));q+=2);var U=p-R,z=U/D;z=Ji(0,z,1),e=r5(O,L,z),h=M1(O,L);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;bn(r.rstyle,"labelWidth",e,f),bn(r.rscratch,"labelWidth",e,f),bn(r.rstyle,"labelHeight",e,h),bn(r.rscratch,"labelHeight",e,h),bn(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(Q,F){return F?(bn(r.rscratch,Q,e,F),F):gr(r.rscratch,Q,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,m=0;m<d.length;m++){var y=d[m],b=this.calculateLabelDimensions(t,y),w=b.width;if(v){var C=y.split("").join(u);y=C}if(w>f){var E=y.matchAll(g),k="",x=0,_=y0(E),S;try{for(_.s();!(S=_.n()).done;){var T=S.value,N=T[0],B=y.substring(x,T.index);x=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(H){_.e(H)}finally{_.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(y)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
43
43
  `)),o("labelWrapKey",c)}else if(l==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,L="",A="…",q=!1;if(this.calculateLabelDimensions(t,a).width<O)return a;for(var U=0;U<a.length;U++){var z=this.calculateLabelDimensions(t,L+a[U]+A).width;if(z>O)break;L+=a[U],U===a.length-1&&(q=!0)}return q||(L+=A),L}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=Zn(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 m=0,y=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;m=Math.max(k,m),y+=E}return m+=c,y+=c,o[i]={width:m,height:y}},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 M1={},F1=28,$1=!1;M1.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<F1||t.height()<F1))return $1||($e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),$1=!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 tl={};tl.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)},tl.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},tl.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],m=g._private,y=m.rstyle,b=m.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var rl={};rl.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)}}},rl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},rl.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(t1),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var V1={};[aa,Qs,Ot,vo,Cc,Or,M1,tl,rl].forEach(function(t){Se(V1,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:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var ti={};ti.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},ti.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||CM(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}},ti.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},ti.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},ti.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},n=function(I,K,te,Z){I==null&&(I=t.cy);for(var X=0;X<K.length;X++){var le=K[X];I.emit({originalEvent:te,type:le,position:Z})}},a=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},i=function(I,K){var te=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var Z=0;K&&Z<K.length;Z++){var I=K[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,K){var te=K.addToList,Z=te.has(I);!Z&&I.grabbable()&&!I.locked()&&(te.merge(I),o(I))},v=function(I,K){if(I.cy().hasCompoundNodes()&&!(K.inDragLayer==null&&K.addToList==null)){var te=I.descendants();K.inDragLayer&&(te.forEach(c),te.connectedEdges().forEach(c)),K.addToList&&h(te,K)}},p=function(I,K){K=K||{};var te=I.cy().hasCompoundNodes();K.inDragLayer&&(I.forEach(c),I.neighborhood().stdFilter(function(Z){return!te||Z.isEdge()}).forEach(c)),K.addToList&&I.forEach(function(Z){h(Z,K)}),v(I,K),y(I,{inDragLayer:K.inDragLayer}),t.updateCachedGrabbedEles()},g=p,m=function(I){I&&(t.getCachedZSortedEles().forEach(function(K){l(K),u(K),f(K)}),t.updateCachedGrabbedEles())},y=function(I,K){if(!(K.inDragLayer==null&&K.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()),X=Z.connectedEdges();K.inDragLayer&&(X.forEach(c),Z.forEach(c)),K.addToList&&Z.forEach(function(le){h(le,K)})}}},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 K=re[I],te=K.removedNodes;if(te)for(var Z=0;Z<te.length;Z++){var X=te[Z];if(X===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=hs(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,K){for(;I!=null;)K(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 K=t.findContainerClientCoords(),te=K[0],Z=K[1],X=K[2],le=K[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+X&&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 K=t.cy,te=[I.clientX,I.clientY],Z=t.projectIntoViewport(te[0],te[1]),X=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]}}):K.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):K.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=K.collection(),g(ee,{addToList:oe}),ee.emit(ye("grabon")).emit(ye("grab"));else{oe=t.dragData.possibleDragElements=K.collection();var ge=K.$(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?(X[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(X[4]=1),me()}X[0]=X[2]=Z[0],X[1]=X[3]=Z[1]}},!1),t.registerBinding(e,"mousemove",function(I){var K=t.hoverData.capture;if(!(!K&&!S(I))){var te=!1,Z=t.cy,X=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 it=le[0]-me[0],ot=it*it,et=le[1]-me[1],At=et*et,pt=ot+At;t.hoverData.isOverThresholdDrag=qe=pt>=t.desktopTapThreshold2}var mt=a(I);qe&&(t.hoverData.tapholdCancelled=!0);var Qt=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 Rt=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 Lt={originalEvent:I,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};ge?ge.emit(Lt):Z.emit(Lt),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])*X,y:(ee[1]-Cr[1])*X},t.hoverData.justStartedPan=!1}else lr={x:Ce[0]*X,y:Ce[1]*X};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()&&(mt||!Z.panningEnabled()||!Z.userPanningEnabled()))Rt();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=La(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()&&mt)ge&&ge.grabbed()&&(m(je),ge.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(ge.emit("dragfreeon"),je.emit("dragfree"))),Rt();else if(ge&&ge.grabbed()&&t.nodeIsDraggable(ge)){var tt=!t.dragData.didDrag;tt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(je,{inDragLayer:!0});var st={x:0,y:0};if(de(Ce[0])&&de(Ce[1])&&(st.x+=Ce[0],st.y+=Ce[1],tt)){var yt=t.hoverData.dragDelta;yt&&de(yt[0])&&de(yt[1])&&(st.x+=yt[0],st.y+=yt[1])}t.hoverData.draggingEles=!0,je.silentShift(st).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Qt();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 K=t.hoverData.capture;if(K){t.hoverData.capture=!1;var te=t.cy,Z=t.projectIntoViewport(I.clientX,I.clientY),X=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(X[0],X[1],X[2],X[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()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ce=oe&&oe.grabbed();m(ee),Ce&&(oe.emit("freeon"),ee.emit("free"),t.dragData.didDrag&&(oe.emit("dragfreeon"),ee.emit("dragfree")))}}X[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 K=t.cy,te=K.zoom(),Z=K.pan(),X=t.projectIntoViewport(I.clientX,I.clientY),le=[X[0]*te+Z.x,X[1]*te+Z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){I.preventDefault();return}if(K.panningEnabled()&&K.userPanningEnabled()&&K.zoomingEnabled()&&K.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=K.zoom()*Math.pow(10,ee);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),K.zoom({level:me,renderedPosition:{x:le[0],y:le[1]}}),K.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 K=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:K[0],y:K[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var K=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:K[0],y:K[1]}})},!1);var D,R,O,L,A,q,U,z,H,J,F,$,V,G=function(I,K,te,Z){return Math.sqrt((te-I)*(te-I)+(Z-K)*(Z-K))},j=function(I,K,te,Z){return(te-I)*(te-I)+(Z-K)*(Z-K)},M;t.registerBinding(t.container,"touchstart",M=function(I){if(t.hasTouchStarted=!0,!!S(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var K=t.cy,te=t.touchData.now,Z=t.touchData.earlier;if(I.touches[0]){var X=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);te[0]=X[0],te[1]=X[1]}if(I.touches[1]){var X=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);te[2]=X[0],te[3]=X[1]}if(I.touches[2]){var X=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);te[4]=X[0],te[5]=X[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var le=t.findContainerClientCoords();H=le[0],J=le[1],F=le[2],$=le[3],D=I.touches[0].clientX-H,R=I.touches[0].clientY-J,O=I.touches[1].clientX-H,L=I.touches[1].clientY-J,V=0<=D&&D<=F&&0<=O&&O<=F&&0<=R&&R<=$&&0<=L&&L<=$;var ee=K.pan(),oe=K.zoom();A=G(D,R,O,L),q=j(D,R,O,L),U=[(D+O)/2,(R+L)/2],z=[(U[0]-ee.x)/oe,(U[1]-ee.y)/oe];var me=200,be=me*me;if(q<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):K.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])K.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=K.collection(),qe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ce.selected()?(qe=K.$(function(pt){return pt.selected()&&t.nodeIsGrabbable(pt)}),p(qe,{addToList:je})):g(Ce,{addToList:je}),d(Ce);var it=function(mt){return{originalEvent:I,type:mt,position:{x:te[0],y:te[1]}}};Ce.emit(it("grabon")),qe?qe.forEach(function(pt){pt.emit(it("grab"))}):Ce.emit(it("grab"))}n(Ce,["touchstart","tapstart","vmousedown"],I,{x:te[0],y:te[1]}),Ce==null&&(t.data.bgActivePosistion={x:X[0],y:X[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 ot=t.touchData.startPosition=[null,null,null,null,null,null],et=0;et<te.length;et++)ot[et]=Z[et]=te[et];var At=I.touches[0];t.touchData.startGPosition=[At.clientX,At.clientY]}}},!1);var W;t.registerBinding(e,"touchmove",W=function(I){var K=t.touchData.capture;if(!(!K&&!S(I))){var te=t.selection,Z=t.cy,X=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);X[0]=oe[0],X[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);X[2]=oe[0],X[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);X[4]=oe[0],X[5]=oe[1]}var me=t.touchData.startGPosition,be;if(K&&I.touches[0]&&me){for(var ye=[],_e=0;_e<X.length;_e++)ye[_e]=X[_e]-le[_e];var ge=I.touches[0].clientX-me[0],Ce=ge*ge,je=I.touches[0].clientY-me[1],qe=je*je,it=Ce+qe;be=it>=t.touchTapThreshold2}if(K&&t.touchData.cxt){I.preventDefault();var ot=I.touches[0].clientX-H,et=I.touches[0].clientY-J,At=I.touches[1].clientX-H,pt=I.touches[1].clientY-J,mt=j(ot,et,At,pt),Qt=mt/q,Rt=150,Lt=Rt*Rt,lr=1.5,Cr=lr*lr;if(Qt>=Cr||mt>=Lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var jt={originalEvent:I,type:"cxttapend",position:{x:X[0],y:X[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(jt),t.touchData.start=null):Z.emit(jt)}}if(K&&t.touchData.cxt){var jt={originalEvent:I,type:"cxtdrag",position:{x:X[0],y:X[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 tt=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||tt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:X[0],y:X[1]}}),t.touchData.cxtOver=tt,tt&&tt.emit({originalEvent:I,type:"cxtdragover",position:{x:X[0],y:X[1]}}))}else if(K&&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:X[0],y:X[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(X[0]+X[2]+X[4])/3,te[1]=(X[1]+X[3]+X[5])/3,te[2]=(X[0]+X[2]+X[4])/3+1,te[3]=(X[1]+X[3]+X[5])/3+1):(te[2]=(X[0]+X[2]+X[4])/3,te[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(K&&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 st=t.dragData.touchDragEles;if(st){t.redrawHint("drag",!0);for(var yt=0;yt<st.length;yt++){var Pn=st[yt]._private;Pn.grabbed=!1,Pn.rscratch.inDragLayer=!1}}var Q=t.touchData.start,ot=I.touches[0].clientX-H,et=I.touches[0].clientY-J,At=I.touches[1].clientX-H,pt=I.touches[1].clientY-J,he=G(ot,et,At,pt),Oe=he/A;if(V){var He=ot-D,Mr=et-R,On=At-O,fi=pt-L,rn=(He+On)/2,ur=(Mr+fi)/2,An=Z.zoom(),Eg=An*Oe,kl=Z.pan(),S_=z[0]*An+kl.x,__=z[1]*An+kl.y,XK={x:-Eg/An*(S_-kl.x-rn)+S_,y:-Eg/An*(__-kl.y-ur)+__};if(Q&&Q.active()){var st=t.dragData.touchDragEles;m(st),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Q.unactivate().emit("freeon"),st.emit("free"),t.dragData.didDrag&&(Q.emit("dragfreeon"),st.emit("dragfree"))}Z.viewport({zoom:Eg,pan:XK,cancelOnFailedZoom:!0}),Z.emit("pinchzoom"),A=he,D=ot,R=et,O=At,L=pt,t.pinching=!0}if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);X[0]=oe[0],X[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);X[2]=oe[0],X[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);X[4]=oe[0],X[5]=oe[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Er=t.touchData.start,xg=t.touchData.last,tt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(tt=t.findNearestElement(X[0],X[1],!0,!0)),K&&Er!=null&&I.preventDefault(),K&&Er!=null&&t.nodeIsDraggable(Er))if(be){var st=t.dragData.touchDragEles,T_=!t.dragData.didDrag;T_&&p(st,{inDragLayer:!0}),t.dragData.didDrag=!0;var No={x:0,y:0};if(de(ye[0])&&de(ye[1])&&(No.x+=ye[0],No.y+=ye[1],T_)){t.redrawHint("eles",!0);var xr=t.touchData.dragDelta;xr&&de(xr[0])&&de(xr[1])&&(No.x+=xr[0],No.y+=xr[1])}t.hoverData.draggingEles=!0,st.silentShift(No).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||tt,["touchmove","tapdrag","vmousemove"],I,{x:X[0],y:X[1]}),(!Er||!Er.grabbed())&&tt!=xg&&(xg&&xg.emit({originalEvent:I,type:"tapdragout",position:{x:X[0],y:X[1]}}),tt&&tt.emit({originalEvent:I,type:"tapdragover",position:{x:X[0],y:X[1]}})),t.touchData.last=tt,K)for(var yt=0;yt<X.length;yt++)X[yt]&&t.touchData.startPosition[yt]&&be&&(t.touchData.singleTouchMoved=!0);if(K&&(Er==null||Er.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var QK=i(Er,t.touchData.starts);QK&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=La(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);X[0]=oe[0],X[1]=oe[1]}}for(var _e=0;_e<X.length;_e++)le[_e]=X[_e];K&&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 K=t.touchData.start;t.touchData.capture=!1,K&&K.unactivate()});var se,ce,ae,ne;if(t.registerBinding(e,"touchend",se=function(I){var K=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 X=t.cy,le=X.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]}K&&K.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:ee[0],y:ee[1]}},K?K.emit(be):X.emit(be),!t.touchData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:ee[0],y:ee[1]}};K?K.emit(ye):X.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]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var _e=X.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),X.emit({type:"boxend",originalEvent:I,position:{x:ee[0],y:ee[1]}});var ge=function(Lt){return Lt.selectable()&&!Lt.selected()};_e.emit("box").stdFilter(ge).select().emit("boxselect"),_e.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(K!=null&&K.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(K!=null){var je=K._private.grabbed;m(Ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(K.emit("freeon"),Ce.emit("free"),t.dragData.didDrag&&(K.emit("dragfreeon"),Ce.emit("dragfree"))),n(K,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]}),K.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 it=t.touchData.startPosition[0]-ee[0],ot=it*it,et=t.touchData.startPosition[1]-ee[1],At=et*et,pt=ot+At,mt=pt*le*le;t.touchData.singleTouchMoved||(K||X.$(":selected").unselect(["tapunselect"]),n(K,["tap","vclick"],I,{x:ee[0],y:ee[1]}),ce=!1,I.timeStamp-ne<=X.multiClickDebounceTime()?(ae&&clearTimeout(ae),ce=!0,ne=null,n(K,["dbltap","vdblclick"],I,{x:ee[0],y:ee[1]})):(ae=setTimeout(function(){ce||n(K,["onetap","voneclick"],I,{x:ee[0],y:ee[1]})},X.multiClickDebounceTime()),ne=I.timeStamp)),K!=null&&!t.dragData.didDrag&&K._private.selectable&&mt<t.touchTapThreshold2&&!t.pinching&&(X.selectionType()==="single"?(X.$(r).unmerge(K).unselect(["tapunselect"]),K.select(["tapselect"])):K.selected()?K.unselect(["tapunselect"]):K.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Qt=0;Qt<ee.length;Qt++)oe[Qt]=ee[Qt];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))},De=function(I){for(var K=0;K<ue.length;K++){var te=ue[K];if(te.event.pointerId===I.pointerId){ue.splice(K,1);return}}},Ie=function(I){var K=ue.filter(function(te){return te.event.pointerId===I.pointerId})[0];K.event=I,K.touch=ie(I)},we=function(I){I.touches=ue.map(function(K){return K.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),M(re))}),t.registerBinding(t.container,"pointerup",function(re){xe(re)||(De(re),we(re),se(re))}),t.registerBinding(t.container,"pointercancel",function(re){xe(re)||(De(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 eo(l,c,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,l,c,u,d){return Yr(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 Jn(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"?Z0(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,m,y,b=h.length;for(g=h[b-1],p=0;p<b;p++)m=h[p%b],y=h[(p+1)%b],c[u][p]=wc(g,m,y,l),g=m,m=y;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 v5(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 h5(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:Ft(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 W0(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"?ea(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Yr(e,r,this.points,o,l,a,i-f,[0,-1],n)||Yr(e,r,this.points,o,l,a-f,i,[0,-1],n)||Jn(e,r,f,f,o-u+c,l-d+c,n)||Jn(e,r,f,f,o+u-c,l-d+c,n)||Jn(e,r,f,f,o+u-c,l+d-c,n)||Jn(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:Gu(),points:Ft(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 eo(i,o,d,e,r)},checkPoint:function(e,r,n,a,i,o,l,c){var u=c==="auto"?this.cornerLength:c;if(Yr(e,r,this.points,o,l,a,i-2*u,[0,-1],n)||Yr(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:Ft(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(m){var y=Ma({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),b=Ma({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},d),w=Ma({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},f);return[m[0],m[1],y.x,y.y,b.x,b.y,w.x,w.y,m[4],m[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return eo(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=Uu(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=Uu(a,i),d=u.heightOffset,f=u.widthOffset;if(Yr(e,r,this.points,o,l,a,i-2*d,[0,-1],n)||Yr(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),L=Math.max(N,P),A=Math.min(D,R),q=Math.max(D,R);if(O<=_&&_<=L&&A<=S&&S<=q){var U=g5(N,B,P),z=u5(U[0],U[1],U[2],_),H=z.filter(function(J){return 0<=J&&J<=1});if(H.length>0)return H[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var m=p[g],y=h[m],b=v(e,r,y);if(b!=null){var w=y[5],C=y[3],x=y[1],k=gt(w,C,x,b);if(y.isTop&&k<=r||y.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:Ft(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=wn(i,o,e,r,u,d,h,f,!1);return v.length>0?v:W0(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){c=c==="auto"?ea(a,i):c;var u=2*c;if(Yr(e,r,this.points,o,l,a,i-u,[0,-1],n)||Yr(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)||Jn(e,r,u,u,o+a/2-c,l+i/2-c,n)||Jn(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",Ft(3,0)),this.generateRoundPolygon("round-triangle",Ft(3,0)),this.generatePolygon("rectangle",Ft(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",Ft(5,0)),this.generateRoundPolygon("round-pentagon",Ft(5,0)),this.generatePolygon("hexagon",Ft(6,0)),this.generateRoundPolygon("round-hexagon",Ft(6,0)),this.generatePolygon("heptagon",Ft(7,0)),this.generateRoundPolygon("round-heptagon",Ft(7,0)),this.generatePolygon("octagon",Ft(8,0)),this.generateRoundPolygon("round-octagon",Ft(8,0));var n=new Array(20);{var a=Ku(5,0),i=Ku(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=Y0(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 go={};go.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},go.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},go.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 z1=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};go.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){z1(t,!0,a);var i=Wr();t.render(t.renderOptions);var o=t.lastDrawTime=Wr();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 z1(t,!1,a);t.skipFrame=!1,ps(n)}};ps(r)}};var Xz=function(e){this.init(e)},H1=Xz,ri=H1.prototype;ri.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ri.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()},ri.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()}},ri.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{}},ri.isHeadless=function(){return!1},[vc,V1,q1,ti,Qr,go].forEach(function(t){Se(ri,t)});var Ec=1e3/60,K1={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=hs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,d){var f=Wr(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var y=Wr(),b=y-f,w=y-d;if(v<Ec){var C=Ec-(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*Ec)break;var x=e.deq(n,m,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,m,g)&&i())},l=e.priority||Fu;a.beforeRender(o,l(n))}}}},Qz=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gs;Du(this,t),this.idsByKey=new Ir,this.keyForId=new Ir,this.cachesByLvl=new Ir,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Pu(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 Ra,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}(),G1=25,nl=50,al=-4,xc=3,Jz=7.99,e3=8,t3=1024,r3=1024,n3=1024,a3=.2,i3=.8,o3=10,s3=.15,l3=.1,u3=.9,c3=.9,d3=100,f3=1,ni={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},h3=xt({getKey:null,doesEleInvalidateKey:gs,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:M0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),mo=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=h3(r);Se(n,a),n.lookup=new Qz(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},ht=mo.prototype;ht.reasons=ni,ht.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ht.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ht.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Xi(function(r,n){return n.reqs-r.reqs});return e},ht.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ht.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(qu(l*r))),n<al)n=al;else if(l>=Jz||n>xc)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<=G1?p=G1:d<=nl?p=nl:p=Math.ceil(d/nl)*nl,d>n3||f>r3)return null;var g=i.getTextureQueue(p),m=g[g.length-2],y=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};m||(m=g[g.length-1]),m||(m=y()),m.width-m.usedWidth<f&&(m=y());for(var b=function(O){return O&&O.scaledLabelShown===h},w=a&&a===ni.dequeue,C=a&&a===ni.highQuality,x=a&&a===ni.downscale,k,E=n+1;E<=xc;E++){var _=c.get(t,E);if(_){k=_;break}}var S=k&&k.level===n+1?k:null,T=function(){m.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,m.usedWidth,0,f,d)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.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,ni.downscale);T()}else return i.queueElement(t,k.level-1),k;else{var B;if(!w&&!C&&!x)for(var P=n-1;P>=al;P--){var D=c.get(t,P);if(D){B=D;break}}if(b(B))return i.queueElement(t,n),B;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,t,e,h,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return v={x:m.usedWidth,texture:m,level:n,scale:u,width:f,height:d,scaledLabelShown:h},m.usedWidth+=Math.ceil(f+e3),m.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(m),v},ht.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ht.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=al;i<=xc;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)}},ht.checkTextureUtility=function(t){t.invalidatedWidth>=a3*t.width&&this.retireTexture(t)},ht.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>i3&&t.fullnessChecks>=o3?yn(r,t):t.fullnessChecks++},ht.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;yn(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)}$u(i);var c=e.getRetiredTextureQueue(r);c.push(t)},ht.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(t3,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},ht.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,$u(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),yn(a,o),n.push(o),o}},ht.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}},ht.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<f3&&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,ni.dequeue)}return a},ht.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=Mu,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},ht.onDequeue=function(t){this.onDequeues.push(t)},ht.offDequeue=function(t){yn(this.onDequeues,t)},ht.setupDequeueing=K1.setupDequeueing({deqRedrawThreshold:d3,deqCost:s3,deqAvgCost:l3,deqNoDrawCost:u3,deqFastCost:c3,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(zu(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var p3=1,yo=-4,il=2,v3=3.99,g3=50,m3=50,y3=.15,b3=.1,w3=.9,C3=.9,E3=1,U1=250,x3=4e3*4e3,k3=!0,j1=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Wr()-2*U1,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=hs(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},m3),n.beforeRender(function(o,l){l-r.lastInvalidationTime<=U1?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Xi(i),r.setupDequeueing()},Tt=j1.prototype,W1=0,S3=Math.pow(2,53)-1;Tt.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:W1=++W1%S3,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},Tt.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(qu(o*e)),r<yo)r=yo;else if(o>=v3||r>il)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;yo<=O&&O<=il&&!T(O);O+=R);};N(1),N(-1);for(var B=d.length-1;B>=0;B--){var P=d[B];P.invalid&&yn(d,P)}};if(!h)p();else return d;var g=function(){if(!f){f=Kt();for(var T=0;T<t.length;T++)G0(f,t[T].boundingBox())}return f},m=function(T){T=T||{};var N=T.after;g();var B=f.w*u*(f.h*u);if(B>x3)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 y=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(_){y=_;continue}if((!y||y.eles.length>=b||!j0(y.bb,x.boundingBox()))&&(y=m({insert:!0,after:y}),!y))return null;v||w?n.queueLayer(y,x):n.drawEleInLayer(y,x,r,e),y.eles.push(x),E[r]=y}return v||(w?null:d)},Tt.getEleLevelForLayerLevel=function(t,e){return t},Tt.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,k3),i.setImgSmoothing(o,!0))},Tt.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},Tt.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}}},Tt.updateElementsInLayers=function(t,e){for(var r=this,n=zi(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=yo;u<=il;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,o,i))}},Tt.haveLayers=function(){for(var t=this,e=!1,r=yo;r<=il;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},Tt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Wr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},Tt.invalidateLayer=function(t){if(this.lastInvalidationTime=Wr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];yn(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)}}},Tt.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])})},Tt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Tt.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))}},Tt.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<E3&&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},Tt.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()}},Tt.requestRedraw=hs(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Tt.setupDequeueing=K1.setupDequeueing({deqRedrawThreshold:g3,deqCost:y3,deqAvgCost:b3,deqNoDrawCost:w3,deqFastCost:C3,deq:function(e,r){return e.dequeue(r)},onDeqd:Fu,shouldRedraw:M0,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Y1={},Z1;function _3(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function T3(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 X1(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 N3(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 I3(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}Y1.arrowShapeImpl=function(t){return(Z1||(Z1={polygon:_3,"triangle-backcurve":T3,"triangle-tee":X1,"circle-triangle":N3,"triangle-cross":X1,circle:I3}))[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,m=u.h,y,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);y=E.x,b=E.y}else y=v,b=p;var _;f!==1&&(_=t.globalAlpha,t.globalAlpha=_*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,y,b,g,m),f!==1&&(t.globalAlpha=_),h!==0&&(t.rotate(-h),t.translate(-w,-C),x||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var B3=function(){return 0},D3=function(e,r){return e.getTextAngle(r,null)},P3=function(e,r){return e.getTextAngle(r,"source")},O3=function(e,r){return e.getTextAngle(r,"target")},A3=function(e,r){return r.effectiveOpacity()},kc=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||zu(h,n))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,c,r,a,v,B3,A3),(!p||!g)&&o.drawCachedElementPortion(t,e,u,r,a,v,D3,kc),p&&!g&&(o.drawCachedElementPortion(t,e,d,r,a,v,P3,kc),o.drawCachedElementPortion(t,e,f,r,a,v,O3,kc)),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 Jr={};Jr.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,m=e.pstyle("line-outline-color").value,y=u*d,b=u*d,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;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]:y;if(t.lineWidth=v+g,t.lineCap=p,g>0)o.colorStrokeStyle(t,m[0],m[1],m[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=y*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 Q1=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")}}}};Jr.drawEdgeOverlay=Q1("overlay"),Jr.drawEdgeUnderlay=Q1("underlay"),Jr.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=m0(a.roundCorners),m;try{for(g.s();!(m=g.n()).done;){var y=m.value;O1(e,y)}}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([])},Jr.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()}},Jr.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)},Jr.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 m=e.pstyle(r+"-arrow-color").value;l.colorFillStyle(t,m[0],m[1],m[2],o),l.colorStrokeStyle(t,m[0],m[1],m[2],o),l.drawArrowShape(e,t,d,f,c,v,n,a,i)}}},Jr.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,m=this.getArrowWidth(n,g),y=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Zn(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,m,c,p,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(o,l),e.rotate(c),e.scale(m,m)),(r==="filled"||r==="both")&&(d?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?m:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/m,1/m),e.rotate(-c),e.translate(-o,-l))};var Sc={};Sc.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)}},Sc.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,m=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),y=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)*m: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)*y:N=d(r,"background-height","pfValue",n)),!(T===0||N===0)){if(f==="contain"){var B=Math.min(m/T,y/N);T*=B,N*=B}else if(f==="cover"){var B=Math.max(m/T,y/N);T*=B,N*=B}var P=l-m/2,D=d(r,"background-position-x","units",n),R=d(r,"background-position-x","pfValue",n);D==="%"?P+=(m-T)*R:P+=R;var O=d(r,"background-offset-x","units",n),L=d(r,"background-offset-x","pfValue",n);O==="%"?P+=(m-T)*L:P+=L;var A=c-y/2,q=d(r,"background-position-y","units",n),U=d(r,"background-position-y","pfValue",n);q==="%"?A+=(y-N)*U:A+=U;var z=d(r,"background-offset-y","units",n),H=d(r,"background-offset-y","pfValue",n);z==="%"?A+=(y-N)*H:A+=H,b.pathCache&&(P-=l,A-=c,l=0,c=0);var J=t.globalAlpha;t.globalAlpha=x;var F=i.getImgSmoothing(t),$=!1;if(k==="no"&&F?(i.setImgSmoothing(t,!1),$=!0):k==="yes"&&!F&&(i.setImgSmoothing(t,!0),$=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,m,y,E,b),t.clip())),i.safeDrawImage(t,e,0,0,_,S,P,A,T,N),C&&t.restore();else{var V=t.createPattern(e,h);t.fillStyle=V,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,m,y,E,b),t.translate(P,A),t.fill(),t.translate(-P,-A)}t.globalAlpha=J,$&&i.setImgSmoothing(t,F)}};var la={};la.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(qu(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)},la.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)},la.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},la.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 _c(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()}la.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},la.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),m=e.pstyle(v+"text-margin-x").pfValue,y=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+=m,u+=y;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 L=t.fillStyle,A=e.pstyle("text-background-color").value;t.fillStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+k*l+")",N?_c(t,P,D,R,O,B):t.fillRect(P,D,R,O),t.fillStyle=L}if(_>0&&E>0){var q=t.strokeStyle,U=t.lineWidth,z=e.pstyle("text-border-color").value,H=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+z[0]+","+z[1]+","+z[2]+","+E*l+")",t.lineWidth=_,t.setLineDash)switch(H){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?_c(t,P,D,R,O,B,"stroke"):t.strokeRect(P,D,R,O),H==="double"){var J=_/2;N?_c(t,P+J,D+J,R-J*2,O-J*2,B,"stroke"):t.strokeRect(P+J,D+J,R-J*2,O-J*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=U,t.strokeStyle=q}}var F=2*e.pstyle("text-outline-width").pfValue;if(F>0&&(t.lineWidth=F),e.pstyle("text-wrap").value==="wrap"){var $=gr(o,"labelWrapCachedLines",r),V=gr(o,"labelLineHeight",r),G=p/2,j=this.getLabelJustification(e);switch(j==="auto"||(w==="left"?j==="left"?c+=-p:j==="center"&&(c+=-G):w==="center"?j==="left"?c+=-G:j==="right"&&(c+=G):w==="right"&&(j==="center"?c+=G:j==="right"&&(c+=p))),C){case"top":u-=($.length-1)*V;break;case"center":case"bottom":u-=($.length-1)*V;break}for(var M=0;M<$.length;M++)F>0&&t.strokeText($[M],c,u),t.fillText($[M],c,u),u+=V}else F>0&&t.strokeText(h,c,u),t.fillText(h,c,u);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var ai={};ai.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,m=e.padding();l=e.width()+2*m,c=e.height()+2*m;var y;r&&(y=r,t.translate(-y.x1,-y.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,L=e.pstyle("border-cap").value,A=e.pstyle("border-position").value,q=e.pstyle("border-dash-pattern").pfValue,U=e.pstyle("border-dash-offset").pfValue,z=e.pstyle("border-opacity").value*h,H=e.pstyle("outline-width").pfValue,J=e.pstyle("outline-color").value,F=e.pstyle("outline-style").value,$=e.pstyle("outline-opacity").value*h,V=e.pstyle("outline-offset").value,G=e.pstyle("corner-radius").value;G!=="auto"&&(G=e.pstyle("corner-radius").pfValue);var j=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,le)},M=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(t,D[0],D[1],D[2],le)},W=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;o.colorStrokeStyle(t,J[0],J[1],J[2],le)},Y=function(le,ee,oe,me){var be=o.nodePathCache=o.nodePathCache||[],ye=R0(oe==="polygon"?oe+","+me.join(","):oe,""+ee,""+le,""+G),_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,ce=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var ae=Y(l,c,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,c,G,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=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,G,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=L,t.lineJoin=O,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(q),t.lineDashOffset=U;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([])}},De=function(){if(H>0){if(t.lineWidth=H,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;A==="inside"&&(oe=0),A==="outside"&&(oe*=2);var me=(l+oe+(H+V))/l,be=(c+oe+(H+V))/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,it=0,ot=0;ee==="round-diamond"?qe=(oe+V+H)*1.4:ee==="round-heptagon"?(qe=(oe+V+H)*1.075,ot=-(oe/2+V+H)/35):ee==="round-hexagon"?qe=(oe+V+H)*1.12:ee==="round-pentagon"?(qe=(oe+V+H)*1.13,ot=-(oe/2+V+H)/15):ee==="round-tag"?(qe=(oe+V+H)*1.12,it=(oe/2+H+V)*.07):ee==="round-triangle"&&(qe=(oe+V+H)*(Math.PI/2),ot=-(oe+V/2+H)/Math.PI),qe!==0&&(me=(l+qe)/l,ye=l*me,["round-hexagon","round-tag"].includes(ee)||(be=(c+qe)/c,_e=c*be)),G=G==="auto"?Z0(ye,_e):G;for(var et=ye/2,At=_e/2,pt=G+(oe+H+V)/2,mt=new Array(ge.length/2),Qt=new Array(ge.length/2),Rt=0;Rt<ge.length/2;Rt++)mt[Rt]={x:le.x+it+et*ge[Rt*2],y:le.y+ot+At*ge[Rt*2+1]};var Lt,lr,Cr,jt,tt=mt.length;for(lr=mt[tt-1],Lt=0;Lt<tt;Lt++)Cr=mt[Lt%tt],jt=mt[(Lt+1)%tt],Qt[Lt]=wc(lr,Cr,jt,pt),lr=Cr,Cr=jt;o.drawRoundPolygonPath(Ce||t,le.x+it,le.y+ot,l*me,c*be,ge,Qt)}else if(["roundrectangle","round-rectangle"].includes(ee))G=G==="auto"?ea(ye,_e):G,o.drawRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,G+(oe+H+V)/2);else if(["cutrectangle","cut-rectangle"].includes(ee))G=G==="auto"?Gu():G,o.drawCutRectanglePath(Ce||t,le.x,le.y,ye,_e,null,G+(oe+H+V)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ee))G=G==="auto"?ea(ye,_e):G,o.drawBottomRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,G+(oe+H+V)/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 st=(oe+H+V)/l;ge=Es(xs(ge,st)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}else{var yt=(oe+H+V)/l;ge=Es(xs(ge,-yt)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,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,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,K=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,Z=te*h;t.translate(I,K),W(),De(),j(te*P),ne(),ue(Z,!0),M(te*z),pe(),ie(N!==0||B!==0),ue(Z,!1),fe(Z),t.translate(-I,-K)}v&&t.translate(-f.x,-f.y),we(),v&&t.translate(f.x,f.y),W(),De(),j(),ne(),ue(h,!0),M(),pe(),ie(N!==0||B!==0),ue(h,!1),fe(),v&&t.translate(-f.x,-f.y),xe(),Ie(),r&&t.translate(y.x1,y.y1)}};var J1=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()}}}};ai.drawNodeOverlay=J1("overlay"),ai.drawNodeUnderlay=J1("underlay"),ai.hasPie=function(t){return t=t[0],t._private.hasPie},ai.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,m=e.pstyle("pie-"+v+"-background-opacity").value*r,y=p/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*y,C=b+w;p===0||f>=1||f+y>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],m),t.fill(),f+=y)}};var Xt={},R3=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=Xn(u,f),v=Xn(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(),m=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,m))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(y.x,y.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||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,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,m=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!m;var y=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&&(y=!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,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===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ae===u.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=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,L=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,O[0],O[1],O[2],L),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(),q=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),U=o.hideEdgesOnViewport&&q,z=[];if(z[o.NODE]=!d[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,z[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),z[o.DRAG]=!d[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,z[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),d[o.NODE]||r||n||z[o.NODE]){var H=h&&!z[o.NODE]&&v!==1,D=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),J=h&&!H?"motionBlur":void 0;B(D,J),U?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||z[o.DRAG])){var H=h&&!z[o.DRAG]&&v!==1,D=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);B(D,h&&!H?"motionBlur":void 0),U?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(),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(u.bgActivePosistion&&!o.hoverData.selecting){var w=o.cy.zoom(),$=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($.x,$.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),D.fill()}var V=o.lastRedrawTime;if(o.showFps&&V){V=Math.round(V);var G=Math.round(1e3/V);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 = "+V+" ms = "+G+" fps",0,20);var j=60;D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(G/j,1),20)}r||(d[o.SELECT_BOX]=!1)}if(h&&v!==1){var M=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],ce=function(ne,ue,ie){ne.setTransform(1,0,0,1,0,0),ie||!y?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]||z[o.NODE])&&(ce(M,W,z[o.NODE]),d[o.NODE]=!1),(d[o.DRAG]||z[o.DRAG])&&(ce(Y,se,z[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()},R3)),e||c.emit("render")};var Nn={};Nn.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()},Nn.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(l){return O1(t,l)}),t.closePath()},Nn.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ea(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()},Nn.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ea(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()},Nn.drawCutRectanglePath=function(t,e,r,n,a,i,o){var l=n/2,c=a/2,u=o==="auto"?Gu():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()},Nn.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=Uu(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 ew=Math.sin(0),tw=Math.cos(0),Tc={},Nc={},rw=Math.PI/40,ii=0*Math.PI;ii<2*Math.PI;ii+=rw)Tc[ii]=Math.sin(ii),Nc[ii]=Math.cos(ii);Nn.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+=rw)i=e-l*Tc[u]*ew+l*Nc[u]*tw,o=r+c*Nc[u]*ew+c*Tc[u]*tw,u===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var bo={};bo.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},bo.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(),m={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(m.x,m.y),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(-m.x,-m.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,o),v.fill())}return h};function L3(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 nw(t){var e=t.indexOf(",");return t.substr(e+1)}function aw(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new za(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 L3(nw(n()),r);case"base64":return nw(n());case"base64uri":default:return n()}}bo.png=function(t){return aw(t,this.bufferCanvasImage(t),"image/png")},bo.jpg=function(t){return aw(t,this.bufferCanvasImage(t),"image/jpeg")};var iw={};iw.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 M3=ow,Me=ow.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 ow(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 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"};kM()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Me.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(j){d.style[j]=c[j]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Me.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!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 u=0;u<Me.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(M){return{x:(M.x1+M.x2)/2,y:(M.y1+M.y2)/2}},v=function(M){return{x:-M.w/2,y:-M.h/2}},p=function(M){var W=M[0]._private,Y=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!Y},g=function(M){return M[0]._private.nodeKey},m=function(M){return M[0]._private.labelStyleKey},y=function(M){return M[0]._private.sourceLabelStyleKey},b=function(M){return M[0]._private.targetLabelStyleKey},w=function(M,W,Y,se,ce){return e.drawElement(M,W,Y,!1,!1,ce)},C=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"main",ce)},x=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"source",ce)},k=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"target",ce)},E=function(M){return M.boundingBox(),M[0]._private.bodyBounds},_=function(M){return M.boundingBox(),M[0]._private.labelBounds.main||f},S=function(M){return M.boundingBox(),M[0]._private.labelBounds.source||f},T=function(M){return M.boundingBox(),M[0]._private.labelBounds.target||f},N=function(M,W){return W},B=function(M){return h(E(M))},P=function(M,W,Y){var se=M?M+"-":"";return{x:W.x+Y.pstyle(se+"text-margin-x").pfValue,y:W.y+Y.pstyle(se+"text-margin-y").pfValue}},D=function(M,W,Y){var se=M[0]._private.rscratch;return{x:se[W],y:se[Y]}},R=function(M){return P("",D(M,"labelX","labelY"),M)},O=function(M){return P("source",D(M,"sourceLabelX","sourceLabelY"),M)},L=function(M){return P("target",D(M,"targetLabelX","targetLabelY"),M)},A=function(M){return v(E(M))},q=function(M){return v(S(M))},U=function(M){return v(T(M))},z=function(M){var W=_(M),Y=v(_(M));if(M.isNode()){switch(M.pstyle("text-halign").value){case"left":Y.x=-W.w;break;case"right":Y.x=0;break}switch(M.pstyle("text-valign").value){case"top":Y.y=-W.h;break;case"bottom":Y.y=0;break}}return Y},H=e.data.eleTxrCache=new mo(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:E,getRotationPoint:B,getRotationOffset:A,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),J=e.data.lblTxrCache=new mo(e,{getKey:m,drawElement:C,getBoundingBox:_,getRotationPoint:R,getRotationOffset:z,isVisible:N}),F=e.data.slbTxrCache=new mo(e,{getKey:y,drawElement:x,getBoundingBox:S,getRotationPoint:O,getRotationOffset:q,isVisible:N}),$=e.data.tlbTxrCache=new mo(e,{getKey:b,drawElement:k,getBoundingBox:T,getRotationPoint:L,getRotationOffset:U,isVisible:N}),V=e.data.lyrTxrCache=new j1(e);e.onUpdateEleCalcs(function(M,W){H.invalidateElements(W),J.invalidateElements(W),F.invalidateElements(W),$.invalidateElements(W),V.invalidateElements(W);for(var Y=0;Y<W.length;Y++){var se=W[Y]._private;se.oldBackgroundTimestamp=se.backgroundTimestamp}});var G=function(M){for(var W=0;W<M.length;W++)V.enqueueElementRefinement(M[W].ele)};H.onDequeue(G),J.onDequeue(G),F.onDequeue(G),$.onDequeue(G)}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 F3=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return F3&&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":ct(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},[Y1,Ar,Jr,Sc,la,ai,Xt,Nn,bo,iw].forEach(function(t){Se(Me,t)});var $3=[{name:"null",impl:k1},{name:"base",impl:H1},{name:"canvas",impl:M3}],V3=[{type:"layout",extensions:Uz},{type:"renderer",extensions:$3}],sw={},lw={};function uw(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(po.prototype[e])return a(e);po.prototype[e]=r}else if(t==="collection"){if(St.prototype[e])return a(e);St.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=cw("renderer","base"),p=v.prototype,g=r,m=r.prototype,y=function(){v.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var w in p){var C=p[w],x=m[w]!=null;if(x)return a(w);b[w]=C}for(var k in m)b[k]=m[k];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Qe("Renderer does not implement `renderer."+E+"()` on its prototype")}}),n=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Qe(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return S0({map:sw,keys:[t,e],value:n})}function cw(t,e){return _0({map:sw,keys:[t,e]})}function q3(t,e,r,n,a){return S0({map:lw,keys:[t,e,r,n],value:a})}function z3(t,e,r,n){return _0({map:lw,keys:[t,e,r,n]})}var Ic=function(){if(arguments.length===2)return cw.apply(null,arguments);if(arguments.length===3)return uw.apply(null,arguments);if(arguments.length===4)return z3.apply(null,arguments);if(arguments.length===5)return q3.apply(null,arguments);Qe("Invalid extension access syntax")};po.prototype.extension=Ic,V3.forEach(function(t){t.extensions.forEach(function(e){uw(t.type,e.name,e.impl)})});var dw=function t(){if(!(this instanceof t))return new t;this.length=0},ua=dw.prototype;ua.instanceString=function(){return"stylesheet"},ua.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},ua.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=Dt.properties[o]||Dt.properties[ds(o)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},ua.style=ua.css,ua.generateStyle=function(t){var e=new Dt(t);return this.appendToStyle(e)},ua.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 H3="3.30.2",In=function(e){if(e===void 0&&(e={}),Ae(e))return new po(e);if(Ee(e))return Ic.apply(Ic,arguments)};In.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(In),t.apply(null,e),this},In.warnings=function(t){return $0(t)},In.version=H3,In.stylesheet=In.Stylesheet=dw;var fw={exports:{}};function Bc(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 Dc,hw;function K3(){if(hw)return Dc;hw=1;function t(){this.__data__=[],this.size=0}return Dc=t,Dc}var Pc,pw;function oi(){if(pw)return Pc;pw=1;function t(e,r){return e===r||e!==e&&r!==r}return Pc=t,Pc}var Oc,vw;function ol(){if(vw)return Oc;vw=1;var t=oi();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Oc=e,Oc}var Ac,gw;function G3(){if(gw)return Ac;gw=1;var t=ol(),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 Ac=n,Ac}var Rc,mw;function U3(){if(mw)return Rc;mw=1;var t=ol();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Rc=e,Rc}var Lc,yw;function j3(){if(yw)return Lc;yw=1;var t=ol();function e(r){return t(this.__data__,r)>-1}return Lc=e,Lc}var Mc,bw;function W3(){if(bw)return Mc;bw=1;var t=ol();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 Mc=e,Mc}var Fc,ww;function sl(){if(ww)return Fc;ww=1;var t=K3(),e=G3(),r=U3(),n=j3(),a=W3();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,Fc=i,Fc}var $c,Cw;function Y3(){if(Cw)return $c;Cw=1;var t=sl();function e(){this.__data__=new t,this.size=0}return $c=e,$c}var Vc,Ew;function Z3(){if(Ew)return Vc;Ew=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Vc=t,Vc}var qc,xw;function X3(){if(xw)return qc;xw=1;function t(e){return this.__data__.get(e)}return qc=t,qc}var zc,kw;function Q3(){if(kw)return zc;kw=1;function t(e){return this.__data__.has(e)}return zc=t,zc}var Hc,Sw;function _w(){if(Sw)return Hc;Sw=1;var t=typeof Ai=="object"&&Ai&&Ai.Object===Object&&Ai;return Hc=t,Hc}var Kc,Tw;function br(){if(Tw)return Kc;Tw=1;var t=_w(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Kc=r,Kc}var Gc,Nw;function si(){if(Nw)return Gc;Nw=1;var t=br(),e=t.Symbol;return Gc=e,Gc}var Uc,Iw;function J3(){if(Iw)return Uc;Iw=1;var t=si(),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 Uc=i,Uc}var jc,Bw;function e4(){if(Bw)return jc;Bw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return jc=r,jc}var Wc,Dw;function ca(){if(Dw)return Wc;Dw=1;var t=si(),e=J3(),r=e4(),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 Wc=o,Wc}var Yc,Pw;function or(){if(Pw)return Yc;Pw=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Yc=t,Yc}var Zc,Ow;function wo(){if(Ow)return Zc;Ow=1;var t=ca(),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 Zc=o,Zc}var Xc,Aw;function t4(){if(Aw)return Xc;Aw=1;var t=br(),e=t["__core-js_shared__"];return Xc=e,Xc}var Qc,Rw;function r4(){if(Rw)return Qc;Rw=1;var t=t4(),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 Qc=r,Qc}var Jc,Lw;function Mw(){if(Lw)return Jc;Lw=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 Jc=r,Jc}var ed,Fw;function n4(){if(Fw)return ed;Fw=1;var t=wo(),e=r4(),r=or(),n=Mw(),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 ed=f,ed}var td,$w;function a4(){if($w)return td;$w=1;function t(e,r){return e==null?void 0:e[r]}return td=t,td}var rd,Vw;function da(){if(Vw)return rd;Vw=1;var t=n4(),e=a4();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return rd=r,rd}var nd,qw;function ad(){if(qw)return nd;qw=1;var t=da(),e=br(),r=t(e,"Map");return nd=r,nd}var id,zw;function ll(){if(zw)return id;zw=1;var t=da(),e=t(Object,"create");return id=e,id}var od,Hw;function i4(){if(Hw)return od;Hw=1;var t=ll();function e(){this.__data__=t?t(null):{},this.size=0}return od=e,od}var sd,Kw;function o4(){if(Kw)return sd;Kw=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return sd=t,sd}var ld,Gw;function s4(){if(Gw)return ld;Gw=1;var t=ll(),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 ld=a,ld}var ud,Uw;function l4(){if(Uw)return ud;Uw=1;var t=ll(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return ud=n,ud}var cd,jw;function u4(){if(jw)return cd;jw=1;var t=ll(),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 cd=r,cd}var dd,Ww;function c4(){if(Ww)return dd;Ww=1;var t=i4(),e=o4(),r=s4(),n=l4(),a=u4();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,dd=i,dd}var fd,Yw;function d4(){if(Yw)return fd;Yw=1;var t=c4(),e=sl(),r=ad();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return fd=n,fd}var hd,Zw;function f4(){if(Zw)return hd;Zw=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return hd=t,hd}var pd,Xw;function ul(){if(Xw)return pd;Xw=1;var t=f4();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return pd=e,pd}var vd,Qw;function h4(){if(Qw)return vd;Qw=1;var t=ul();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return vd=e,vd}var gd,Jw;function p4(){if(Jw)return gd;Jw=1;var t=ul();function e(r){return t(this,r).get(r)}return gd=e,gd}var md,eC;function v4(){if(eC)return md;eC=1;var t=ul();function e(r){return t(this,r).has(r)}return md=e,md}var yd,tC;function g4(){if(tC)return yd;tC=1;var t=ul();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 yd=e,yd}var bd,rC;function wd(){if(rC)return bd;rC=1;var t=d4(),e=h4(),r=p4(),n=v4(),a=g4();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,bd=i,bd}var Cd,nC;function m4(){if(nC)return Cd;nC=1;var t=sl(),e=ad(),r=wd(),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 Cd=a,Cd}var Ed,aC;function cl(){if(aC)return Ed;aC=1;var t=sl(),e=Y3(),r=Z3(),n=X3(),a=Q3(),i=m4();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,Ed=o,Ed}var xd,iC;function kd(){if(iC)return xd;iC=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 xd=t,xd}var Sd,oC;function sC(){if(oC)return Sd;oC=1;var t=da(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Sd=e,Sd}var _d,lC;function dl(){if(lC)return _d;lC=1;var t=sC();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return _d=e,_d}var Td,uC;function fl(){if(uC)return Td;uC=1;var t=dl(),e=oi(),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 Td=a,Td}var Nd,cC;function Co(){if(cC)return Nd;cC=1;var t=fl(),e=dl();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 Nd=r,Nd}var Id,dC;function y4(){if(dC)return Id;dC=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return Id=t,Id}var Bd,fC;function Rr(){if(fC)return Bd;fC=1;function t(e){return e!=null&&typeof e=="object"}return Bd=t,Bd}var Dd,hC;function b4(){if(hC)return Dd;hC=1;var t=ca(),e=Rr(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Dd=n,Dd}var Pd,pC;function Eo(){if(pC)return Pd;pC=1;var t=b4(),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 Pd=i,Pd}var Od,vC;function at(){if(vC)return Od;vC=1;var t=Array.isArray;return Od=t,Od}var xo={exports:{}},Ad,gC;function w4(){if(gC)return Ad;gC=1;function t(){return!1}return Ad=t,Ad}xo.exports;var mC;function li(){return mC||(mC=1,function(t,e){var r=br(),n=w4(),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}(xo,xo.exports)),xo.exports}var Rd,yC;function hl(){if(yC)return Rd;yC=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 Rd=r,Rd}var Ld,bC;function Md(){if(bC)return Ld;bC=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Ld=e,Ld}var Fd,wC;function C4(){if(wC)return Fd;wC=1;var t=ca(),e=Md(),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]",m="[object ArrayBuffer]",y="[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[m]=N[i]=N[y]=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 Fd=B,Fd}var $d,CC;function pl(){if(CC)return $d;CC=1;function t(e){return function(r){return e(r)}}return $d=t,$d}var ko={exports:{}};ko.exports;var EC;function Vd(){return EC||(EC=1,function(t,e){var r=_w(),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}(ko,ko.exports)),ko.exports}var qd,xC;function So(){if(xC)return qd;xC=1;var t=C4(),e=pl(),r=Vd(),n=r&&r.isTypedArray,a=n?e(n):t;return qd=a,qd}var zd,kC;function SC(){if(kC)return zd;kC=1;var t=y4(),e=Eo(),r=at(),n=li(),a=hl(),i=So(),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,m=g?t(u.length,String):[],y=m.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,y)))&&m.push(b);return m}return zd=c,zd}var Hd,_C;function vl(){if(_C)return Hd;_C=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Hd=e,Hd}var Kd,TC;function NC(){if(TC)return Kd;TC=1;function t(e,r){return function(n){return e(r(n))}}return Kd=t,Kd}var Gd,IC;function E4(){if(IC)return Gd;IC=1;var t=NC(),e=t(Object.keys,Object);return Gd=e,Gd}var Ud,BC;function jd(){if(BC)return Ud;BC=1;var t=vl(),e=E4(),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 Ud=a,Ud}var Wd,DC;function en(){if(DC)return Wd;DC=1;var t=wo(),e=Md();function r(n){return n!=null&&e(n.length)&&!t(n)}return Wd=r,Wd}var Yd,PC;function Bn(){if(PC)return Yd;PC=1;var t=SC(),e=jd(),r=en();function n(a){return r(a)?t(a):e(a)}return Yd=n,Yd}var Zd,OC;function x4(){if(OC)return Zd;OC=1;var t=Co(),e=Bn();function r(n,a){return n&&t(a,e(a),n)}return Zd=r,Zd}var Xd,AC;function k4(){if(AC)return Xd;AC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return Xd=t,Xd}var Qd,RC;function S4(){if(RC)return Qd;RC=1;var t=or(),e=vl(),r=k4(),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 Qd=i,Qd}var Jd,LC;function fa(){if(LC)return Jd;LC=1;var t=SC(),e=S4(),r=en();function n(a){return r(a)?t(a,!0):e(a)}return Jd=n,Jd}var ef,MC;function _4(){if(MC)return ef;MC=1;var t=Co(),e=fa();function r(n,a){return n&&t(a,e(a),n)}return ef=r,ef}var _o={exports:{}};_o.exports;var FC;function $C(){return FC||(FC=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}(_o,_o.exports)),_o.exports}var tf,VC;function qC(){if(VC)return tf;VC=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 tf=t,tf}var rf,zC;function HC(){if(zC)return rf;zC=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 rf=t,rf}var nf,KC;function GC(){if(KC)return nf;KC=1;function t(){return[]}return nf=t,nf}var af,UC;function of(){if(UC)return af;UC=1;var t=HC(),e=GC(),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 af=i,af}var sf,jC;function T4(){if(jC)return sf;jC=1;var t=Co(),e=of();function r(n,a){return t(n,e(n),a)}return sf=r,sf}var lf,WC;function uf(){if(WC)return lf;WC=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 lf=t,lf}var cf,YC;function gl(){if(YC)return cf;YC=1;var t=NC(),e=t(Object.getPrototypeOf,Object);return cf=e,cf}var df,ZC;function XC(){if(ZC)return df;ZC=1;var t=uf(),e=gl(),r=of(),n=GC(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var l=[];o;)t(l,r(o)),o=e(o);return l}:n;return df=i,df}var ff,QC;function N4(){if(QC)return ff;QC=1;var t=Co(),e=XC();function r(n,a){return t(n,e(n),a)}return ff=r,ff}var hf,JC;function eE(){if(JC)return hf;JC=1;var t=uf(),e=at();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return hf=r,hf}var pf,tE;function rE(){if(tE)return pf;tE=1;var t=eE(),e=of(),r=Bn();function n(a){return t(a,r,e)}return pf=n,pf}var vf,nE;function I4(){if(nE)return vf;nE=1;var t=eE(),e=XC(),r=fa();function n(a){return t(a,r,e)}return vf=n,vf}var gf,aE;function B4(){if(aE)return gf;aE=1;var t=da(),e=br(),r=t(e,"DataView");return gf=r,gf}var mf,iE;function D4(){if(iE)return mf;iE=1;var t=da(),e=br(),r=t(e,"Promise");return mf=r,mf}var yf,oE;function sE(){if(oE)return yf;oE=1;var t=da(),e=br(),r=t(e,"Set");return yf=r,yf}var bf,lE;function P4(){if(lE)return bf;lE=1;var t=da(),e=br(),r=t(e,"WeakMap");return bf=r,bf}var wf,uE;function ui(){if(uE)return wf;uE=1;var t=B4(),e=ad(),r=D4(),n=sE(),a=P4(),i=ca(),o=Mw(),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),m=o(n),y=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 m:return d;case y:return f}return C}),wf=b,wf}var Cf,cE;function O4(){if(cE)return Cf;cE=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 Cf=r,Cf}var Ef,dE;function fE(){if(dE)return Ef;dE=1;var t=br(),e=t.Uint8Array;return Ef=e,Ef}var xf,hE;function kf(){if(hE)return xf;hE=1;var t=fE();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return xf=e,xf}var Sf,pE;function A4(){if(pE)return Sf;pE=1;var t=kf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Sf=e,Sf}var _f,vE;function R4(){if(vE)return _f;vE=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return _f=e,_f}var Tf,gE;function L4(){if(gE)return Tf;gE=1;var t=si(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return Tf=n,Tf}var Nf,mE;function yE(){if(mE)return Nf;mE=1;var t=kf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Nf=e,Nf}var If,bE;function M4(){if(bE)return If;bE=1;var t=kf(),e=A4(),r=R4(),n=L4(),a=yE(),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]",m="[object Float64Array]",y="[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 m:case y: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 If=_,If}var Bf,wE;function CE(){if(wE)return Bf;wE=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 Bf=r,Bf}var Df,EE;function xE(){if(EE)return Df;EE=1;var t=CE(),e=gl(),r=vl();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Df=n,Df}var Pf,kE;function F4(){if(kE)return Pf;kE=1;var t=ui(),e=Rr(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Pf=n,Pf}var Of,SE;function $4(){if(SE)return Of;SE=1;var t=F4(),e=pl(),r=Vd(),n=r&&r.isMap,a=n?e(n):t;return Of=a,Of}var Af,_E;function V4(){if(_E)return Af;_E=1;var t=ui(),e=Rr(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return Af=n,Af}var Rf,TE;function q4(){if(TE)return Rf;TE=1;var t=V4(),e=pl(),r=Vd(),n=r&&r.isSet,a=n?e(n):t;return Rf=a,Rf}var Lf,NE;function IE(){if(NE)return Lf;NE=1;var t=cl(),e=kd(),r=fl(),n=x4(),a=_4(),i=$C(),o=qC(),l=T4(),c=N4(),u=rE(),d=I4(),f=ui(),h=O4(),v=M4(),p=xE(),g=at(),m=li(),y=$4(),b=or(),w=q4(),C=Bn(),x=fa(),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]",L="[object Number]",A="[object Object]",q="[object RegExp]",U="[object Set]",z="[object String]",H="[object Symbol]",J="[object WeakMap]",F="[object ArrayBuffer]",$="[object DataView]",V="[object Float32Array]",G="[object Float64Array]",j="[object Int8Array]",M="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",se="[object Uint8ClampedArray]",ce="[object Uint16Array]",ae="[object Uint32Array]",ne={};ne[S]=ne[T]=ne[F]=ne[$]=ne[N]=ne[B]=ne[V]=ne[G]=ne[j]=ne[M]=ne[W]=ne[O]=ne[L]=ne[A]=ne[q]=ne[U]=ne[z]=ne[H]=ne[Y]=ne[se]=ne[ce]=ne[ae]=!0,ne[P]=ne[D]=ne[J]=!1;function ue(ie,fe,pe,De,Ie,we){var xe,re=fe&k,I=fe&E,K=fe&_;if(pe&&(xe=Ie?pe(ie,De,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),X=Z==D||Z==R;if(m(ie))return i(ie,re);if(Z==A||Z==S||X&&!Ie){if(xe=I||X?{}: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(ue(me,fe,pe,me,ie,we))}):y(ie)&&ie.forEach(function(me,be){xe.set(be,ue(me,fe,pe,be,ie,we))});var ee=K?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,ue(me,fe,pe,be,ie,we))}),xe}return Lf=ue,Lf}var Mf,BE;function z4(){if(BE)return Mf;BE=1;var t=IE(),e=4;function r(n){return t(n,e)}return Mf=r,Mf}var Ff,DE;function $f(){if(DE)return Ff;DE=1;function t(e){return function(){return e}}return Ff=t,Ff}var Vf,PE;function H4(){if(PE)return Vf;PE=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 Vf=t,Vf}var qf,OE;function zf(){if(OE)return qf;OE=1;var t=H4(),e=t();return qf=e,qf}var Hf,AE;function Kf(){if(AE)return Hf;AE=1;var t=zf(),e=Bn();function r(n,a){return n&&t(n,a,e)}return Hf=r,Hf}var Gf,RE;function K4(){if(RE)return Gf;RE=1;var t=en();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 Gf=e,Gf}var Uf,LE;function ml(){if(LE)return Uf;LE=1;var t=Kf(),e=K4(),r=e(t);return Uf=r,Uf}var jf,ME;function ha(){if(ME)return jf;ME=1;function t(e){return e}return jf=t,jf}var Wf,FE;function $E(){if(FE)return Wf;FE=1;var t=ha();function e(r){return typeof r=="function"?r:t}return Wf=e,Wf}var Yf,VE;function qE(){if(VE)return Yf;VE=1;var t=kd(),e=ml(),r=$E(),n=at();function a(i,o){var l=n(i)?t:e;return l(i,r(o))}return Yf=a,Yf}var Zf,zE;function HE(){return zE||(zE=1,Zf=qE()),Zf}var Xf,KE;function G4(){if(KE)return Xf;KE=1;var t=ml();function e(r,n){var a=[];return t(r,function(i,o,l){n(i,o,l)&&a.push(i)}),a}return Xf=e,Xf}var Qf,GE;function U4(){if(GE)return Qf;GE=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Qf=e,Qf}var Jf,UE;function j4(){if(UE)return Jf;UE=1;function t(e){return this.__data__.has(e)}return Jf=t,Jf}var eh,jE;function WE(){if(jE)return eh;jE=1;var t=wd(),e=U4(),r=j4();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,eh=n,eh}var th,YE;function W4(){if(YE)return th;YE=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 th=t,th}var rh,ZE;function XE(){if(ZE)return rh;ZE=1;function t(e,r){return e.has(r)}return rh=t,rh}var nh,QE;function JE(){if(QE)return nh;QE=1;var t=WE(),e=W4(),r=XE(),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),m=f.get(l);if(g&&m)return g==l&&m==o;var y=-1,b=!0,w=c&a?new t:void 0;for(f.set(o,l),f.set(l,o);++y<v;){var C=o[y],x=l[y];if(u)var k=h?u(x,C,y,l,o,f):u(C,x,y,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 nh=i,nh}var ah,ex;function Y4(){if(ex)return ah;ex=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return ah=t,ah}var ih,tx;function oh(){if(tx)return ih;tx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return ih=t,ih}var sh,rx;function Z4(){if(rx)return sh;rx=1;var t=si(),e=fE(),r=oi(),n=JE(),a=Y4(),i=oh(),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]",m="[object Symbol]",y="[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 y: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 m:if(C)return C.call(k)==C.call(E)}return!1}return sh=x,sh}var lh,nx;function X4(){if(nx)return lh;nx=1;var t=rE(),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 m=v;m--;){var y=h[m];if(!(f?y in o:n.call(o,y)))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;++m<v;){y=h[m];var k=i[y],E=o[y];if(c)var _=f?c(E,k,y,o,i,d):c(k,E,y,i,o,d);if(!(_===void 0?k===E||u(k,E,l,c,d):_)){C=!1;break}x||(x=y=="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 lh=a,lh}var uh,ax;function Q4(){if(ax)return uh;ax=1;var t=cl(),e=JE(),r=Z4(),n=X4(),a=ui(),i=at(),o=li(),l=So(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function p(g,m,y,b,w,C){var x=i(g),k=i(m),E=x?d:a(g),_=k?d:a(m);E=E==u?f:E,_=_==u?f:_;var S=E==f,T=_==f,N=E==_;if(N&&o(g)){if(!o(m))return!1;x=!0,S=!1}if(N&&!S)return C||(C=new t),x||l(g)?e(g,m,y,b,w,C):r(g,m,E,y,b,w,C);if(!(y&c)){var B=S&&v.call(g,"__wrapped__"),P=T&&v.call(m,"__wrapped__");if(B||P){var D=B?g.value():g,R=P?m.value():m;return C||(C=new t),w(D,R,y,b,C)}}return N?(C||(C=new t),n(g,m,y,b,w,C)):!1}return uh=p,uh}var ch,ix;function ox(){if(ix)return ch;ix=1;var t=Q4(),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 ch=r,ch}var dh,sx;function J4(){if(sx)return dh;sx=1;var t=cl(),e=ox(),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 m=new t;if(c)var y=c(p,g,v,i,o,m);if(!(y===void 0?e(g,p,r|n,c,m):y))return!1}}return!0}return dh=a,dh}var fh,lx;function ux(){if(lx)return fh;lx=1;var t=or();function e(r){return r===r&&!t(r)}return fh=e,fh}var hh,cx;function e8(){if(cx)return hh;cx=1;var t=ux(),e=Bn();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 hh=r,hh}var ph,dx;function fx(){if(dx)return ph;dx=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return ph=t,ph}var vh,hx;function t8(){if(hx)return vh;hx=1;var t=J4(),e=e8(),r=fx();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 vh=n,vh}var gh,px;function ci(){if(px)return gh;px=1;var t=ca(),e=Rr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return gh=n,gh}var mh,vx;function yh(){if(vx)return mh;vx=1;var t=at(),e=ci(),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 mh=a,mh}var bh,gx;function r8(){if(gx)return bh;gx=1;var t=wd(),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,bh=r,bh}var wh,mx;function n8(){if(mx)return wh;mx=1;var t=r8(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return wh=r,wh}var Ch,yx;function a8(){if(yx)return Ch;yx=1;var t=n8(),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 Ch=n,Ch}var Eh,bx;function yl(){if(bx)return Eh;bx=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 Eh=t,Eh}var xh,wx;function i8(){if(wx)return xh;wx=1;var t=si(),e=yl(),r=at(),n=ci(),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 xh=l,xh}var kh,Cx;function Ex(){if(Cx)return kh;Cx=1;var t=i8();function e(r){return r==null?"":t(r)}return kh=e,kh}var Sh,xx;function bl(){if(xx)return Sh;xx=1;var t=at(),e=yh(),r=a8(),n=Ex();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Sh=a,Sh}var _h,kx;function To(){if(kx)return _h;kx=1;var t=ci(),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 _h=r,_h}var Th,Sx;function wl(){if(Sx)return Th;Sx=1;var t=bl(),e=To();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 Th=r,Th}var Nh,_x;function o8(){if(_x)return Nh;_x=1;var t=wl();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Nh=e,Nh}var Ih,Tx;function s8(){if(Tx)return Ih;Tx=1;function t(e,r){return e!=null&&r in Object(e)}return Ih=t,Ih}var Bh,Nx;function Ix(){if(Nx)return Bh;Nx=1;var t=bl(),e=Eo(),r=at(),n=hl(),a=Md(),i=To();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 Bh=o,Bh}var Dh,Bx;function Dx(){if(Bx)return Dh;Bx=1;var t=s8(),e=Ix();function r(n,a){return n!=null&&e(n,a,t)}return Dh=r,Dh}var Ph,Px;function l8(){if(Px)return Ph;Px=1;var t=ox(),e=o8(),r=Dx(),n=yh(),a=ux(),i=fx(),o=To(),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 Ph=u,Ph}var Oh,Ox;function Ax(){if(Ox)return Oh;Ox=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Oh=t,Oh}var Ah,Rx;function u8(){if(Rx)return Ah;Rx=1;var t=wl();function e(r){return function(n){return t(n,r)}}return Ah=e,Ah}var Rh,Lx;function c8(){if(Lx)return Rh;Lx=1;var t=Ax(),e=u8(),r=yh(),n=To();function a(i){return r(i)?t(n(i)):e(i)}return Rh=a,Rh}var Lh,Mx;function tn(){if(Mx)return Lh;Mx=1;var t=t8(),e=l8(),r=ha(),n=at(),a=c8();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 Lh=i,Lh}var Mh,Fx;function $x(){if(Fx)return Mh;Fx=1;var t=HC(),e=G4(),r=tn(),n=at();function a(i,o){var l=n(i)?t:e;return l(i,r(o,3))}return Mh=a,Mh}var Fh,Vx;function d8(){if(Vx)return Fh;Vx=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return Fh=r,Fh}var $h,qx;function zx(){if(qx)return $h;qx=1;var t=d8(),e=Ix();function r(n,a){return n!=null&&e(n,a,t)}return $h=r,$h}var Vh,Hx;function f8(){if(Hx)return Vh;Hx=1;var t=jd(),e=ui(),r=Eo(),n=at(),a=en(),i=li(),o=vl(),l=So(),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 Vh=h,Vh}var qh,Kx;function Gx(){if(Kx)return qh;Kx=1;function t(e){return e===void 0}return qh=t,qh}var zh,Ux;function jx(){if(Ux)return zh;Ux=1;var t=ml(),e=en();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 zh=r,zh}var Hh,Wx;function Yx(){if(Wx)return Hh;Wx=1;var t=yl(),e=tn(),r=jx(),n=at();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return Hh=a,Hh}var Kh,Zx;function h8(){if(Zx)return Kh;Zx=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 Kh=t,Kh}var Gh,Xx;function p8(){if(Xx)return Gh;Xx=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 Gh=t,Gh}var Uh,Qx;function Jx(){if(Qx)return Uh;Qx=1;var t=h8(),e=ml(),r=tn(),n=p8(),a=at();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 Uh=i,Uh}var jh,ek;function v8(){if(ek)return jh;ek=1;var t=ca(),e=at(),r=Rr(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return jh=a,jh}var Wh,tk;function g8(){if(tk)return Wh;tk=1;var t=Ax(),e=t("length");return Wh=e,Wh}var Yh,rk;function m8(){if(rk)return Yh;rk=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 Yh=c,Yh}var Zh,nk;function y8(){if(nk)return Zh;nk=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+"]?",m="(?:"+v+"(?:"+[d,f,h].join("|")+")"+g+p+")*",y=g+p+m,b="(?:"+[d+l+"?",l,f,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+b+y,"g");function C(x){for(var k=w.lastIndex=0;w.test(x);)++k;return k}return Zh=C,Zh}var Xh,ak;function b8(){if(ak)return Xh;ak=1;var t=g8(),e=m8(),r=y8();function n(a){return e(a)?r(a):t(a)}return Xh=n,Xh}var Qh,ik;function w8(){if(ik)return Qh;ik=1;var t=jd(),e=ui(),r=en(),n=v8(),a=b8(),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 Qh=l,Qh}var Jh,ok;function C8(){if(ok)return Jh;ok=1;var t=kd(),e=CE(),r=Kf(),n=tn(),a=gl(),i=at(),o=li(),l=wo(),c=or(),u=So();function d(f,h,v){var p=i(f),g=p||o(f)||u(f);if(h=n(h,4),v==null){var m=f&&f.constructor;g?v=p?new m:[]:c(f)?v=l(m)?e(a(f)):{}:v={}}return(g?t:r)(f,function(y,b,w){return h(v,y,b,w)}),v}return Jh=d,Jh}var ep,sk;function E8(){if(sk)return ep;sk=1;var t=si(),e=Eo(),r=at(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return ep=a,ep}var tp,lk;function rp(){if(lk)return tp;lk=1;var t=uf(),e=E8();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 tp=r,tp}var np,uk;function x8(){if(uk)return np;uk=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 np=t,np}var ap,ck;function dk(){if(ck)return ap;ck=1;var t=x8(),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 ap=r,ap}var ip,fk;function k8(){if(fk)return ip;fk=1;var t=$f(),e=sC(),r=ha(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return ip=n,ip}var op,hk;function S8(){if(hk)return op;hk=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 op=n,op}var sp,pk;function vk(){if(pk)return sp;pk=1;var t=k8(),e=S8(),r=e(t);return sp=r,sp}var lp,gk;function Cl(){if(gk)return lp;gk=1;var t=ha(),e=dk(),r=vk();function n(a,i){return r(e(a,i,t),a+"")}return lp=n,lp}var up,mk;function yk(){if(mk)return up;mk=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 up=t,up}var cp,bk;function _8(){if(bk)return cp;bk=1;function t(e){return e!==e}return cp=t,cp}var dp,wk;function T8(){if(wk)return dp;wk=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 dp=t,dp}var fp,Ck;function N8(){if(Ck)return fp;Ck=1;var t=yk(),e=_8(),r=T8();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return fp=n,fp}var hp,Ek;function I8(){if(Ek)return hp;Ek=1;var t=N8();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return hp=e,hp}var pp,xk;function B8(){if(xk)return pp;xk=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 pp=t,pp}var vp,kk;function D8(){if(kk)return vp;kk=1;function t(){}return vp=t,vp}var gp,Sk;function P8(){if(Sk)return gp;Sk=1;var t=sE(),e=D8(),r=oh(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return gp=a,gp}var mp,_k;function O8(){if(_k)return mp;_k=1;var t=WE(),e=I8(),r=B8(),n=XE(),a=P8(),i=oh(),o=200;function l(c,u,d){var f=-1,h=e,v=c.length,p=!0,g=[],m=g;if(d)p=!1,h=r;else if(v>=o){var y=u?null:a(c);if(y)return i(y);p=!1,h=n,m=new t}else m=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=m.length;C--;)if(m[C]===w)continue e;u&&m.push(w),g.push(b)}else h(m,w,d)||(m!==g&&m.push(w),g.push(b))}return g}return mp=l,mp}var yp,Tk;function Nk(){if(Tk)return yp;Tk=1;var t=en(),e=Rr();function r(n){return e(n)&&t(n)}return yp=r,yp}var bp,Ik;function A8(){if(Ik)return bp;Ik=1;var t=rp(),e=Cl(),r=O8(),n=Nk(),a=e(function(i){return r(t(i,1,n,!0))});return bp=a,bp}var wp,Bk;function R8(){if(Bk)return wp;Bk=1;var t=yl();function e(r,n){return t(n,function(a){return r[a]})}return wp=e,wp}var Cp,Dk;function Pk(){if(Dk)return Cp;Dk=1;var t=R8(),e=Bn();function r(n){return n==null?[]:t(n,e(n))}return Cp=r,Cp}var Ep,Ok;function sr(){if(Ok)return Ep;Ok=1;var t;if(typeof Bc=="function")try{t={clone:z4(),constant:$f(),each:HE(),filter:$x(),has:zx(),isArray:at(),isEmpty:f8(),isFunction:wo(),isUndefined:Gx(),keys:Bn(),map:Yx(),reduce:Jx(),size:w8(),transform:C8(),union:A8(),values:Pk()}}catch{}return t||(t=window._),Ep=t,Ep}var xp,Ak;function kp(){if(Ak)return xp;Ak=1;var t=sr();xp=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,m){d(m)&&f.setNode(m,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 m=h.parent(g);return m===void 0||f.hasNode(m)?(v[g]=m,m):m in v?v[m]:p(m)}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 m=l(this._isDirected,d,f,h);if(t.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=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[m]=p?v:this._defaultEdgeLabelFn(d,f,h);var y=c(this._isDirected,d,f,h);return d=y.v,f=y.w,Object.freeze(y),this._edgeObjs[m]=y,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][m]=y,this._out[d][m]=y,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 m=p;p=g,g=m}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 m=p;p=g,g=m}var y={v:p,w:g};return v&&(y.name=v),y}function u(d,f){return l(d,f.v,f.w,f.name)}return xp}var Sp,Rk;function L8(){return Rk||(Rk=1,Sp="2.1.8"),Sp}var _p,Lk;function M8(){return Lk||(Lk=1,_p={Graph:kp(),version:L8()}),_p}var Tp,Mk;function F8(){if(Mk)return Tp;Mk=1;var t=sr(),e=kp();Tp={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 Tp}var Np,Fk;function $8(){if(Fk)return Np;Fk=1;var t=sr();Np=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 Np}var Ip,$k;function Vk(){if($k)return Ip;$k=1;var t=sr();Ip=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},Ip}var Bp,qk;function zk(){if(qk)return Bp;qk=1;var t=sr(),e=Vk();Bp=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,m=u[g],y=l(p),b=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+y);b<m.distance&&(m.distance=b,m.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 Bp}var Dp,Hk;function V8(){if(Hk)return Dp;Hk=1;var t=zk(),e=sr();Dp=r;function r(n,a,i){return e.transform(n.nodes(),function(o,l){o[l]=t(n,l,a,i)},{})}return Dp}var Pp,Kk;function Gk(){if(Kk)return Pp;Kk=1;var t=sr();Pp=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 Pp}var Op,Uk;function q8(){if(Uk)return Op;Uk=1;var t=sr(),e=Gk();Op=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 Op}var Ap,jk;function z8(){if(jk)return Ap;jk=1;var t=sr();Ap=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],m=h[v],y=p.distance+g.distance;y<m.distance&&(m.distance=y,m.predecessor=g.predecessor)})})}),l}return Ap}var Rp,Wk;function Yk(){if(Wk)return Rp;Wk=1;var t=sr();Rp=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,Rp}var Lp,Zk;function H8(){if(Zk)return Lp;Zk=1;var t=Yk();Lp=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return Lp}var Mp,Xk;function Qk(){if(Xk)return Mp;Xk=1;var t=sr();Mp=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 Mp}var Fp,Jk;function K8(){if(Jk)return Fp;Jk=1;var t=Qk();Fp=e;function e(r,n){return t(r,n,"post")}return Fp}var $p,e2;function G8(){if(e2)return $p;e2=1;var t=Qk();$p=e;function e(r,n){return t(r,n,"pre")}return $p}var Vp,t2;function U8(){if(t2)return Vp;t2=1;var t=sr(),e=kp(),r=Vk();Vp=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 Vp}var qp,r2;function j8(){return r2||(r2=1,qp={components:$8(),dijkstra:zk(),dijkstraAll:V8(),findCycles:q8(),floydWarshall:z8(),isAcyclic:H8(),postorder:K8(),preorder:G8(),prim:U8(),tarjan:Gk(),topsort:Yk()}),qp}var zp,n2;function W8(){if(n2)return zp;n2=1;var t=M8();return zp={Graph:t.Graph,json:F8(),alg:j8(),version:t.version},zp}var Hp,a2;function wr(){if(a2)return Hp;a2=1;var t;if(typeof Bc=="function")try{t=W8()}catch{}return t||(t=window.graphlib),Hp=t,Hp}var Kp,i2;function Y8(){if(i2)return Kp;i2=1;var t=IE(),e=1,r=4;function n(a){return t(a,e|r)}return Kp=n,Kp}var Gp,o2;function El(){if(o2)return Gp;o2=1;var t=oi(),e=en(),r=hl(),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 Gp=a,Gp}var Up,s2;function Z8(){if(s2)return Up;s2=1;var t=Cl(),e=oi(),r=El(),n=fa(),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 m=v[p],y=l[m];(y===void 0||e(y,a[m])&&!i.call(l,m))&&(l[m]=h[m])}return l});return Up=o,Up}var jp,l2;function X8(){if(l2)return jp;l2=1;var t=tn(),e=en(),r=Bn();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 jp=n,jp}var Wp,u2;function Q8(){if(u2)return Wp;u2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Wp=e,Wp}var Yp,c2;function J8(){if(c2)return Yp;c2=1;var t=Q8(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Yp=r,Yp}var Zp,d2;function e6(){if(d2)return Zp;d2=1;var t=J8(),e=or(),r=ci(),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 Zp=c,Zp}var Xp,f2;function h2(){if(f2)return Xp;f2=1;var t=e6(),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 Xp=n,Xp}var Qp,p2;function t6(){if(p2)return Qp;p2=1;var t=h2();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return Qp=e,Qp}var Jp,v2;function r6(){if(v2)return Jp;v2=1;var t=yk(),e=tn(),r=t6(),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 Jp=a,Jp}var ev,g2;function n6(){if(g2)return ev;g2=1;var t=X8(),e=r6(),r=t(e);return ev=r,ev}var tv,m2;function y2(){if(m2)return tv;m2=1;var t=rp();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return tv=e,tv}var rv,b2;function a6(){if(b2)return rv;b2=1;var t=zf(),e=$E(),r=fa();function n(a,i){return a==null?a:t(a,e(i),r)}return rv=n,rv}var nv,w2;function i6(){if(w2)return nv;w2=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return nv=t,nv}var av,C2;function o6(){if(C2)return av;C2=1;var t=dl(),e=Kf(),r=tn();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 av=n,av}var iv,E2;function ov(){if(E2)return iv;E2=1;var t=ci();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 iv=e,iv}var sv,x2;function s6(){if(x2)return sv;x2=1;function t(e,r){return e>r}return sv=t,sv}var lv,k2;function l6(){if(k2)return lv;k2=1;var t=ov(),e=s6(),r=ha();function n(a){return a&&a.length?t(a,r,e):void 0}return lv=n,lv}var uv,S2;function _2(){if(S2)return uv;S2=1;var t=dl(),e=oi();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return uv=r,uv}var cv,T2;function u6(){if(T2)return cv;T2=1;var t=ca(),e=gl(),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 cv=u,cv}var dv,N2;function I2(){if(N2)return dv;N2=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return dv=t,dv}var fv,B2;function c6(){if(B2)return fv;B2=1;var t=Co(),e=fa();function r(n){return t(n,e(n))}return fv=r,fv}var hv,D2;function d6(){if(D2)return hv;D2=1;var t=_2(),e=$C(),r=yE(),n=qC(),a=xE(),i=Eo(),o=at(),l=Nk(),c=li(),u=wo(),d=or(),f=u6(),h=So(),v=I2(),p=c6();function g(m,y,b,w,C,x,k){var E=v(m,b),_=v(y,b),S=k.get(_);if(S){t(m,b,S);return}var T=x?x(E,_,b+"",m,y,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(m,b,T)}return hv=g,hv}var pv,P2;function f6(){if(P2)return pv;P2=1;var t=cl(),e=_2(),r=zf(),n=d6(),a=or(),i=fa(),o=I2();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 pv=l,pv}var vv,O2;function h6(){if(O2)return vv;O2=1;var t=Cl(),e=El();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 vv=r,vv}var gv,A2;function p6(){if(A2)return gv;A2=1;var t=f6(),e=h6(),r=e(function(n,a,i){t(n,a,i)});return gv=r,gv}var mv,R2;function L2(){if(R2)return mv;R2=1;function t(e,r){return e<r}return mv=t,mv}var yv,M2;function v6(){if(M2)return yv;M2=1;var t=ov(),e=L2(),r=ha();function n(a){return a&&a.length?t(a,r,e):void 0}return yv=n,yv}var bv,F2;function g6(){if(F2)return bv;F2=1;var t=ov(),e=tn(),r=L2();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return bv=n,bv}var wv,$2;function m6(){if($2)return wv;$2=1;var t=br(),e=function(){return t.Date.now()};return wv=e,wv}var Cv,V2;function y6(){if(V2)return Cv;V2=1;var t=fl(),e=bl(),r=hl(),n=or(),a=To();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 m=v[p];g=u?u(m,p,v):void 0,g===void 0&&(g=n(m)?m:r(l[d+1])?[]:{})}t(v,p,g),v=v[p]}return o}return Cv=i,Cv}var Ev,q2;function b6(){if(q2)return Ev;q2=1;var t=wl(),e=y6(),r=bl();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 Ev=n,Ev}var xv,z2;function w6(){if(z2)return xv;z2=1;var t=b6(),e=Dx();function r(n,a){return t(n,a,function(i,o){return e(n,o)})}return xv=r,xv}var kv,H2;function C6(){if(H2)return kv;H2=1;var t=y2(),e=dk(),r=vk();function n(a){return r(e(a,void 0,t),a+"")}return kv=n,kv}var Sv,K2;function E6(){if(K2)return Sv;K2=1;var t=w6(),e=C6(),r=e(function(n,a){return n==null?{}:t(n,a)});return Sv=r,Sv}var _v,G2;function x6(){if(G2)return _v;G2=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 _v=r,_v}var Tv,U2;function k6(){if(U2)return Tv;U2=1;var t=x6(),e=El(),r=h2();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 Tv=n,Tv}var Nv,j2;function S6(){if(j2)return Nv;j2=1;var t=k6(),e=t();return Nv=e,Nv}var Iv,W2;function _6(){if(W2)return Iv;W2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Iv=t,Iv}var Bv,Y2;function T6(){if(Y2)return Bv;Y2=1;var t=ci();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 Bv=e,Bv}var Dv,Z2;function N6(){if(Z2)return Dv;Z2=1;var t=T6();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 Dv=e,Dv}var Pv,X2;function I6(){if(X2)return Pv;X2=1;var t=yl(),e=wl(),r=tn(),n=jx(),a=_6(),i=pl(),o=N6(),l=ha(),c=at();function u(d,f,h){f.length?f=t(f,function(g){return c(g)?function(m){return e(m,g.length===1?g[0]:g)}:g}):f=[l];var v=-1;f=t(f,i(r));var p=n(d,function(g,m,y){var b=t(f,function(w){return w(g)});return{criteria:b,index:++v,value:g}});return a(p,function(g,m){return o(g,m,h)})}return Pv=u,Pv}var Ov,Q2;function B6(){if(Q2)return Ov;Q2=1;var t=rp(),e=I6(),r=Cl(),n=El(),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 Ov=a,Ov}var Av,J2;function D6(){if(J2)return Av;J2=1;var t=Ex(),e=0;function r(n){var a=++e;return t(n)+a}return Av=r,Av}var Rv,eS;function P6(){if(eS)return Rv;eS=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 Rv=t,Rv}var Lv,tS;function O6(){if(tS)return Lv;tS=1;var t=fl(),e=P6();function r(n,a){return e(n||[],a||[],t)}return Lv=r,Lv}var Mv,rS;function Ze(){if(rS)return Mv;rS=1;var t;if(typeof Bc=="function")try{t={cloneDeep:Y8(),constant:$f(),defaults:Z8(),each:HE(),filter:$x(),find:n6(),flatten:y2(),forEach:qE(),forIn:a6(),has:zx(),isUndefined:Gx(),last:i6(),map:Yx(),mapValues:o6(),max:l6(),merge:p6(),min:v6(),minBy:g6(),now:m6(),pick:E6(),range:S6(),reduce:Jx(),sortBy:B6(),uniqueId:D6(),values:Pk(),zipObject:O6()}}catch{}return t||(t=window._),Mv=t,Mv}var Fv,nS;function A6(){if(nS)return Fv;nS=1,Fv=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 Fv}var $v,aS;function R6(){if(aS)return $v;aS=1;var t=Ze(),e=wr().Graph,r=A6();$v=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 m=d.length-2;m>0;--m)if(g=d[m].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 m=u.edge(g),y=u.node(g.v);v&&p.push({v:g.v,w:g.w}),y.out-=m,c(d,f,y)}),t.forEach(u.outEdges(h.v),function(g){var m=u.edge(g),y=g.w,b=u.node(y);b.in-=m,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(m){f.setNode(m,{v:m,in:0,out:0})}),t.forEach(u.edges(),function(m){var y=f.edge(m.v,m.w)||0,b=d(m),w=y+b;f.setEdge(m.v,m.w,w),v=Math.max(v,f.node(m.v).out+=b),h=Math.max(h,f.node(m.w).in+=b)});var p=t.range(v+h+3).map(function(){return new r}),g=h+1;return t.forEach(f.nodes(),function(m){c(p,g,f.node(m))}),{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 $v}var Vv,iS;function L6(){if(iS)return Vv;iS=1;var t=Ze(),e=R6();Vv={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 Vv}var qv,oS;function Ut(){if(oS)return qv;oS=1;var t=Ze(),e=wr().Graph;qv={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(m,y,b,w){var C;do C=t.uniqueId(w);while(m.hasNode(C));return b.dummy=y,m.setNode(C,b),C}function n(m){var y=new e().setGraph(m.graph());return t.forEach(m.nodes(),function(b){y.setNode(b,m.node(b))}),t.forEach(m.edges(),function(b){var w=y.edge(b.v,b.w)||{weight:0,minlen:1},C=m.edge(b);y.setEdge(b.v,b.w,{weight:w.weight+C.weight,minlen:Math.max(w.minlen,C.minlen)})}),y}function a(m){var y=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return t.forEach(m.nodes(),function(b){m.children(b).length||y.setNode(b,m.node(b))}),t.forEach(m.edges(),function(b){y.setEdge(b,m.edge(b))}),y}function i(m){var y=t.map(m.nodes(),function(b){var w={};return t.forEach(m.outEdges(b),function(C){w[C.w]=(w[C.w]||0)+m.edge(C).weight}),w});return t.zipObject(m.nodes(),y)}function o(m){var y=t.map(m.nodes(),function(b){var w={};return t.forEach(m.inEdges(b),function(C){w[C.v]=(w[C.v]||0)+m.edge(C).weight}),w});return t.zipObject(m.nodes(),y)}function l(m,y){var b=m.x,w=m.y,C=y.x-b,x=y.y-w,k=m.width/2,E=m.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(m){var y=t.map(t.range(h(m)+1),function(){return[]});return t.forEach(m.nodes(),function(b){var w=m.node(b),C=w.rank;t.isUndefined(C)||(y[C][w.order]=b)}),y}function u(m){var y=t.min(t.map(m.nodes(),function(b){return m.node(b).rank}));t.forEach(m.nodes(),function(b){var w=m.node(b);t.has(w,"rank")&&(w.rank-=y)})}function d(m){var y=t.min(t.map(m.nodes(),function(x){return m.node(x).rank})),b=[];t.forEach(m.nodes(),function(x){var k=m.node(x).rank-y;b[k]||(b[k]=[]),b[k].push(x)});var w=0,C=m.graph().nodeRankFactor;t.forEach(b,function(x,k){t.isUndefined(x)&&k%C!==0?--w:w&&t.forEach(x,function(E){m.node(E).rank+=w})})}function f(m,y,b,w){var C={width:0,height:0};return arguments.length>=4&&(C.rank=b,C.order=w),r(m,"border",C,y)}function h(m){return t.max(t.map(m.nodes(),function(y){var b=m.node(y).rank;if(!t.isUndefined(b))return b}))}function v(m,y){var b={lhs:[],rhs:[]};return t.forEach(m,function(w){y(w)?b.lhs.push(w):b.rhs.push(w)}),b}function p(m,y){var b=t.now();try{return y()}finally{console.log(m+" time: "+(t.now()-b)+"ms")}}function g(m,y){return y()}return qv}var zv,sS;function M6(){if(sS)return zv;sS=1;var t=Ze(),e=Ut();zv={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,m;for(m=0,++c;c<d;++m,++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),m===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 zv}var Hv,lS;function xl(){if(lS)return Hv;lS=1;var t=Ze();Hv={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 Hv}var Kv,uS;function cS(){if(uS)return Kv;uS=1;var t=Ze(),e=wr().Graph,r=xl().slack;Kv=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 Kv}var Gv,dS;function F6(){if(dS)return Gv;dS=1;var t=Ze(),e=cS(),r=xl().slack,n=xl().longestPath,a=wr().alg.preorder,i=wr().alg.postorder,o=Ut().simplify;Gv=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,y(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),m(w,C)}function m(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 y(w,C,x){return w.hasEdge(C,x)}function b(w,C,x){return x.low<=C.lim&&C.lim<=x.lim}return Gv}var Uv,fS;function $6(){if(fS)return Uv;fS=1;var t=xl(),e=t.longestPath,r=cS(),n=F6();Uv=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 Uv}var jv,hS;function V6(){if(hS)return jv;hS=1;var t=Ze();jv=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 jv}var Wv,pS;function q6(){if(pS)return Wv;pS=1;var t=Ze(),e=Ut();Wv={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"),m=e.addBorderNode(l,"_bb"),y=l.node(v);l.setParent(g,v),y.borderTop=g,l.setParent(m,v),y.borderBottom=m,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,m,{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 Wv}var Yv,vS;function z6(){if(vS)return Yv;vS=1;var t=Ze(),e=Ut();Yv=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 Yv}var Zv,gS;function H6(){if(gS)return Zv;gS=1;var t=Ze();Zv={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 Zv}var Xv,mS;function K6(){if(mS)return Xv;mS=1;var t=Ze();Xv=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 Xv}var Qv,yS;function G6(){if(yS)return Qv;yS=1;var t=Ze();Qv=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 Qv}var Jv,bS;function U6(){if(bS)return Jv;bS=1;var t=Ze();Jv=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 Jv}var eg,wS;function j6(){if(wS)return eg;wS=1;var t=Ze();eg=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 eg}var tg,CS;function W6(){if(CS)return tg;CS=1;var t=Ze(),e=Ut();tg=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 tg}var rg,ES;function Y6(){if(ES)return rg;ES=1;var t=Ze(),e=U6(),r=j6(),n=W6();rg=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 m=e(l,f);t.forEach(m,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 y=r(m,u);i(y,g);var b=n(y,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 rg}var ng,xS;function Z6(){if(xS)return ng;xS=1;var t=Ze(),e=wr().Graph;ng=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 ng}var ag,kS;function X6(){if(kS)return ag;kS=1;var t=Ze();ag=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 ag}var ig,SS;function Q6(){if(SS)return ig;SS=1;var t=Ze(),e=K6(),r=G6(),n=Y6(),a=Z6(),i=X6(),o=wr().Graph,l=Ut();ig=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"),m=e(h);f(h,m);for(var y=Number.POSITIVE_INFINITY,b,w=0,C=0;C<4;++w,++C){d(w%2?p:g,w%4>=2),m=l.buildLayerMatrix(h);var x=r(h,m);x<y&&(C=0,b=t.cloneDeep(m),y=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 m=g.graph().root,y=n(g,m,p,v);t.forEach(y.vs,function(b,w){g.node(b).order=w}),i(g,p,y.vs)})}function f(h,v){t.forEach(v,function(p){t.forEach(p,function(g,m){h.node(g).order=m})})}return ig}var og,_S;function J6(){if(_S)return og;_S=1;var t=Ze(),e=wr().Graph,r=Ut();og={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:v};function n(y,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(y,N),D=P?y.node(P).order:S;(P||N===T)&&(t.forEach(k.slice(_,B+1),function(R){t.forEach(y.predecessors(R),function(O){var L=y.node(O),A=L.order;(A<E||D<A)&&!(L.dummy&&y.node(R).dummy)&&o(w,O,R)})}),_=B+1,E=D)}),k}return t.reduce(b,C),w}function a(y,b){var w={};function C(k,E,_,S,T){var N;t.forEach(t.range(E,_),function(B){N=k[B],y.node(N).dummy&&t.forEach(y.predecessors(N),function(P){var D=y.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(y.node(N).dummy==="border"){var P=y.predecessors(N);P.length&&(S=y.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(y,b){if(y.node(b).dummy)return t.find(y.predecessors(b),function(w){return y.node(w).dummy})}function o(y,b,w){if(b>w){var C=b;b=w,w=C}var x=y[b];x||(y[b]=x={}),x[w]=!0}function l(y,b,w){if(b>w){var C=b;b=w,w=C}return t.has(y[b],w)}function c(y,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(y,b,w,C,x){var k={},E=d(y,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=y.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(y,b,w,C){var x=new e,k=y.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(y,T,S),P||0))}S=T})}),x}function f(y,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 _=m(y,E)/2;C=Math.max(k+_,C),x=Math.min(k-_,x)}),C-x})}function h(y,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=y[_],T;if(S!==b){var N=t.values(S);T=E==="l"?C-t.min(N):x-t.max(N),T&&(y[_]=t.mapValues(S,function(B){return B+T}))}})})}function v(y,b){return t.mapValues(y.ul,function(w,C){if(b)return y[b.toLowerCase()][C];var x=t.sortBy(t.map(y,C));return(x[1]+x[2])/2})}function p(y){var b=r.buildLayerMatrix(y),w=t.merge(n(y,b),a(y,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"?y.predecessors:y.successors).bind(y),T=c(y,x,w,S),N=u(y,x,T.root,T.align,_==="r");_==="r"&&(N=t.mapValues(N,function(B){return-B})),C[E+_]=N})});var k=f(y,C);return h(C,k),v(C,y.graph().align)}function g(y,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:y)/2,S+=(_.dummy?b:y)/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 m(y,b){return y.node(b).width}return og}var sg,TS;function e9(){if(TS)return sg;TS=1;var t=Ze(),e=Ut(),r=J6().positionX;sg=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 sg}var lg,NS;function t9(){if(NS)return lg;NS=1;var t=Ze(),e=L6(),r=M6(),n=$6(),a=Ut().normalizeRanks,i=V6(),o=Ut().removeEmptyRanks,l=q6(),c=z6(),u=H6(),d=Q6(),f=e9(),h=Ut(),v=wr().Graph;lg=p;function p(F,$){var V=$&&$.debugTiming?h.time:h.notime;V("layout",function(){var G=V(" buildLayoutGraph",function(){return S(F)});V(" runLayout",function(){g(G,V)}),V(" updateInputGraph",function(){m(F,G)})})}function g(F,$){$(" makeSpaceForEdgeLabels",function(){T(F)}),$(" removeSelfEdges",function(){q(F)}),$(" acyclic",function(){e.run(F)}),$(" nestingGraph.run",function(){l.run(F)}),$(" rank",function(){n(h.asNonCompoundGraph(F))}),$(" injectEdgeLabelProxies",function(){N(F)}),$(" removeEmptyRanks",function(){o(F)}),$(" nestingGraph.cleanup",function(){l.cleanup(F)}),$(" normalizeRanks",function(){a(F)}),$(" assignRankMinMax",function(){B(F)}),$(" removeEdgeLabelProxies",function(){P(F)}),$(" normalize.run",function(){r.run(F)}),$(" parentDummyChains",function(){i(F)}),$(" addBorderSegments",function(){c(F)}),$(" order",function(){d(F)}),$(" insertSelfEdges",function(){U(F)}),$(" adjustCoordinateSystem",function(){u.adjust(F)}),$(" position",function(){f(F)}),$(" positionSelfEdges",function(){z(F)}),$(" removeBorderNodes",function(){A(F)}),$(" normalize.undo",function(){r.undo(F)}),$(" fixupEdgeLabelCoords",function(){O(F)}),$(" undoCoordinateSystem",function(){u.undo(F)}),$(" translateGraph",function(){D(F)}),$(" assignNodeIntersects",function(){R(F)}),$(" reversePoints",function(){L(F)}),$(" acyclic.undo",function(){e.undo(F)})}function m(F,$){t.forEach(F.nodes(),function(V){var G=F.node(V),j=$.node(V);G&&(G.x=j.x,G.y=j.y,$.children(V).length&&(G.width=j.width,G.height=j.height))}),t.forEach(F.edges(),function(V){var G=F.edge(V),j=$.edge(V);G.points=j.points,t.has(j,"x")&&(G.x=j.x,G.y=j.y)}),F.graph().width=$.graph().width,F.graph().height=$.graph().height}var y=["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 $=new v({multigraph:!0,compound:!0}),V=J(F.graph());return $.setGraph(t.merge({},b,H(V,y),t.pick(V,w))),t.forEach(F.nodes(),function(G){var j=J(F.node(G));$.setNode(G,t.defaults(H(j,C),x)),$.setParent(G,F.parent(G))}),t.forEach(F.edges(),function(G){var j=J(F.edge(G));$.setEdge(G,t.merge({},E,H(j,k),t.pick(j,_)))}),$}function T(F){var $=F.graph();$.ranksep/=2,t.forEach(F.edges(),function(V){var G=F.edge(V);G.minlen*=2,G.labelpos.toLowerCase()!=="c"&&($.rankdir==="TB"||$.rankdir==="BT"?G.width+=G.labeloffset:G.height+=G.labeloffset)})}function N(F){t.forEach(F.edges(),function($){var V=F.edge($);if(V.width&&V.height){var G=F.node($.v),j=F.node($.w),M={rank:(j.rank-G.rank)/2+G.rank,e:$};h.addDummyNode(F,"edge-proxy",M,"_ep")}})}function B(F){var $=0;t.forEach(F.nodes(),function(V){var G=F.node(V);G.borderTop&&(G.minRank=F.node(G.borderTop).rank,G.maxRank=F.node(G.borderBottom).rank,$=t.max($,G.maxRank))}),F.graph().maxRank=$}function P(F){t.forEach(F.nodes(),function($){var V=F.node($);V.dummy==="edge-proxy"&&(F.edge(V.e).labelRank=V.rank,F.removeNode($))})}function D(F){var $=Number.POSITIVE_INFINITY,V=0,G=Number.POSITIVE_INFINITY,j=0,M=F.graph(),W=M.marginx||0,Y=M.marginy||0;function se(ce){var ae=ce.x,ne=ce.y,ue=ce.width,ie=ce.height;$=Math.min($,ae-ue/2),V=Math.max(V,ae+ue/2),G=Math.min(G,ne-ie/2),j=Math.max(j,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)}),$-=W,G-=Y,t.forEach(F.nodes(),function(ce){var ae=F.node(ce);ae.x-=$,ae.y-=G}),t.forEach(F.edges(),function(ce){var ae=F.edge(ce);t.forEach(ae.points,function(ne){ne.x-=$,ne.y-=G}),t.has(ae,"x")&&(ae.x-=$),t.has(ae,"y")&&(ae.y-=G)}),M.width=V-$+W,M.height=j-G+Y}function R(F){t.forEach(F.edges(),function($){var V=F.edge($),G=F.node($.v),j=F.node($.w),M,W;V.points?(M=V.points[0],W=V.points[V.points.length-1]):(V.points=[],M=j,W=G),V.points.unshift(h.intersectRect(G,M)),V.points.push(h.intersectRect(j,W))})}function O(F){t.forEach(F.edges(),function($){var V=F.edge($);if(t.has(V,"x"))switch((V.labelpos==="l"||V.labelpos==="r")&&(V.width-=V.labeloffset),V.labelpos){case"l":V.x-=V.width/2+V.labeloffset;break;case"r":V.x+=V.width/2+V.labeloffset;break}})}function L(F){t.forEach(F.edges(),function($){var V=F.edge($);V.reversed&&V.points.reverse()})}function A(F){t.forEach(F.nodes(),function($){if(F.children($).length){var V=F.node($),G=F.node(V.borderTop),j=F.node(V.borderBottom),M=F.node(t.last(V.borderLeft)),W=F.node(t.last(V.borderRight));V.width=Math.abs(W.x-M.x),V.height=Math.abs(j.y-G.y),V.x=M.x+V.width/2,V.y=G.y+V.height/2}}),t.forEach(F.nodes(),function($){F.node($).dummy==="border"&&F.removeNode($)})}function q(F){t.forEach(F.edges(),function($){if($.v===$.w){var V=F.node($.v);V.selfEdges||(V.selfEdges=[]),V.selfEdges.push({e:$,label:F.edge($)}),F.removeEdge($)}})}function U(F){var $=h.buildLayerMatrix(F);t.forEach($,function(V){var G=0;t.forEach(V,function(j,M){var W=F.node(j);W.order=M+G,t.forEach(W.selfEdges,function(Y){h.addDummyNode(F,"selfedge",{width:Y.label.width,height:Y.label.height,rank:W.rank,order:M+ ++G,e:Y.e,label:Y.label},"_se")}),delete W.selfEdges})})}function z(F){t.forEach(F.nodes(),function($){var V=F.node($);if(V.dummy==="selfedge"){var G=F.node(V.e.v),j=G.x+G.width/2,M=G.y,W=V.x-j,Y=G.height/2;F.setEdge(V.e,V.label),F.removeNode($),V.label.points=[{x:j+2*W/3,y:M-Y},{x:j+5*W/6,y:M-Y},{x:j+W,y:M},{x:j+5*W/6,y:M+Y},{x:j+2*W/3,y:M+Y}],V.label.x=V.x,V.label.y=V.y}})}function H(F,$){return t.mapValues(t.pick(F,$),Number)}function J(F){var $={};return t.forEach(F,function(V,G){$[G.toLowerCase()]=V}),$}return lg}var ug,IS;function r9(){if(IS)return ug;IS=1;var t=Ze(),e=Ut(),r=wr().Graph;ug={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 ug}var cg,BS;function n9(){return BS||(BS=1,cg="0.8.5"),cg}var dg,DS;function a9(){return DS||(DS=1,dg={graphlib:wr(),layout:t9(),debug:r9(),util:{time:Ut().time,notime:Ut().notime},version:n9()}),dg}(function(t,e){(function(n,a){t.exports=a(a9())})(Ai,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,m=function(z,H){return l(H)?H.apply(z,[z]):H},y=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};y.x2===void 0&&(y.x2=y.x1+y.w),y.w===void 0&&(y.w=y.x2-y.x1),y.y2===void 0&&(y.y2=y.y1+y.h),y.h===void 0&&(y.h=y.y2-y.y1);var b=new d.graphlib.Graph({multigraph:!0,compound:!0}),w={},C=function(z,H){H!=null&&(w[z]=H)};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(U){return!U.source().isParent()&&!U.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:m(P,h.minLen),weight:m(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],L=b.node(O);p.getElementById(O).scratch().dagre=L}var A;h.boundingBox?(A={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},x.forEach(function(U){var z=U.scratch().dagre;A.x1=Math.min(A.x1,z.x),A.x2=Math.max(A.x2,z.x),A.y1=Math.min(A.y1,z.y),A.y2=Math.max(A.y2,z.y)}),A.w=A.x2-A.x1,A.h=A.y2-A.y1):A=y;var q=function(z){if(h.boundingBox){var H=A.w===0?0:(z.x-A.x1)/A.w,J=A.h===0?0:(z.y-A.y1)/A.h;return{x:y.x1+H*y.w,y:y.y1+J*y.h}}else return z};return x.layoutPositions(v,h,function(U){U=o(U)==="object"?U:this;var z=U.scratch().dagre;return q({x:z.x,y:z.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}])})})(fw);var i9=fw.exports;const o9=xA(i9);In.use(o9);const PS=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)):[]},l9=function(t,e,r){let n=t.connectivity.flat(),a=s9(n),i=[],o=!1;return a.forEach(l=>{o=!1,PS(e,l)&&(o=!0),PS(r,l)&&(o=!0),o||i.push(l)}),i};let u9=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=l9(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 h9(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=fg(o);f9(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 c9=[{selector:"node",style:{label:function(t){return d9(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 d9(t){const e=t.split(`
46
- `),r=e.length/2,n=e.slice(r);return OS(n.join(`
47
- `))}function OS(t){return t.split(`
44
+ `),w=0;w<b.length;w++){var C=b[w],E=p.measureText(C),k=Math.ceil(E.width),x=d;m=Math.max(k,m),y+=x}return m+=c,y+=c,o[i]={width:m,height:y}},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 F1={},$1=28,V1=!1;F1.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<$1||t.height()<$1))return V1||($e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),V1=!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 tl={};tl.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)},tl.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},tl.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],m=g._private,y=m.rstyle,b=m.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var rl={};rl.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)}}},rl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},rl.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(r1),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var q1={};[aa,Js,Ot,vo,Cc,Or,F1,tl,rl].forEach(function(t){Se(q1,t)});var z1={};z1.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 ri={};ri.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},ri.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||EM(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}},ri.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},ri.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},ri.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},n=function(I,K,te,Z){I==null&&(I=t.cy);for(var X=0;X<K.length;X++){var le=K[X];I.emit({originalEvent:te,type:le,position:Z})}},a=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},i=function(I,K){var te=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var Z=0;K&&Z<K.length;Z++){var I=K[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,K){var te=K.addToList,Z=te.has(I);!Z&&I.grabbable()&&!I.locked()&&(te.merge(I),o(I))},v=function(I,K){if(I.cy().hasCompoundNodes()&&!(K.inDragLayer==null&&K.addToList==null)){var te=I.descendants();K.inDragLayer&&(te.forEach(c),te.connectedEdges().forEach(c)),K.addToList&&h(te,K)}},p=function(I,K){K=K||{};var te=I.cy().hasCompoundNodes();K.inDragLayer&&(I.forEach(c),I.neighborhood().stdFilter(function(Z){return!te||Z.isEdge()}).forEach(c)),K.addToList&&I.forEach(function(Z){h(Z,K)}),v(I,K),y(I,{inDragLayer:K.inDragLayer}),t.updateCachedGrabbedEles()},g=p,m=function(I){I&&(t.getCachedZSortedEles().forEach(function(K){l(K),u(K),f(K)}),t.updateCachedGrabbedEles())},y=function(I,K){if(!(K.inDragLayer==null&&K.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()),X=Z.connectedEdges();K.inDragLayer&&(X.forEach(c),Z.forEach(c)),K.addToList&&Z.forEach(function(le){h(le,K)})}}},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 K=re[I],te=K.removedNodes;if(te)for(var Z=0;Z<te.length;Z++){var X=te[Z];if(X===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 E=hs(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(E),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",E),C&&(t.resizeObserver=new ResizeObserver(E),t.resizeObserver.observe(t.container));var k=function(I,K){for(;I!=null;)K(I),I=I.parentNode},x=function(){t.invalidateContainerClientCoordsCache()};k(t.container,function(re){t.registerBinding(re,"transitionend",x),t.registerBinding(re,"animationend",x),t.registerBinding(re,"scroll",x)}),t.registerBinding(t.container,"contextmenu",function(re){re.preventDefault()});var _=function(){return t.selection[4]!==0},S=function(I){for(var K=t.findContainerClientCoords(),te=K[0],Z=K[1],X=K[2],le=K[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+X&&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 K=t.cy,te=[I.clientX,I.clientY],Z=t.projectIntoViewport(te[0],te[1]),X=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]}}):K.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):K.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=K.collection(),g(ee,{addToList:oe}),ee.emit(ye("grabon")).emit(ye("grab"));else{oe=t.dragData.possibleDragElements=K.collection();var ge=K.$(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?(X[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(X[4]=1),me()}X[0]=X[2]=Z[0],X[1]=X[3]=Z[1]}},!1),t.registerBinding(e,"mousemove",function(I){var K=t.hoverData.capture;if(!(!K&&!S(I))){var te=!1,Z=t.cy,X=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 it=le[0]-me[0],ot=it*it,et=le[1]-me[1],At=et*et,pt=ot+At;t.hoverData.isOverThresholdDrag=qe=pt>=t.desktopTapThreshold2}var mt=a(I);qe&&(t.hoverData.tapholdCancelled=!0);var Jt=function(){var J=t.hoverData.dragDelta=t.hoverData.dragDelta||[];J.length===0?(J.push(Ce[0]),J.push(Ce[1])):(J[0]+=Ce[0],J[1]+=Ce[1])};te=!0,n(ye,["mousemove","vmousemove","tapdrag"],I,{x:ee[0],y:ee[1]});var Rt=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 Lt={originalEvent:I,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};ge?ge.emit(Lt):Z.emit(Lt),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])*X,y:(ee[1]-Cr[1])*X},t.hoverData.justStartedPan=!1}else lr={x:Ce[0]*X,y:Ce[1]*X};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()&&(mt||!Z.panningEnabled()||!Z.userPanningEnabled()))Rt();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=Ma(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()&&mt)ge&&ge.grabbed()&&(m(je),ge.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(ge.emit("dragfreeon"),je.emit("dragfree"))),Rt();else if(ge&&ge.grabbed()&&t.nodeIsDraggable(ge)){var tt=!t.dragData.didDrag;tt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(je,{inDragLayer:!0});var st={x:0,y:0};if(de(Ce[0])&&de(Ce[1])&&(st.x+=Ce[0],st.y+=Ce[1],tt)){var yt=t.hoverData.dragDelta;yt&&de(yt[0])&&de(yt[1])&&(st.x+=yt[0],st.y+=yt[1])}t.hoverData.draggingEles=!0,je.silentShift(st).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 K=t.hoverData.capture;if(K){t.hoverData.capture=!1;var te=t.cy,Z=t.projectIntoViewport(I.clientX,I.clientY),X=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(X[0],X[1],X[2],X[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()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ce=oe&&oe.grabbed();m(ee),Ce&&(oe.emit("freeon"),ee.emit("free"),t.dragData.didDrag&&(oe.emit("dragfreeon"),ee.emit("dragfree")))}}X[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 K=t.cy,te=K.zoom(),Z=K.pan(),X=t.projectIntoViewport(I.clientX,I.clientY),le=[X[0]*te+Z.x,X[1]*te+Z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){I.preventDefault();return}if(K.panningEnabled()&&K.userPanningEnabled()&&K.zoomingEnabled()&&K.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=K.zoom()*Math.pow(10,ee);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),K.zoom({level:me,renderedPosition:{x:le[0],y:le[1]}}),K.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 K=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:K[0],y:K[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var K=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:K[0],y:K[1]}})},!1);var D,R,O,L,A,q,U,z,H,Q,F,$,V,G=function(I,K,te,Z){return Math.sqrt((te-I)*(te-I)+(Z-K)*(Z-K))},j=function(I,K,te,Z){return(te-I)*(te-I)+(Z-K)*(Z-K)},M;t.registerBinding(t.container,"touchstart",M=function(I){if(t.hasTouchStarted=!0,!!S(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var K=t.cy,te=t.touchData.now,Z=t.touchData.earlier;if(I.touches[0]){var X=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);te[0]=X[0],te[1]=X[1]}if(I.touches[1]){var X=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);te[2]=X[0],te[3]=X[1]}if(I.touches[2]){var X=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);te[4]=X[0],te[5]=X[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var le=t.findContainerClientCoords();H=le[0],Q=le[1],F=le[2],$=le[3],D=I.touches[0].clientX-H,R=I.touches[0].clientY-Q,O=I.touches[1].clientX-H,L=I.touches[1].clientY-Q,V=0<=D&&D<=F&&0<=O&&O<=F&&0<=R&&R<=$&&0<=L&&L<=$;var ee=K.pan(),oe=K.zoom();A=G(D,R,O,L),q=j(D,R,O,L),U=[(D+O)/2,(R+L)/2],z=[(U[0]-ee.x)/oe,(U[1]-ee.y)/oe];var me=200,be=me*me;if(q<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):K.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])K.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=K.collection(),qe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ce.selected()?(qe=K.$(function(pt){return pt.selected()&&t.nodeIsGrabbable(pt)}),p(qe,{addToList:je})):g(Ce,{addToList:je}),d(Ce);var it=function(mt){return{originalEvent:I,type:mt,position:{x:te[0],y:te[1]}}};Ce.emit(it("grabon")),qe?qe.forEach(function(pt){pt.emit(it("grab"))}):Ce.emit(it("grab"))}n(Ce,["touchstart","tapstart","vmousedown"],I,{x:te[0],y:te[1]}),Ce==null&&(t.data.bgActivePosistion={x:X[0],y:X[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 ot=t.touchData.startPosition=[null,null,null,null,null,null],et=0;et<te.length;et++)ot[et]=Z[et]=te[et];var At=I.touches[0];t.touchData.startGPosition=[At.clientX,At.clientY]}}},!1);var W;t.registerBinding(e,"touchmove",W=function(I){var K=t.touchData.capture;if(!(!K&&!S(I))){var te=t.selection,Z=t.cy,X=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);X[0]=oe[0],X[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);X[2]=oe[0],X[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);X[4]=oe[0],X[5]=oe[1]}var me=t.touchData.startGPosition,be;if(K&&I.touches[0]&&me){for(var ye=[],_e=0;_e<X.length;_e++)ye[_e]=X[_e]-le[_e];var ge=I.touches[0].clientX-me[0],Ce=ge*ge,je=I.touches[0].clientY-me[1],qe=je*je,it=Ce+qe;be=it>=t.touchTapThreshold2}if(K&&t.touchData.cxt){I.preventDefault();var ot=I.touches[0].clientX-H,et=I.touches[0].clientY-Q,At=I.touches[1].clientX-H,pt=I.touches[1].clientY-Q,mt=j(ot,et,At,pt),Jt=mt/q,Rt=150,Lt=Rt*Rt,lr=1.5,Cr=lr*lr;if(Jt>=Cr||mt>=Lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var jt={originalEvent:I,type:"cxttapend",position:{x:X[0],y:X[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(jt),t.touchData.start=null):Z.emit(jt)}}if(K&&t.touchData.cxt){var jt={originalEvent:I,type:"cxtdrag",position:{x:X[0],y:X[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 tt=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||tt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:X[0],y:X[1]}}),t.touchData.cxtOver=tt,tt&&tt.emit({originalEvent:I,type:"cxtdragover",position:{x:X[0],y:X[1]}}))}else if(K&&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:X[0],y:X[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(X[0]+X[2]+X[4])/3,te[1]=(X[1]+X[3]+X[5])/3,te[2]=(X[0]+X[2]+X[4])/3+1,te[3]=(X[1]+X[3]+X[5])/3+1):(te[2]=(X[0]+X[2]+X[4])/3,te[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(K&&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 st=t.dragData.touchDragEles;if(st){t.redrawHint("drag",!0);for(var yt=0;yt<st.length;yt++){var Pn=st[yt]._private;Pn.grabbed=!1,Pn.rscratch.inDragLayer=!1}}var J=t.touchData.start,ot=I.touches[0].clientX-H,et=I.touches[0].clientY-Q,At=I.touches[1].clientX-H,pt=I.touches[1].clientY-Q,he=G(ot,et,At,pt),Oe=he/A;if(V){var He=ot-D,Mr=et-R,On=At-O,fi=pt-L,rn=(He+On)/2,ur=(Mr+fi)/2,An=Z.zoom(),xg=An*Oe,kl=Z.pan(),__=z[0]*An+kl.x,T_=z[1]*An+kl.y,JK={x:-xg/An*(__-kl.x-rn)+__,y:-xg/An*(T_-kl.y-ur)+T_};if(J&&J.active()){var st=t.dragData.touchDragEles;m(st),t.redrawHint("drag",!0),t.redrawHint("eles",!0),J.unactivate().emit("freeon"),st.emit("free"),t.dragData.didDrag&&(J.emit("dragfreeon"),st.emit("dragfree"))}Z.viewport({zoom:xg,pan:JK,cancelOnFailedZoom:!0}),Z.emit("pinchzoom"),A=he,D=ot,R=et,O=At,L=pt,t.pinching=!0}if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);X[0]=oe[0],X[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);X[2]=oe[0],X[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);X[4]=oe[0],X[5]=oe[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Er=t.touchData.start,kg=t.touchData.last,tt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(tt=t.findNearestElement(X[0],X[1],!0,!0)),K&&Er!=null&&I.preventDefault(),K&&Er!=null&&t.nodeIsDraggable(Er))if(be){var st=t.dragData.touchDragEles,N_=!t.dragData.didDrag;N_&&p(st,{inDragLayer:!0}),t.dragData.didDrag=!0;var No={x:0,y:0};if(de(ye[0])&&de(ye[1])&&(No.x+=ye[0],No.y+=ye[1],N_)){t.redrawHint("eles",!0);var xr=t.touchData.dragDelta;xr&&de(xr[0])&&de(xr[1])&&(No.x+=xr[0],No.y+=xr[1])}t.hoverData.draggingEles=!0,st.silentShift(No).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||tt,["touchmove","tapdrag","vmousemove"],I,{x:X[0],y:X[1]}),(!Er||!Er.grabbed())&&tt!=kg&&(kg&&kg.emit({originalEvent:I,type:"tapdragout",position:{x:X[0],y:X[1]}}),tt&&tt.emit({originalEvent:I,type:"tapdragover",position:{x:X[0],y:X[1]}})),t.touchData.last=tt,K)for(var yt=0;yt<X.length;yt++)X[yt]&&t.touchData.startPosition[yt]&&be&&(t.touchData.singleTouchMoved=!0);if(K&&(Er==null||Er.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var QK=i(Er,t.touchData.starts);QK&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Ma(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);X[0]=oe[0],X[1]=oe[1]}}for(var _e=0;_e<X.length;_e++)le[_e]=X[_e];K&&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 K=t.touchData.start;t.touchData.capture=!1,K&&K.unactivate()});var se,ce,ae,ne;if(t.registerBinding(e,"touchend",se=function(I){var K=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 X=t.cy,le=X.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]}K&&K.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:ee[0],y:ee[1]}},K?K.emit(be):X.emit(be),!t.touchData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:ee[0],y:ee[1]}};K?K.emit(ye):X.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]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var _e=X.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),X.emit({type:"boxend",originalEvent:I,position:{x:ee[0],y:ee[1]}});var ge=function(Lt){return Lt.selectable()&&!Lt.selected()};_e.emit("box").stdFilter(ge).select().emit("boxselect"),_e.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(K!=null&&K.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(K!=null){var je=K._private.grabbed;m(Ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(K.emit("freeon"),Ce.emit("free"),t.dragData.didDrag&&(K.emit("dragfreeon"),Ce.emit("dragfree"))),n(K,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]}),K.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 it=t.touchData.startPosition[0]-ee[0],ot=it*it,et=t.touchData.startPosition[1]-ee[1],At=et*et,pt=ot+At,mt=pt*le*le;t.touchData.singleTouchMoved||(K||X.$(":selected").unselect(["tapunselect"]),n(K,["tap","vclick"],I,{x:ee[0],y:ee[1]}),ce=!1,I.timeStamp-ne<=X.multiClickDebounceTime()?(ae&&clearTimeout(ae),ce=!0,ne=null,n(K,["dbltap","vdblclick"],I,{x:ee[0],y:ee[1]})):(ae=setTimeout(function(){ce||n(K,["onetap","voneclick"],I,{x:ee[0],y:ee[1]})},X.multiClickDebounceTime()),ne=I.timeStamp)),K!=null&&!t.dragData.didDrag&&K._private.selectable&&mt<t.touchTapThreshold2&&!t.pinching&&(X.selectionType()==="single"?(X.$(r).unmerge(K).unselect(["tapunselect"]),K.select(["tapselect"])):K.selected()?K.unselect(["tapunselect"]):K.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))},De=function(I){for(var K=0;K<ue.length;K++){var te=ue[K];if(te.event.pointerId===I.pointerId){ue.splice(K,1);return}}},Ie=function(I){var K=ue.filter(function(te){return te.event.pointerId===I.pointerId})[0];K.event=I,K.touch=ie(I)},we=function(I){I.touches=ue.map(function(K){return K.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),M(re))}),t.registerBinding(t.container,"pointerup",function(re){xe(re)||(De(re),we(re),se(re))}),t.registerBinding(t.container,"pointercancel",function(re){xe(re)||(De(re),we(re),Y(re))}),t.registerBinding(t.container,"pointermove",function(re){xe(re)||(re.preventDefault(),Ie(re),we(re),W(re))})}};var Jr={};Jr.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 eo(l,c,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,l,c,u,d){return Yr(n,a,this.points,c,u,o,l,[0,-1],i)}}},Jr.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 v5(i,o,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,o,l,c){return Qn(e,r,a,i,o,l,n)}}},Jr.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"?X0(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,m,y,b=h.length;for(g=h[b-1],p=0;p<b;p++)m=h[p%b],y=h[(p+1)%b],c[u][p]=wc(g,m,y,l),g=m,m=y;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 g5(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 p5(n,a,this.points,c,u,o,l,this.getOrCreateCorners(c,u,o,l,d,f,"corners"))}}},Jr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Ft(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 Y0(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"?ea(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Yr(e,r,this.points,o,l,a,i-f,[0,-1],n)||Yr(e,r,this.points,o,l,a-f,i,[0,-1],n)||Qn(e,r,f,f,o-u+c,l-d+c,n)||Qn(e,r,f,f,o+u-c,l-d+c,n)||Qn(e,r,f,f,o+u-c,l+d-c,n)||Qn(e,r,f,f,o-u+c,l+d-c,n))}}},Jr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Gu(),points:Ft(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 eo(i,o,d,e,r)},checkPoint:function(e,r,n,a,i,o,l,c){var u=c==="auto"?this.cornerLength:c;if(Yr(e,r,this.points,o,l,a,i-2*u,[0,-1],n)||Yr(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)}}},Jr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Ft(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(m){var y=Fa({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),b=Fa({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},d),w=Fa({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},f);return[m[0],m[1],y.x,y.y,b.x,b.y,w.x,w.y,m[4],m[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return eo(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=Uu(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=Uu(a,i),d=u.heightOffset,f=u.widthOffset;if(Yr(e,r,this.points,o,l,a,i-2*d,[0,-1],n)||Yr(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),L=Math.max(N,P),A=Math.min(D,R),q=Math.max(D,R);if(O<=_&&_<=L&&A<=S&&S<=q){var U=m5(N,B,P),z=c5(U[0],U[1],U[2],_),H=z.filter(function(Q){return 0<=Q&&Q<=1});if(H.length>0)return H[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var m=p[g],y=h[m],b=v(e,r,y);if(b!=null){var w=y[5],C=y[3],E=y[1],k=gt(w,C,E,b);if(y.isTop&&k<=r||y.isBottom&&r<=k)return!0}}return!1}}},Jr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Ft(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=wn(i,o,e,r,u,d,h,f,!1);return v.length>0?v:Y0(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){c=c==="auto"?ea(a,i):c;var u=2*c;if(Yr(e,r,this.points,o,l,a,i-u,[0,-1],n)||Yr(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)||Qn(e,r,u,u,o+a/2-c,l+i/2-c,n)||Qn(e,r,u,u,o-a/2+c,l+i/2-c,n))}}},Jr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ft(3,0)),this.generateRoundPolygon("round-triangle",Ft(3,0)),this.generatePolygon("rectangle",Ft(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",Ft(5,0)),this.generateRoundPolygon("round-pentagon",Ft(5,0)),this.generatePolygon("hexagon",Ft(6,0)),this.generateRoundPolygon("round-hexagon",Ft(6,0)),this.generatePolygon("heptagon",Ft(7,0)),this.generateRoundPolygon("round-heptagon",Ft(7,0)),this.generatePolygon("octagon",Ft(8,0)),this.generateRoundPolygon("round-octagon",Ft(8,0));var n=new Array(20);{var a=Ku(5,0),i=Ku(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=Z0(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 go={};go.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},go.redraw=function(t){t=t||z0();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},go.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 H1=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};go.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){H1(t,!0,a);var i=Wr();t.render(t.renderOptions);var o=t.lastDrawTime=Wr();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 H1(t,!1,a);t.skipFrame=!1,ps(n)}};ps(r)}};var Jz=function(e){this.init(e)},K1=Jz,ni=K1.prototype;ni.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ni.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()},ni.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()}},ni.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{}},ni.isHeadless=function(){return!1},[vc,q1,z1,ri,Jr,go].forEach(function(t){Se(ni,t)});var Ec=1e3/60,G1={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=hs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,d){var f=Wr(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var y=Wr(),b=y-f,w=y-d;if(v<Ec){var C=Ec-(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*Ec)break;var E=e.deq(n,m,g);if(E.length>0)for(var k=0;k<E.length;k++)p.push(E[k]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,m,g)&&i())},l=e.priority||Fu;a.beforeRender(o,l(n))}}}},Qz=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gs;Du(this,t),this.idsByKey=new Ir,this.keyForId=new Ir,this.cachesByLvl=new Ir,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Pu(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 La,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}(),U1=25,nl=50,al=-4,xc=3,e3=7.99,t3=8,r3=1024,n3=1024,a3=1024,i3=.2,o3=.8,s3=10,l3=.15,u3=.1,c3=.9,d3=.9,f3=100,h3=1,ai={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},p3=xt({getKey:null,doesEleInvalidateKey:gs,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:F0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),mo=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=p3(r);Se(n,a),n.lookup=new Qz(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},ht=mo.prototype;ht.reasons=ai,ht.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ht.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ht.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Xi(function(r,n){return n.reqs-r.reqs});return e},ht.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ht.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(qu(l*r))),n<al)n=al;else if(l>=e3||n>xc)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<=U1?p=U1:d<=nl?p=nl:p=Math.ceil(d/nl)*nl,d>a3||f>n3)return null;var g=i.getTextureQueue(p),m=g[g.length-2],y=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};m||(m=g[g.length-1]),m||(m=y()),m.width-m.usedWidth<f&&(m=y());for(var b=function(O){return O&&O.scaledLabelShown===h},w=a&&a===ai.dequeue,C=a&&a===ai.highQuality,E=a&&a===ai.downscale,k,x=n+1;x<=xc;x++){var _=c.get(t,x);if(_){k=_;break}}var S=k&&k.level===n+1?k:null,T=function(){m.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,m.usedWidth,0,f,d)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.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,ai.downscale);T()}else return i.queueElement(t,k.level-1),k;else{var B;if(!w&&!C&&!E)for(var P=n-1;P>=al;P--){var D=c.get(t,P);if(D){B=D;break}}if(b(B))return i.queueElement(t,n),B;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,t,e,h,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return v={x:m.usedWidth,texture:m,level:n,scale:u,width:f,height:d,scaledLabelShown:h},m.usedWidth+=Math.ceil(f+t3),m.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(m),v},ht.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ht.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=al;i<=xc;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)}},ht.checkTextureUtility=function(t){t.invalidatedWidth>=i3*t.width&&this.retireTexture(t)},ht.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>o3&&t.fullnessChecks>=s3?yn(r,t):t.fullnessChecks++},ht.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;yn(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)}$u(i);var c=e.getRetiredTextureQueue(r);c.push(t)},ht.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(r3,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},ht.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,$u(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),yn(a,o),n.push(o),o}},ht.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}},ht.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<h3&&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,ai.dequeue)}return a},ht.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=Mu,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},ht.onDequeue=function(t){this.onDequeues.push(t)},ht.offDequeue=function(t){yn(this.onDequeues,t)},ht.setupDequeueing=G1.setupDequeueing({deqRedrawThreshold:f3,deqCost:l3,deqAvgCost:u3,deqNoDrawCost:c3,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 c=o[l].boundingBox();if(zu(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var v3=1,yo=-4,il=2,g3=3.99,m3=50,y3=50,b3=.15,w3=.1,C3=.9,E3=.9,x3=1,j1=250,k3=4e3*4e3,S3=!0,W1=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Wr()-2*j1,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=hs(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},y3),n.beforeRender(function(o,l){l-r.lastInvalidationTime<=j1?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Xi(i),r.setupDequeueing()},Tt=W1.prototype,Y1=0,_3=Math.pow(2,53)-1;Tt.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:Y1=++Y1%_3,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},Tt.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(qu(o*e)),r<yo)r=yo;else if(o>=g3||r>il)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;yo<=O&&O<=il&&!T(O);O+=R);};N(1),N(-1);for(var B=d.length-1;B>=0;B--){var P=d[B];P.invalid&&yn(d,P)}};if(!h)p();else return d;var g=function(){if(!f){f=Kt();for(var T=0;T<t.length;T++)U0(f,t[T].boundingBox())}return f},m=function(T){T=T||{};var N=T.after;g();var B=f.w*u*(f.h*u);if(B>k3)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 y=null,b=t.length/v3,w=!l,C=0;C<t.length;C++){var E=t[C],k=E._private.rscratch,x=k.imgLayerCaches=k.imgLayerCaches||{},_=x[r];if(_){y=_;continue}if((!y||y.eles.length>=b||!W0(y.bb,E.boundingBox()))&&(y=m({insert:!0,after:y}),!y))return null;v||w?n.queueLayer(y,E):n.drawEleInLayer(y,E,r,e),y.eles.push(E),x[r]=y}return v||(w?null:d)},Tt.getEleLevelForLayerLevel=function(t,e){return t},Tt.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,S3),i.setImgSmoothing(o,!0))},Tt.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},Tt.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}}},Tt.updateElementsInLayers=function(t,e){for(var r=this,n=zi(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=yo;u<=il;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,o,i))}},Tt.haveLayers=function(){for(var t=this,e=!1,r=yo;r<=il;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},Tt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Wr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},Tt.invalidateLayer=function(t){if(this.lastInvalidationTime=Wr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];yn(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)}}},Tt.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])})},Tt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Tt.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))}},Tt.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<x3&&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},Tt.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()}},Tt.requestRedraw=hs(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Tt.setupDequeueing=G1.setupDequeueing({deqRedrawThreshold:m3,deqCost:b3,deqAvgCost:w3,deqNoDrawCost:C3,deqFastCost:E3,deq:function(e,r){return e.dequeue(r)},onDeqd:Fu,shouldRedraw:F0,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Z1={},X1;function T3(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function N3(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 J1(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 I3(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 B3(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}Z1.arrowShapeImpl=function(t){return(X1||(X1={polygon:T3,"triangle-backcurve":N3,"triangle-tee":J1,"circle-triangle":I3,"triangle-cross":J1,circle:B3}))[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,m=u.h,y,b,w,C,E;if(h!==0){var k=r.getRotationPoint(e);w=k.x,C=k.y,t.translate(w,C),t.rotate(h),E=c.getImgSmoothing(t),E||c.setImgSmoothing(t,!0);var x=r.getRotationOffset(e);y=x.x,b=x.y}else y=v,b=p;var _;f!==1&&(_=t.globalAlpha,t.globalAlpha=_*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,y,b,g,m),f!==1&&(t.globalAlpha=_),h!==0&&(t.rotate(-h),t.translate(-w,-C),E||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var D3=function(){return 0},P3=function(e,r){return e.getTextAngle(r,null)},O3=function(e,r){return e.getTextAngle(r,"source")},A3=function(e,r){return e.getTextAngle(r,"target")},R3=function(e,r){return r.effectiveOpacity()},kc=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||zu(h,n))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,c,r,a,v,D3,R3),(!p||!g)&&o.drawCachedElementPortion(t,e,u,r,a,v,P3,kc),p&&!g&&(o.drawCachedElementPortion(t,e,d,r,a,v,O3,kc),o.drawCachedElementPortion(t,e,f,r,a,v,A3,kc)),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 Qr={};Qr.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,m=e.pstyle("line-outline-color").value,y=u*d,b=u*d,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;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]:y;if(t.lineWidth=v+g,t.lineCap=p,g>0)o.colorStrokeStyle(t,m[0],m[1],m[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")},E=function(){a&&o.drawEdgeOverlay(t,e)},k=function(){a&&o.drawEdgeUnderlay(t,e)},x=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=y*B;t.translate(T,N),w(P),x(P),t.translate(-T,-N)}else C();k(),w(),x(),E(),_(),r&&t.translate(c.x1,c.y1)}};var Q1=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")}}}};Qr.drawEdgeOverlay=Q1("overlay"),Qr.drawEdgeUnderlay=Q1("underlay"),Qr.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=y0(a.roundCorners),m;try{for(g.s();!(m=g.n()).done;){var y=m.value;A1(e,y)}}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([])},Qr.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()}},Qr.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)},Qr.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 m=e.pstyle(r+"-arrow-color").value;l.colorFillStyle(t,m[0],m[1],m[2],o),l.colorStrokeStyle(t,m[0],m[1],m[2],o),l.drawArrowShape(e,t,d,f,c,v,n,a,i)}}},Qr.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,m=this.getArrowWidth(n,g),y=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Zn(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,m,c,p,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(o,l),e.rotate(c),e.scale(m,m)),(r==="filled"||r==="both")&&(d?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?m:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/m,1/m),e.rotate(-c),e.translate(-o,-l))};var Sc={};Sc.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)}},Sc.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,m=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),y=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",E=d(r,"background-image-opacity","value",n)*a,k=d(r,"background-image-smoothing","value",n),x=r.pstyle("corner-radius").value;x!=="auto"&&(x=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)*m: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)*y:N=d(r,"background-height","pfValue",n)),!(T===0||N===0)){if(f==="contain"){var B=Math.min(m/T,y/N);T*=B,N*=B}else if(f==="cover"){var B=Math.max(m/T,y/N);T*=B,N*=B}var P=l-m/2,D=d(r,"background-position-x","units",n),R=d(r,"background-position-x","pfValue",n);D==="%"?P+=(m-T)*R:P+=R;var O=d(r,"background-offset-x","units",n),L=d(r,"background-offset-x","pfValue",n);O==="%"?P+=(m-T)*L:P+=L;var A=c-y/2,q=d(r,"background-position-y","units",n),U=d(r,"background-position-y","pfValue",n);q==="%"?A+=(y-N)*U:A+=U;var z=d(r,"background-offset-y","units",n),H=d(r,"background-offset-y","pfValue",n);z==="%"?A+=(y-N)*H:A+=H,b.pathCache&&(P-=l,A-=c,l=0,c=0);var Q=t.globalAlpha;t.globalAlpha=E;var F=i.getImgSmoothing(t),$=!1;if(k==="no"&&F?(i.setImgSmoothing(t,!1),$=!0):k==="yes"&&!F&&(i.setImgSmoothing(t,!0),$=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,m,y,x,b),t.clip())),i.safeDrawImage(t,e,0,0,_,S,P,A,T,N),C&&t.restore();else{var V=t.createPattern(e,h);t.fillStyle=V,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,m,y,x,b),t.translate(P,A),t.fill(),t.translate(-P,-A)}t.globalAlpha=Q,$&&i.setImgSmoothing(t,F)}};var la={};la.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(qu(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)},la.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)},la.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},la.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 _c(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()}la.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},la.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),m=e.pstyle(v+"text-margin-x").pfValue,y=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+=m,u+=y;var E;switch(n?E=this.getTextAngle(e,r):E=0,E!==0&&(d=c,f=u,t.translate(d,f),t.rotate(E),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,x=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&&x>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 L=t.fillStyle,A=e.pstyle("text-background-color").value;t.fillStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+k*l+")",N?_c(t,P,D,R,O,B):t.fillRect(P,D,R,O),t.fillStyle=L}if(_>0&&x>0){var q=t.strokeStyle,U=t.lineWidth,z=e.pstyle("text-border-color").value,H=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+z[0]+","+z[1]+","+z[2]+","+x*l+")",t.lineWidth=_,t.setLineDash)switch(H){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?_c(t,P,D,R,O,B,"stroke"):t.strokeRect(P,D,R,O),H==="double"){var Q=_/2;N?_c(t,P+Q,D+Q,R-Q*2,O-Q*2,B,"stroke"):t.strokeRect(P+Q,D+Q,R-Q*2,O-Q*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=U,t.strokeStyle=q}}var F=2*e.pstyle("text-outline-width").pfValue;if(F>0&&(t.lineWidth=F),e.pstyle("text-wrap").value==="wrap"){var $=gr(o,"labelWrapCachedLines",r),V=gr(o,"labelLineHeight",r),G=p/2,j=this.getLabelJustification(e);switch(j==="auto"||(w==="left"?j==="left"?c+=-p:j==="center"&&(c+=-G):w==="center"?j==="left"?c+=-G:j==="right"&&(c+=G):w==="right"&&(j==="center"?c+=G:j==="right"&&(c+=p))),C){case"top":u-=($.length-1)*V;break;case"center":case"bottom":u-=($.length-1)*V;break}for(var M=0;M<$.length;M++)F>0&&t.strokeText($[M],c,u),t.fillText($[M],c,u),u+=V}else F>0&&t.strokeText(h,c,u),t.fillText(h,c,u);E!==0&&(t.rotate(-E),t.translate(-d,-f))}}};var ii={};ii.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,m=e.padding();l=e.width()+2*m,c=e.height()+2*m;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),E=new Array(w.length),k=0,x=0;x<w.length;x++){var _=w[x],S=C[x]=_!=null&&_!=="none";if(S){var T=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);k++,E[x]=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,L=e.pstyle("border-cap").value,A=e.pstyle("border-position").value,q=e.pstyle("border-dash-pattern").pfValue,U=e.pstyle("border-dash-offset").pfValue,z=e.pstyle("border-opacity").value*h,H=e.pstyle("outline-width").pfValue,Q=e.pstyle("outline-color").value,F=e.pstyle("outline-style").value,$=e.pstyle("outline-opacity").value*h,V=e.pstyle("outline-offset").value,G=e.pstyle("corner-radius").value;G!=="auto"&&(G=e.pstyle("corner-radius").pfValue);var j=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,le)},M=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(t,D[0],D[1],D[2],le)},W=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;o.colorStrokeStyle(t,Q[0],Q[1],Q[2],le)},Y=function(le,ee,oe,me){var be=o.nodePathCache=o.nodePathCache||[],ye=L0(oe==="polygon"?oe+","+me.join(","):oe,""+ee,""+le,""+G),_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,ce=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var ae=Y(l,c,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,c,G,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=u.backgrounding,me=0,be=0;be<E.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]&&E[be].complete&&!E[be].error&&(me++,o.drawInscribedImage(t,E[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,G,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=L,t.lineJoin=O,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(q),t.lineDashOffset=U;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([])}},De=function(){if(H>0){if(t.lineWidth=H,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;A==="inside"&&(oe=0),A==="outside"&&(oe*=2);var me=(l+oe+(H+V))/l,be=(c+oe+(H+V))/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,it=0,ot=0;ee==="round-diamond"?qe=(oe+V+H)*1.4:ee==="round-heptagon"?(qe=(oe+V+H)*1.075,ot=-(oe/2+V+H)/35):ee==="round-hexagon"?qe=(oe+V+H)*1.12:ee==="round-pentagon"?(qe=(oe+V+H)*1.13,ot=-(oe/2+V+H)/15):ee==="round-tag"?(qe=(oe+V+H)*1.12,it=(oe/2+H+V)*.07):ee==="round-triangle"&&(qe=(oe+V+H)*(Math.PI/2),ot=-(oe+V/2+H)/Math.PI),qe!==0&&(me=(l+qe)/l,ye=l*me,["round-hexagon","round-tag"].includes(ee)||(be=(c+qe)/c,_e=c*be)),G=G==="auto"?X0(ye,_e):G;for(var et=ye/2,At=_e/2,pt=G+(oe+H+V)/2,mt=new Array(ge.length/2),Jt=new Array(ge.length/2),Rt=0;Rt<ge.length/2;Rt++)mt[Rt]={x:le.x+it+et*ge[Rt*2],y:le.y+ot+At*ge[Rt*2+1]};var Lt,lr,Cr,jt,tt=mt.length;for(lr=mt[tt-1],Lt=0;Lt<tt;Lt++)Cr=mt[Lt%tt],jt=mt[(Lt+1)%tt],Jt[Lt]=wc(lr,Cr,jt,pt),lr=Cr,Cr=jt;o.drawRoundPolygonPath(Ce||t,le.x+it,le.y+ot,l*me,c*be,ge,Jt)}else if(["roundrectangle","round-rectangle"].includes(ee))G=G==="auto"?ea(ye,_e):G,o.drawRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,G+(oe+H+V)/2);else if(["cutrectangle","cut-rectangle"].includes(ee))G=G==="auto"?Gu():G,o.drawCutRectanglePath(Ce||t,le.x,le.y,ye,_e,null,G+(oe+H+V)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ee))G=G==="auto"?ea(ye,_e):G,o.drawBottomRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,G+(oe+H+V)/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 st=(oe+H+V)/l;ge=Es(xs(ge,st)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}else{var yt=(oe+H+V)/l;ge=Es(xs(ge,-yt)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,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,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,K=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,Z=te*h;t.translate(I,K),W(),De(),j(te*P),ne(),ue(Z,!0),M(te*z),pe(),ie(N!==0||B!==0),ue(Z,!1),fe(Z),t.translate(-I,-K)}v&&t.translate(-f.x,-f.y),we(),v&&t.translate(f.x,f.y),W(),De(),j(),ne(),ue(h,!0),M(),pe(),ie(N!==0||B!==0),ue(h,!1),fe(),v&&t.translate(-f.x,-f.y),xe(),Ie(),r&&t.translate(y.x1,y.y1)}};var ew=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()}}}};ii.drawNodeOverlay=ew("overlay"),ii.drawNodeUnderlay=ew("underlay"),ii.hasPie=function(t){return t=t[0],t._private.hasPie},ii.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,m=e.pstyle("pie-"+v+"-background-opacity").value*r,y=p/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*y,C=b+w;p===0||f>=1||f+y>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],m),t.fill(),f+=y)}};var Xt={},L3=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=Xn(u,f),v=Xn(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(),m=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,m))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var w=o?{x:0,y:0}:r.position(),C=r.paddedWidth(),E=r.paddedHeight(),k=C/2,x=E/2,_=r.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=t.createLinearGradient(w.x,w.y-x,w.x,w.y+x);break;case"to-top":i=t.createLinearGradient(w.x,w.y+x,w.x,w.y-x);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-x,w.x+k,w.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-k,w.y+x,w.x+k,w.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+k,w.y-x,w.x-k,w.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+k,w.y+x,w.x-k,w.y-x);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||z0();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,m=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!m;var y=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&&(y=!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,E=c.pan(),k={x:E.x,y:E.y},x={zoom:w,pan:{x:E.x,y:E.y}},_=o.prevViewport,S=_===void 0||x.zoom!==_.zoom||x.pan.x!==_.pan.x||x.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===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(ue={x:E.x*v,y:E.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=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 x=o.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:o.canvasWidth,height:o.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}d[o.DRAG]=!1,d[o.NODE]=!1;var D=u.contexts[o.NODE],R=o.textureCache.texture,x=o.textureCache.viewport;D.setTransform(1,0,0,1,0,0),h?N(D,0,0,x.width,x.height):D.clearRect(0,0,x.width,x.height);var O=b.core("outside-texture-bg-color").value,L=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,O[0],O[1],O[2],L),D.fillRect(0,0,x.width,x.height);var w=c.zoom();B(D,!1),D.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l),D.drawImage(R,x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var A=c.extent(),q=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),U=o.hideEdgesOnViewport&&q,z=[];if(z[o.NODE]=!d[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,z[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),z[o.DRAG]=!d[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,z[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),d[o.NODE]||r||n||z[o.NODE]){var H=h&&!z[o.NODE]&&v!==1,D=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),Q=h&&!H?"motionBlur":void 0;B(D,Q),U?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||z[o.DRAG])){var H=h&&!z[o.DRAG]&&v!==1,D=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);B(D,h&&!H?"motionBlur":void 0),U?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(),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(u.bgActivePosistion&&!o.hoverData.selecting){var w=o.cy.zoom(),$=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($.x,$.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),D.fill()}var V=o.lastRedrawTime;if(o.showFps&&V){V=Math.round(V);var G=Math.round(1e3/V);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 = "+V+" ms = "+G+" fps",0,20);var j=60;D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(G/j,1),20)}r||(d[o.SELECT_BOX]=!1)}if(h&&v!==1){var M=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],ce=function(ne,ue,ie){ne.setTransform(1,0,0,1,0,0),ie||!y?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]||z[o.NODE])&&(ce(M,W,z[o.NODE]),d[o.NODE]=!1),(d[o.DRAG]||z[o.DRAG])&&(ce(Y,se,z[o.DRAG]),d[o.DRAG]=!1)}o.prevViewport=x,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()},L3)),e||c.emit("render")};var Nn={};Nn.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()},Nn.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(l){return A1(t,l)}),t.closePath()},Nn.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ea(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()},Nn.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ea(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()},Nn.drawCutRectanglePath=function(t,e,r,n,a,i,o){var l=n/2,c=a/2,u=o==="auto"?Gu():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()},Nn.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=Uu(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 tw=Math.sin(0),rw=Math.cos(0),Tc={},Nc={},nw=Math.PI/40,oi=0*Math.PI;oi<2*Math.PI;oi+=nw)Tc[oi]=Math.sin(oi),Nc[oi]=Math.cos(oi);Nn.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+=nw)i=e-l*Tc[u]*tw+l*Nc[u]*rw,o=r+c*Nc[u]*tw+c*Tc[u]*rw,u===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var bo={};bo.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},bo.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(),m={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(m.x,m.y),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(-m.x,-m.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,o),v.fill())}return h};function M3(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 aw(t){var e=t.indexOf(",");return t.substr(e+1)}function iw(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ha(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 M3(aw(n()),r);case"base64":return aw(n());case"base64uri":default:return n()}}bo.png=function(t){return iw(t,this.bufferCanvasImage(t),"image/png")},bo.jpg=function(t){return iw(t,this.bufferCanvasImage(t),"image/jpeg")};var ow={};ow.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 F3=sw,Me=sw.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 sw(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 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"};SM()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Me.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(j){d.style[j]=c[j]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Me.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!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 u=0;u<Me.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(M){return{x:(M.x1+M.x2)/2,y:(M.y1+M.y2)/2}},v=function(M){return{x:-M.w/2,y:-M.h/2}},p=function(M){var W=M[0]._private,Y=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!Y},g=function(M){return M[0]._private.nodeKey},m=function(M){return M[0]._private.labelStyleKey},y=function(M){return M[0]._private.sourceLabelStyleKey},b=function(M){return M[0]._private.targetLabelStyleKey},w=function(M,W,Y,se,ce){return e.drawElement(M,W,Y,!1,!1,ce)},C=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"main",ce)},E=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"source",ce)},k=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"target",ce)},x=function(M){return M.boundingBox(),M[0]._private.bodyBounds},_=function(M){return M.boundingBox(),M[0]._private.labelBounds.main||f},S=function(M){return M.boundingBox(),M[0]._private.labelBounds.source||f},T=function(M){return M.boundingBox(),M[0]._private.labelBounds.target||f},N=function(M,W){return W},B=function(M){return h(x(M))},P=function(M,W,Y){var se=M?M+"-":"";return{x:W.x+Y.pstyle(se+"text-margin-x").pfValue,y:W.y+Y.pstyle(se+"text-margin-y").pfValue}},D=function(M,W,Y){var se=M[0]._private.rscratch;return{x:se[W],y:se[Y]}},R=function(M){return P("",D(M,"labelX","labelY"),M)},O=function(M){return P("source",D(M,"sourceLabelX","sourceLabelY"),M)},L=function(M){return P("target",D(M,"targetLabelX","targetLabelY"),M)},A=function(M){return v(x(M))},q=function(M){return v(S(M))},U=function(M){return v(T(M))},z=function(M){var W=_(M),Y=v(_(M));if(M.isNode()){switch(M.pstyle("text-halign").value){case"left":Y.x=-W.w;break;case"right":Y.x=0;break}switch(M.pstyle("text-valign").value){case"top":Y.y=-W.h;break;case"bottom":Y.y=0;break}}return Y},H=e.data.eleTxrCache=new mo(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:x,getRotationPoint:B,getRotationOffset:A,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),Q=e.data.lblTxrCache=new mo(e,{getKey:m,drawElement:C,getBoundingBox:_,getRotationPoint:R,getRotationOffset:z,isVisible:N}),F=e.data.slbTxrCache=new mo(e,{getKey:y,drawElement:E,getBoundingBox:S,getRotationPoint:O,getRotationOffset:q,isVisible:N}),$=e.data.tlbTxrCache=new mo(e,{getKey:b,drawElement:k,getBoundingBox:T,getRotationPoint:L,getRotationOffset:U,isVisible:N}),V=e.data.lyrTxrCache=new W1(e);e.onUpdateEleCalcs(function(M,W){H.invalidateElements(W),Q.invalidateElements(W),F.invalidateElements(W),$.invalidateElements(W),V.invalidateElements(W);for(var Y=0;Y<W.length;Y++){var se=W[Y]._private;se.oldBackgroundTimestamp=se.backgroundTimestamp}});var G=function(M){for(var W=0;W<M.length;W++)V.enqueueElementRefinement(M[W].ele)};H.onDequeue(G),Q.onDequeue(G),F.onDequeue(G),$.onDequeue(G)}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 $3=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return $3&&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":ct(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},[Z1,Ar,Qr,Sc,la,ii,Xt,Nn,bo,ow].forEach(function(t){Se(Me,t)});var V3=[{name:"null",impl:S1},{name:"base",impl:K1},{name:"canvas",impl:F3}],q3=[{type:"layout",extensions:jz},{type:"renderer",extensions:V3}],lw={},uw={};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(po.prototype[e])return a(e);po.prototype[e]=r}else if(t==="collection"){if(St.prototype[e])return a(e);St.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 x=this.options;if(x&&x.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=dw("renderer","base"),p=v.prototype,g=r,m=r.prototype,y=function(){v.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var w in p){var C=p[w],E=m[w]!=null;if(E)return a(w);b[w]=C}for(var k in m)b[k]=m[k];p.clientFunctions.forEach(function(x){b[x]=b[x]||function(){Je("Renderer does not implement `renderer."+x+"()` on its prototype")}}),n=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Je(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return _0({map:lw,keys:[t,e],value:n})}function dw(t,e){return T0({map:lw,keys:[t,e]})}function z3(t,e,r,n,a){return _0({map:uw,keys:[t,e,r,n],value:a})}function H3(t,e,r,n){return T0({map:uw,keys:[t,e,r,n]})}var Ic=function(){if(arguments.length===2)return dw.apply(null,arguments);if(arguments.length===3)return cw.apply(null,arguments);if(arguments.length===4)return H3.apply(null,arguments);if(arguments.length===5)return z3.apply(null,arguments);Je("Invalid extension access syntax")};po.prototype.extension=Ic,q3.forEach(function(t){t.extensions.forEach(function(e){cw(t.type,e.name,e.impl)})});var fw=function t(){if(!(this instanceof t))return new t;this.length=0},ua=fw.prototype;ua.instanceString=function(){return"stylesheet"},ua.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},ua.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=Dt.properties[o]||Dt.properties[ds(o)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},ua.style=ua.css,ua.generateStyle=function(t){var e=new Dt(t);return this.appendToStyle(e)},ua.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 K3="3.30.2",In=function(e){if(e===void 0&&(e={}),Ae(e))return new po(e);if(Ee(e))return Ic.apply(Ic,arguments)};In.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(In),t.apply(null,e),this},In.warnings=function(t){return V0(t)},In.version=K3,In.stylesheet=In.Stylesheet=fw;var hw={exports:{}};function Bc(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 Dc,pw;function G3(){if(pw)return Dc;pw=1;function t(){this.__data__=[],this.size=0}return Dc=t,Dc}var Pc,vw;function si(){if(vw)return Pc;vw=1;function t(e,r){return e===r||e!==e&&r!==r}return Pc=t,Pc}var Oc,gw;function ol(){if(gw)return Oc;gw=1;var t=si();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Oc=e,Oc}var Ac,mw;function U3(){if(mw)return Ac;mw=1;var t=ol(),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 Ac=n,Ac}var Rc,yw;function j3(){if(yw)return Rc;yw=1;var t=ol();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Rc=e,Rc}var Lc,bw;function W3(){if(bw)return Lc;bw=1;var t=ol();function e(r){return t(this.__data__,r)>-1}return Lc=e,Lc}var Mc,ww;function Y3(){if(ww)return Mc;ww=1;var t=ol();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 Mc=e,Mc}var Fc,Cw;function sl(){if(Cw)return Fc;Cw=1;var t=G3(),e=U3(),r=j3(),n=W3(),a=Y3();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,Fc=i,Fc}var $c,Ew;function Z3(){if(Ew)return $c;Ew=1;var t=sl();function e(){this.__data__=new t,this.size=0}return $c=e,$c}var Vc,xw;function X3(){if(xw)return Vc;xw=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Vc=t,Vc}var qc,kw;function J3(){if(kw)return qc;kw=1;function t(e){return this.__data__.get(e)}return qc=t,qc}var zc,Sw;function Q3(){if(Sw)return zc;Sw=1;function t(e){return this.__data__.has(e)}return zc=t,zc}var Hc,_w;function Tw(){if(_w)return Hc;_w=1;var t=typeof Ai=="object"&&Ai&&Ai.Object===Object&&Ai;return Hc=t,Hc}var Kc,Nw;function br(){if(Nw)return Kc;Nw=1;var t=Tw(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Kc=r,Kc}var Gc,Iw;function li(){if(Iw)return Gc;Iw=1;var t=br(),e=t.Symbol;return Gc=e,Gc}var Uc,Bw;function e4(){if(Bw)return Uc;Bw=1;var t=li(),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 Uc=i,Uc}var jc,Dw;function t4(){if(Dw)return jc;Dw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return jc=r,jc}var Wc,Pw;function ca(){if(Pw)return Wc;Pw=1;var t=li(),e=e4(),r=t4(),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 Wc=o,Wc}var Yc,Ow;function or(){if(Ow)return Yc;Ow=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Yc=t,Yc}var Zc,Aw;function wo(){if(Aw)return Zc;Aw=1;var t=ca(),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 Zc=o,Zc}var Xc,Rw;function r4(){if(Rw)return Xc;Rw=1;var t=br(),e=t["__core-js_shared__"];return Xc=e,Xc}var Jc,Lw;function n4(){if(Lw)return Jc;Lw=1;var t=r4(),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 Jc=r,Jc}var Qc,Mw;function Fw(){if(Mw)return Qc;Mw=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 Qc=r,Qc}var ed,$w;function a4(){if($w)return ed;$w=1;var t=wo(),e=n4(),r=or(),n=Fw(),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 ed=f,ed}var td,Vw;function i4(){if(Vw)return td;Vw=1;function t(e,r){return e==null?void 0:e[r]}return td=t,td}var rd,qw;function da(){if(qw)return rd;qw=1;var t=a4(),e=i4();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return rd=r,rd}var nd,zw;function ad(){if(zw)return nd;zw=1;var t=da(),e=br(),r=t(e,"Map");return nd=r,nd}var id,Hw;function ll(){if(Hw)return id;Hw=1;var t=da(),e=t(Object,"create");return id=e,id}var od,Kw;function o4(){if(Kw)return od;Kw=1;var t=ll();function e(){this.__data__=t?t(null):{},this.size=0}return od=e,od}var sd,Gw;function s4(){if(Gw)return sd;Gw=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return sd=t,sd}var ld,Uw;function l4(){if(Uw)return ld;Uw=1;var t=ll(),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 ld=a,ld}var ud,jw;function u4(){if(jw)return ud;jw=1;var t=ll(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return ud=n,ud}var cd,Ww;function c4(){if(Ww)return cd;Ww=1;var t=ll(),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 cd=r,cd}var dd,Yw;function d4(){if(Yw)return dd;Yw=1;var t=o4(),e=s4(),r=l4(),n=u4(),a=c4();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,dd=i,dd}var fd,Zw;function f4(){if(Zw)return fd;Zw=1;var t=d4(),e=sl(),r=ad();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return fd=n,fd}var hd,Xw;function h4(){if(Xw)return hd;Xw=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return hd=t,hd}var pd,Jw;function ul(){if(Jw)return pd;Jw=1;var t=h4();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return pd=e,pd}var vd,Qw;function p4(){if(Qw)return vd;Qw=1;var t=ul();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return vd=e,vd}var gd,eC;function v4(){if(eC)return gd;eC=1;var t=ul();function e(r){return t(this,r).get(r)}return gd=e,gd}var md,tC;function g4(){if(tC)return md;tC=1;var t=ul();function e(r){return t(this,r).has(r)}return md=e,md}var yd,rC;function m4(){if(rC)return yd;rC=1;var t=ul();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 yd=e,yd}var bd,nC;function wd(){if(nC)return bd;nC=1;var t=f4(),e=p4(),r=v4(),n=g4(),a=m4();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,bd=i,bd}var Cd,aC;function y4(){if(aC)return Cd;aC=1;var t=sl(),e=ad(),r=wd(),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 Cd=a,Cd}var Ed,iC;function cl(){if(iC)return Ed;iC=1;var t=sl(),e=Z3(),r=X3(),n=J3(),a=Q3(),i=y4();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,Ed=o,Ed}var xd,oC;function kd(){if(oC)return xd;oC=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 xd=t,xd}var Sd,sC;function lC(){if(sC)return Sd;sC=1;var t=da(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Sd=e,Sd}var _d,uC;function dl(){if(uC)return _d;uC=1;var t=lC();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return _d=e,_d}var Td,cC;function fl(){if(cC)return Td;cC=1;var t=dl(),e=si(),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 Td=a,Td}var Nd,dC;function Co(){if(dC)return Nd;dC=1;var t=fl(),e=dl();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 Nd=r,Nd}var Id,fC;function b4(){if(fC)return Id;fC=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return Id=t,Id}var Bd,hC;function Rr(){if(hC)return Bd;hC=1;function t(e){return e!=null&&typeof e=="object"}return Bd=t,Bd}var Dd,pC;function w4(){if(pC)return Dd;pC=1;var t=ca(),e=Rr(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Dd=n,Dd}var Pd,vC;function Eo(){if(vC)return Pd;vC=1;var t=w4(),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 Pd=i,Pd}var Od,gC;function at(){if(gC)return Od;gC=1;var t=Array.isArray;return Od=t,Od}var xo={exports:{}},Ad,mC;function C4(){if(mC)return Ad;mC=1;function t(){return!1}return Ad=t,Ad}xo.exports;var yC;function ui(){return yC||(yC=1,function(t,e){var r=br(),n=C4(),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}(xo,xo.exports)),xo.exports}var Rd,bC;function hl(){if(bC)return Rd;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 Rd=r,Rd}var Ld,wC;function Md(){if(wC)return Ld;wC=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Ld=e,Ld}var Fd,CC;function E4(){if(CC)return Fd;CC=1;var t=ca(),e=Md(),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]",m="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",x="[object Uint8Array]",_="[object Uint8ClampedArray]",S="[object Uint16Array]",T="[object Uint32Array]",N={};N[b]=N[w]=N[C]=N[E]=N[k]=N[x]=N[_]=N[S]=N[T]=!0,N[n]=N[a]=N[m]=N[i]=N[y]=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 Fd=B,Fd}var $d,EC;function pl(){if(EC)return $d;EC=1;function t(e){return function(r){return e(r)}}return $d=t,$d}var ko={exports:{}};ko.exports;var xC;function Vd(){return xC||(xC=1,function(t,e){var r=Tw(),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}(ko,ko.exports)),ko.exports}var qd,kC;function So(){if(kC)return qd;kC=1;var t=E4(),e=pl(),r=Vd(),n=r&&r.isTypedArray,a=n?e(n):t;return qd=a,qd}var zd,SC;function _C(){if(SC)return zd;SC=1;var t=b4(),e=Eo(),r=at(),n=ui(),a=hl(),i=So(),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,m=g?t(u.length,String):[],y=m.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,y)))&&m.push(b);return m}return zd=c,zd}var Hd,TC;function vl(){if(TC)return Hd;TC=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Hd=e,Hd}var Kd,NC;function IC(){if(NC)return Kd;NC=1;function t(e,r){return function(n){return e(r(n))}}return Kd=t,Kd}var Gd,BC;function x4(){if(BC)return Gd;BC=1;var t=IC(),e=t(Object.keys,Object);return Gd=e,Gd}var Ud,DC;function jd(){if(DC)return Ud;DC=1;var t=vl(),e=x4(),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 Ud=a,Ud}var Wd,PC;function en(){if(PC)return Wd;PC=1;var t=wo(),e=Md();function r(n){return n!=null&&e(n.length)&&!t(n)}return Wd=r,Wd}var Yd,OC;function Bn(){if(OC)return Yd;OC=1;var t=_C(),e=jd(),r=en();function n(a){return r(a)?t(a):e(a)}return Yd=n,Yd}var Zd,AC;function k4(){if(AC)return Zd;AC=1;var t=Co(),e=Bn();function r(n,a){return n&&t(a,e(a),n)}return Zd=r,Zd}var Xd,RC;function S4(){if(RC)return Xd;RC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return Xd=t,Xd}var Jd,LC;function _4(){if(LC)return Jd;LC=1;var t=or(),e=vl(),r=S4(),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 Jd=i,Jd}var Qd,MC;function fa(){if(MC)return Qd;MC=1;var t=_C(),e=_4(),r=en();function n(a){return r(a)?t(a,!0):e(a)}return Qd=n,Qd}var ef,FC;function T4(){if(FC)return ef;FC=1;var t=Co(),e=fa();function r(n,a){return n&&t(a,e(a),n)}return ef=r,ef}var _o={exports:{}};_o.exports;var $C;function VC(){return $C||($C=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}(_o,_o.exports)),_o.exports}var tf,qC;function zC(){if(qC)return tf;qC=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 tf=t,tf}var rf,HC;function KC(){if(HC)return rf;HC=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 rf=t,rf}var nf,GC;function UC(){if(GC)return nf;GC=1;function t(){return[]}return nf=t,nf}var af,jC;function of(){if(jC)return af;jC=1;var t=KC(),e=UC(),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 af=i,af}var sf,WC;function N4(){if(WC)return sf;WC=1;var t=Co(),e=of();function r(n,a){return t(n,e(n),a)}return sf=r,sf}var lf,YC;function uf(){if(YC)return lf;YC=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 lf=t,lf}var cf,ZC;function gl(){if(ZC)return cf;ZC=1;var t=IC(),e=t(Object.getPrototypeOf,Object);return cf=e,cf}var df,XC;function JC(){if(XC)return df;XC=1;var t=uf(),e=gl(),r=of(),n=UC(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var l=[];o;)t(l,r(o)),o=e(o);return l}:n;return df=i,df}var ff,QC;function I4(){if(QC)return ff;QC=1;var t=Co(),e=JC();function r(n,a){return t(n,e(n),a)}return ff=r,ff}var hf,eE;function tE(){if(eE)return hf;eE=1;var t=uf(),e=at();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return hf=r,hf}var pf,rE;function nE(){if(rE)return pf;rE=1;var t=tE(),e=of(),r=Bn();function n(a){return t(a,r,e)}return pf=n,pf}var vf,aE;function B4(){if(aE)return vf;aE=1;var t=tE(),e=JC(),r=fa();function n(a){return t(a,r,e)}return vf=n,vf}var gf,iE;function D4(){if(iE)return gf;iE=1;var t=da(),e=br(),r=t(e,"DataView");return gf=r,gf}var mf,oE;function P4(){if(oE)return mf;oE=1;var t=da(),e=br(),r=t(e,"Promise");return mf=r,mf}var yf,sE;function lE(){if(sE)return yf;sE=1;var t=da(),e=br(),r=t(e,"Set");return yf=r,yf}var bf,uE;function O4(){if(uE)return bf;uE=1;var t=da(),e=br(),r=t(e,"WeakMap");return bf=r,bf}var wf,cE;function ci(){if(cE)return wf;cE=1;var t=D4(),e=ad(),r=P4(),n=lE(),a=O4(),i=ca(),o=Fw(),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),m=o(n),y=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),E=C==c?w.constructor:void 0,k=E?o(E):"";if(k)switch(k){case v:return h;case p:return l;case g:return u;case m:return d;case y:return f}return C}),wf=b,wf}var Cf,dE;function A4(){if(dE)return Cf;dE=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 Cf=r,Cf}var Ef,fE;function hE(){if(fE)return Ef;fE=1;var t=br(),e=t.Uint8Array;return Ef=e,Ef}var xf,pE;function kf(){if(pE)return xf;pE=1;var t=hE();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return xf=e,xf}var Sf,vE;function R4(){if(vE)return Sf;vE=1;var t=kf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Sf=e,Sf}var _f,gE;function L4(){if(gE)return _f;gE=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return _f=e,_f}var Tf,mE;function M4(){if(mE)return Tf;mE=1;var t=li(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return Tf=n,Tf}var Nf,yE;function bE(){if(yE)return Nf;yE=1;var t=kf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Nf=e,Nf}var If,wE;function F4(){if(wE)return If;wE=1;var t=kf(),e=R4(),r=L4(),n=M4(),a=bE(),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]",m="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",C="[object Uint8Array]",E="[object Uint8ClampedArray]",k="[object Uint16Array]",x="[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 m:case y:case b:case w:case C:case E:case k:case x: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 If=_,If}var Bf,CE;function EE(){if(CE)return Bf;CE=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 Bf=r,Bf}var Df,xE;function kE(){if(xE)return Df;xE=1;var t=EE(),e=gl(),r=vl();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Df=n,Df}var Pf,SE;function $4(){if(SE)return Pf;SE=1;var t=ci(),e=Rr(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Pf=n,Pf}var Of,_E;function V4(){if(_E)return Of;_E=1;var t=$4(),e=pl(),r=Vd(),n=r&&r.isMap,a=n?e(n):t;return Of=a,Of}var Af,TE;function q4(){if(TE)return Af;TE=1;var t=ci(),e=Rr(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return Af=n,Af}var Rf,NE;function z4(){if(NE)return Rf;NE=1;var t=q4(),e=pl(),r=Vd(),n=r&&r.isSet,a=n?e(n):t;return Rf=a,Rf}var Lf,IE;function BE(){if(IE)return Lf;IE=1;var t=cl(),e=kd(),r=fl(),n=k4(),a=T4(),i=VC(),o=zC(),l=N4(),c=I4(),u=nE(),d=B4(),f=ci(),h=A4(),v=F4(),p=kE(),g=at(),m=ui(),y=V4(),b=or(),w=z4(),C=Bn(),E=fa(),k=1,x=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]",L="[object Number]",A="[object Object]",q="[object RegExp]",U="[object Set]",z="[object String]",H="[object Symbol]",Q="[object WeakMap]",F="[object ArrayBuffer]",$="[object DataView]",V="[object Float32Array]",G="[object Float64Array]",j="[object Int8Array]",M="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",se="[object Uint8ClampedArray]",ce="[object Uint16Array]",ae="[object Uint32Array]",ne={};ne[S]=ne[T]=ne[F]=ne[$]=ne[N]=ne[B]=ne[V]=ne[G]=ne[j]=ne[M]=ne[W]=ne[O]=ne[L]=ne[A]=ne[q]=ne[U]=ne[z]=ne[H]=ne[Y]=ne[se]=ne[ce]=ne[ae]=!0,ne[P]=ne[D]=ne[Q]=!1;function ue(ie,fe,pe,De,Ie,we){var xe,re=fe&k,I=fe&x,K=fe&_;if(pe&&(xe=Ie?pe(ie,De,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),X=Z==D||Z==R;if(m(ie))return i(ie,re);if(Z==A||Z==S||X&&!Ie){if(xe=I||X?{}: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(ue(me,fe,pe,me,ie,we))}):y(ie)&&ie.forEach(function(me,be){xe.set(be,ue(me,fe,pe,be,ie,we))});var ee=K?I?d:u:I?E:C,oe=te?void 0:ee(ie);return e(oe||ie,function(me,be){oe&&(be=me,me=ie[be]),r(xe,be,ue(me,fe,pe,be,ie,we))}),xe}return Lf=ue,Lf}var Mf,DE;function H4(){if(DE)return Mf;DE=1;var t=BE(),e=4;function r(n){return t(n,e)}return Mf=r,Mf}var Ff,PE;function $f(){if(PE)return Ff;PE=1;function t(e){return function(){return e}}return Ff=t,Ff}var Vf,OE;function K4(){if(OE)return Vf;OE=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 Vf=t,Vf}var qf,AE;function zf(){if(AE)return qf;AE=1;var t=K4(),e=t();return qf=e,qf}var Hf,RE;function Kf(){if(RE)return Hf;RE=1;var t=zf(),e=Bn();function r(n,a){return n&&t(n,a,e)}return Hf=r,Hf}var Gf,LE;function G4(){if(LE)return Gf;LE=1;var t=en();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 Gf=e,Gf}var Uf,ME;function ml(){if(ME)return Uf;ME=1;var t=Kf(),e=G4(),r=e(t);return Uf=r,Uf}var jf,FE;function ha(){if(FE)return jf;FE=1;function t(e){return e}return jf=t,jf}var Wf,$E;function VE(){if($E)return Wf;$E=1;var t=ha();function e(r){return typeof r=="function"?r:t}return Wf=e,Wf}var Yf,qE;function zE(){if(qE)return Yf;qE=1;var t=kd(),e=ml(),r=VE(),n=at();function a(i,o){var l=n(i)?t:e;return l(i,r(o))}return Yf=a,Yf}var Zf,HE;function KE(){return HE||(HE=1,Zf=zE()),Zf}var Xf,GE;function U4(){if(GE)return Xf;GE=1;var t=ml();function e(r,n){var a=[];return t(r,function(i,o,l){n(i,o,l)&&a.push(i)}),a}return Xf=e,Xf}var Jf,UE;function j4(){if(UE)return Jf;UE=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Jf=e,Jf}var Qf,jE;function W4(){if(jE)return Qf;jE=1;function t(e){return this.__data__.has(e)}return Qf=t,Qf}var eh,WE;function YE(){if(WE)return eh;WE=1;var t=wd(),e=j4(),r=W4();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,eh=n,eh}var th,ZE;function Y4(){if(ZE)return th;ZE=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 th=t,th}var rh,XE;function JE(){if(XE)return rh;XE=1;function t(e,r){return e.has(r)}return rh=t,rh}var nh,QE;function ex(){if(QE)return nh;QE=1;var t=YE(),e=Y4(),r=JE(),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),m=f.get(l);if(g&&m)return g==l&&m==o;var y=-1,b=!0,w=c&a?new t:void 0;for(f.set(o,l),f.set(l,o);++y<v;){var C=o[y],E=l[y];if(u)var k=h?u(E,C,y,l,o,f):u(C,E,y,o,l,f);if(k!==void 0){if(k)continue;b=!1;break}if(w){if(!e(l,function(x,_){if(!r(w,_)&&(C===x||d(C,x,c,u,f)))return w.push(_)})){b=!1;break}}else if(!(C===E||d(C,E,c,u,f))){b=!1;break}}return f.delete(o),f.delete(l),b}return nh=i,nh}var ah,tx;function Z4(){if(tx)return ah;tx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return ah=t,ah}var ih,rx;function oh(){if(rx)return ih;rx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return ih=t,ih}var sh,nx;function X4(){if(nx)return sh;nx=1;var t=li(),e=hE(),r=si(),n=ex(),a=Z4(),i=oh(),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]",m="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",w=t?t.prototype:void 0,C=w?w.valueOf:void 0;function E(k,x,_,S,T,N,B){switch(_){case b:if(k.byteLength!=x.byteLength||k.byteOffset!=x.byteOffset)return!1;k=k.buffer,x=x.buffer;case y:return!(k.byteLength!=x.byteLength||!N(new e(k),new e(x)));case c:case u:case h:return r(+k,+x);case d:return k.name==x.name&&k.message==x.message;case v:case g:return k==x+"";case f:var P=a;case p:var D=S&o;if(P||(P=i),k.size!=x.size&&!D)return!1;var R=B.get(k);if(R)return R==x;S|=l,B.set(k,x);var O=n(P(k),P(x),S,T,N,B);return B.delete(k),O;case m:if(C)return C.call(k)==C.call(x)}return!1}return sh=E,sh}var lh,ax;function J4(){if(ax)return lh;ax=1;var t=nE(),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 m=v;m--;){var y=h[m];if(!(f?y in o:n.call(o,y)))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 E=f;++m<v;){y=h[m];var k=i[y],x=o[y];if(c)var _=f?c(x,k,y,o,i,d):c(k,x,y,i,o,d);if(!(_===void 0?k===x||u(k,x,l,c,d):_)){C=!1;break}E||(E=y=="constructor")}if(C&&!E){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 lh=a,lh}var uh,ix;function Q4(){if(ix)return uh;ix=1;var t=cl(),e=ex(),r=X4(),n=J4(),a=ci(),i=at(),o=ui(),l=So(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function p(g,m,y,b,w,C){var E=i(g),k=i(m),x=E?d:a(g),_=k?d:a(m);x=x==u?f:x,_=_==u?f:_;var S=x==f,T=_==f,N=x==_;if(N&&o(g)){if(!o(m))return!1;E=!0,S=!1}if(N&&!S)return C||(C=new t),E||l(g)?e(g,m,y,b,w,C):r(g,m,x,y,b,w,C);if(!(y&c)){var B=S&&v.call(g,"__wrapped__"),P=T&&v.call(m,"__wrapped__");if(B||P){var D=B?g.value():g,R=P?m.value():m;return C||(C=new t),w(D,R,y,b,C)}}return N?(C||(C=new t),n(g,m,y,b,w,C)):!1}return uh=p,uh}var ch,ox;function sx(){if(ox)return ch;ox=1;var t=Q4(),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 ch=r,ch}var dh,lx;function e8(){if(lx)return dh;lx=1;var t=cl(),e=sx(),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 m=new t;if(c)var y=c(p,g,v,i,o,m);if(!(y===void 0?e(g,p,r|n,c,m):y))return!1}}return!0}return dh=a,dh}var fh,ux;function cx(){if(ux)return fh;ux=1;var t=or();function e(r){return r===r&&!t(r)}return fh=e,fh}var hh,dx;function t8(){if(dx)return hh;dx=1;var t=cx(),e=Bn();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 hh=r,hh}var ph,fx;function hx(){if(fx)return ph;fx=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return ph=t,ph}var vh,px;function r8(){if(px)return vh;px=1;var t=e8(),e=t8(),r=hx();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 vh=n,vh}var gh,vx;function di(){if(vx)return gh;vx=1;var t=ca(),e=Rr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return gh=n,gh}var mh,gx;function yh(){if(gx)return mh;gx=1;var t=at(),e=di(),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 mh=a,mh}var bh,mx;function n8(){if(mx)return bh;mx=1;var t=wd(),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,bh=r,bh}var wh,yx;function a8(){if(yx)return wh;yx=1;var t=n8(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return wh=r,wh}var Ch,bx;function i8(){if(bx)return Ch;bx=1;var t=a8(),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 Ch=n,Ch}var Eh,wx;function yl(){if(wx)return Eh;wx=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 Eh=t,Eh}var xh,Cx;function o8(){if(Cx)return xh;Cx=1;var t=li(),e=yl(),r=at(),n=di(),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 xh=l,xh}var kh,Ex;function xx(){if(Ex)return kh;Ex=1;var t=o8();function e(r){return r==null?"":t(r)}return kh=e,kh}var Sh,kx;function bl(){if(kx)return Sh;kx=1;var t=at(),e=yh(),r=i8(),n=xx();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Sh=a,Sh}var _h,Sx;function To(){if(Sx)return _h;Sx=1;var t=di(),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 _h=r,_h}var Th,_x;function wl(){if(_x)return Th;_x=1;var t=bl(),e=To();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 Th=r,Th}var Nh,Tx;function s8(){if(Tx)return Nh;Tx=1;var t=wl();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Nh=e,Nh}var Ih,Nx;function l8(){if(Nx)return Ih;Nx=1;function t(e,r){return e!=null&&r in Object(e)}return Ih=t,Ih}var Bh,Ix;function Bx(){if(Ix)return Bh;Ix=1;var t=bl(),e=Eo(),r=at(),n=hl(),a=Md(),i=To();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 Bh=o,Bh}var Dh,Dx;function Px(){if(Dx)return Dh;Dx=1;var t=l8(),e=Bx();function r(n,a){return n!=null&&e(n,a,t)}return Dh=r,Dh}var Ph,Ox;function u8(){if(Ox)return Ph;Ox=1;var t=sx(),e=s8(),r=Px(),n=yh(),a=cx(),i=hx(),o=To(),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 Ph=u,Ph}var Oh,Ax;function Rx(){if(Ax)return Oh;Ax=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Oh=t,Oh}var Ah,Lx;function c8(){if(Lx)return Ah;Lx=1;var t=wl();function e(r){return function(n){return t(n,r)}}return Ah=e,Ah}var Rh,Mx;function d8(){if(Mx)return Rh;Mx=1;var t=Rx(),e=c8(),r=yh(),n=To();function a(i){return r(i)?t(n(i)):e(i)}return Rh=a,Rh}var Lh,Fx;function tn(){if(Fx)return Lh;Fx=1;var t=r8(),e=u8(),r=ha(),n=at(),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 Lh=i,Lh}var Mh,$x;function Vx(){if($x)return Mh;$x=1;var t=KC(),e=U4(),r=tn(),n=at();function a(i,o){var l=n(i)?t:e;return l(i,r(o,3))}return Mh=a,Mh}var Fh,qx;function f8(){if(qx)return Fh;qx=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return Fh=r,Fh}var $h,zx;function Hx(){if(zx)return $h;zx=1;var t=f8(),e=Bx();function r(n,a){return n!=null&&e(n,a,t)}return $h=r,$h}var Vh,Kx;function h8(){if(Kx)return Vh;Kx=1;var t=jd(),e=ci(),r=Eo(),n=at(),a=en(),i=ui(),o=vl(),l=So(),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 Vh=h,Vh}var qh,Gx;function Ux(){if(Gx)return qh;Gx=1;function t(e){return e===void 0}return qh=t,qh}var zh,jx;function Wx(){if(jx)return zh;jx=1;var t=ml(),e=en();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 zh=r,zh}var Hh,Yx;function Zx(){if(Yx)return Hh;Yx=1;var t=yl(),e=tn(),r=Wx(),n=at();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return Hh=a,Hh}var Kh,Xx;function p8(){if(Xx)return Kh;Xx=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 Kh=t,Kh}var Gh,Jx;function v8(){if(Jx)return Gh;Jx=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 Gh=t,Gh}var Uh,Qx;function ek(){if(Qx)return Uh;Qx=1;var t=p8(),e=ml(),r=tn(),n=v8(),a=at();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 Uh=i,Uh}var jh,tk;function g8(){if(tk)return jh;tk=1;var t=ca(),e=at(),r=Rr(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return jh=a,jh}var Wh,rk;function m8(){if(rk)return Wh;rk=1;var t=Rx(),e=t("length");return Wh=e,Wh}var Yh,nk;function y8(){if(nk)return Yh;nk=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 Yh=c,Yh}var Zh,ak;function b8(){if(ak)return Zh;ak=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+"]?",m="(?:"+v+"(?:"+[d,f,h].join("|")+")"+g+p+")*",y=g+p+m,b="(?:"+[d+l+"?",l,f,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+b+y,"g");function C(E){for(var k=w.lastIndex=0;w.test(E);)++k;return k}return Zh=C,Zh}var Xh,ik;function w8(){if(ik)return Xh;ik=1;var t=m8(),e=y8(),r=b8();function n(a){return e(a)?r(a):t(a)}return Xh=n,Xh}var Jh,ok;function C8(){if(ok)return Jh;ok=1;var t=jd(),e=ci(),r=en(),n=g8(),a=w8(),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 Jh=l,Jh}var Qh,sk;function E8(){if(sk)return Qh;sk=1;var t=kd(),e=EE(),r=Kf(),n=tn(),a=gl(),i=at(),o=ui(),l=wo(),c=or(),u=So();function d(f,h,v){var p=i(f),g=p||o(f)||u(f);if(h=n(h,4),v==null){var m=f&&f.constructor;g?v=p?new m:[]:c(f)?v=l(m)?e(a(f)):{}:v={}}return(g?t:r)(f,function(y,b,w){return h(v,y,b,w)}),v}return Qh=d,Qh}var ep,lk;function x8(){if(lk)return ep;lk=1;var t=li(),e=Eo(),r=at(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return ep=a,ep}var tp,uk;function rp(){if(uk)return tp;uk=1;var t=uf(),e=x8();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 tp=r,tp}var np,ck;function k8(){if(ck)return np;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 np=t,np}var ap,dk;function fk(){if(dk)return ap;dk=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,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 ap=r,ap}var ip,hk;function S8(){if(hk)return ip;hk=1;var t=$f(),e=lC(),r=ha(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return ip=n,ip}var op,pk;function _8(){if(pk)return op;pk=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 op=n,op}var sp,vk;function gk(){if(vk)return sp;vk=1;var t=S8(),e=_8(),r=e(t);return sp=r,sp}var lp,mk;function Cl(){if(mk)return lp;mk=1;var t=ha(),e=fk(),r=gk();function n(a,i){return r(e(a,i,t),a+"")}return lp=n,lp}var up,yk;function bk(){if(yk)return up;yk=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 up=t,up}var cp,wk;function T8(){if(wk)return cp;wk=1;function t(e){return e!==e}return cp=t,cp}var dp,Ck;function N8(){if(Ck)return dp;Ck=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 dp=t,dp}var fp,Ek;function I8(){if(Ek)return fp;Ek=1;var t=bk(),e=T8(),r=N8();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return fp=n,fp}var hp,xk;function B8(){if(xk)return hp;xk=1;var t=I8();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return hp=e,hp}var pp,kk;function D8(){if(kk)return pp;kk=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 pp=t,pp}var vp,Sk;function P8(){if(Sk)return vp;Sk=1;function t(){}return vp=t,vp}var gp,_k;function O8(){if(_k)return gp;_k=1;var t=lE(),e=P8(),r=oh(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return gp=a,gp}var mp,Tk;function A8(){if(Tk)return mp;Tk=1;var t=YE(),e=B8(),r=D8(),n=JE(),a=O8(),i=oh(),o=200;function l(c,u,d){var f=-1,h=e,v=c.length,p=!0,g=[],m=g;if(d)p=!1,h=r;else if(v>=o){var y=u?null:a(c);if(y)return i(y);p=!1,h=n,m=new t}else m=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=m.length;C--;)if(m[C]===w)continue e;u&&m.push(w),g.push(b)}else h(m,w,d)||(m!==g&&m.push(w),g.push(b))}return g}return mp=l,mp}var yp,Nk;function Ik(){if(Nk)return yp;Nk=1;var t=en(),e=Rr();function r(n){return e(n)&&t(n)}return yp=r,yp}var bp,Bk;function R8(){if(Bk)return bp;Bk=1;var t=rp(),e=Cl(),r=A8(),n=Ik(),a=e(function(i){return r(t(i,1,n,!0))});return bp=a,bp}var wp,Dk;function L8(){if(Dk)return wp;Dk=1;var t=yl();function e(r,n){return t(n,function(a){return r[a]})}return wp=e,wp}var Cp,Pk;function Ok(){if(Pk)return Cp;Pk=1;var t=L8(),e=Bn();function r(n){return n==null?[]:t(n,e(n))}return Cp=r,Cp}var Ep,Ak;function sr(){if(Ak)return Ep;Ak=1;var t;if(typeof Bc=="function")try{t={clone:H4(),constant:$f(),each:KE(),filter:Vx(),has:Hx(),isArray:at(),isEmpty:h8(),isFunction:wo(),isUndefined:Ux(),keys:Bn(),map:Zx(),reduce:ek(),size:C8(),transform:E8(),union:R8(),values:Ok()}}catch{}return t||(t=window._),Ep=t,Ep}var xp,Rk;function kp(){if(Rk)return xp;Rk=1;var t=sr();xp=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,m){d(m)&&f.setNode(m,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 m=h.parent(g);return m===void 0||f.hasNode(m)?(v[g]=m,m):m in v?v[m]:p(m)}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 m=l(this._isDirected,d,f,h);if(t.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=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[m]=p?v:this._defaultEdgeLabelFn(d,f,h);var y=c(this._isDirected,d,f,h);return d=y.v,f=y.w,Object.freeze(y),this._edgeObjs[m]=y,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][m]=y,this._out[d][m]=y,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 m=p;p=g,g=m}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 m=p;p=g,g=m}var y={v:p,w:g};return v&&(y.name=v),y}function u(d,f){return l(d,f.v,f.w,f.name)}return xp}var Sp,Lk;function M8(){return Lk||(Lk=1,Sp="2.1.8"),Sp}var _p,Mk;function F8(){return Mk||(Mk=1,_p={Graph:kp(),version:M8()}),_p}var Tp,Fk;function $8(){if(Fk)return Tp;Fk=1;var t=sr(),e=kp();Tp={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 Tp}var Np,$k;function V8(){if($k)return Np;$k=1;var t=sr();Np=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 Np}var Ip,Vk;function qk(){if(Vk)return Ip;Vk=1;var t=sr();Ip=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},Ip}var Bp,zk;function Hk(){if(zk)return Bp;zk=1;var t=sr(),e=qk();Bp=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,m=u[g],y=l(p),b=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+y);b<m.distance&&(m.distance=b,m.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 Bp}var Dp,Kk;function q8(){if(Kk)return Dp;Kk=1;var t=Hk(),e=sr();Dp=r;function r(n,a,i){return e.transform(n.nodes(),function(o,l){o[l]=t(n,l,a,i)},{})}return Dp}var Pp,Gk;function Uk(){if(Gk)return Pp;Gk=1;var t=sr();Pp=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 Pp}var Op,jk;function z8(){if(jk)return Op;jk=1;var t=sr(),e=Uk();Op=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 Op}var Ap,Wk;function H8(){if(Wk)return Ap;Wk=1;var t=sr();Ap=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],m=h[v],y=p.distance+g.distance;y<m.distance&&(m.distance=y,m.predecessor=g.predecessor)})})}),l}return Ap}var Rp,Yk;function Zk(){if(Yk)return Rp;Yk=1;var t=sr();Rp=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,Rp}var Lp,Xk;function K8(){if(Xk)return Lp;Xk=1;var t=Zk();Lp=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return Lp}var Mp,Jk;function Qk(){if(Jk)return Mp;Jk=1;var t=sr();Mp=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 Mp}var Fp,e2;function G8(){if(e2)return Fp;e2=1;var t=Qk();Fp=e;function e(r,n){return t(r,n,"post")}return Fp}var $p,t2;function U8(){if(t2)return $p;t2=1;var t=Qk();$p=e;function e(r,n){return t(r,n,"pre")}return $p}var Vp,r2;function j8(){if(r2)return Vp;r2=1;var t=sr(),e=kp(),r=qk();Vp=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 Vp}var qp,n2;function W8(){return n2||(n2=1,qp={components:V8(),dijkstra:Hk(),dijkstraAll:q8(),findCycles:z8(),floydWarshall:H8(),isAcyclic:K8(),postorder:G8(),preorder:U8(),prim:j8(),tarjan:Uk(),topsort:Zk()}),qp}var zp,a2;function Y8(){if(a2)return zp;a2=1;var t=F8();return zp={Graph:t.Graph,json:$8(),alg:W8(),version:t.version},zp}var Hp,i2;function wr(){if(i2)return Hp;i2=1;var t;if(typeof Bc=="function")try{t=Y8()}catch{}return t||(t=window.graphlib),Hp=t,Hp}var Kp,o2;function Z8(){if(o2)return Kp;o2=1;var t=BE(),e=1,r=4;function n(a){return t(a,e|r)}return Kp=n,Kp}var Gp,s2;function El(){if(s2)return Gp;s2=1;var t=si(),e=en(),r=hl(),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 Gp=a,Gp}var Up,l2;function X8(){if(l2)return Up;l2=1;var t=Cl(),e=si(),r=El(),n=fa(),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 m=v[p],y=l[m];(y===void 0||e(y,a[m])&&!i.call(l,m))&&(l[m]=h[m])}return l});return Up=o,Up}var jp,u2;function J8(){if(u2)return jp;u2=1;var t=tn(),e=en(),r=Bn();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 jp=n,jp}var Wp,c2;function Q8(){if(c2)return Wp;c2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Wp=e,Wp}var Yp,d2;function e6(){if(d2)return Yp;d2=1;var t=Q8(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Yp=r,Yp}var Zp,f2;function t6(){if(f2)return Zp;f2=1;var t=e6(),e=or(),r=di(),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 Zp=c,Zp}var Xp,h2;function p2(){if(h2)return Xp;h2=1;var t=t6(),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 Xp=n,Xp}var Jp,v2;function r6(){if(v2)return Jp;v2=1;var t=p2();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return Jp=e,Jp}var Qp,g2;function n6(){if(g2)return Qp;g2=1;var t=bk(),e=tn(),r=r6(),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 Qp=a,Qp}var ev,m2;function a6(){if(m2)return ev;m2=1;var t=J8(),e=n6(),r=t(e);return ev=r,ev}var tv,y2;function b2(){if(y2)return tv;y2=1;var t=rp();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return tv=e,tv}var rv,w2;function i6(){if(w2)return rv;w2=1;var t=zf(),e=VE(),r=fa();function n(a,i){return a==null?a:t(a,e(i),r)}return rv=n,rv}var nv,C2;function o6(){if(C2)return nv;C2=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return nv=t,nv}var av,E2;function s6(){if(E2)return av;E2=1;var t=dl(),e=Kf(),r=tn();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 av=n,av}var iv,x2;function ov(){if(x2)return iv;x2=1;var t=di();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 iv=e,iv}var sv,k2;function l6(){if(k2)return sv;k2=1;function t(e,r){return e>r}return sv=t,sv}var lv,S2;function u6(){if(S2)return lv;S2=1;var t=ov(),e=l6(),r=ha();function n(a){return a&&a.length?t(a,r,e):void 0}return lv=n,lv}var uv,_2;function T2(){if(_2)return uv;_2=1;var t=dl(),e=si();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return uv=r,uv}var cv,N2;function c6(){if(N2)return cv;N2=1;var t=ca(),e=gl(),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 cv=u,cv}var dv,I2;function B2(){if(I2)return dv;I2=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return dv=t,dv}var fv,D2;function d6(){if(D2)return fv;D2=1;var t=Co(),e=fa();function r(n){return t(n,e(n))}return fv=r,fv}var hv,P2;function f6(){if(P2)return hv;P2=1;var t=T2(),e=VC(),r=bE(),n=zC(),a=kE(),i=Eo(),o=at(),l=Ik(),c=ui(),u=wo(),d=or(),f=c6(),h=So(),v=B2(),p=d6();function g(m,y,b,w,C,E,k){var x=v(m,b),_=v(y,b),S=k.get(_);if(S){t(m,b,S);return}var T=E?E(x,_,b+"",m,y,k):void 0,N=T===void 0;if(N){var B=o(_),P=!B&&c(_),D=!B&&!P&&h(_);T=_,B||P||D?o(x)?T=x:l(x)?T=n(x):P?(N=!1,T=e(_,!0)):D?(N=!1,T=r(_,!0)):T=[]:f(_)||i(_)?(T=x,i(x)?T=p(x):(!d(x)||u(x))&&(T=a(_))):N=!1}N&&(k.set(_,T),C(T,_,w,E,k),k.delete(_)),t(m,b,T)}return hv=g,hv}var pv,O2;function h6(){if(O2)return pv;O2=1;var t=cl(),e=T2(),r=zf(),n=f6(),a=or(),i=fa(),o=B2();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 pv=l,pv}var vv,A2;function p6(){if(A2)return vv;A2=1;var t=Cl(),e=El();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 vv=r,vv}var gv,R2;function v6(){if(R2)return gv;R2=1;var t=h6(),e=p6(),r=e(function(n,a,i){t(n,a,i)});return gv=r,gv}var mv,L2;function M2(){if(L2)return mv;L2=1;function t(e,r){return e<r}return mv=t,mv}var yv,F2;function g6(){if(F2)return yv;F2=1;var t=ov(),e=M2(),r=ha();function n(a){return a&&a.length?t(a,r,e):void 0}return yv=n,yv}var bv,$2;function m6(){if($2)return bv;$2=1;var t=ov(),e=tn(),r=M2();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return bv=n,bv}var wv,V2;function y6(){if(V2)return wv;V2=1;var t=br(),e=function(){return t.Date.now()};return wv=e,wv}var Cv,q2;function b6(){if(q2)return Cv;q2=1;var t=fl(),e=bl(),r=hl(),n=or(),a=To();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 m=v[p];g=u?u(m,p,v):void 0,g===void 0&&(g=n(m)?m:r(l[d+1])?[]:{})}t(v,p,g),v=v[p]}return o}return Cv=i,Cv}var Ev,z2;function w6(){if(z2)return Ev;z2=1;var t=wl(),e=b6(),r=bl();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 Ev=n,Ev}var xv,H2;function C6(){if(H2)return xv;H2=1;var t=w6(),e=Px();function r(n,a){return t(n,a,function(i,o){return e(n,o)})}return xv=r,xv}var kv,K2;function E6(){if(K2)return kv;K2=1;var t=b2(),e=fk(),r=gk();function n(a){return r(e(a,void 0,t),a+"")}return kv=n,kv}var Sv,G2;function x6(){if(G2)return Sv;G2=1;var t=C6(),e=E6(),r=e(function(n,a){return n==null?{}:t(n,a)});return Sv=r,Sv}var _v,U2;function k6(){if(U2)return _v;U2=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 _v=r,_v}var Tv,j2;function S6(){if(j2)return Tv;j2=1;var t=k6(),e=El(),r=p2();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 Tv=n,Tv}var Nv,W2;function _6(){if(W2)return Nv;W2=1;var t=S6(),e=t();return Nv=e,Nv}var Iv,Y2;function T6(){if(Y2)return Iv;Y2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Iv=t,Iv}var Bv,Z2;function N6(){if(Z2)return Bv;Z2=1;var t=di();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 Bv=e,Bv}var Dv,X2;function I6(){if(X2)return Dv;X2=1;var t=N6();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 Dv=e,Dv}var Pv,J2;function B6(){if(J2)return Pv;J2=1;var t=yl(),e=wl(),r=tn(),n=Wx(),a=T6(),i=pl(),o=I6(),l=ha(),c=at();function u(d,f,h){f.length?f=t(f,function(g){return c(g)?function(m){return e(m,g.length===1?g[0]:g)}:g}):f=[l];var v=-1;f=t(f,i(r));var p=n(d,function(g,m,y){var b=t(f,function(w){return w(g)});return{criteria:b,index:++v,value:g}});return a(p,function(g,m){return o(g,m,h)})}return Pv=u,Pv}var Ov,Q2;function D6(){if(Q2)return Ov;Q2=1;var t=rp(),e=B6(),r=Cl(),n=El(),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 Ov=a,Ov}var Av,eS;function P6(){if(eS)return Av;eS=1;var t=xx(),e=0;function r(n){var a=++e;return t(n)+a}return Av=r,Av}var Rv,tS;function O6(){if(tS)return Rv;tS=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 Rv=t,Rv}var Lv,rS;function A6(){if(rS)return Lv;rS=1;var t=fl(),e=O6();function r(n,a){return e(n||[],a||[],t)}return Lv=r,Lv}var Mv,nS;function Ze(){if(nS)return Mv;nS=1;var t;if(typeof Bc=="function")try{t={cloneDeep:Z8(),constant:$f(),defaults:X8(),each:KE(),filter:Vx(),find:a6(),flatten:b2(),forEach:zE(),forIn:i6(),has:Hx(),isUndefined:Ux(),last:o6(),map:Zx(),mapValues:s6(),max:u6(),merge:v6(),min:g6(),minBy:m6(),now:y6(),pick:x6(),range:_6(),reduce:ek(),sortBy:D6(),uniqueId:P6(),values:Ok(),zipObject:A6()}}catch{}return t||(t=window._),Mv=t,Mv}var Fv,aS;function R6(){if(aS)return Fv;aS=1,Fv=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 Fv}var $v,iS;function L6(){if(iS)return $v;iS=1;var t=Ze(),e=wr().Graph,r=R6();$v=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 m=d.length-2;m>0;--m)if(g=d[m].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 m=u.edge(g),y=u.node(g.v);v&&p.push({v:g.v,w:g.w}),y.out-=m,c(d,f,y)}),t.forEach(u.outEdges(h.v),function(g){var m=u.edge(g),y=g.w,b=u.node(y);b.in-=m,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(m){f.setNode(m,{v:m,in:0,out:0})}),t.forEach(u.edges(),function(m){var y=f.edge(m.v,m.w)||0,b=d(m),w=y+b;f.setEdge(m.v,m.w,w),v=Math.max(v,f.node(m.v).out+=b),h=Math.max(h,f.node(m.w).in+=b)});var p=t.range(v+h+3).map(function(){return new r}),g=h+1;return t.forEach(f.nodes(),function(m){c(p,g,f.node(m))}),{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 $v}var Vv,oS;function M6(){if(oS)return Vv;oS=1;var t=Ze(),e=L6();Vv={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 Vv}var qv,sS;function Ut(){if(sS)return qv;sS=1;var t=Ze(),e=wr().Graph;qv={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(m,y,b,w){var C;do C=t.uniqueId(w);while(m.hasNode(C));return b.dummy=y,m.setNode(C,b),C}function n(m){var y=new e().setGraph(m.graph());return t.forEach(m.nodes(),function(b){y.setNode(b,m.node(b))}),t.forEach(m.edges(),function(b){var w=y.edge(b.v,b.w)||{weight:0,minlen:1},C=m.edge(b);y.setEdge(b.v,b.w,{weight:w.weight+C.weight,minlen:Math.max(w.minlen,C.minlen)})}),y}function a(m){var y=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return t.forEach(m.nodes(),function(b){m.children(b).length||y.setNode(b,m.node(b))}),t.forEach(m.edges(),function(b){y.setEdge(b,m.edge(b))}),y}function i(m){var y=t.map(m.nodes(),function(b){var w={};return t.forEach(m.outEdges(b),function(C){w[C.w]=(w[C.w]||0)+m.edge(C).weight}),w});return t.zipObject(m.nodes(),y)}function o(m){var y=t.map(m.nodes(),function(b){var w={};return t.forEach(m.inEdges(b),function(C){w[C.v]=(w[C.v]||0)+m.edge(C).weight}),w});return t.zipObject(m.nodes(),y)}function l(m,y){var b=m.x,w=m.y,C=y.x-b,E=y.y-w,k=m.width/2,x=m.height/2;if(!C&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var _,S;return Math.abs(E)*k>Math.abs(C)*x?(E<0&&(x=-x),_=x*C/E,S=x):(C<0&&(k=-k),_=k,S=k*E/C),{x:b+_,y:w+S}}function c(m){var y=t.map(t.range(h(m)+1),function(){return[]});return t.forEach(m.nodes(),function(b){var w=m.node(b),C=w.rank;t.isUndefined(C)||(y[C][w.order]=b)}),y}function u(m){var y=t.min(t.map(m.nodes(),function(b){return m.node(b).rank}));t.forEach(m.nodes(),function(b){var w=m.node(b);t.has(w,"rank")&&(w.rank-=y)})}function d(m){var y=t.min(t.map(m.nodes(),function(E){return m.node(E).rank})),b=[];t.forEach(m.nodes(),function(E){var k=m.node(E).rank-y;b[k]||(b[k]=[]),b[k].push(E)});var w=0,C=m.graph().nodeRankFactor;t.forEach(b,function(E,k){t.isUndefined(E)&&k%C!==0?--w:w&&t.forEach(E,function(x){m.node(x).rank+=w})})}function f(m,y,b,w){var C={width:0,height:0};return arguments.length>=4&&(C.rank=b,C.order=w),r(m,"border",C,y)}function h(m){return t.max(t.map(m.nodes(),function(y){var b=m.node(y).rank;if(!t.isUndefined(b))return b}))}function v(m,y){var b={lhs:[],rhs:[]};return t.forEach(m,function(w){y(w)?b.lhs.push(w):b.rhs.push(w)}),b}function p(m,y){var b=t.now();try{return y()}finally{console.log(m+" time: "+(t.now()-b)+"ms")}}function g(m,y){return y()}return qv}var zv,lS;function F6(){if(lS)return zv;lS=1;var t=Ze(),e=Ut();zv={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,m;for(m=0,++c;c<d;++m,++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),m===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 zv}var Hv,uS;function xl(){if(uS)return Hv;uS=1;var t=Ze();Hv={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 Hv}var Kv,cS;function dS(){if(cS)return Kv;cS=1;var t=Ze(),e=wr().Graph,r=xl().slack;Kv=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 Kv}var Gv,fS;function $6(){if(fS)return Gv;fS=1;var t=Ze(),e=dS(),r=xl().slack,n=xl().longestPath,a=wr().alg.preorder,i=wr().alg.postorder,o=Ut().simplify;Gv=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 E,k;E=v(C);)k=p(C,w,E),g(C,w,E,k)}function c(w,C){var E=i(w,w.nodes());E=E.slice(0,E.length-1),t.forEach(E,function(k){u(w,C,k)})}function u(w,C,E){var k=w.node(E),x=k.parent;w.edge(E,x).cutvalue=d(w,C,E)}function d(w,C,E){var k=w.node(E),x=k.parent,_=!0,S=C.edge(E,x),T=0;return S||(_=!1,S=C.edge(x,E)),T=S.weight,t.forEach(C.nodeEdges(E),function(N){var B=N.v===E,P=B?N.w:N.v;if(P!==x){var D=B===_,R=C.edge(N).weight;if(T+=D?R:-R,y(w,E,P)){var O=w.edge(E,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,E,k,x){var _=E,S=w.node(k);return C[k]=!0,t.forEach(w.neighbors(k),function(T){t.has(C,T)||(E=h(w,C,E,T,k))}),S.low=_,S.lim=E++,x?S.parent=x:delete S.parent,E}function v(w){return t.find(w.edges(),function(C){return w.edge(C).cutvalue<0})}function p(w,C,E){var k=E.v,x=E.w;C.hasEdge(k,x)||(k=E.w,x=E.v);var _=w.node(k),S=w.node(x),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,E,k){var x=E.v,_=E.w;w.removeEdge(x,_),w.setEdge(k.v,k.w,{}),f(w),c(w,C),m(w,C)}function m(w,C){var E=t.find(w.nodes(),function(x){return!C.node(x).parent}),k=a(w,E);k=k.slice(1),t.forEach(k,function(x){var _=w.node(x).parent,S=C.edge(x,_),T=!1;S||(S=C.edge(_,x),T=!0),C.node(x).rank=C.node(_).rank+(T?S.minlen:-S.minlen)})}function y(w,C,E){return w.hasEdge(C,E)}function b(w,C,E){return E.low<=C.lim&&C.lim<=E.lim}return Gv}var Uv,hS;function V6(){if(hS)return Uv;hS=1;var t=xl(),e=t.longestPath,r=dS(),n=$6();Uv=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 Uv}var jv,pS;function q6(){if(pS)return jv;pS=1;var t=Ze();jv=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 jv}var Wv,vS;function z6(){if(vS)return Wv;vS=1;var t=Ze(),e=Ut();Wv={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"),m=e.addBorderNode(l,"_bb"),y=l.node(v);l.setParent(g,v),y.borderTop=g,l.setParent(m,v),y.borderBottom=m,t.forEach(p,function(b){n(l,c,u,d,f,h,b);var w=l.node(b),C=w.borderTop?w.borderTop:b,E=w.borderBottom?w.borderBottom:b,k=w.borderTop?d:2*d,x=C!==E?1:f-h[v]+1;l.setEdge(g,C,{weight:k,minlen:x,nestingEdge:!0}),l.setEdge(E,m,{weight:k,minlen:x,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 Wv}var Yv,gS;function H6(){if(gS)return Yv;gS=1;var t=Ze(),e=Ut();Yv=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 Yv}var Zv,mS;function K6(){if(mS)return Zv;mS=1;var t=Ze();Zv={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 Zv}var Xv,yS;function G6(){if(yS)return Xv;yS=1;var t=Ze();Xv=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 Xv}var Jv,bS;function U6(){if(bS)return Jv;bS=1;var t=Ze();Jv=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 Jv}var Qv,wS;function j6(){if(wS)return Qv;wS=1;var t=Ze();Qv=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 Qv}var eg,CS;function W6(){if(CS)return eg;CS=1;var t=Ze();eg=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 eg}var tg,ES;function Y6(){if(ES)return tg;ES=1;var t=Ze(),e=Ut();tg=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 tg}var rg,xS;function Z6(){if(xS)return rg;xS=1;var t=Ze(),e=j6(),r=W6(),n=Y6();rg=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(E){return E!==v&&E!==p}));var m=e(l,f);t.forEach(m,function(E){if(l.children(E.v).length){var k=a(l,E.v,u,d);g[E.v]=k,t.has(k,"barycenter")&&o(E,k)}});var y=r(m,u);i(y,g);var b=n(y,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 rg}var ng,kS;function X6(){if(kS)return ng;kS=1;var t=Ze(),e=wr().Graph;ng=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 ng}var ag,SS;function J6(){if(SS)return ag;SS=1;var t=Ze();ag=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 ag}var ig,_S;function Q6(){if(_S)return ig;_S=1;var t=Ze(),e=G6(),r=U6(),n=Z6(),a=X6(),i=J6(),o=wr().Graph,l=Ut();ig=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"),m=e(h);f(h,m);for(var y=Number.POSITIVE_INFINITY,b,w=0,C=0;C<4;++w,++C){d(w%2?p:g,w%4>=2),m=l.buildLayerMatrix(h);var E=r(h,m);E<y&&(C=0,b=t.cloneDeep(m),y=E)}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 m=g.graph().root,y=n(g,m,p,v);t.forEach(y.vs,function(b,w){g.node(b).order=w}),i(g,p,y.vs)})}function f(h,v){t.forEach(v,function(p){t.forEach(p,function(g,m){h.node(g).order=m})})}return ig}var og,TS;function e9(){if(TS)return og;TS=1;var t=Ze(),e=wr().Graph,r=Ut();og={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:v};function n(y,b){var w={};function C(E,k){var x=0,_=0,S=E.length,T=t.last(k);return t.forEach(k,function(N,B){var P=i(y,N),D=P?y.node(P).order:S;(P||N===T)&&(t.forEach(k.slice(_,B+1),function(R){t.forEach(y.predecessors(R),function(O){var L=y.node(O),A=L.order;(A<x||D<A)&&!(L.dummy&&y.node(R).dummy)&&o(w,O,R)})}),_=B+1,x=D)}),k}return t.reduce(b,C),w}function a(y,b){var w={};function C(k,x,_,S,T){var N;t.forEach(t.range(x,_),function(B){N=k[B],y.node(N).dummy&&t.forEach(y.predecessors(N),function(P){var D=y.node(P);D.dummy&&(D.order<S||D.order>T)&&o(w,P,N)})})}function E(k,x){var _=-1,S,T=0;return t.forEach(x,function(N,B){if(y.node(N).dummy==="border"){var P=y.predecessors(N);P.length&&(S=y.node(P[0]).order,C(x,T,B,_,S),T=B,_=S)}C(x,T,x.length,S,k.length)}),x}return t.reduce(b,E),w}function i(y,b){if(y.node(b).dummy)return t.find(y.predecessors(b),function(w){return y.node(w).dummy})}function o(y,b,w){if(b>w){var C=b;b=w,w=C}var E=y[b];E||(y[b]=E={}),E[w]=!0}function l(y,b,w){if(b>w){var C=b;b=w,w=C}return t.has(y[b],w)}function c(y,b,w,C){var E={},k={},x={};return t.forEach(b,function(_){t.forEach(_,function(S,T){E[S]=S,k[S]=S,x[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 x[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<x[R]&&!l(w,T,R)&&(k[R]=T,k[T]=E[T]=E[R],S=x[R])}}})}),{root:E,align:k}}function u(y,b,w,C,E){var k={},x=d(y,b,w,E),_=E?"borderLeft":"borderRight";function S(B,P){for(var D=x.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]=x.inEdges(B).reduce(function(P,D){return Math.max(P,k[D.v]+x.edge(D))},0)}function N(B){var P=x.outEdges(B).reduce(function(R,O){return Math.min(R,k[O.w]-x.edge(O))},Number.POSITIVE_INFINITY),D=y.node(B);P!==Number.POSITIVE_INFINITY&&D.borderType!==_&&(k[B]=Math.max(k[B],P))}return S(T,x.predecessors.bind(x)),S(N,x.successors.bind(x)),t.forEach(C,function(B){k[B]=k[w[B]]}),k}function d(y,b,w,C){var E=new e,k=y.graph(),x=g(k.nodesep,k.edgesep,C);return t.forEach(b,function(_){var S;t.forEach(_,function(T){var N=w[T];if(E.setNode(N),S){var B=w[S],P=E.edge(B,N);E.setEdge(B,N,Math.max(x(y,T,S),P||0))}S=T})}),E}function f(y,b){return t.minBy(t.values(b),function(w){var C=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY;return t.forIn(w,function(k,x){var _=m(y,x)/2;C=Math.max(k+_,C),E=Math.min(k-_,E)}),C-E})}function h(y,b){var w=t.values(b),C=t.min(w),E=t.max(w);t.forEach(["u","d"],function(k){t.forEach(["l","r"],function(x){var _=k+x,S=y[_],T;if(S!==b){var N=t.values(S);T=x==="l"?C-t.min(N):E-t.max(N),T&&(y[_]=t.mapValues(S,function(B){return B+T}))}})})}function v(y,b){return t.mapValues(y.ul,function(w,C){if(b)return y[b.toLowerCase()][C];var E=t.sortBy(t.map(y,C));return(E[1]+E[2])/2})}function p(y){var b=r.buildLayerMatrix(y),w=t.merge(n(y,b),a(y,b)),C={},E;t.forEach(["u","d"],function(x){E=x==="u"?b:t.values(b).reverse(),t.forEach(["l","r"],function(_){_==="r"&&(E=t.map(E,function(B){return t.values(B).reverse()}));var S=(x==="u"?y.predecessors:y.successors).bind(y),T=c(y,E,w,S),N=u(y,E,T.root,T.align,_==="r");_==="r"&&(N=t.mapValues(N,function(B){return-B})),C[x+_]=N})});var k=f(y,C);return h(C,k),v(C,y.graph().align)}function g(y,b,w){return function(C,E,k){var x=C.node(E),_=C.node(k),S=0,T;if(S+=x.width/2,t.has(x,"labelpos"))switch(x.labelpos.toLowerCase()){case"l":T=-x.width/2;break;case"r":T=x.width/2;break}if(T&&(S+=w?T:-T),T=0,S+=(x.dummy?b:y)/2,S+=(_.dummy?b:y)/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 m(y,b){return y.node(b).width}return og}var sg,NS;function t9(){if(NS)return sg;NS=1;var t=Ze(),e=Ut(),r=e9().positionX;sg=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 sg}var lg,IS;function r9(){if(IS)return lg;IS=1;var t=Ze(),e=M6(),r=F6(),n=V6(),a=Ut().normalizeRanks,i=q6(),o=Ut().removeEmptyRanks,l=z6(),c=H6(),u=K6(),d=Q6(),f=t9(),h=Ut(),v=wr().Graph;lg=p;function p(F,$){var V=$&&$.debugTiming?h.time:h.notime;V("layout",function(){var G=V(" buildLayoutGraph",function(){return S(F)});V(" runLayout",function(){g(G,V)}),V(" updateInputGraph",function(){m(F,G)})})}function g(F,$){$(" makeSpaceForEdgeLabels",function(){T(F)}),$(" removeSelfEdges",function(){q(F)}),$(" acyclic",function(){e.run(F)}),$(" nestingGraph.run",function(){l.run(F)}),$(" rank",function(){n(h.asNonCompoundGraph(F))}),$(" injectEdgeLabelProxies",function(){N(F)}),$(" removeEmptyRanks",function(){o(F)}),$(" nestingGraph.cleanup",function(){l.cleanup(F)}),$(" normalizeRanks",function(){a(F)}),$(" assignRankMinMax",function(){B(F)}),$(" removeEdgeLabelProxies",function(){P(F)}),$(" normalize.run",function(){r.run(F)}),$(" parentDummyChains",function(){i(F)}),$(" addBorderSegments",function(){c(F)}),$(" order",function(){d(F)}),$(" insertSelfEdges",function(){U(F)}),$(" adjustCoordinateSystem",function(){u.adjust(F)}),$(" position",function(){f(F)}),$(" positionSelfEdges",function(){z(F)}),$(" removeBorderNodes",function(){A(F)}),$(" normalize.undo",function(){r.undo(F)}),$(" fixupEdgeLabelCoords",function(){O(F)}),$(" undoCoordinateSystem",function(){u.undo(F)}),$(" translateGraph",function(){D(F)}),$(" assignNodeIntersects",function(){R(F)}),$(" reversePoints",function(){L(F)}),$(" acyclic.undo",function(){e.undo(F)})}function m(F,$){t.forEach(F.nodes(),function(V){var G=F.node(V),j=$.node(V);G&&(G.x=j.x,G.y=j.y,$.children(V).length&&(G.width=j.width,G.height=j.height))}),t.forEach(F.edges(),function(V){var G=F.edge(V),j=$.edge(V);G.points=j.points,t.has(j,"x")&&(G.x=j.x,G.y=j.y)}),F.graph().width=$.graph().width,F.graph().height=$.graph().height}var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],C=["width","height"],E={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],x={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function S(F){var $=new v({multigraph:!0,compound:!0}),V=Q(F.graph());return $.setGraph(t.merge({},b,H(V,y),t.pick(V,w))),t.forEach(F.nodes(),function(G){var j=Q(F.node(G));$.setNode(G,t.defaults(H(j,C),E)),$.setParent(G,F.parent(G))}),t.forEach(F.edges(),function(G){var j=Q(F.edge(G));$.setEdge(G,t.merge({},x,H(j,k),t.pick(j,_)))}),$}function T(F){var $=F.graph();$.ranksep/=2,t.forEach(F.edges(),function(V){var G=F.edge(V);G.minlen*=2,G.labelpos.toLowerCase()!=="c"&&($.rankdir==="TB"||$.rankdir==="BT"?G.width+=G.labeloffset:G.height+=G.labeloffset)})}function N(F){t.forEach(F.edges(),function($){var V=F.edge($);if(V.width&&V.height){var G=F.node($.v),j=F.node($.w),M={rank:(j.rank-G.rank)/2+G.rank,e:$};h.addDummyNode(F,"edge-proxy",M,"_ep")}})}function B(F){var $=0;t.forEach(F.nodes(),function(V){var G=F.node(V);G.borderTop&&(G.minRank=F.node(G.borderTop).rank,G.maxRank=F.node(G.borderBottom).rank,$=t.max($,G.maxRank))}),F.graph().maxRank=$}function P(F){t.forEach(F.nodes(),function($){var V=F.node($);V.dummy==="edge-proxy"&&(F.edge(V.e).labelRank=V.rank,F.removeNode($))})}function D(F){var $=Number.POSITIVE_INFINITY,V=0,G=Number.POSITIVE_INFINITY,j=0,M=F.graph(),W=M.marginx||0,Y=M.marginy||0;function se(ce){var ae=ce.x,ne=ce.y,ue=ce.width,ie=ce.height;$=Math.min($,ae-ue/2),V=Math.max(V,ae+ue/2),G=Math.min(G,ne-ie/2),j=Math.max(j,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)}),$-=W,G-=Y,t.forEach(F.nodes(),function(ce){var ae=F.node(ce);ae.x-=$,ae.y-=G}),t.forEach(F.edges(),function(ce){var ae=F.edge(ce);t.forEach(ae.points,function(ne){ne.x-=$,ne.y-=G}),t.has(ae,"x")&&(ae.x-=$),t.has(ae,"y")&&(ae.y-=G)}),M.width=V-$+W,M.height=j-G+Y}function R(F){t.forEach(F.edges(),function($){var V=F.edge($),G=F.node($.v),j=F.node($.w),M,W;V.points?(M=V.points[0],W=V.points[V.points.length-1]):(V.points=[],M=j,W=G),V.points.unshift(h.intersectRect(G,M)),V.points.push(h.intersectRect(j,W))})}function O(F){t.forEach(F.edges(),function($){var V=F.edge($);if(t.has(V,"x"))switch((V.labelpos==="l"||V.labelpos==="r")&&(V.width-=V.labeloffset),V.labelpos){case"l":V.x-=V.width/2+V.labeloffset;break;case"r":V.x+=V.width/2+V.labeloffset;break}})}function L(F){t.forEach(F.edges(),function($){var V=F.edge($);V.reversed&&V.points.reverse()})}function A(F){t.forEach(F.nodes(),function($){if(F.children($).length){var V=F.node($),G=F.node(V.borderTop),j=F.node(V.borderBottom),M=F.node(t.last(V.borderLeft)),W=F.node(t.last(V.borderRight));V.width=Math.abs(W.x-M.x),V.height=Math.abs(j.y-G.y),V.x=M.x+V.width/2,V.y=G.y+V.height/2}}),t.forEach(F.nodes(),function($){F.node($).dummy==="border"&&F.removeNode($)})}function q(F){t.forEach(F.edges(),function($){if($.v===$.w){var V=F.node($.v);V.selfEdges||(V.selfEdges=[]),V.selfEdges.push({e:$,label:F.edge($)}),F.removeEdge($)}})}function U(F){var $=h.buildLayerMatrix(F);t.forEach($,function(V){var G=0;t.forEach(V,function(j,M){var W=F.node(j);W.order=M+G,t.forEach(W.selfEdges,function(Y){h.addDummyNode(F,"selfedge",{width:Y.label.width,height:Y.label.height,rank:W.rank,order:M+ ++G,e:Y.e,label:Y.label},"_se")}),delete W.selfEdges})})}function z(F){t.forEach(F.nodes(),function($){var V=F.node($);if(V.dummy==="selfedge"){var G=F.node(V.e.v),j=G.x+G.width/2,M=G.y,W=V.x-j,Y=G.height/2;F.setEdge(V.e,V.label),F.removeNode($),V.label.points=[{x:j+2*W/3,y:M-Y},{x:j+5*W/6,y:M-Y},{x:j+W,y:M},{x:j+5*W/6,y:M+Y},{x:j+2*W/3,y:M+Y}],V.label.x=V.x,V.label.y=V.y}})}function H(F,$){return t.mapValues(t.pick(F,$),Number)}function Q(F){var $={};return t.forEach(F,function(V,G){$[G.toLowerCase()]=V}),$}return lg}var ug,BS;function n9(){if(BS)return ug;BS=1;var t=Ze(),e=Ut(),r=wr().Graph;ug={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 ug}var cg,DS;function a9(){return DS||(DS=1,cg="0.8.5"),cg}var dg,PS;function i9(){return PS||(PS=1,dg={graphlib:wr(),layout:r9(),debug:n9(),util:{time:Ut().time,notime:Ut().notime},version:a9()}),dg}(function(t,e){(function(n,a){t.exports=a(i9())})(Ai,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,m=function(z,H){return l(H)?H.apply(z,[z]):H},y=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};y.x2===void 0&&(y.x2=y.x1+y.w),y.w===void 0&&(y.w=y.x2-y.x1),y.y2===void 0&&(y.y2=y.y1+y.h),y.h===void 0&&(y.h=y.y2-y.y1);var b=new d.graphlib.Graph({multigraph:!0,compound:!0}),w={},C=function(z,H){H!=null&&(w[z]=H)};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 E=g.nodes();l(h.sort)&&(E=E.sort(h.sort));for(var k=0;k<E.length;k++){var x=E[k],_=x.layoutDimensions(h);b.setNode(x.id(),{width:_.w,height:_.h,name:x.id()})}for(var S=0;S<E.length;S++){var T=E[S];T.isChild()&&b.setParent(T.id(),T.parent().id())}var N=g.edges().stdFilter(function(U){return!U.source().isParent()&&!U.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:m(P,h.minLen),weight:m(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],L=b.node(O);p.getElementById(O).scratch().dagre=L}var A;h.boundingBox?(A={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},E.forEach(function(U){var z=U.scratch().dagre;A.x1=Math.min(A.x1,z.x),A.x2=Math.max(A.x2,z.x),A.y1=Math.min(A.y1,z.y),A.y2=Math.max(A.y2,z.y)}),A.w=A.x2-A.x1,A.h=A.y2-A.y1):A=y;var q=function(z){if(h.boundingBox){var H=A.w===0?0:(z.x-A.x1)/A.w,Q=A.h===0?0:(z.y-A.y1)/A.h;return{x:y.x1+H*y.w,y:y.y1+Q*y.h}}else return z};return E.layoutPositions(v,h,function(U){U=o(U)==="object"?U:this;var z=U.scratch().dagre;return q({x:z.x,y:z.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}])})})(hw);var o9=hw.exports;const s9=kA(o9);In.use(s9);const OS=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1},l9=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},u9=function(t,e,r){let n=t.connectivity.flat(),a=l9(n),i=[],o=!1;return a.forEach(l=>{o=!1,OS(e,l)&&(o=!0),OS(r,l)&&(o=!0),o||i.push(l)}),i};let c9=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=u9(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 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=fg(o);h9(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 d9=[{selector:"node",style:{label:function(t){return f9(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 f9(t){const e=t.split(`
46
+ `),r=e.length/2,n=e.slice(r);return AS(n.join(`
47
+ `))}function AS(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
49
  `)}function fg(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 f9(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 h9 extends EventTarget{constructor(r,n){var a;super();cr(this,"cy");cr(this,"tooltip");this.cy=In({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:c9,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=fg(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=OS(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=fg(o),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const p9=1.3,v9=24*60*60*1e3,g9="Reset position",AS="Lock zoom",m9="Unlock zoom",y9="Zoom in",b9="Zoom out",RS=.25,w9="#8300bf",C9={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:g9,zoomLockLabel:AS,zoomInLabel:y9,zoomOutLabel:b9,iconColor:w9,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()+v9;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.loadingError="Loading error!"}).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.isSCKANVersionAvailable()?(await this.setPathList(this.selectedSource),{success:!0}):{error:`No data available for SCKAN version ${this.selectedSource}.`})},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new u9(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
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 h9(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();cr(this,"cy");cr(this,"tooltip");this.cy=In({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=fg(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=AS(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=fg(o),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const v9=1.3,g9=24*60*60*1e3,m9="Reset position",RS="Lock zoom",y9="Unlock zoom",b9="Zoom in",w9="Zoom out",LS=.25,C9="#8300bf",E9={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:RS,zoomInLabel:b9,zoomOutLabel:w9,iconColor:C9,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()+g9;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.loadingError="Loading error!"}).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<v9?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),this.isSCKANVersionAvailable()?(await this.setPathList(this.selectedSource),{success:!0}):{error:`No data available for SCKAN version ${this.selectedSource}.`})},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new c9(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(RS)},zoomOut:function(){this.connectivityGraph.zoom(-RS)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?m9:AS,this.connectivityGraph.enableZoom(!this.zoomEnabled)}}},E9={class:"connectivity-graph",ref:"connectivityGraphRef"},x9={ref:"graphCanvas",class:"graph-canvas"},k9={class:"control-panel control-panel-tools"},S9={class:"visually-hidden"},_9={class:"visually-hidden"},T9={class:"visually-hidden"},N9={class:"visually-hidden"},I9=s.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-1239b5ce><div class="node-key" data-v-1239b5ce><div class="key-box-container" data-v-1239b5ce><div class="key-box key-box-dendrite" data-v-1239b5ce> Origin </div><div class="key-box key-box-node" data-v-1239b5ce> Components </div><div class="key-box key-box-axon" data-v-1239b5ce> Destination </div></div></div></div>',1),B9={class:"connectivity-graph-error"},D9={key:0,class:"loading-error"};function P9(t,e,r,n,a,i){const o=Te.Aim,l=ut,c=Ht,u=Oi,d=Te.Lock,f=Te.Unlock,h=Te.ZoomIn,v=Te.ZoomOut,p=Bu;return s.withDirectives((s.openBlock(),s.createElementBlock("div",E9,[s.createElementVNode("div",x9,null,512),s.createElementVNode("div",k9,[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",S9,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",_9,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",T9,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",N9,s.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),I9,s.withDirectives(s.createElementVNode("div",B9,[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",D9,s.toDisplayString(t.loadingError),1)):s.createCommentVNode("",!0)])),[[p,t.loading]])}const O9=Yt(C9,[["render",P9],["__scopeId","data-v-1239b5ce"]]),LS=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),A9=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),R9=t=>new Promise(e=>setTimeout(e,t)),L9={name:"ConnectivityList",components:{Button:Ht,Container:xu,Icon:ut,ElIconWarning:Te.Warning,ElIconSearch:Te.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 LS(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())})}}},Dn=t=>(s.pushScopeId("data-v-81bbd5ff"),t=t(),s.popScopeId(),t),M9={ref:"connectivityList",class:"connectivity-list"},F9={key:0,class:"block"},$9={class:"attribute-title-container"},V9=Dn(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),q9={style:{"word-break":"keep-all"}},z9=Dn(()=>s.createElementVNode("i",null,"Origin",-1)),H9=["origin-item-label","onMouseenter"],K9=Dn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),G9={key:1,class:"block"},U9=Dn(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),j9=["component-item-label","onMouseenter"],W9=Dn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),Y9={key:2,class:"block"},Z9={class:"attribute-title-container"},X9=Dn(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),Q9=Dn(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),J9=["destination-item-label","onMouseenter"],eH=Dn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),tH={class:"block"};function rH(t,e,r,n,a,i){const o=Da,l=Te.Warning,c=ut,u=Te.Search,d=Ht;return s.openBlock(),s.createElementBlock("div",M9,[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",F9,[s.createElementVNode("div",$9,[V9,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",q9,[z9,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(()=>[K9]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,H9))),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",G9,[U9,(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(()=>[W9]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,j9))),128))])):s.createCommentVNode("",!0),r.destinations&&r.destinations.length>0?(s.openBlock(),s.createElementBlock("div",Y9,[s.createElementVNode("div",Z9,[X9,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(()=>[Q9]),_: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(()=>[eH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,J9))),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",tH,[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 hg=Yt(L9,[["render",rH],["__scopeId","data-v-81bbd5ff"]]),nH=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},aH={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 nH(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},pg=t=>(s.pushScopeId("data-v-1ddab772"),t=t(),s.popScopeId(),t),iH={class:"dialog-container"},oH=pg(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),sH=pg(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),lH=pg(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),uH={class:"connection-label"};function cH(t,e,r,n,a,i){const o=Ht,l=as,c=Ri,u=Da,d=NA;return s.openBlock(),s.createElementBlock("div",iH,[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(()=>[oH,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(()=>[lH,(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",uH,s.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const dH=Yt(aH,[["render",cH],["__scopeId","data-v-1ddab772"]]),MS=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},fH=["xlink:href"],hH={__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,fH)],2))}},pH=MS(hH,[["__scopeId","data-v-e172d5ff"]]),FS=`<?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(LS)},zoomOut:function(){this.connectivityGraph.zoom(-LS)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?y9:RS,this.connectivityGraph.enableZoom(!this.zoomEnabled)}}},x9={class:"connectivity-graph",ref:"connectivityGraphRef"},k9={ref:"graphCanvas",class:"graph-canvas"},S9={class:"control-panel control-panel-tools"},_9={class:"visually-hidden"},T9={class:"visually-hidden"},N9={class:"visually-hidden"},I9={class:"visually-hidden"},B9=s.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-1239b5ce><div class="node-key" data-v-1239b5ce><div class="key-box-container" data-v-1239b5ce><div class="key-box key-box-dendrite" data-v-1239b5ce> Origin </div><div class="key-box key-box-node" data-v-1239b5ce> Components </div><div class="key-box key-box-axon" data-v-1239b5ce> Destination </div></div></div></div>',1),D9={class:"connectivity-graph-error"},P9={key:0,class:"loading-error"};function O9(t,e,r,n,a,i){const o=Te.Aim,l=ut,c=Ht,u=Oi,d=Te.Lock,f=Te.Unlock,h=Te.ZoomIn,v=Te.ZoomOut,p=Bu;return s.withDirectives((s.openBlock(),s.createElementBlock("div",x9,[s.createElementVNode("div",k9,null,512),s.createElementVNode("div",S9,[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",_9,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",T9,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",N9,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",I9,s.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),B9,s.withDirectives(s.createElementVNode("div",D9,[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",P9,s.toDisplayString(t.loadingError),1)):s.createCommentVNode("",!0)])),[[p,t.loading]])}const A9=Yt(E9,[["render",O9],["__scopeId","data-v-1239b5ce"]]),MS=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),R9=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),L9=t=>new Promise(e=>setTimeout(e,t)),M9={name:"ConnectivityList",components:{Button:Ht,Container:xu,Icon:ut,ElIconWarning:Te.Warning,ElIconSearch:Te.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 MS(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())})}}},Dn=t=>(s.pushScopeId("data-v-81bbd5ff"),t=t(),s.popScopeId(),t),F9={ref:"connectivityList",class:"connectivity-list"},$9={key:0,class:"block"},V9={class:"attribute-title-container"},q9=Dn(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),z9={style:{"word-break":"keep-all"}},H9=Dn(()=>s.createElementVNode("i",null,"Origin",-1)),K9=["origin-item-label","onMouseenter"],G9=Dn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),U9={key:1,class:"block"},j9=Dn(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),W9=["component-item-label","onMouseenter"],Y9=Dn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),Z9={key:2,class:"block"},X9={class:"attribute-title-container"},J9=Dn(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),Q9=Dn(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),eH=["destination-item-label","onMouseenter"],tH=Dn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),rH={class:"block"};function nH(t,e,r,n,a,i){const o=Pa,l=Te.Warning,c=ut,u=Te.Search,d=Ht;return s.openBlock(),s.createElementBlock("div",F9,[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",$9,[s.createElementVNode("div",V9,[q9,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",z9,[H9,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(()=>[G9]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,K9))),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",U9,[j9,(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(()=>[Y9]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,W9))),128))])):s.createCommentVNode("",!0),r.destinations&&r.destinations.length>0?(s.openBlock(),s.createElementBlock("div",Z9,[s.createElementVNode("div",X9,[J9,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(()=>[Q9]),_: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(()=>[tH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,eH))),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",rH,[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 hg=Yt(M9,[["render",nH],["__scopeId","data-v-81bbd5ff"]]),aH=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},iH={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 aH(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},pg=t=>(s.pushScopeId("data-v-1ddab772"),t=t(),s.popScopeId(),t),oH={class:"dialog-container"},sH=pg(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),lH=pg(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),uH=pg(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),cH={class:"connection-label"};function dH(t,e,r,n,a,i){const o=Ht,l=as,c=Ri,u=Pa,d=IA;return s.openBlock(),s.createElementBlock("div",oH,[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(()=>[sH,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(()=>[lH,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(()=>[uH,(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",cH,s.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const fH=Yt(iH,[["render",dH],["__scopeId","data-v-1ddab772"]]),FS=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},hH=["xlink:href"],pH={__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,hH)],2))}},vH=FS(pH,[["__scopeId","data-v-e172d5ff"]]),$S=`<?xml version="1.0" encoding="UTF-8"?>
56
56
  <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
57
  <title>2horpanel</title>
58
58
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -67,7 +67,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
67
67
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
68
68
  </g>
69
69
  </g>
70
- </svg>`,$S=`<?xml version="1.0" encoding="UTF-8"?>
70
+ </svg>`,VS=`<?xml version="1.0" encoding="UTF-8"?>
71
71
  <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
72
  <title>2vertpanel</title>
73
73
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -82,7 +82,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
82
82
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
83
83
  </g>
84
84
  </g>
85
- </svg>`,VS=`<?xml version="1.0" encoding="UTF-8"?>
85
+ </svg>`,qS=`<?xml version="1.0" encoding="UTF-8"?>
86
86
  <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
87
  <title>3panel</title>
88
88
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -98,7 +98,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
98
98
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
99
99
  </g>
100
100
  </g>
101
- </svg>`,qS=`<?xml version="1.0" encoding="UTF-8"?>
101
+ </svg>`,zS=`<?xml version="1.0" encoding="UTF-8"?>
102
102
  <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
103
  <title>4panel</title>
104
104
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -114,7 +114,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
114
114
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
115
115
  </g>
116
116
  </g>
117
- </svg>`,zS=`<?xml version="1.0" encoding="UTF-8"?>
117
+ </svg>`,HS=`<?xml version="1.0" encoding="UTF-8"?>
118
118
  <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
119
  <title>2horpanel</title>
120
120
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -132,7 +132,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
132
132
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
133
133
  </g>
134
134
  </g>
135
- </svg>`,HS=`<?xml version="1.0" encoding="UTF-8"?>
135
+ </svg>`,KS=`<?xml version="1.0" encoding="UTF-8"?>
136
136
  <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
137
  <title>2horpanel</title>
138
138
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -149,7 +149,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
149
149
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
150
150
  </g>
151
151
  </g>
152
- </svg>`,KS=`<?xml version="1.0" encoding="UTF-8"?>
152
+ </svg>`,GS=`<?xml version="1.0" encoding="UTF-8"?>
153
153
  <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
154
  <title>4panel</title>
155
155
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -166,7 +166,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
166
166
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
167
167
  </g>
168
168
  </g>
169
- </svg>`,GS=`<?xml version="1.0" encoding="UTF-8"?>
169
+ </svg>`,US=`<?xml version="1.0" encoding="UTF-8"?>
170
170
  <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
171
  <title>changeBckgd</title>
172
172
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -177,7 +177,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
177
177
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
178
178
  </g>
179
179
  </g>
180
- </svg>`,US=`<?xml version="1.0" encoding="UTF-8"?>
180
+ </svg>`,jS=`<?xml version="1.0" encoding="UTF-8"?>
181
181
  <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
182
  <title>close no bk</title>
183
183
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -186,7 +186,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
186
186
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
187
187
  </g>
188
188
  </g>
189
- </svg>`,jS=`<?xml version="1.0" encoding="UTF-8"?>
189
+ </svg>`,WS=`<?xml version="1.0" encoding="UTF-8"?>
190
190
  <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
191
  <title>close</title>
192
192
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -200,7 +200,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
200
200
  </g>
201
201
  </g>
202
202
  </g>
203
- </svg>`,WS=`<?xml version="1.0" encoding="UTF-8"?>
203
+ </svg>`,YS=`<?xml version="1.0" encoding="UTF-8"?>
204
204
  <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
205
  <title>closeFullScreen</title>
206
206
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -212,7 +212,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
212
212
  <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
213
  </g>
214
214
  </g>
215
- </svg>`,YS=`<?xml version="1.0" encoding="UTF-8"?>
215
+ </svg>`,ZS=`<?xml version="1.0" encoding="UTF-8"?>
216
216
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
217
217
  xmlns:xlink="http://www.w3.org/1999/xlink">
218
218
  <title>Comment</title>
@@ -221,7 +221,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
221
221
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
222
222
  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
223
  </g>
224
- </svg>`,ZS=`<?xml version="1.0" encoding="UTF-8"?>
224
+ </svg>`,XS=`<?xml version="1.0" encoding="UTF-8"?>
225
225
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
226
226
  xmlns:xlink="http://www.w3.org/1999/xlink">
227
227
  <title>Connection</title>
@@ -232,7 +232,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
232
232
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
233
233
  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
234
  </g>
235
- </svg>`,XS=`<?xml version="1.0" encoding="UTF-8"?>
235
+ </svg>`,JS=`<?xml version="1.0" encoding="UTF-8"?>
236
236
  <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
237
  <title>dock</title>
238
238
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -259,28 +259,28 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
259
259
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
260
260
  <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
261
  </g>
262
- </svg>`,JS=`<?xml version="1.0" encoding="UTF-8"?>
262
+ </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
263
263
  <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
264
  <title>drawPoint</title>
265
265
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
266
266
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
267
267
  <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
268
  </g>
269
- </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
269
+ </svg>`,t_=`<?xml version="1.0" encoding="UTF-8"?>
270
270
  <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
271
  <title>drawPolygon</title>
272
272
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
273
273
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
274
274
  <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
275
  </g>
276
- </svg>`,t_=`<?xml version="1.0" encoding="UTF-8"?>
276
+ </svg>`,r_=`<?xml version="1.0" encoding="UTF-8"?>
277
277
  <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
278
  <title>drawTrash</title>
279
279
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
280
280
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
281
281
  <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
282
  </g>
283
- </svg>`,r_=`<?xml version="1.0" encoding="UTF-8"?>
283
+ </svg>`,n_=`<?xml version="1.0" encoding="UTF-8"?>
284
284
  <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
285
  <title>fitWindow</title>
286
286
  <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -299,7 +299,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
299
299
  </g>
300
300
  </g>
301
301
  </g>
302
- </svg>`,n_=`<?xml version="1.0" encoding="UTF-8"?>
302
+ </svg>`,a_=`<?xml version="1.0" encoding="UTF-8"?>
303
303
  <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
304
  <title>fullScreen</title>
305
305
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -313,7 +313,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
313
313
  </g>
314
314
  </g>
315
315
  </g>
316
- </svg>`,a_='<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>',i_=`<?xml version="1.0" encoding="UTF-8"?>
316
+ </svg>`,i_='<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>',o_=`<?xml version="1.0" encoding="UTF-8"?>
317
317
  <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
318
  <title>magnifyingGlass</title>
319
319
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -327,7 +327,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
327
327
  </g>
328
328
  </g>
329
329
  </g>
330
- </svg>`,o_=`<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>`,s_=`<?xml version="1.0" encoding="UTF-8"?>
330
+ </svg>`,s_=`<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>`,l_=`<?xml version="1.0" encoding="UTF-8"?>
331
331
  <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
332
  <title>openMap</title>
333
333
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -337,7 +337,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
337
337
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
338
338
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
339
339
  </g>
340
- </svg>`,l_=`<?xml version="1.0" encoding="UTF-8"?>
340
+ </svg>`,u_=`<?xml version="1.0" encoding="UTF-8"?>
341
341
  <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
342
  <title>Artboard Copy 6</title>
343
343
  <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -347,7 +347,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
347
347
  <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
348
348
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
349
349
  </g>
350
- </svg>`,u_=`<?xml version="1.0" encoding="UTF-8"?>
350
+ </svg>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
351
351
  <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
352
  <title>permalink</title>
353
353
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -355,7 +355,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
355
355
  <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
356
  <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
357
  </g>
358
- </svg>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
358
+ </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
359
359
  <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
360
  <title>play</title>
361
361
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -366,7 +366,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
366
366
  <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
367
  </g>
368
368
  </g>
369
- </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
369
+ </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
370
370
  <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
371
  <title>resetZoom</title>
372
372
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -384,7 +384,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
384
384
  </g>
385
385
  </g>
386
386
  </g>
387
- </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
387
+ </svg>`,h_=`<?xml version="1.0" encoding="UTF-8"?>
388
388
  <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
389
  <title>singlepanel</title>
390
390
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -398,7 +398,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
398
398
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
399
399
  </g>
400
400
  </g>
401
- </svg>`,h_=`<?xml version="1.0" encoding="UTF-8"?>
401
+ </svg>`,p_=`<?xml version="1.0" encoding="UTF-8"?>
402
402
  <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
403
  <title>tooltips</title>
404
404
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -410,7 +410,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
410
410
  </text>
411
411
  </g>
412
412
  </g>
413
- </svg>`,p_=`<?xml version="1.0" encoding="UTF-8"?>
413
+ </svg>`,v_=`<?xml version="1.0" encoding="UTF-8"?>
414
414
  <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
415
  <title>undock</title>
416
416
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -430,7 +430,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
430
430
  </g>
431
431
  </g>
432
432
  </g>
433
- </svg>`,v_=`<?xml version="1.0" encoding="UTF-8"?>
433
+ </svg>`,g_=`<?xml version="1.0" encoding="UTF-8"?>
434
434
  <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
435
  <title>zoomIn</title>
436
436
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -446,7 +446,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
446
446
  <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
447
  </g>
448
448
  </g>
449
- </svg>`,g_=`<?xml version="1.0" encoding="UTF-8"?>
449
+ </svg>`,m_=`<?xml version="1.0" encoding="UTF-8"?>
450
450
  <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
451
  <title>zoomOut</title>
452
452
  <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -461,10 +461,10 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
461
461
  <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
462
  </g>
463
463
  </g>
464
- </svg>`,m_=(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},y_=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(),vH=!0,gH=!0,mH=["fill"],vg=Object.assign({"/assets/icons/2horpanel.svg":FS,"/assets/icons/2vertpanel.svg":$S,"/assets/icons/3panel.svg":VS,"/assets/icons/4panel.svg":qS,"/assets/icons/5panel.svg":zS,"/assets/icons/6panel.svg":HS,"/assets/icons/6panelVertical.svg":KS,"/assets/icons/changeBckgd.svg":GS,"/assets/icons/close-no-bk.svg":US,"/assets/icons/close.svg":jS,"/assets/icons/closeFullScreen.svg":WS,"/assets/icons/comment.svg":YS,"/assets/icons/connection.svg":ZS,"/assets/icons/dock.svg":XS,"/assets/icons/drawLine.svg":QS,"/assets/icons/drawPoint.svg":JS,"/assets/icons/drawPolygon.svg":e_,"/assets/icons/drawTrash.svg":t_,"/assets/icons/fitWindow.svg":r_,"/assets/icons/fullScreen.svg":n_,"/assets/icons/help.svg":a_,"/assets/icons/magnifyingGlass.svg":i_,"/assets/icons/noun-filter.svg":o_,"/assets/icons/openMap.svg":s_,"/assets/icons/pause.svg":l_,"/assets/icons/permalink.svg":u_,"/assets/icons/play.svg":c_,"/assets/icons/resetZoom.svg":d_,"/assets/icons/singlepanel.svg":f_,"/assets/icons/tooltips.svg":h_,"/assets/icons/undock.svg":p_,"/assets/icons/zoomIn.svg":v_,"/assets/icons/zoomOut.svg":g_});Object.keys(vg).map(t=>{const e=m_(vg[t],vH,gH,mH),r=t.replace(/^.+\/(\w+).svg$/,"$1");return y_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
465
- `);const gg=Object.assign({"/assets/icons/2horpanel.svg":FS,"/assets/icons/2vertpanel.svg":$S,"/assets/icons/3panel.svg":VS,"/assets/icons/4panel.svg":qS,"/assets/icons/5panel.svg":zS,"/assets/icons/6panel.svg":HS,"/assets/icons/6panelVertical.svg":KS,"/assets/icons/changeBckgd.svg":GS,"/assets/icons/close-no-bk.svg":US,"/assets/icons/close.svg":jS,"/assets/icons/closeFullScreen.svg":WS,"/assets/icons/comment.svg":YS,"/assets/icons/connection.svg":ZS,"/assets/icons/dock.svg":XS,"/assets/icons/drawLine.svg":QS,"/assets/icons/drawPoint.svg":JS,"/assets/icons/drawPolygon.svg":e_,"/assets/icons/drawTrash.svg":t_,"/assets/icons/fitWindow.svg":r_,"/assets/icons/fullScreen.svg":n_,"/assets/icons/help.svg":a_,"/assets/icons/magnifyingGlass.svg":i_,"/assets/icons/noun-filter.svg":o_,"/assets/icons/openMap.svg":s_,"/assets/icons/pause.svg":l_,"/assets/icons/permalink.svg":u_,"/assets/icons/play.svg":c_,"/assets/icons/resetZoom.svg":d_,"/assets/icons/singlepanel.svg":f_,"/assets/icons/tooltips.svg":h_,"/assets/icons/undock.svg":p_,"/assets/icons/zoomIn.svg":v_,"/assets/icons/zoomOut.svg":g_}),yH=Object.keys(gg).map(t=>{const e=m_(gg[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return y_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),bH={name:"MapSvgSpriteColor",svgContext:gg,svgSprite:yH.join(`
466
- `)},wH=["innerHTML"];function CH(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,wH)}const EH=MS(bH,[["render",CH]]),xH=(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`}},kH={name:"DrawToolbar",components:{MapSvgIcon:pH,MapSvgSpriteColor:EH},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");xH(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)}},SH={class:"toolbar-container"},_H={class:"toolbar-icons"};function TH(t,e,r,n,a,i){const o=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=Da,u=dH;return s.openBlock(),s.createElementBlock("div",SH,[s.createVNode(o),s.createElementVNode("div",_H,[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 NH=Yt(kH,[["render",TH],["__scopeId","data-v-21e6f6bd"]]),IH={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):""}}},mg=t=>(s.pushScopeId("data-v-3efb89fb"),t=t(),s.popScopeId(),t),BH=mg(()=>s.createElementVNode("h4",null,"Help Mode",-1)),DH=mg(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),PH=mg(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function OH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[BH,r.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[DH,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},[PH,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 AH=Yt(IH,[["render",OH],["__scopeId","data-v-3efb89fb"]]),RH={name:"RelatedConnectivitiesButton",props:{resource:{type:String,required:!0}}},LH={class:"reference-button-container"};function MH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",LH,[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 b_=Yt(RH,[["render",MH],["__scopeId","data-v-2f3dd1db"]]),FH="https://citation.doi.org",$H=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],yg="apa",VH=600,qH={name:"ExternalResourceCard",components:{CopyToClipboard:us,RelatedConnectivitiesButton:b_},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:$H,citationType:yg,crosscite_host:FH}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(yg)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(yg)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t)},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],m=o(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:m})}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 R9(VH)}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},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(`
464
+ </svg>`,y_=(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},b_=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(),gH=!0,mH=!0,yH=["fill"],vg=Object.assign({"/assets/icons/2horpanel.svg":$S,"/assets/icons/2vertpanel.svg":VS,"/assets/icons/3panel.svg":qS,"/assets/icons/4panel.svg":zS,"/assets/icons/5panel.svg":HS,"/assets/icons/6panel.svg":KS,"/assets/icons/6panelVertical.svg":GS,"/assets/icons/changeBckgd.svg":US,"/assets/icons/close-no-bk.svg":jS,"/assets/icons/close.svg":WS,"/assets/icons/closeFullScreen.svg":YS,"/assets/icons/comment.svg":ZS,"/assets/icons/connection.svg":XS,"/assets/icons/dock.svg":JS,"/assets/icons/drawLine.svg":QS,"/assets/icons/drawPoint.svg":e_,"/assets/icons/drawPolygon.svg":t_,"/assets/icons/drawTrash.svg":r_,"/assets/icons/fitWindow.svg":n_,"/assets/icons/fullScreen.svg":a_,"/assets/icons/help.svg":i_,"/assets/icons/magnifyingGlass.svg":o_,"/assets/icons/noun-filter.svg":s_,"/assets/icons/openMap.svg":l_,"/assets/icons/pause.svg":u_,"/assets/icons/permalink.svg":c_,"/assets/icons/play.svg":d_,"/assets/icons/resetZoom.svg":f_,"/assets/icons/singlepanel.svg":h_,"/assets/icons/tooltips.svg":p_,"/assets/icons/undock.svg":v_,"/assets/icons/zoomIn.svg":g_,"/assets/icons/zoomOut.svg":m_});Object.keys(vg).map(t=>{const e=y_(vg[t],gH,mH,yH),r=t.replace(/^.+\/(\w+).svg$/,"$1");return b_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
465
+ `);const gg=Object.assign({"/assets/icons/2horpanel.svg":$S,"/assets/icons/2vertpanel.svg":VS,"/assets/icons/3panel.svg":qS,"/assets/icons/4panel.svg":zS,"/assets/icons/5panel.svg":HS,"/assets/icons/6panel.svg":KS,"/assets/icons/6panelVertical.svg":GS,"/assets/icons/changeBckgd.svg":US,"/assets/icons/close-no-bk.svg":jS,"/assets/icons/close.svg":WS,"/assets/icons/closeFullScreen.svg":YS,"/assets/icons/comment.svg":ZS,"/assets/icons/connection.svg":XS,"/assets/icons/dock.svg":JS,"/assets/icons/drawLine.svg":QS,"/assets/icons/drawPoint.svg":e_,"/assets/icons/drawPolygon.svg":t_,"/assets/icons/drawTrash.svg":r_,"/assets/icons/fitWindow.svg":n_,"/assets/icons/fullScreen.svg":a_,"/assets/icons/help.svg":i_,"/assets/icons/magnifyingGlass.svg":o_,"/assets/icons/noun-filter.svg":s_,"/assets/icons/openMap.svg":l_,"/assets/icons/pause.svg":u_,"/assets/icons/permalink.svg":c_,"/assets/icons/play.svg":d_,"/assets/icons/resetZoom.svg":f_,"/assets/icons/singlepanel.svg":h_,"/assets/icons/tooltips.svg":p_,"/assets/icons/undock.svg":v_,"/assets/icons/zoomIn.svg":g_,"/assets/icons/zoomOut.svg":m_}),bH=Object.keys(gg).map(t=>{const e=y_(gg[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return b_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),wH={name:"MapSvgSpriteColor",svgContext:gg,svgSprite:bH.join(`
466
+ `)},CH=["innerHTML"];function EH(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,CH)}const xH=FS(wH,[["render",EH]]),kH=(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`}},SH={name:"DrawToolbar",components:{MapSvgIcon:vH,MapSvgSpriteColor:xH},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");kH(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)}},_H={class:"toolbar-container"},TH={class:"toolbar-icons"};function NH(t,e,r,n,a,i){const o=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=Pa,u=fH;return s.openBlock(),s.createElementBlock("div",_H,[s.createVNode(o),s.createElementVNode("div",TH,[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 IH=Yt(SH,[["render",NH],["__scopeId","data-v-21e6f6bd"]]),BH={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):""}}},mg=t=>(s.pushScopeId("data-v-3efb89fb"),t=t(),s.popScopeId(),t),DH=mg(()=>s.createElementVNode("h4",null,"Help Mode",-1)),PH=mg(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),OH=mg(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function AH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[DH,r.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[PH,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},[OH,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 RH=Yt(BH,[["render",AH],["__scopeId","data-v-3efb89fb"]]),LH={name:"RelatedConnectivitiesButton",props:{resource:{type:String,required:!0}}},MH={class:"reference-button-container"};function FH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",MH,[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 w_=Yt(LH,[["render",FH],["__scopeId","data-v-2f3dd1db"]]),$H="https://citation.doi.org",VH=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],yg="apa",qH=600,zH={name:"ExternalResourceCard",components:{CopyToClipboard:us,RelatedConnectivitiesButton:w_},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:VH,citationType:yg,crosscite_host:$H}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(yg)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(yg)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t)},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],m=o(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:m})}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 L9(qH)}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},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
467
  `)}</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)}}}},pa=t=>(s.pushScopeId("data-v-4ded3f61"),t=t(),s.popScopeId(),t),zH={class:"resource-container"},HH={class:"attribute-title-container"},KH=pa(()=>s.createElementVNode("div",{class:"attribute-title"},"References",-1)),GH={class:"copy-button"},UH={key:0,class:"citation-tabs"},jH={class:"citation-list"},WH=pa(()=>s.createElementVNode("span",null,"Internal Server Error",-1)),YH=pa(()=>s.createElementVNode("br",null,null,-1)),ZH=pa(()=>s.createElementVNode("br",null,null,-1)),XH=["href"],QH=pa(()=>s.createElementVNode("br",null,null,-1)),JH=pa(()=>s.createElementVNode("span",null,"Sorry, something went wrong.",-1)),eK=pa(()=>s.createElementVNode("br",null,null,-1)),tK=["onClick"],rK=["innerHTML"],nK=["innerHTML"],aK=["href"];function iK(t,e,r,n,a,i){const o=us,l=Ht,c=b_;return s.openBlock(),s.createElementBlock("div",zH,[s.createElementVNode("div",HH,[KH,s.createElementVNode("div",GH,[s.createVNode(o,{label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(s.openBlock(),s.createElementBlock("div",UH,[(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",jH,[(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},[WH,YH,s.createTextVNode(" Sorry, something went wrong."),ZH,s.createTextVNode(" The dataset citation generator ("),s.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},s.toDisplayString(t.crosscite_host),9,XH),s.createTextVNode(") encountered an internal error and was unable to complete your request."),QH,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},[JH,eK,s.createTextVNode(" Please try again. "),s.createElementVNode("span",{class:"reload-button",onClick:p=>i.reloadCitation(u)},"Reload",8,tK)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,rK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{content:u.citation[t.citationType]},null,8,["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,nK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{content:i.formatCopyReference(u)},null,8,["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,aK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{content:u.url},null,8,["content"])]))),128))])])}const bg=Yt(qH,[["render",iK],["__scopeId","data-v-4ded3f61"]]);function oK(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 w_=new oK,sK={name:"ProvenancePopup",components:{ElIconArrowUp:Te.ArrowUp,ElIconArrowDown:Te.ArrowDown,ElIconWarning:Te.Warning,ConnectivityList:hg,ExternalResourceCard:bg},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 A9(t)},capitalise:function(t){return LS(t)},onConnectivityActionClick:function(t){w_.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},lK=t=>(s.pushScopeId("data-v-63f443c8"),t=t(),s.popScopeId(),t),uK={key:0,class:"main"},cK={key:0,class:"toggle-button"},dK={key:1,class:"block"},fK={class:"title"},hK={key:0,class:"subtitle"},pK={key:2,class:"block"},vK={class:"title"},gK={key:3,class:"attribute-title-container"},mK=lK(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),yK={style:{"word-break":"keep-all"}},bK={class:"content-container scrollbar"};function wK(t,e,r,n,a,i){const o=Ht,l=Da,c=Te.Warning,u=ut,d=Te.ArrowUp,f=Te.ArrowDown,h=hg,v=bg,p=Bu;return i.entry?s.withDirectives((s.openBlock(),s.createElementBlock("div",uK,[r.tooltipEntry.length>1?(s.openBlock(),s.createElementBlock("div",cK,[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",dK,[s.createElementVNode("div",fK,s.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",hK,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",pK,[s.createElementVNode("div",vK,s.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(s.openBlock(),s.createElementBlock("div",gK,[mK,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",yK,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",bK,[(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 CK=Yt(sK,[["render",wK],["__scopeId","data-v-63f443c8"]]),EK={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){w_.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},xK={class:"tooltip-container",id:"tooltip-container"};function kK(t,e,r,n,a,i){const o=h0,l=CK;return s.openBlock(),s.createElementBlock("div",xK,[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 SK=Yt(EK,[["render",kK],["__scopeId","data-v-d1e37cc2"]]),_K={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)}},TK={class:"selections-container"},NK={class:"title-text"},IK={class:"tree-container",ref:"treeContainer"},BK={class:"tooltip-text"},DK=["onClick","onMouseover","onMouseenter"],PK=["onClick","onMouseover","onMouseenter"],OK={class:"lastChildInItem"},AK={key:0,class:"node-options"};function RK(t,e,r,n,a,i){const o=Ri,l=Di,c=as,u=Da,d=IR,f=PL,h=Bu;return s.openBlock(),s.createElementBlock("div",TK,[r.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(o,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",NK,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",IK,[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",BK,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,DK)):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",OK,[s.createElementVNode("span",null,s.toDisplayString(v.label),1),p.isTextureSlides?(s.openBlock(),s.createElementBlock("span",AK," (Texture) ")):s.createCommentVNode("",!0)])],42,PK)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!r.isReady]])],512)])}const LK=Yt(_K,[["render",RK],["__scopeId","data-v-e1dbd1e9"]]);async function MK(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 di(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]),MK(o,u)}async function FK(t,e,r){var o;const n=Array.isArray(r)?r:[r],a=n[0].startsWith("ilxtr:")?23:1,i=await di({flatmapAPI:t,knowledgeSource:e,queryId:a,parameters:[{column:"feature_id",value:n}]});if((o=i==null?void 0:i.results)!=null&&o.values){const l=i.results.values.map(c=>c[1]);return[...new Set(l)]}return[]}async function $K(t,e,r){var a;const n=await di({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 VK(t,e,r){var a;const n=await di({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 qK(t,e,r){var a;const n=await di({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[]}async function zK({flatmapAPI:t,knowledgeSource:e,origins:r,destinations:n,vias:a}){var u;const i={column:"source_node_id",value:r},o={column:"via_node_id",value:a},l={column:"dest_node_id",value:n};r.length||(i.negate=!0),a.length||(o.negate=!0),n.length||(l.negate=!0);const c=await di({flatmapAPI:t,knowledgeSource:e,queryId:24,parameters:[i,o,l]});if((u=c==null?void 0:c.results)!=null&&u.values){const d=c.results.values.map(f=>f[1]);return[...new Set(d)]}return[]}async function HK(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 C_(t,e){return e.length?await(await HK(t,`select entity, knowledge from knowledge
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)}}}},pa=t=>(s.pushScopeId("data-v-4ded3f61"),t=t(),s.popScopeId(),t),HH={class:"resource-container"},KH={class:"attribute-title-container"},GH=pa(()=>s.createElementVNode("div",{class:"attribute-title"},"References",-1)),UH={class:"copy-button"},jH={key:0,class:"citation-tabs"},WH={class:"citation-list"},YH=pa(()=>s.createElementVNode("span",null,"Internal Server Error",-1)),ZH=pa(()=>s.createElementVNode("br",null,null,-1)),XH=pa(()=>s.createElementVNode("br",null,null,-1)),JH=["href"],QH=pa(()=>s.createElementVNode("br",null,null,-1)),eK=pa(()=>s.createElementVNode("span",null,"Sorry, something went wrong.",-1)),tK=pa(()=>s.createElementVNode("br",null,null,-1)),rK=["onClick"],nK=["innerHTML"],aK=["innerHTML"],iK=["href"];function oK(t,e,r,n,a,i){const o=us,l=Ht,c=w_;return s.openBlock(),s.createElementBlock("div",HH,[s.createElementVNode("div",KH,[GH,s.createElementVNode("div",UH,[s.createVNode(o,{label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(s.openBlock(),s.createElementBlock("div",jH,[(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",WH,[(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},[YH,ZH,s.createTextVNode(" Sorry, something went wrong."),XH,s.createTextVNode(" The dataset citation generator ("),s.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},s.toDisplayString(t.crosscite_host),9,JH),s.createTextVNode(") encountered an internal error and was unable to complete your request."),QH,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},[eK,tK,s.createTextVNode(" Please try again. "),s.createElementVNode("span",{class:"reload-button",onClick:p=>i.reloadCitation(u)},"Reload",8,rK)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,nK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{content:u.citation[t.citationType]},null,8,["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,aK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{content:i.formatCopyReference(u)},null,8,["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,iK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{content:u.url},null,8,["content"])]))),128))])])}const bg=Yt(zH,[["render",oK],["__scopeId","data-v-4ded3f61"]]);function sK(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 C_=new sK,lK={name:"ProvenancePopup",components:{ElIconArrowUp:Te.ArrowUp,ElIconArrowDown:Te.ArrowDown,ElIconWarning:Te.Warning,ConnectivityList:hg,ExternalResourceCard:bg},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 R9(t)},capitalise:function(t){return MS(t)},onConnectivityActionClick:function(t){C_.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},uK=t=>(s.pushScopeId("data-v-63f443c8"),t=t(),s.popScopeId(),t),cK={key:0,class:"main"},dK={key:0,class:"toggle-button"},fK={key:1,class:"block"},hK={class:"title"},pK={key:0,class:"subtitle"},vK={key:2,class:"block"},gK={class:"title"},mK={key:3,class:"attribute-title-container"},yK=uK(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),bK={style:{"word-break":"keep-all"}},wK={class:"content-container scrollbar"};function CK(t,e,r,n,a,i){const o=Ht,l=Pa,c=Te.Warning,u=ut,d=Te.ArrowUp,f=Te.ArrowDown,h=hg,v=bg,p=Bu;return i.entry?s.withDirectives((s.openBlock(),s.createElementBlock("div",cK,[r.tooltipEntry.length>1?(s.openBlock(),s.createElementBlock("div",dK,[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",fK,[s.createElementVNode("div",hK,s.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",pK,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",vK,[s.createElementVNode("div",gK,s.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(s.openBlock(),s.createElementBlock("div",mK,[yK,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",bK,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",wK,[(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 EK=Yt(lK,[["render",CK],["__scopeId","data-v-63f443c8"]]),xK={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){C_.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},kK={class:"tooltip-container",id:"tooltip-container"};function SK(t,e,r,n,a,i){const o=p0,l=EK;return s.openBlock(),s.createElementBlock("div",kK,[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 _K=Yt(xK,[["render",SK],["__scopeId","data-v-d1e37cc2"]]),TK={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)}},NK={class:"selections-container"},IK={class:"title-text"},BK={class:"tree-container",ref:"treeContainer"},DK={class:"tooltip-text"},PK=["onClick","onMouseover","onMouseenter"],OK=["onClick","onMouseover","onMouseenter"],AK={class:"lastChildInItem"},RK={key:0,class:"node-options"};function LK(t,e,r,n,a,i){const o=Ri,l=Di,c=as,u=Pa,d=BR,f=OL,h=Bu;return s.openBlock(),s.createElementBlock("div",NK,[r.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(o,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",IK,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",BK,[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",DK,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,PK)):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",AK,[s.createElementVNode("span",null,s.toDisplayString(v.label),1),p.isTextureSlides?(s.openBlock(),s.createElementBlock("span",RK," (Texture) ")):s.createCommentVNode("",!0)])],42,OK)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!r.isReady]])],512)])}const MK=Yt(TK,[["render",LK],["__scopeId","data-v-e1dbd1e9"]]);async function FK(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 va(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]),FK(o,u)}async function $K(t,e,r){var o;const n=Array.isArray(r)?r:[r],a=n[0].startsWith("ilxtr:")?23:1,i=await va({flatmapAPI:t,knowledgeSource:e,queryId:a,parameters:[{column:"feature_id",value:n}]});if((o=i==null?void 0:i.results)!=null&&o.values){const l=i.results.values.map(c=>c[1]);return[...new Set(l)]}return[]}async function VK(t,e,r){var a;const n=await va({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 qK(t,e,r){var a;const n=await va({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 zK(t,e,r){var a;const n=await va({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 wg(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 HK({flatmapAPI:t,knowledgeSource:e,origins:r,destinations:n,vias:a}){var y,b,w,C;const i=wg(r),o=wg(n),l=wg(a),c=[{column:"source_feature_id",value:i,...i.length===0&&{negate:!0}},{column:"via_feature_id",value:l,...l.length===0&&{negate:!0}},{column:"dest_feature_id",value:o,...o.length===0&&{negate:!0}}],u=[{column:"source_node_id",value:r,...r.length===0&&{negate:!0}},{column:"via_node_id",value:a,...a.length===0&&{negate:!0}},{column:"dest_node_id",value:n,...n.length===0&&{negate:!0}}],d=c.some(E=>Array.isArray(E.value)&&E.value.length>0),f=[va({flatmapAPI:t,knowledgeSource:e,queryId:24,parameters:u})];d&&f.push(va({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=((b=(y=E==null?void 0:E.results)==null?void 0:y.values)==null?void 0:b.map(k=>k[1]))||[]}else p=h[0];const g=((C=(w=p==null?void 0:p.results)==null?void 0:w.values)==null?void 0:C.map(E=>E[1]))||[];return[...new Set([...v,...g])]}async function KK(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 E_(t,e){return e.length?await(await KK(t,`select entity, knowledge from knowledge
469
469
  where entity in (?${", ?".repeat(e.length-1)})
470
- order by source desc`,[...e])).values:[]}function KK(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 GK(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 UK(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 wg(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 Cg(t,e){const r=Array.from(new Map(e.map(c=>[JSON.stringify(c),c])).values()),n=r.flat(1/0),a=[...new Set(n)],o=(await C_(t,a)).map(c=>JSON.parse(c[1]));return r.map(c=>{const u=c.flat(),d=[];for(let f=0;f<u.length;f++){const h=o.find(v=>v.id===u[f]);h&&d.push(h.label)}return{key:c,label:d.join(", ")}})}async function jK(t,e){const r=[];return e.forEach(n=>{if(!Array.isArray(n.connectivity)||n.connectivity.length===0)return;const a=new Set(wg(n));Lr(n,"ilxtr:hasSomaLocatedIn").forEach(i=>{const o=JSON.stringify(i);a.has(o)&&r.push(i)})}),await Cg(t,r)}async function WK(t,e){const r=[];return e.forEach(n=>{if(!Array.isArray(n.connectivity)||n.connectivity.length===0)return;const a=new Set(wg(n));[...Lr(n,"ilxtr:hasAxonPresynapticElementIn"),...Lr(n,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(i=>{const o=JSON.stringify(i);a.has(o)&&r.push(i)})}),await Cg(t,r)}async function YK(t,e){const r=[];return e.forEach(n=>{if(!Array.isArray(n.connectivity)||n.connectivity.length===0)return;const a=new Set(wg(n));[...Lr(n,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(n,"ilxtr:hasAxonLocatedIn")].forEach(i=>{const o=JSON.stringify(i);a.has(o)&&r.push(i)})}),await Cg(t,r)}function E_(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 x_(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 k_(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 ZK({knowledge:t,origins:e,destinations:r,vias:n}){let a=t;return e.length&&(a=E_(a,e)),r.length&&(a=x_(a,r)),n.length&&(a=k_(a,n)),a}Ne.AnnotationPopup=h0,Ne.ConnectivityGraph=O9,Ne.ConnectivityList=hg,Ne.CopyToClipboard=us,Ne.CreateTooltipContent=cM,Ne.DrawToolbar=NH,Ne.ExternalResourceCard=bg,Ne.HelpModeDialog=AH,Ne.Tooltip=SK,Ne.TreeControls=LK,Ne.competencyQuery=di,Ne.extractDestinationItems=WK,Ne.extractOriginItems=jK,Ne.extractViaItems=YK,Ne.fetchLabels=C_,Ne.filterDestinations=GK,Ne.filterOrigins=KK,Ne.filterViaLocations=UK,Ne.findPathsByDestinationItem=x_,Ne.findPathsByOriginItem=E_,Ne.findPathsByViaItem=k_,Ne.queryAllConnectedPaths=FK,Ne.queryPathsByDestination=qK,Ne.queryPathsByOrigin=$K,Ne.queryPathsByRoute=zK,Ne.queryPathsByRouteFromKnowledge=ZK,Ne.queryPathsByViaLocation=VK,Object.defineProperty(Ne,Symbol.toStringTag,{value:"Module"})});
470
+ order by source desc`,[...e])).values:[]}function GK(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 UK(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 jK(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 Cg(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 Eg(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 E_(t,i)).reduce((f,h)=>{const v=h[0],p=JSON.parse(h[1]);return p.source===e&&f.push({id:v,label:p.label}),f},[]),c=[];return[...n.map(f=>{const h=f.flat(),v=[];for(let p=0;p<h.length;p++){const g=l.find(m=>m.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 WK(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Cg(a));Lr(a,"ilxtr:hasSomaLocatedIn").forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await Eg(t,e,n)}async function YK(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Cg(a));[...Lr(a,"ilxtr:hasAxonPresynapticElementIn"),...Lr(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await Eg(t,e,n)}async function ZK(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Cg(a));[...Lr(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(a,"ilxtr:hasAxonLocatedIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await Eg(t,e,n)}function x_(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 k_(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 S_(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 XK({knowledge:t,origins:e,destinations:r,vias:n}){let a=t;return e.length&&(a=x_(a,e)),r.length&&(a=k_(a,r)),n.length&&(a=S_(a,n)),a}Ne.AnnotationPopup=p0,Ne.ConnectivityGraph=A9,Ne.ConnectivityList=hg,Ne.CopyToClipboard=us,Ne.CreateTooltipContent=dM,Ne.DrawToolbar=IH,Ne.ExternalResourceCard=bg,Ne.HelpModeDialog=RH,Ne.Tooltip=_K,Ne.TreeControls=MK,Ne.competencyQuery=va,Ne.extractDestinationItems=YK,Ne.extractOriginItems=WK,Ne.extractViaItems=ZK,Ne.fetchLabels=E_,Ne.filterDestinations=UK,Ne.filterOrigins=GK,Ne.filterViaLocations=jK,Ne.findPathsByDestinationItem=k_,Ne.findPathsByOriginItem=x_,Ne.findPathsByViaItem=S_,Ne.queryAllConnectedPaths=$K,Ne.queryPathsByDestination=zK,Ne.queryPathsByOrigin=VK,Ne.queryPathsByRoute=HK,Ne.queryPathsByRouteFromKnowledge=XK,Ne.queryPathsByViaLocation=qK,Object.defineProperty(Ne,Symbol.toStringTag,{value:"Module"})});