PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/nx/src/core/graph

Просмотр файла: main.js

/*! For license information please see main.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[179],{94365:(e,t,n)=>{"use strict";var r=n(12139),o=n(995);n(15735),n(6886),n(73439),n(43105);function i(e){return e.split("-")[1]}function a(e){return"y"===e?"height":"width"}function s(e){return e.split("-")[0]}function l(e){return["top","bottom"].includes(s(e))?"x":"y"}function u(e,t,n){let{reference:r,floating:o}=e;const u=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,d=l(t),f=a(d),h=r[f]/2-o[f]/2,p="x"===d;let v;switch(s(t)){case"top":v={x:u,y:r.y-o.height};break;case"bottom":v={x:u,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:c};break;case"left":v={x:r.x-o.width,y:c};break;default:v={x:r.x,y:r.y}}switch(i(t)){case"start":v[d]-=h*(n&&p?-1:1);break;case"end":v[d]+=h*(n&&p?-1:1)}return v}const c=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=u(c,r,l),h=r,p={},v=0;for(let g=0;g<s.length;g++){const{name:n,fn:i}=s[g],{x:y,y:m,data:b,reset:x}=await i({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=y?y:d,f=null!=m?m:f,p={...p,[n]:{...p[n],...b}},x&&v<=50&&(v++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:d,y:f}=u(c,h,l))),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:p}};function d(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function f(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function h(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:p=!1,padding:v=0}=t,g=d(v),y=s[p?"floating"===h?"reference":"floating":h],m=f(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(y)))||n?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b="floating"===h?{...a.floating,x:r,y:o}:a.reference,x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),w=await(null==i.isElement?void 0:i.isElement(x))&&await(null==i.getScale?void 0:i.getScale(x))||{x:1,y:1},_=f(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:x,strategy:l}):b);return{top:(m.top-_.top+g.top)/w.y,bottom:(_.bottom-m.bottom+g.bottom)/w.y,left:(m.left-_.left+g.left)/w.x,right:(_.right-m.right+g.right)/w.x}}const p=Math.min,v=Math.max;function g(e,t,n){return v(e,p(t,n))}const y=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:s,placement:u,rects:c,platform:f}=t;if(null==n)return{};const h=d(r),p={x:o,y:s},v=l(u),y=a(v),m=await f.getDimensions(n),b="y"===v?"top":"left",x="y"===v?"bottom":"right",w=c.reference[y]+c.reference[v]-p[v]-c.floating[y],_=p[v]-c.reference[v],E=await(null==f.getOffsetParent?void 0:f.getOffsetParent(n));let k=E?"y"===v?E.clientHeight||0:E.clientWidth||0:0;0===k&&(k=c.floating[y]);const S=w/2-_/2,P=h[b],j=k-m[y]-h[x],C=k/2-m[y]/2+S,T=g(P,C,j),O=null!=i(u)&&C!=T&&c.reference[y]/2-(C<P?h[b]:h[x])-m[y]/2<0;return{[v]:p[v]-(O?C<P?P-C:j-C:0),data:{[v]:T,centerOffset:C-T}}}}),m=["top","right","bottom","left"],b=(m.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function x(e){return e.replace(/left|right|bottom|top/g,(e=>b[e]))}function w(e,t,n){void 0===n&&(n=!1);const r=i(e),o=l(e),s=a(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=x(u)),{main:u,cross:x(u)}}const _={start:"end",end:"start"};function E(e){return e.replace(/start|end/g,(e=>_[e]))}const k=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:a,initialPlacement:l,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...m}=e,b=s(r),_=s(l)===l,k=await(null==u.isRTL?void 0:u.isRTL(c.floating)),S=p||(_||!y?[x(l)]:function(e){const t=x(e);return[E(e),t,E(t)]}(l));p||"none"===g||S.push(...function(e,t,n,r){const o=i(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(s(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(E)))),a}(l,y,g,k));const P=[l,...S],j=await h(t,m),C=[];let T=(null==(n=o.flip)?void 0:n.overflows)||[];if(d&&C.push(j[b]),f){const{main:e,cross:t}=w(r,a,k);C.push(j[e],j[t])}if(T=[...T,{placement:r,overflows:C}],!C.every((e=>e<=0))){var O,D;const e=((null==(O=o.flip)?void 0:O.index)||0)+1,t=P[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n=null==(D=T.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:D.placement;if(!n)switch(v){case"bestFit":{var N;const e=null==(N=T.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}};const S=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=s(n),c=i(n),d="x"===l(n),f=["left","top"].includes(u)?-1:1,h=a&&d?-1:1,p="function"==typeof t?t(e):t;let{mainAxis:v,crossAxis:g,alignmentAxis:y}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return c&&"number"==typeof y&&(g="end"===c?-1*y:y),d?{x:g*h,y:v*f}:{x:v*f,y:g*h}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return"x"===e?"y":"x"}const j=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,d={x:n,y:r},f=await h(t,c),p=l(s(o)),v=P(p);let y=d[p],m=d[v];if(i){const e="y"===p?"bottom":"right";y=g(y+f["y"===p?"top":"left"],y,y-f[e])}if(a){const e="y"===v?"bottom":"right";m=g(m+f["y"===v?"top":"left"],m,m-f[e])}const b=u.fn({...t,[p]:y,[v]:m});return{...b,data:{x:b.x-n,y:b.y-r}}}}};function C(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function T(e){return C(e).getComputedStyle(e)}const O=Math.min,D=Math.max,N=Math.round;function A(e){const t=T(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,a=N(n)!==o||N(r)!==i;return a&&(n=o,r=i),{width:n,height:r,fallback:a}}function R(e){return F(e)?(e.nodeName||"").toLowerCase():""}let M;function I(){if(M)return M;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(M=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),M):navigator.userAgent}function L(e){return e instanceof C(e).HTMLElement}function B(e){return e instanceof C(e).Element}function F(e){return e instanceof C(e).Node}function V(e){return"undefined"!=typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}function G(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=T(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function H(e){return["table","td","th"].includes(R(e))}function W(e){const t=/firefox/i.test(I()),n=T(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function Y(){return/^((?!chrome|android).)*safari/i.test(I())}function q(e){return["html","body","#document"].includes(R(e))}function X(e){return B(e)?e:e.contextElement}const $={x:1,y:1};function K(e){const t=X(e);if(!L(t))return $;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=A(t);let a=(i?N(n.width):n.width)/r,s=(i?N(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function Z(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=X(e);let l=$;t&&(r?B(r)&&(l=K(r)):l=K(e));const u=s?C(s):window,c=Y()&&n;let d=(a.left+(c&&(null==(o=u.visualViewport)?void 0:o.offsetLeft)||0))/l.x,f=(a.top+(c&&(null==(i=u.visualViewport)?void 0:i.offsetTop)||0))/l.y,h=a.width/l.x,p=a.height/l.y;if(s){const e=C(s),t=r&&B(r)?C(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=K(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,h*=e.x,p*=e.y,d+=t.x,f+=t.y,n=C(n).frameElement}}return{width:h,height:p,top:f,right:d+h,bottom:f+p,left:d,x:d,y:f}}function Q(e){return((F(e)?e.ownerDocument:e.document)||window.document).documentElement}function J(e){return B(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ee(e){return Z(Q(e)).left+J(e).scrollLeft}function te(e){if("html"===R(e))return e;const t=e.assignedSlot||e.parentNode||V(e)&&e.host||Q(e);return V(t)?t.host:t}function ne(e){const t=te(e);return q(t)?t.ownerDocument.body:L(t)&&G(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=C(r);return o?t.concat(i,i.visualViewport||[],G(r)?r:[]):t.concat(r,re(r))}function oe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=C(e),r=Q(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Y();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Q(e),n=J(e),r=e.ownerDocument.body,o=D(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ee(e);const s=-n.scrollTop;return"rtl"===T(r).direction&&(a+=D(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Q(e));else if(B(t))r=function(e,t){const n=Z(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=L(e)?K(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n={...t};if(Y()){var o,i;const t=C(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(i=t.visualViewport)?void 0:i.offsetTop)||0}r=n}return f(r)}function ie(e,t){return L(e)&&"fixed"!==T(e).position?t?t(e):e.offsetParent:null}function ae(e,t){const n=C(e);let r=ie(e,t);for(;r&&H(r)&&"static"===T(r).position;)r=ie(r,t);return r&&("html"===R(r)||"body"===R(r)&&"static"===T(r).position&&!W(r))?n:r||function(e){let t=te(e);for(;L(t)&&!q(t);){if(W(t))return t;t=te(t)}return null}(e)||n}function se(e,t,n){const r=L(t),o=Q(t),i=Z(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==R(t)||G(o))&&(a=J(t)),L(t)){const e=Z(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ee(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}const le={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=re(e).filter((e=>B(e)&&"body"!==R(e))),o=null;const i="fixed"===T(e).position;let a=i?te(e):e;for(;B(a)&&!q(a);){const e=T(a),t=W(a);"fixed"===e.position?o=null:(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==a)),a=te(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=oe(t,n,o);return e.top=D(r.top,e.top),e.right=O(r.right,e.right),e.bottom=O(r.bottom,e.bottom),e.left=D(r.left,e.left),e}),oe(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=L(n),i=Q(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==R(n)||G(i))&&(a=J(n)),L(n))){const e=Z(n);s=K(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:B,getDimensions:function(e){return L(e)?A(e):e.getBoundingClientRect()},getOffsetParent:ae,getDocumentElement:Q,getScale:K,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ae,i=this.getDimensions;return{reference:se(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===T(e).direction};function ue(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,u=l||i?[...B(e)?re(e):e.contextElement?re(e.contextElement):[],...re(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));let c,d=null;if(a){let r=!0;d=new ResizeObserver((()=>{r||n(),r=!1})),B(e)&&!s&&d.observe(e),B(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t)}let f=s?Z(e):null;return s&&function t(){const r=Z(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n(),f=r,c=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(c)}}const ce=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){return r=t,Object.prototype.hasOwnProperty.call(r,"current")?null!=t.current?y({element:t.current,padding:n}).fn(e):{}:t?y({element:t,padding:n}).fn(e):{};var r}}};var de="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function fe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!fe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!fe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function he(e){const t=r.useRef(e);return de((()=>{t.current=e})),t}function pe(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,whileElementsMounted:a,open:s}=e,[l,u]=r.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=r.useState(o);fe(d,o)||f(o);const h=r.useRef(null),p=r.useRef(null),v=r.useRef(l),g=he(a),y=he(i),[m,b]=r.useState(null),[x,w]=r.useState(null),_=r.useCallback((e=>{h.current!==e&&(h.current=e,b(e))}),[]),E=r.useCallback((e=>{p.current!==e&&(p.current=e,w(e))}),[]),k=r.useCallback((()=>{if(!h.current||!p.current)return;const e={placement:t,strategy:n,middleware:d};y.current&&(e.platform=y.current),((e,t,n)=>{const r=new Map,o={platform:le,...n},i={...o.platform,_c:r};return c(e,t,{...o,platform:i})})(h.current,p.current,e).then((e=>{const t={...e,isPositioned:!0};S.current&&!fe(v.current,t)&&(v.current=t,r.flushSync((()=>{u(t)})))}))}),[d,t,n,y]);de((()=>{!1===s&&v.current.isPositioned&&(v.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[s]);const S=r.useRef(!1);de((()=>(S.current=!0,()=>{S.current=!1})),[]),de((()=>{if(m&&x){if(g.current)return g.current(m,x,k);k()}}),[m,x,k,g]);const P=r.useMemo((()=>({reference:h,floating:p,setReference:_,setFloating:E})),[_,E]),j=r.useMemo((()=>({reference:m,floating:x})),[m,x]);return r.useMemo((()=>({...l,update:k,refs:P,elements:j,reference:_,floating:E})),[l,k,P,j,_,E])}var ve="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;let ge=!1,ye=0;const me=()=>"floating-ui-"+ye++;const be=r["useId".toString()]||function(){const[e,t]=r.useState((()=>ge?me():void 0));return ve((()=>{null==e&&t(me())}),[]),r.useEffect((()=>{ge||(ge=!0)}),[]),e};function xe(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter((e=>e!==n)))}}}const we=r.createContext(null),_e=r.createContext(null),Ee=()=>{var e;return(null==(e=r.useContext(we))?void 0:e.id)||null},ke=()=>r.useContext(_e);function Se(e){return(null==e?void 0:e.ownerDocument)||document}function Pe(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function je(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Ce(e){return Se(e).defaultView||window}function Te(e){return!!e&&e instanceof Ce(e).Element}function Oe(e){return!!e&&e instanceof Ce(e).HTMLElement}function De(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Pe())||t.test(je()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function Ne(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function Ae(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Re(e){const t=(0,r.useRef)(e);return ve((()=>{t.current=e})),t}const Me="data-floating-ui-safe-polygon";function Ie(e,t,n){return n&&!Ae(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Le(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}))||[],r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))}))||[],n=n.concat(r);return n}function Be(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Fe(e){return Oe(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}const ze=r["useInsertionEffect".toString()]||(e=>e());function Ve(e){const t=r.useRef((()=>{0}));return ze((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function Ge(e){return Oe(e.target)&&"BUTTON"===e.target.tagName}function Ue(e){return Fe(e)}function He(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}const We={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ye={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function qe(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];null==(e=r.get(n))||e.forEach((e=>e(...o)))})):e[n]=o})),e):e),{})}}var Xe=n(33847),$e=0;function Ke(e,t,n,r,o){var i,a,s={};for(a in t)"ref"==a?i=t[a]:s[a]=t[a];var l={type:e,props:s,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--$e,__source:r,__self:o};if("function"==typeof e&&(i=e.defaultProps))for(a in i)void 0===s[a]&&(s[a]=i[a]);return Xe.YM.vnode&&Xe.YM.vnode(l),l}function Ze({children:e,open:t=!1,content:n,placement:o="top",reference:i,openAction:a="click",strategy:s="absolute"}){const[l,u]=(0,r.useState)(t),c=(0,r.useRef)(null),{x:d,y:f,refs:h,strategy:p,placement:v,middlewareData:{arrow:{x:g,y}={}},context:m}=function(e){void 0===e&&(e={});const{open:t=!1,onOpenChange:n,nodeId:o}=e,i=pe(e),a=ke(),s=r.useRef(null),l=r.useRef({}),u=r.useState((()=>xe()))[0],[c,d]=r.useState(null),f=r.useCallback((e=>{const t=Te(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;i.refs.setReference(t)}),[i.refs]),h=r.useCallback((e=>{(Te(e)||null===e)&&(s.current=e,d(e)),(Te(i.refs.reference.current)||null===i.refs.reference.current||null!==e&&!Te(e))&&i.refs.setReference(e)}),[i.refs]),p=r.useMemo((()=>({...i.refs,setReference:h,setPositionReference:f,domReference:s})),[i.refs,h,f]),v=r.useMemo((()=>({...i.elements,domReference:c})),[i.elements,c]),g=Ve(n),y=r.useMemo((()=>({...i,refs:p,elements:v,dataRef:l,nodeId:o,events:u,open:t,onOpenChange:g})),[i,o,u,t,g,p,v]);return ve((()=>{const e=null==a?void 0:a.nodesRef.current.find((e=>e.id===o));e&&(e.context=y)})),r.useMemo((()=>({...i,context:y,refs:p,reference:h,positionReference:f})),[i,p,y,h,f])}({placement:o,whileElementsMounted:"fixed"===s?ue:void 0,open:l,onOpenChange:u,strategy:s,middleware:[S(6),k(),j({padding:6}),ce({element:c})]}),b={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]]||"bottom";(0,r.useLayoutEffect)((()=>{i&&h.setReference(i)}),[h,i]);const x=function(e,t){let{open:n,onOpenChange:o,dataRef:i,elements:{domReference:a}}=e,{enabled:s=!0,event:l="click",toggle:u=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0}=void 0===t?{}:t;const f=r.useRef();return r.useMemo((()=>s?{reference:{onPointerDown(e){f.current=e.pointerType},onMouseDown(e){0===e.button&&(Ae(f.current,!0)&&c||"click"!==l&&(n?!u||i.current.openEvent&&"mousedown"!==i.current.openEvent.type||o(!1):(e.preventDefault(),o(!0)),i.current.openEvent=e.nativeEvent))},onClick(e){i.current.__syncReturnFocus||("mousedown"===l&&f.current?f.current=void 0:Ae(f.current,!0)&&c||(n?!u||i.current.openEvent&&"click"!==i.current.openEvent.type||o(!1):o(!0),i.current.openEvent=e.nativeEvent))},onKeyDown(e){f.current=void 0,d&&(Ge(e)||(" "!==e.key||Ue(a)||e.preventDefault(),"Enter"===e.key&&(n?u&&o(!1):o(!0))))},onKeyUp(e){d&&(Ge(e)||Ue(a)||" "===e.key&&(n?u&&o(!1):o(!0)))}}}:{}),[s,i,l,c,d,a,u,n,o])}(m,{enabled:"click"===a}),w=function(e,t){let{open:n,onOpenChange:o,events:i,nodeId:a,elements:{reference:s,domReference:l,floating:u},dataRef:c}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:v=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:m=!0}=void 0===t?{}:t;const b=ke(),x=null!=Ee(),w=Ve("function"==typeof h?h:()=>!1),_="function"==typeof h?w:h,E=r.useRef(!1),{escapeKeyBubbles:k,outsidePressBubbles:S}=function(e){var t,n;return void 0===e&&(e=!0),{escapeKeyBubbles:"boolean"==typeof e?e:null==(t=e.escapeKey)||t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=e.outsidePress)||n}}(m);return r.useEffect((()=>{if(!n||!d)return;function e(e){if("Escape"===e.key){const e=b?Le(b.nodesRef.current,a):[];if(e.length>0){let t=!0;if(e.forEach((e=>{var n;null==(n=e.context)||!n.open||e.context.dataRef.current.__escapeKeyBubbles||(t=!1)})),!t)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1)}}function t(e){const t=E.current;if(E.current=!1,t)return;if("function"==typeof _&&!_(e))return;const n=Be(e);if(Oe(n)&&u){const t=u.ownerDocument.defaultView||window,r=n.scrollWidth>n.clientWidth,o=n.scrollHeight>n.clientHeight;let i=o&&e.offsetX>n.clientWidth;if(o&&"rtl"===t.getComputedStyle(n).direction&&(i=e.offsetX<=n.offsetWidth-n.clientWidth),i||r&&e.offsetY>n.clientHeight)return}const r=b&&Le(b.nodesRef.current,a).some((t=>{var n;return He(e,null==(n=t.context)?void 0:n.elements.floating)}));if(He(e,u)||He(e,l)||r)return;const s=b?Le(b.nodesRef.current,a):[];if(s.length>0){let e=!0;if(s.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:De(e)||Ne(e)}}),o(!1)}function r(){o(!1)}c.current.__escapeKeyBubbles=k,c.current.__outsidePressBubbles=S;const h=Se(u);f&&h.addEventListener("keydown",e),_&&h.addEventListener(p,t);let v=[];return y&&(Te(l)&&(v=re(l)),Te(u)&&(v=v.concat(re(u))),!Te(s)&&s&&s.contextElement&&(v=v.concat(re(s.contextElement)))),v=v.filter((e=>{var t;return e!==(null==(t=h.defaultView)?void 0:t.visualViewport)})),v.forEach((e=>{e.addEventListener("scroll",r,{passive:!0})})),()=>{f&&h.removeEventListener("keydown",e),_&&h.removeEventListener(p,t),v.forEach((e=>{e.removeEventListener("scroll",r)}))}}),[c,u,l,s,f,_,p,i,b,a,n,o,y,d,k,S,x]),r.useEffect((()=>{E.current=!1}),[_,p]),r.useMemo((()=>d?{reference:{[We[g]]:()=>{v&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1))}},floating:{[Ye[p]]:()=>{E.current=!0}}}:{}),[d,i,v,p,g,o])}(m,{enabled:"click"===a,referencePress:!1,outsidePress:!0,outsidePressEvent:"mousedown"}),_=function(e,t){let{enabled:n=!0,delay:o=0,handleClose:i=null,mouseOnly:a=!1,restMs:s=0,move:l=!0}=void 0===t?{}:t;const{open:u,onOpenChange:c,dataRef:d,events:f,elements:{domReference:h,floating:p},refs:v}=e,g=ke(),y=Ee(),m=Re(i),b=Re(o),x=r.useRef(),w=r.useRef(),_=r.useRef(),E=r.useRef(),k=r.useRef(!0),S=r.useRef(!1),P=r.useRef((()=>{})),j=r.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);r.useEffect((()=>{if(n)return f.on("dismiss",e),()=>{f.off("dismiss",e)};function e(){clearTimeout(w.current),clearTimeout(E.current),k.current=!0}}),[n,f]),r.useEffect((()=>{if(!n||!m.current||!u)return;function e(){j()&&c(!1)}const t=Se(p).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[p,u,c,n,m,d,j]);const C=r.useCallback((function(e){void 0===e&&(e=!0);const t=Ie(b.current,"close",x.current);t&&!_.current?(clearTimeout(w.current),w.current=setTimeout((()=>c(!1)),t)):e&&(clearTimeout(w.current),c(!1))}),[b,c]),T=r.useCallback((()=>{P.current(),_.current=void 0}),[]),O=r.useCallback((()=>{if(S.current){const e=Se(v.floating.current).body;e.style.pointerEvents="",e.removeAttribute(Me),S.current=!1}}),[v]);return r.useEffect((()=>{if(n&&Te(h)){const e=h;return u&&e.addEventListener("mouseleave",i),null==p||p.addEventListener("mouseleave",i),l&&e.addEventListener("mousemove",r,{once:!0}),e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",o),()=>{u&&e.removeEventListener("mouseleave",i),null==p||p.removeEventListener("mouseleave",i),l&&e.removeEventListener("mousemove",r),e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",o)}}function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(w.current),k.current=!1,a&&!Ae(x.current)||s>0&&0===Ie(b.current,"open"))return;d.current.openEvent=e;const t=Ie(b.current,"open",x.current);t?w.current=setTimeout((()=>{c(!0)}),t):c(!0)}function o(n){if(t())return;P.current();const r=Se(p);if(clearTimeout(E.current),m.current){u||clearTimeout(w.current),_.current=m.current({...e,tree:g,x:n.clientX,y:n.clientY,onClose(){O(),T(),C()}});const t=_.current;return r.addEventListener("mousemove",t),void(P.current=()=>{r.removeEventListener("mousemove",t)})}C()}function i(n){t()||null==m.current||m.current({...e,tree:g,x:n.clientX,y:n.clientY,onClose(){O(),T(),C()}})(n)}}),[h,p,n,e,a,s,l,C,T,O,c,u,g,b,m,d]),ve((()=>{var e;if(n&&u&&null!=(e=m.current)&&e.__options.blockPointerEvents&&j()){const e=Se(p).body;if(e.setAttribute(Me,""),e.style.pointerEvents="none",S.current=!0,Te(h)&&p){var t,r;const e=h,n=null==g||null==(t=g.nodesRef.current.find((e=>e.id===y)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",p.style.pointerEvents="auto",()=>{e.style.pointerEvents="",p.style.pointerEvents=""}}}}),[n,u,y,p,h,g,m,d,j]),ve((()=>{u||(x.current=void 0,T(),O())}),[u,T,O]),r.useEffect((()=>()=>{T(),clearTimeout(w.current),clearTimeout(E.current),O()}),[n,T,O]),r.useMemo((()=>{if(!n)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(){u||0===s||(clearTimeout(E.current),E.current=setTimeout((()=>{k.current||c(!0)}),s))}},floating:{onMouseEnter(){clearTimeout(w.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),C(!1)}}}}),[f,n,s,u,c,C])}(m,{enabled:"hover"===a}),E=function(e,t){let{open:n}=e,{enabled:o=!0,role:i="dialog"}=void 0===t?{}:t;const a=be(),s=be();return r.useMemo((()=>{const e={id:a,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?a:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?a:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:s}},floating:{...e,..."menu"===i&&{"aria-labelledby":s}}}:{}}),[o,i,n,a,s])}(m,{role:"tooltip"}),{getReferenceProps:P,getFloatingProps:C}=function(e){void 0===e&&(e=[]);const t=e,n=r.useCallback((t=>qe(t,e,"reference")),t),o=r.useCallback((t=>qe(t,e,"floating")),t),i=r.useCallback((t=>qe(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return r.useMemo((()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i})),[n,o,i])}([x,_,w,E]),T=Object.assign({ref:h.setReference},P());return Ke(Xe.HY,{children:[!i&&e?(0,r.cloneElement)(e,T):e,l?Ke("div",Object.assign({ref:h.setFloating,style:{position:p,top:null!=f?f:0,left:null!=d?d:0,width:"max-content"},className:"z-10 min-w-[250px] rounded-md border border-slate-500"},C(),{children:[Ke("div",{style:{left:null!=g?`${g}px`:"",top:null!=y?`${y}px`:"",right:"",bottom:"",[b]:"-4px"},className:"absolute -z-10 h-4 w-4 rotate-45 bg-slate-500",ref:c}),Ke("div",{className:"select-text rounded-md bg-white p-3 dark:bg-slate-900 dark:text-slate-400",children:n})]})):null]})}n(634);const Qe=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"}))}));const Je=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75L14.25 12m0 0l2.25 2.25M14.25 12l2.25-2.25M14.25 12L12 14.25m-2.58 4.92l-6.375-6.375a1.125 1.125 0 010-1.59L9.42 4.83c.211-.211.498-.33.796-.33H19.5a2.25 2.25 0 012.25 2.25v10.5a2.25 2.25 0 01-2.25 2.25h-9.284c-.298 0-.585-.119-.796-.33z"}))}));function et({initialText:e,placeholderText:t,resetTextFilter:n,updateTextFilter:o}){const[i,a]=(0,r.useState)(null!=e?e:""),[s,l]=function(e,t){const[n,o]=(0,r.useState)(e);return(0,r.useEffect)((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),[n,o]}(i,500);function u(e){""===e?(a(""),l(""),n()):a(e)}return(0,r.useEffect)((()=>{""!==s&&o(s)}),[s,o]),Ke("form",{className:"group relative flex rounded-md shadow-sm",onSubmit:e=>e.preventDefault(),children:[Ke("span",{className:"inline-flex items-center rounded-l-md border border-r-0 border-slate-300 bg-slate-50 p-2 dark:border-slate-900 dark:bg-slate-800",children:Ke(Qe,{className:"h-4 w-4"})}),Ke("input",{type:"text",className:"block w-full flex-1 rounded-none rounded-r-md border border-slate-300 bg-white p-1.5 font-light text-slate-400 placeholder:font-light placeholder:text-slate-400 dark:border-slate-900 dark:bg-slate-800 dark:text-white dark:hover:bg-slate-700",placeholder:t,"data-cy":"textFilterInput",name:"filter",value:i,onKeyUp:function(e){"Enter"===e.key&&u(e.currentTarget.value)},onChange:e=>u(e.currentTarget.value)}),i.length>0?Ke("button",{"data-cy":"textFilterReset",type:"reset",onClick:function(){a(""),l(""),n()},className:"absolute top-1 right-1 inline-block rounded-md bg-slate-50 p-1 text-slate-400 dark:bg-slate-800",children:Ke(Je,{className:"h-5 w-5"})}):null]})}function tt(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}const nt=["className","children"];function rt(e){let{className:t,children:n}=e,r=tt(e,nt);return Ke("span",Object.assign({className:`${t} inline-block rounded-md bg-slate-300 p-2 font-sans text-xs font-semibold uppercase leading-4 tracking-wide text-slate-700`},r,{children:n}))}const ot=["className","children"];function it(e){const{className:t,children:n}=e,r=tt(e,ot);return Ke("select",Object.assign({className:`flex items-center rounded-md rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700 ${t}`},r,{children:n}))}function at({type:e,source:t,target:n,fileDependencies:r,description:o}){return Ke("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[Ke("h4",{className:"implicit"!==e?"mb-3":"",children:[Ke(rt,{className:"mr-3",children:null!=e?e:"unknown"}),Ke("span",{className:"font-mono",children:[t," \u2192 ",n]})]}),o?Ke("p",{children:o}):null,"implicit"!==e&&(null==r?void 0:r.length)>0?Ke("div",{className:"overflow-hidden rounded-md border border-slate-200 dark:border-slate-800",children:[Ke("div",{className:"bg-slate-50 px-4 py-2 text-xs font-medium uppercase text-slate-500 dark:bg-slate-800 dark:text-slate-400",children:Ke("span",{children:"Files"})}),Ke("ul",{className:"max-h-[300px] divide-y divide-slate-200 overflow-auto dark:divide-slate-800",children:r.map((e=>Ke("li",{className:"whitespace-nowrap px-4 py-2 text-sm font-medium text-slate-800 dark:text-slate-300",children:Ke("span",{className:"block truncate font-normal",children:e.fileName})},e.fileName)))})]}):null]})}function st({type:e,id:t,tags:n,children:r,description:o}){return Ke("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[Ke("h4",{children:[Ke(rt,{className:"mr-3",children:e}),Ke("span",{className:"font-mono",children:t})]}),n.length>0?Ke("p",{className:"my-2",children:[Ke("strong",{children:"tags"}),Ke("br",{}),n.join(", ")]}):null,o?Ke("p",{className:"mt-4",children:o}):null,r]})}function lt({id:e,executor:t,description:n}){return Ke("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[Ke("h4",{children:[Ke(rt,{className:"mr-3",children:t}),Ke("span",{className:"font-mono",children:e})]}),n?Ke("p",{className:"mt-4",children:n}):null]})}var ut=n(32175);const ct=["className","children"],dt=["to","className","children"],ft="inline-flex justify-center rounded-md border border-slate-300 bg-slate-50 py-2 px-4 mt-2 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700";function ht(e){let{className:t,children:n}=e,r=tt(e,ct);return Ke("button",Object.assign({className:`${ft} ${t}`},r,{children:n}))}function pt(e){let{to:t,className:n,children:r}=e,o=tt(e,dt);return Ke(ut.Link,Object.assign({className:`${ft} ${n}`,to:t},o,{children:r}))}class tooltip_service_GraphTooltipService{constructor(e){this.subscribers=new Set,this.currentTooltip=void 0,e.listen((e=>{switch(e.type){case"GraphRegenerated":case"BackgroundClick":this.hideAll();break;case"ProjectNodeClick":this.openProjectNodeToolTip(e.ref,{id:e.data.id,tags:e.data.tags,type:e.data.type,description:e.data.description});break;case"TaskNodeClick":this.openTaskNodeTooltip(e.ref,Object.assign({},e.data));break;case"EdgeClick":this.openEdgeToolTip(e.ref,{type:e.data.type,target:e.data.target,source:e.data.source,fileDependencies:e.data.fileDependencies})}}))}openProjectNodeToolTip(e,t){this.currentTooltip={type:"projectNode",ref:e,props:t},this.broadcastChange()}openTaskNodeTooltip(e,t){this.currentTooltip={type:"taskNode",ref:e,props:t},this.broadcastChange()}openEdgeToolTip(e,t){this.currentTooltip={type:"projectEdge",ref:e,props:t},this.broadcastChange()}broadcastChange(){this.subscribers.forEach((e=>e(this.currentTooltip)))}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}hideAll(){this.currentTooltip=null,this.broadcastChange()}}var vt=n(19798);let gt;function yt(){if(!gt){kt(!0,!1);gt=new vt.GraphService("cytoscape-graph",kt("dark","light"))}return gt}const mt=document.documentElement,bt="nx-dep-graph-theme";let xt;function wt(e){const t=e.matches?"dark":"light";_t(t),xt=t}function _t(e){"dark"===e?(mt.classList.add("dark"),mt.classList.remove("light")):(mt.classList.add("light"),mt.classList.remove("dark"))}function Et(e){if(!("matchMedia"in window))return;const t=window.matchMedia("(prefers-color-scheme: dark)");if("system"!==e)t.removeEventListener("change",wt),_t(e),xt=e;else{const e=t.matches?"dark":"light";t.addEventListener("change",wt),_t(e),xt=e}localStorage.setItem(bt,e),yt().theme=xt}function kt(e,t){return"dark"===xt?e:t}const St="nx-dep-graph-rankdir";let Pt;function jt(e){Pt=e,localStorage.setItem(St,e),yt().rankDir=Pt}const Ct=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}))}));const Tt=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 9l-3 3m0 0l3 3m-3-3h7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Ot=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"}))}));var Dt=n(72779),Nt=n.n(Dt);const At=(0,r.memo)((function({projects:e,selectedProject:t,selectedProjectChange:n,lastPerfReport:r}){return Ke("div",{"data-cy":"debugger-panel",className:"flex-column flex w-auto items-center items-center justify-items-center justify-items-center gap-4 border-b border-slate-900/10 bg-slate-50 p-4 transition-all dark:border-slate-300/10 dark:bg-transparent",children:[Ke("h4",{className:"dark:text-sidebar-title-dark mr-4 text-lg font-normal",children:"Debugger"}),Ke(it,{"data-cy":"project-select",defaultValue:t,onChange:e=>n(e.currentTarget.value),children:e.map((e=>Ke("option",{value:e.id,children:e.label},e.id)))}),Ke("p",{className:"text-sm",children:["Last render took ",r.renderTime,"ms:"," ",Ke("b",{className:"text-medium font-mono",children:[r.numNodes," nodes"]})," ","|"," ",Ke("b",{className:"text-medium font-mono",children:[r.numEdges," edges"]}),"."]})]})}));function Rt(){return(0,r.useRef)(Mt()).current}function Mt(){return{exclude:window.exclude,watch:window.watch,localMode:window.localMode,projectGraphResponse:window.projectGraphResponse,environment:window.environment,appConfig:Object.assign({},window.appConfig,{showExperimentalFeatures:"true"===localStorage.getItem("showExperimentalFeatures")||window.appConfig.showExperimentalFeatures}),useXstateInspect:window.useXstateInspect}}function It(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,It),r}var Lt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Lt||{}),Bt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Bt||{});function Ft({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a}){let s=Vt(t,e);if(i)return zt(s,n,r,a);let l=null!=o?o:0;if(2&l){let{static:e=!1,...t}=s;if(e)return zt(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return It(e?0:1,{0:()=>null,1:()=>zt({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return zt(s,n,r,a)}function zt(e,t={},n,o){let{as:i=n,children:a,refName:s="ref",...l}=Ht(e,["unmount","static"]),u=void 0!==e.ref?{[s]:e.ref}:{},c="function"==typeof a?a(t):a;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(i===r.Fragment&&Object.keys(Ut(l)).length>0){if(!(0,r.isValidElement)(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${o} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map((e=>`  - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>`  - ${e}`)).join("\n")].join("\n"));return(0,r.cloneElement)(c,Object.assign({},Vt(c.props,Ut(Ht(l,["ref"]))),d,u,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(c.ref,u.ref)))}return(0,r.createElement)(i,Object.assign({},Ht(l,["ref"]),i!==r.Fragment&&u,i!==r.Fragment&&d),c)}function Vt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let r in n)Object.assign(t,{[r](e,...t){let o=n[r];for(let n of o){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;n(e,...t)}}});return t}function Gt(e){var t;return Object.assign((0,r.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Ut(e){let t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}function Ht(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Wt(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add((()=>e.removeEventListener(t,r,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function Yt(){let[e]=(0,r.useState)(Wt);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}const qt="undefined"==typeof window||"undefined"==typeof document;let Xt=qt?r.useEffect:r.useLayoutEffect;function $t(e){let t=(0,r.useRef)(e);return Xt((()=>{t.current=e}),[e]),t}let Kt=function(e){let t=$t(e);return r.default.useCallback(((...e)=>t.current(...e)),[t])},Zt=Symbol();function Qt(...e){let t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);let n=Kt((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[Zt])))?void 0:n}let Jt={serverHandoffComplete:!1};function en(){let[e,t]=(0,r.useState)(Jt.serverHandoffComplete);return(0,r.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,r.useEffect)((()=>{!1===Jt.serverHandoffComplete&&(Jt.serverHandoffComplete=!0)}),[]),e}var tn;let nn=0;function rn(){return++nn}let on=null!=(tn=r.default.useId)?tn:function(){let e=en(),[t,n]=r.default.useState(e?rn:null);return Xt((()=>{null===t&&n(rn())}),[t]),null!=t?""+t:void 0};var an=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(an||{});var sn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(sn||{});function ln(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1,i=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=o)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===i?r:i}function un(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function cn(e){return qt?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let dn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var fn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(fn||{}),hn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(hn||{}),pn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(pn||{});function vn(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(dn))}var gn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(gn||{});function yn(e,t=0){var n;return e!==(null==(n=cn(e))?void 0:n.body)&&It(t,{0:()=>e.matches(dn),1(){let t=e;for(;null!==t;){if(t.matches(dn))return!0;t=t.parentElement}return!1}})}function mn(e){let t=cn(e);Wt().nextFrame((()=>{t&&!yn(t.activeElement,0)&&function(e){null==e||e.focus({preventScroll:!0})}(e)}))}let bn=["textarea","input"].join(",");function xn(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function wn(e,t){return function(e,t,n=!0,r=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?xn(e):e:vn(e);r=null!=r?r:o.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,i.indexOf(r))-1;if(4&t)return Math.max(0,i.indexOf(r))+1;if(8&t)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},c=0,d=i.length;do{if(c>=d||c+d<=0)return 0;let e=l+c;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=i[e],null==a||a.focus(u),c+=s}while(a!==o.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,bn))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}(vn(),t,!0,e)}function _n(e,t,n){let o=$t(t);(0,r.useEffect)((()=>{function t(e){o.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}let En=(0,r.createContext)(null);En.displayName="OpenClosedContext";var kn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kn||{});function Sn(){return(0,r.useContext)(En)}function Pn({value:e,children:t}){return r.default.createElement(En.Provider,{value:e},t)}function jn(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Cn(e,t){let[n,o]=(0,r.useState)((()=>jn(e)));return Xt((()=>{o(jn(e))}),[e.type,e.as]),Xt((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&o("button")}),[n,t]),n}var Tn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Tn||{}),On=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(On||{}),Dn=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Dn||{});function Nn(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=xn(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),o=n?r.indexOf(n):null;return-1===o&&(o=null),{items:r,activeItemIndex:o}}let An={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Nn(e),o=ln(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),i=o?e.items.indexOf(o):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Nn(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Nn(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Rn=(0,r.createContext)(null);function Mn(e){let t=(0,r.useContext)(Rn);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Mn),t}return t}function In(e,t){return It(t.type,An,e,t)}Rn.displayName="MenuContext";let Ln=r.Fragment,Bn=Gt((function(e,t){let n=(0,r.useReducer)(In,{menuState:1,buttonRef:(0,r.createRef)(),itemsRef:(0,r.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:i,buttonRef:a},s]=n,l=Qt(t);!function(e,t,n=!0){let o=(0,r.useRef)(!1);function i(n,r){if(!o.current||n.defaultPrevented)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=r(n);if(null!==a&&a.ownerDocument.documentElement.contains(a)){for(let e of i){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!yn(a,gn.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,r.useEffect)((()=>{requestAnimationFrame((()=>{o.current=n}))}),[n]);let a=(0,r.useRef)(null);_n("mousedown",(e=>{var t,n;o.current&&(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),_n("click",(e=>{!a.current||(i(e,(()=>a.current)),a.current=null)}),!0),_n("blur",(e=>i(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}([a,i],((e,t)=>{var n;s({type:1}),yn(t,gn.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===o);let u=(0,r.useMemo)((()=>({open:0===o})),[o]),c=e,d={ref:l};return r.default.createElement(Rn.Provider,{value:n},r.default.createElement(Pn,{value:It(o,{0:kn.Open,1:kn.Closed})},Ft({ourProps:d,theirProps:c,slot:u,defaultTag:Ln,name:"Menu"})))})),Fn=Gt((function(e,t){var n;let[o,i]=Mn("Menu.Button"),a=Qt(o.buttonRef,t),s=`headlessui-menu-button-${on()}`,l=Yt(),u=Kt((e=>{switch(e.key){case an.Space:case an.Enter:case an.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),l.nextFrame((()=>i({type:2,focus:sn.First})));break;case an.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),l.nextFrame((()=>i({type:2,focus:sn.Last})))}})),c=Kt((e=>{if(e.key===an.Space)e.preventDefault()})),d=Kt((t=>{if(un(t.currentTarget))return t.preventDefault();e.disabled||(0===o.menuState?(i({type:1}),l.nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),f=(0,r.useMemo)((()=>({open:0===o.menuState})),[o]),h=e;return Ft({ourProps:{ref:a,id:s,type:Cn(e,o.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=o.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===o.menuState,onKeyDown:u,onKeyUp:c,onClick:d},theirProps:h,slot:f,defaultTag:"button",name:"Menu.Button"})})),zn=Lt.RenderStrategy|Lt.Static,Vn=Gt((function(e,t){var n,o;let[i,a]=Mn("Menu.Items"),s=Qt(i.itemsRef,t),l=function(...e){return(0,r.useMemo)((()=>cn(...e)),[...e])}(i.itemsRef),u=`headlessui-menu-items-${on()}`,c=Yt(),d=Sn(),f=null!==d?d===kn.Open:0===i.menuState;(0,r.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==l?void 0:l.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,l]),function({container:e,accept:t,walk:n,enabled:o=!0}){let i=(0,r.useRef)(t),a=(0,r.useRef)(n);(0,r.useEffect)((()=>{i.current=t,a.current=n}),[t,n]),Xt((()=>{if(!e||!o)return;let t=cn(e);if(!t)return;let n=i.current,r=a.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)r(l.currentNode)}),[e,o,i,a])}({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=Kt((e=>{var t,n;switch(c.dispose(),e.key){case an.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),a({type:3,value:e.key});case an.Enter:if(e.preventDefault(),e.stopPropagation(),a({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}mn(i.buttonRef.current);break;case an.ArrowDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:sn.Next});case an.ArrowUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:sn.Previous});case an.Home:case an.PageUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:sn.First});case an.End:case an.PageDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:sn.Last});case an.Escape:e.preventDefault(),e.stopPropagation(),a({type:1}),Wt().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case an.Tab:e.preventDefault(),e.stopPropagation(),a({type:1}),Wt().nextFrame((()=>{wn(i.buttonRef.current,e.shiftKey?fn.Previous:fn.Next)}));break;default:1===e.key.length&&(a({type:3,value:e.key}),c.setTimeout((()=>a({type:4})),350))}})),p=Kt((e=>{if(e.key===an.Space)e.preventDefault()})),v=(0,r.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return Ft({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(o=i.buttonRef.current)?void 0:o.id,id:u,onKeyDown:h,onKeyUp:p,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:v,defaultTag:"div",features:zn,visible:f,name:"Menu.Items"})})),Gn=r.Fragment,Un=Gt((function(e,t){let{disabled:n=!1,...o}=e,[i,a]=Mn("Menu.Item"),s=`headlessui-menu-item-${on()}`,l=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===s,u=(0,r.useRef)(null),c=Qt(t,u);Xt((()=>{if(0!==i.menuState||!l||0===i.activationTrigger)return;let e=Wt();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=u.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[u,l,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,r.useRef)({disabled:n,domRef:u});Xt((()=>{d.current.disabled=n}),[d,n]),Xt((()=>{var e,t;d.current.textValue=null==(t=null==(e=u.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,u]),Xt((()=>(a({type:5,id:s,dataRef:d}),()=>a({type:6,id:s}))),[d,s]);let f=Kt((e=>{if(n)return e.preventDefault();a({type:1}),mn(i.buttonRef.current)})),h=Kt((()=>{if(n)return a({type:2,focus:sn.Nothing});a({type:2,focus:sn.Specific,id:s})})),p=Kt((()=>{n||l||a({type:2,focus:sn.Specific,id:s,trigger:0})})),v=Kt((()=>{n||!l||a({type:2,focus:sn.Nothing})})),g=(0,r.useMemo)((()=>({active:l,disabled:n})),[l,n]);return Ft({ourProps:{id:s,ref:c,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:f,onFocus:h,onPointerMove:p,onMouseMove:p,onPointerLeave:v,onMouseLeave:v},theirProps:o,slot:g,defaultTag:Gn,name:"Menu.Item"})})),Hn=Object.assign(Bn,{Button:Fn,Items:Vn,Item:Un});function Wn(){let e=(0,r.useRef)(!1);return Xt((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function Yn(e,...t){e&&t.length>0&&e.classList.add(...t)}function qn(e,...t){e&&t.length>0&&e.classList.remove(...t)}var Xn=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(Xn||{});function $n(e,t,n,r){let o=n?"enter":"leave",i=Wt(),a=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===o&&(e.removeAttribute("hidden"),e.style.display="");let s=It(o,{enter:()=>t.enter,leave:()=>t.leave}),l=It(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=It(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return qn(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Yn(e,...s,...u),i.nextFrame((()=>{qn(e,...u),Yn(e,...l),function(e,t){let n=Wt();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,a]=[r,o].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(i+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(o=>{o.target===o.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(qn(e,...s),Yn(e,...t.entered)),a(n))))})),i.dispose}function Kn(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let Zn=(0,r.createContext)(null);Zn.displayName="TransitionContext";var Qn=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Qn||{});let Jn=(0,r.createContext)(null);function er(e){return"children"in e?er(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function tr(e,t){let n=$t(e),o=(0,r.useRef)([]),i=Wn(),a=Yt(),s=Kt(((e,t=Bt.Hidden)=>{let r=o.current.findIndex((({el:t})=>t===e));-1!==r&&(It(t,{[Bt.Unmount](){o.current.splice(r,1)},[Bt.Hidden](){o.current[r].state="hidden"}}),a.microTask((()=>{var e;!er(o)&&i.current&&(null==(e=n.current)||e.call(n))})))})),l=Kt((e=>{let t=o.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):o.current.push({el:e,state:"visible"}),()=>s(e,Bt.Unmount)})),u=(0,r.useRef)([]),c=(0,r.useRef)(Promise.resolve()),d=(0,r.useRef)({enter:[],leave:[],idle:[]}),f=Kt(((e,n,r)=>{u.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{u.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?c.current=c.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),h=Kt(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=u.current.shift())||e()})).then((()=>n(t)))}));return(0,r.useMemo)((()=>({children:o,register:l,unregister:s,onStart:f,onStop:h,wait:c,chains:d})),[l,s,o,f,h,d,c])}function nr(){}Jn.displayName="NestingContext";let rr=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function or(e){var t;let n={};for(let r of rr)n[r]=null!=(t=e[r])?t:nr;return n}let ir=Lt.RenderStrategy,ar=Gt((function(e,t){let{beforeEnter:n,afterEnter:o,beforeLeave:i,afterLeave:a,enter:s,enterFrom:l,enterTo:u,entered:c,leave:d,leaveFrom:f,leaveTo:h,...p}=e,v=(0,r.useRef)(null),g=Qt(v,t),y=p.unmount?Bt.Unmount:Bt.Hidden,{show:m,appear:b,initial:x}=function(){let e=(0,r.useContext)(Zn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,_]=(0,r.useState)(m?"visible":"hidden"),E=function(){let e=(0,r.useContext)(Jn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:k,unregister:S}=E,P=(0,r.useRef)(null);(0,r.useEffect)((()=>k(v)),[k,v]),(0,r.useEffect)((()=>{if(y===Bt.Hidden&&v.current)return m&&"visible"!==w?void _("visible"):It(w,{hidden:()=>S(v),visible:()=>k(v)})}),[w,v,k,S,m,y]);let j=$t({enter:Kn(s),enterFrom:Kn(l),enterTo:Kn(u),entered:Kn(c),leave:Kn(d),leaveFrom:Kn(f),leaveTo:Kn(h)}),C=function(e){let t=(0,r.useRef)(or(e));return(0,r.useEffect)((()=>{t.current=or(e)}),[e]),t}({beforeEnter:n,afterEnter:o,beforeLeave:i,afterLeave:a}),T=en();(0,r.useEffect)((()=>{if(T&&"visible"===w&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,w,T]);let O=x&&!b,D=!T||O||P.current===m?"idle":m?"enter":"leave",N=Kt((e=>It(e,{enter:()=>C.current.beforeEnter(),leave:()=>C.current.beforeLeave(),idle:()=>{}}))),A=Kt((e=>It(e,{enter:()=>C.current.afterEnter(),leave:()=>C.current.afterLeave(),idle:()=>{}}))),R=tr((()=>{_("hidden"),S(v)}),E);(function({container:e,direction:t,classes:n,onStart:r,onStop:o}){let i=Wn(),a=Yt(),s=$t(t);Xt((()=>{let t=Wt();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&i.current)return t.dispose(),r.current(s.current),t.add($n(l,n.current,"enter"===s.current,(e=>{t.dispose(),It(e,{[Xn.Ended](){o.current(s.current)},[Xn.Cancelled]:()=>{}})}))),t.dispose}),[t])})({container:v,classes:j,direction:D,onStart:$t((e=>{R.onStart(v,e,N)})),onStop:$t((e=>{R.onStop(v,e,A),"leave"===e&&!er(R)&&(_("hidden"),S(v))}))}),(0,r.useEffect)((()=>{!O||(y===Bt.Hidden?P.current=null:P.current=m)}),[m,O,w]);let M=p,I={ref:g};return r.default.createElement(Jn.Provider,{value:R},r.default.createElement(Pn,{value:It(w,{visible:kn.Open,hidden:kn.Closed})},Ft({ourProps:I,theirProps:M,defaultTag:"div",features:ir,visible:"visible"===w,name:"Transition.Child"})))})),sr=Gt((function(e,t){let{show:n,appear:o=!1,unmount:i,...a}=e,s=(0,r.useRef)(null),l=Qt(s,t);en();let u=Sn();if(void 0===n&&null!==u&&(n=It(u,{[kn.Open]:!0,[kn.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=(0,r.useState)(n?"visible":"hidden"),f=tr((()=>{d("hidden")})),[h,p]=(0,r.useState)(!0),v=(0,r.useRef)([n]);Xt((()=>{!1!==h&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))}),[v,n]);let g=(0,r.useMemo)((()=>({show:n,appear:o,initial:h})),[n,o,h]);(0,r.useEffect)((()=>{if(n)d("visible");else if(er(f)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")}),[n,f]);let y={unmount:i};return r.default.createElement(Jn.Provider,{value:f},r.default.createElement(Zn.Provider,{value:g},Ft({ourProps:{...y,as:r.Fragment,children:r.default.createElement(ar,{ref:l,...y,...a})},theirProps:{},defaultTag:r.Fragment,features:ir,visible:"visible"===c,name:"Transition"})))})),lr=Gt((function(e,t){let n=null!==(0,r.useContext)(Zn),o=null!==Sn();return r.default.createElement(r.default.Fragment,null,!n&&o?r.default.createElement(sr,{ref:t,...e}):r.default.createElement(ar,{ref:t,...e}))})),ur=Object.assign(sr,{Child:lr,Root:sr});const cr=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"}))}));const dr=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"}))}));const fr=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"}))}));function hr(){const[e,t]=(0,r.useState)(localStorage.getItem(bt)||"system");return(0,r.useEffect)((()=>{Et(e)}),[e]),Ke(Hn,{as:"div",className:"relative inline-block text-left",children:[Ke("div",{children:Ke(Hn.Button,{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"theme-open-modal-button",children:[Ke("span",{className:"sr-only",children:"Theme switcher"}),"system"===e&&Ke(cr,{className:"h-4 w-4","aria-hidden":"true"}),"light"===e&&Ke(dr,{className:"h-4 w-4","aria-hidden":"true"}),"dark"===e&&Ke(fr,{className:"h-4 w-4","aria-hidden":"true"})]})}),Ke(ur,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:Ke(Hn.Items,{className:"absolute right-0 z-50 mt-2 w-36 origin-top-right rounded-md bg-white text-slate-500 shadow-lg ring-1 ring-slate-900/10 ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:text-slate-400 dark:ring-0",children:Ke("div",{className:"px-1 py-1",children:[Ke(Hn.Item,{children:({active:n})=>Ke("button",{"data-cy":"system-theme-button",className:Nt()("system"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("system"),children:[Ke(cr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"System"]})}),Ke(Hn.Item,{children:({active:n})=>Ke("button",{"data-cy":"light-theme-button",className:Nt()("light"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("light"),children:[Ke(dr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Light"]})}),Ke(Hn.Item,{children:({active:n})=>Ke("button",{"data-cy":"dark-theme-button",className:Nt()("dark"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("dark"),children:[Ke(fr,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Dark"]})})]})})})]})}const pr=()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)(),i=(0,ut.useLocation)();if(i.pathname===e)return n;t(i.pathname);const a=(0,ut.matchRoutes)(Fo(),i).at(-1),{environment:s}=Mt();let l;return l="dev"===s?{workspace:a.pathname.split("/")[1],currentPath:`/${a.pathname.split("/").slice(2).join("/")}`}:{workspace:"local",currentPath:a.pathname},o(l),l};function vr(e){return Rt().appConfig.showExperimentalFeatures?r.Children.map(e.children,(e=>(0,r.cloneElement)(e,{"data-cy":"experimental-feature"}))):null}const gr=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))}));const yr=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}));function mr(){const[e,t]=(0,r.useState)(localStorage.getItem(St)||"TB");return(0,r.useEffect)((()=>{jt(e)}),[e]),Ke("div",{className:"relative inline-block text-left",children:Ke("button",{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"rankdir-change-button",children:[Ke("span",{className:"sr-only",children:"Graph layout direction switcher"}),"TB"===e&&Ke("button",{title:"Set graph direction to left-to-right","data-cy":"lr-rankdir-button",onClick:()=>t("LR"),children:Ke(gr,{className:"h-4 w-4","aria-hidden":"true"})}),"LR"===e&&Ke("button",{title:"Set graph direction to top-to-bottom","data-cy":"tb-rankdir-button",onClick:()=>t("TB"),children:Ke(yr,{className:"h-4 w-4","aria-hidden":"true"})})]})})}var br=n(96524),xr=n(36021);const wr={on:{updateGraph:{target:"customSelected",actions:[(0,xr.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,br.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},_r={entry:[(0,xr.f0)(((e,t)=>{"focusProject"===t.type&&(e.focusedProject=t.projectName)})),"notifyGraphFocusProject"],exit:[(0,xr.f0)((e=>{e.focusedProject=null}))],on:{incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFocusProject"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFocusProject"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFocusProject"]},setSearchDepth:{actions:["setSearchDepth","notifyGraphFocusProject"]},unfocusProject:{target:"unselected"},updateGraph:{actions:["setGraph",(0,br.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFocusProject"]}}},Er=(e,t)=>{const n=yt();t((t=>{const{selectedProjectNames:r,perfReport:o}=n.handleProjectEvent(t);e({type:"setSelectedProjectsFromGraph",selectedProjectNames:r,perfReport:o})}))},kr={entry:[(0,xr.f0)(((e,t)=>{"filterByText"===t.type&&(e.textFilter=t.search)})),"notifyGraphFilterProjectsByText"],on:{clearTextFilter:{target:"unselected",actions:(0,xr.f0)((e=>{e.includePath=!1,e.textFilter=""}))},setIncludeProjectsByPath:{actions:["setIncludeProjectsByPath","notifyGraphFilterProjectsByText"]},incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFilterProjectsByText"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFilterProjectsByText"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFilterProjectsByText"]},updateGraph:{actions:["setGraph",(0,br.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFilterProjectsByText"]}}},Sr={entry:[(0,xr.f0)(((e,t)=>{"setTracingStart"===t.type?e.tracing.start=t.projectName:"setTracingEnd"===t.type&&(e.tracing.end=t.projectName)})),"notifyGraphTracing"],exit:[(0,xr.f0)(((e,t)=>{"setTracingStart"!==t.type&&"setTracingEnd"!==t.type&&(e.tracing.start=null,e.tracing.end=null)}))],on:{clearTraceStart:{actions:[(0,xr.f0)((e=>{e.tracing.start=null})),"notifyGraphTracing"]},clearTraceEnd:{actions:[(0,xr.f0)((e=>{e.tracing.end=null})),"notifyGraphTracing"]}}},Pr={entry:["notifyGraphHideAllProjects"],on:{updateGraph:{target:"customSelected",actions:[(0,xr.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,br.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},jr=(0,br.createMachine)({predictableActionArguments:!0,id:"project-graph",initial:"idle",context:{projects:[],dependencies:{},affectedProjects:[],selectedProjects:[],focusedProject:null,textFilter:"",includePath:!1,searchDepth:1,searchDepthEnabled:!0,groupByFolder:!1,collapseEdges:!1,workspaceLayout:{libsDir:"",appsDir:""},graphActor:null,lastPerfReport:{numEdges:0,numNodes:0,renderTime:0},tracing:{start:null,end:null,algorithm:"shortest"}},states:{idle:{},unselected:Pr,customSelected:wr,focused:_r,textFiltered:kr,tracing:Sr},on:{setProjects:{target:"unselected",actions:["setGraph",(0,br.send)(((e,t)=>({type:"notifyGraphInitGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges})),{to:e=>e.graphActor})]},setSelectedProjectsFromGraph:{actions:[(0,xr.f0)(((e,t)=>{e.selectedProjects=t.selectedProjectNames,e.lastPerfReport=t.perfReport}))]},selectProject:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectProjects:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectAll:{target:"customSelected",actions:["notifyGraphShowAllProjects"]},selectAffected:{target:"customSelected",actions:["notifyGraphShowAffectedProjects"]},deselectProject:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectProjects:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectAll:{target:"unselected"},focusProject:{target:"focused"},setTracingStart:{target:"tracing"},setTracingEnd:{target:"tracing"},setCollapseEdges:{actions:["setCollapseEdges",(0,br.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setGroupByFolder:{actions:["setGroupByFolder",(0,br.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setIncludeProjectsByPath:{actions:[(0,xr.f0)(((e,t)=>{e.includePath=t.includeProjectsByPath}))]},incrementSearchDepth:{actions:["incrementSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled"]},setSearchDepth:{actions:["setSearchDepth"]},setTracingAlgorithm:{actions:[(0,xr.f0)(((e,t)=>{e.tracing.algorithm=t.algorithm})),"notifyGraphTracing"]},filterByText:{target:"textFiltered"}}},{guards:{deselectLastProject:e=>e.selectedProjects.length<=1},actions:{setGroupByFolder:(0,xr.f0)(((e,t)=>{"setGroupByFolder"===t.type&&(e.groupByFolder=t.groupByFolder)})),setCollapseEdges:(0,xr.f0)(((e,t)=>{"setCollapseEdges"===t.type&&(e.collapseEdges=t.collapseEdges)})),incrementSearchDepth:(0,xr.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth+1})),decrementSearchDepth:(0,xr.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth>1?e.searchDepth-1:1})),setSearchDepth:(0,xr.f0)(((e,t)=>{"setSearchDepth"===t.type&&(e.searchDepthEnabled=!0,e.searchDepth=t.searchDepth>1?t.searchDepth:1)})),setSearchDepthEnabled:(0,xr.f0)(((e,t)=>{"setSearchDepthEnabled"===t.type&&(e.searchDepthEnabled=t.searchDepthEnabled)})),setIncludeProjectsByPath:(0,xr.f0)(((e,t)=>{"setIncludeProjectsByPath"===t.type&&(e.includePath=t.includeProjectsByPath)})),setGraph:(0,xr.f0)(((e,t)=>{"setProjects"!==t.type&&"updateGraph"!==t.type||(e.projects=t.projects,e.dependencies=t.dependencies,e.graphActor=(0,br.spawn)(Er,"graphActor"),"setProjects"===t.type&&(e.workspaceLayout=t.workspaceLayout,e.affectedProjects=t.affectedProjects))})),notifyGraphTracing:(0,br.send)(((e,t)=>({type:"notifyGraphTracing",start:e.tracing.start,end:e.tracing.end,algorithm:e.tracing.algorithm})),{to:e=>e.graphActor}),notifyGraphShowProjects:(0,br.send)(((e,t)=>{if("selectProject"===t.type||"selectProjects"===t.type)return"selectProject"===t.type?{type:"notifyGraphShowProjects",projectNames:[t.projectName]}:{type:"notifyGraphShowProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphHideProjects:(0,br.send)(((e,t)=>{if("deselectProject"===t.type||"deselectProjects"===t.type)return"deselectProject"===t.type?{type:"notifyGraphHideProjects",projectNames:[t.projectName]}:{type:"notifyGraphHideProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphShowAllProjects:(0,br.send)(((e,t)=>({type:"notifyGraphShowAllProjects"})),{to:e=>e.graphActor}),notifyGraphHideAllProjects:(0,br.send)(((e,t)=>({type:"notifyGraphHideAllProjects"})),{to:e=>e.graphActor}),notifyGraphShowAffectedProjects:(0,br.send)({type:"notifyGraphShowAffectedProjects"},{to:e=>e.graphActor}),notifyGraphFocusProject:(0,br.send)(((e,t)=>({type:"notifyGraphFocusProject",projectName:e.focusedProject,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor}),notifyGraphFilterProjectsByText:(0,br.send)(((e,t)=>({type:"notifyGraphFilterProjectsByText",search:e.textFilter,includeProjectsByPath:e.includePath,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor})}});let Cr,Tr=(0,br.interpret)(jr,{devTools:!!window.useXstateInspect});function Or(){return Tr.status===br.InterpreterStatus.NotStarted&&Tr.start(),Tr}var Dr=n(43100);const Nr=()=>{const{environment:e}=Mt(),{selectedWorkspaceId:t}=(0,ut.useParams)(),[n]=(0,ut.useSearchParams)();return(r,o)=>{let i="";return"object"==typeof r?(i="dev"===e?`/${t}${r.pathname}`:r.pathname,Object.assign({},r,{pathname:i,search:r.search?r.search.toString():o?n.toString():""})):"string"==typeof r?(i="dev"===e?`/${t}${r}`:r,{pathname:i,search:o?n.toString():""}):void 0}};function Ar(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}function Rr(e,t){return t.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}function Mr(e,t){let n={};return e.forEach((e=>{const r="app"===e.type||"e2e"===e.type?t.appsDir:t.libsDir,o=Ar(e.data.root,r).join("/");n.hasOwnProperty(o)||(n[o]=[]),n[o].push(e)})),n}function Ir(e,t,n){return n?`${e}:${t}:${n}`:`${e}:${t}`}const Lr=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M11.54 22.351l.07.04.028.016a.76.76 0 00.723 0l.028-.015.071-.041a16.975 16.975 0 001.144-.742 19.58 19.58 0 002.683-2.282c1.944-1.99 3.963-4.98 3.963-8.827a8.25 8.25 0 00-16.5 0c0 3.846 2.02 6.837 3.963 8.827a19.58 19.58 0 002.682 2.282 16.975 16.975 0 001.145.742zM12 13.5a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"}))}));const Br=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M3 2.25a.75.75 0 01.75.75v.54l1.838-.46a9.75 9.75 0 016.725.738l.108.054a8.25 8.25 0 005.58.652l3.109-.732a.75.75 0 01.917.81 47.784 47.784 0 00.005 10.337.75.75 0 01-.574.812l-3.114.733a9.75 9.75 0 01-6.594-.77l-.108-.054a8.25 8.25 0 00-5.69-.625l-2.202.55V21a.75.75 0 01-1.5 0V3A.75.75 0 013 2.25z",clipRule:"evenodd"}))}));function Fr({id:e}){const t=Or(),{start:n,end:r,algorithm:o}=t.getSnapshot().context.tracing,i=Nr(),a=(0,ut.useNavigate)(),s=encodeURIComponent(e);return Ke("div",{className:"grid grid-cols-3 gap-4",children:[Ke(pt,{to:i(`/projects/${s}`,!0),children:"Focus"}),Ke(ht,{onClick:function(){t.send({type:"deselectProject",projectName:e}),a(i("/projects",!0))},children:"Exclude"}),Ke(ht,n?{className:"flex flex-row items-center",onClick:function(){a(i(`/projects/trace/${encodeURIComponent(n)}/${s}`,!0))},children:[Ke(Br,{className:"mr-2 h-5 w-5 text-slate-500"}),"End"]}:{className:"flex flex-row items-center",onClick:function(){a(i(`/projects/trace/${s}`,!0))},children:[Ke(Lr,{className:"mr-2 h-5 w-5 text-slate-500"}),"Start"]})]})}const zr=function(){if(!Cr){const e=yt();Cr=new tooltip_service_GraphTooltipService(e)}return Cr}();function Vr(){const e=(0,Dr.useSyncExternalStore)((e=>zr.subscribe(e)),(()=>zr.currentTooltip));let t;if(e)switch(e.type){case"projectNode":t=Ke(st,Object.assign({},e.props,{children:Ke(Fr,Object.assign({},e.props))}));break;case"projectEdge":t=Ke(at,Object.assign({},e.props));break;case"taskNode":t=Ke(lt,Object.assign({},e.props))}return t?Ke(Ze,{content:t,open:!0,reference:e.ref,placement:"top",openAction:"manual"}):null}function Gr(){const e=Or(),t=yt(),n=(0,Dr.useSyncExternalStore)((e=>t.listen(e)),(()=>t.lastPerformanceReport)),r=0!==n.numNodes,o=Rt(),i=Rt(),a=(0,ut.useNavigate)(),s=pr(),{selectedWorkspaceId:l,selectedTaskId:u}=(0,ut.useParams)(),c=s.currentPath,d=c.startsWith("/tasks")?"/tasks":"/projects";return Ke(Xe.HY,{children:[Ke("div",{className:("nx-console"===i.environment?"absolute top-5 left-5 z-50 bg-white":"relative flex h-full overflow-y-scroll")+" w-72 flex-col pb-10 shadow-lg ring-1 ring-slate-900/10 ring-opacity-10 transition-all dark:ring-slate-300/10",id:"sidebar",children:["nx-console"!==i.environment?Ke(Xe.HY,{children:[Ke("div",{className:"border-b border-slate-900/10 text-slate-700 dark:border-slate-300/10 dark:bg-transparent dark:text-slate-400",children:Ke("div",{className:"mx-4 my-2 flex items-center justify-between",children:[Ke("svg",{className:"h-10 w-auto text-slate-900 dark:text-white",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[Ke("title",{children:"Nx"}),Ke("path",{d:"M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z"})]}),Ke(it,{"data-cy":"route-select",defaultValue:c.startsWith("/projects")?"/projects":"/tasks",onChange:t=>{e.send("deselectAll"),"dev"===o.environment?a(`/${encodeURIComponent(s.workspace)}${t.currentTarget.value}`):a(`${t.currentTarget.value}`)},children:[{route:"/projects",label:"Projects"},{route:"/tasks",label:"Tasks"}].map((e=>Ke("option",{value:e.route,children:e.label},e.label)))}),Ke(vr,{children:Ke(mr,{})}),Ke(hr,{})]})}),Ke("a",{id:"help",className:" mt-3 flex cursor-pointer items-center px-4 text-xs hover:underline ",href:"https://nx.dev/structure/dependency-graph",rel:"noreferrer",target:"_blank",children:[Ke(Ct,{className:"mr-2 h-4 w-4"}),"Analyse and visualize your workspace."]})]}):null,Ke(ut.Outlet,{})]}),Ke("div",{id:"main-content",className:"flex-grow overflow-hidden transition-all",children:[o.appConfig.showDebugger?Ke(At,{projects:o.appConfig.workspaces,selectedProject:l,lastPerfReport:n,selectedProjectChange:function(e){a(`/${encodeURIComponent(e)}${d}`)}}):null,r?null:Ke("div",{"data-cy":"no-tasks-selected",className:"flex h-full w-full items-center justify-center text-slate-700 dark:text-slate-400",children:[Ke(Tt,{className:"mr-4 h-6 w-6"}),Ke("h4",{children:["Please select a"," ",c.startsWith("/tasks")?"task":"project"," in the sidebar."]})]}),Ke("div",{className:"h-full w-full",children:[Ke("div",{className:"h-full w-full cursor-pointer",id:"cytoscape-graph"}),Ke(Vr,{}),Ke(Ze,{openAction:"hover",content:"Download Graph as PNG",placement:"left",children:Ke("button",{type:"button",className:Nt()(r?"":"invisible opacity-0","fixed bottom-4 right-4 z-50 block h-16 w-16 transform rounded-full bg-blue-500 text-white shadow-sm transition duration-300 dark:bg-sky-500"),"data-cy":"downloadImageButton",onClick:function(){const e=yt().getImage();let t=document.createElement("a");t.href=e,t.download="graph.png",t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},children:Ke(Ot,{className:"absolute top-1/2 left-1/2 -mt-3 -ml-3 h-6 w-6"})})})]})]})]})}var Ur=n(59399);function Hr(e){const t=Or();return(0,Ur.v9)(t,e)}const Wr=e=>e.context.projects,Yr=e=>e.context.workspaceLayout,qr=e=>e.context.selectedProjects,Xr=e=>e.context.focusedProject,$r=e=>({searchDepth:e.context.searchDepth,searchDepthEnabled:e.context.searchDepthEnabled}),Kr=e=>e.context.includePath,Zr=e=>e.context.groupByFolder,Qr=e=>e.context.collapseEdges,Jr=e=>e.context.textFilter,eo=e=>e.context.affectedProjects.length>0,to=e=>e.context.tracing,no=(0,r.memo)((({collapseEdges:e,collapseEdgesChanged:t})=>Ke("div",{className:"px-4",children:Ke("div",{className:"flex items-start",children:[Ke("div",{className:"flex h-5 items-center",children:Ke("input",{id:"collapseEdges",name:"collapseEdges",value:"collapseEdges",type:"checkbox",className:"h-4 w-4 accent-purple-500",onChange:e=>t(e.target.checked),checked:e})}),Ke("div",{className:"ml-3 text-sm",children:[Ke("label",{htmlFor:"collapseEdges",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Collapse edges"}),Ke("p",{className:"text-slate-400 dark:text-slate-500",children:"Display edges between groups rather than libraries"})]})]})})));const ro=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12.75 15l3-3m0 0l-3-3m3 3h-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const oo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),io=(0,r.memo)((({focusedLabel:e,resetFocus:t})=>Ke("div",{className:"mt-10 px-4",children:Ke("div",{className:"group relative flex cursor-pointer items-center overflow-hidden rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm dark:border-slate-700 dark:bg-sky-500","data-cy":"unfocusButton",onClick:()=>t(),children:[Ke("p",{className:"truncate transition duration-200 ease-in-out group-hover:opacity-60",children:[Ke(ro,{className:"-mt-1 mr-1 inline h-6 w-6"}),Ke("span",{id:"focused-project-name",children:["Focused on ",e]})]}),Ke("div",{className:"absolute right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300",children:["Reset",Ke("span",{className:"rounded-md p-1",children:Ke(oo,{className:"h-5 w-5"})})]})]})}))),ao=(0,r.memo)((({checked:e,checkChanged:t,label:n,description:r,name:o})=>Ke("div",{className:"mt-8 px-4",children:Ke("div",{className:"flex items-start",children:[Ke("div",{className:"flex h-5 items-center",children:Ke("input",{id:o,name:o,value:o,type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",onChange:e=>t(e.target.checked),checked:e})}),Ke("div",{className:"ml-3 text-sm",children:[Ke("label",{htmlFor:o,className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:n}),Ke("p",{className:"text-slate-400 dark:text-slate-500",children:r})]})]})}))),so=({groupByFolder:e,groupByFolderChanged:t})=>Ke(ao,{checked:e,checkChanged:t,name:"groupByFolder",label:"Group by folder",description:"Visually arrange libraries by folders."});const lo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9zm3.75 11.625a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"}))}));const uo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"}))}));const co=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5"}))}));const fo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}));function ho(e,t,n){let r={};return e.forEach((e=>{const o="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,i=Ar(e.data.root,o).join("/");r.hasOwnProperty(i)||(r[i]=[]),r[i].push({projectGraphNode:e,isSelected:t.includes(e.name)})})),r}function po({project:e,tracingInfo:t}){const n=Or(),r=(0,ut.useNavigate)(),o=Nr();function i(e,t){t?n.send({type:"deselectProject",projectName:e}):n.send({type:"selectProject",projectName:e}),r(o("/projects",!0))}return Ke("li",{className:"relative block cursor-default select-none py-1 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[Ke("div",{className:"flex items-center",children:[Ke(ut.Link,{"data-cy":`focus-button-${e.projectGraphNode.name}`,className:"mr-1 flex items-center rounded-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 ring-slate-200 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",title:"Focus on this library",to:o(`/projects/${encodeURIComponent(e.projectGraphNode.name)}`,!0),children:Ke(lo,{className:"h-5 w-5"})}),Ke(vr,{children:Ke("span",{className:"relative z-0 inline-flex rounded-md shadow-sm",children:[Ke("button",{type:"button",title:"Start Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingStart",projectName:t});var t},className:(t.start===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-l-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:Ke(uo,{className:"h-5 w-5"})}),Ke("button",{type:"button",title:"End Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingEnd",projectName:t});var t},className:(t.end===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-r-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:Ke(co,{className:"h-5 w-5"})})]})}),Ke("label",{className:"ml-2 block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>i(e.projectGraphNode.name,e.isSelected),children:e.projectGraphNode.name})]}),e.isSelected?Ke("span",{title:"This library is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>i(e.projectGraphNode.name,e.isSelected),children:Ke(fo,{className:"h-5 w-5"})}):null]})}function vo({headerText:e="",projects:t,tracingInfo:n}){const r=Or();let o=[...t];o.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name)));const i=t.every((e=>e.isSelected));return Ke(Xe.HY,{children:[""!==e?Ke("div",{className:"relative mt-4 flex justify-between py-2 text-slate-800 dark:text-slate-200",children:[Ke("h3",{className:"cursor-text text-sm font-semibold uppercase tracking-wide lg:text-xs",children:e}),Ke("span",{title:i?`Hide all ${e} projects`:`Show all ${e} projects`,className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-sm font-semibold uppercase tracking-wide lg:text-xs","data-cy":`toggle-folder-visibility-button-${e}`,onClick:()=>function(e){const n=t.map((e=>e.projectGraphNode.name));e?r.send({type:"deselectProjects",projectNames:n}):r.send({type:"selectProjects",projectNames:n})}(i),children:Ke(fo,{className:"h-5 w-5"})})]}):null,Ke("ul",{className:"mt-2 -ml-3",children:o.map((e=>Ke(po,{project:e,tracingInfo:n},e.projectGraphNode.name)))})]})}function go(){const e=Hr(to),t=Hr(Wr),n=Hr(Yr),r=Hr(qr),o=Rr("app",t),i=Rr("lib",t),a=Rr("e2e",t),s=ho(o,r,n),l=ho(i,r,n),u=ho(a,r,n),c=Object.keys(s).sort(),d=Object.keys(l).sort(),f=Object.keys(u).sort();return Ke("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"}),c.map((t=>Ke(vo,{headerText:t,projects:s[t],tracingInfo:e},"app-"+t))),Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"}),f.map((t=>Ke(vo,{headerText:t,projects:u[t],tracingInfo:e},"e2e-"+t))),Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"}),d.map((t=>Ke(vo,{headerText:t,projects:l[t],tracingInfo:e},"lib-"+t)))]})}const yo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"}))}));const mo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))})),bo=(0,r.memo)((({searchDepth:e,searchDepthEnabled:t,searchDepthFilterEnabledChange:n,decrementDepthFilter:r,incrementDepthFilter:o})=>Ke("div",{className:"mt-4 px-4",children:[Ke("div",{className:"mt-4 flex items-start",children:[Ke("div",{className:"flex h-5 items-center",children:Ke("input",{id:"depthFilter",name:"depthFilter",value:"depthFilterActivated",type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:t,onChange:e=>n(e.target.checked)})}),Ke("div",{className:"ml-3 text-sm",children:[Ke("label",{htmlFor:"depthFilter",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Activate proximity"}),Ke("p",{className:"text-slate-400 dark:text-slate-500",children:"Explore connected libraries step by step."})]})]}),Ke("div",{className:"mt-3 px-10",children:Ke("div",{className:"flex rounded-md shadow-sm",children:[Ke("button",{"data-cy":"decrement-depth-filter",title:"Remove ancestor level",className:"inline-flex items-center rounded-l-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:r,children:Ke(yo,{className:"h-4 w-4"})}),Ke("span",{id:"depthFilterValue","data-cy":"depth-value",className:"block w-full flex-1 rounded-none border-t border-b border-slate-300 bg-white p-1.5 text-center font-mono dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:e}),Ke("button",{"data-cy":"increment-depth-filter",title:"Add ancestor level",className:"inline-flex items-center rounded-r-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:o,children:Ke(mo,{className:"h-4 w-4"})})]})})]})));const xo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"}))}));const wo=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"}))})),_o=(0,r.memo)((({showAll:e,hideAll:t,showAffected:n,hasAffected:r,label:o})=>Ke("div",{className:"mt-8 px-4",children:[Ke("button",{onClick:e,type:"button",className:"flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"selectAllButton",children:[Ke(fo,{className:"-ml-1 mr-2 h-5 w-5 text-slate-400"}),"Show all ",o]}),r?Ke("button",{onClick:n,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-pink-500 bg-pink-400 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-pink-500 dark:border-fuchsia-800 dark:bg-fuchsia-700 dark:text-white hover:dark:bg-fuchsia-600","data-cy":"affectedButton",children:[Ke(xo,{className:"-ml-1 mr-2 h-5 w-5 text-white"}),"Show affected ",o]}):null,Ke("button",{onClick:t,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"deselectAllButton",children:[Ke(wo,{className:"-ml-1 mr-2 h-5 w-5 text-slate-500"}),"Hide all ",o]})]})));function Eo({textFilter:e,resetTextFilter:t,updateTextFilter:n,toggleIncludeLibsInPathChange:r,includePath:o}){return Ke("div",{children:[Ke("div",{className:"mt-10 px-4",children:Ke(et,{resetTextFilter:t,updateTextFilter:n,initialText:"",placeholderText:"lib name, other lib name"})}),Ke("div",{className:"mt-4 px-4",children:Ke("div",{className:"flex items-start",children:[Ke("div",{className:"flex h-5 items-center",children:Ke("input",{disabled:0===e.length,id:"includeInPath",name:"textFilterCheckbox",type:"checkbox",value:"includeInPath",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:o,onChange:r})}),Ke("div",{className:"ml-3 text-sm",children:[Ke("label",{htmlFor:"includeInPath",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Include related libraries"}),Ke("p",{className:"text-slate-400 dark:text-slate-500",children:"Show libraries that are related to your search."})]})]})})]})}const ko=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"}))})),So=(0,r.memo)((({start:e,end:t,algorithm:n,setAlgorithm:r,resetStart:o,resetEnd:i})=>Ke("div",{className:"mt-10 px-4",children:Ke("div",{className:"transition duration-200 ease-in-out group-hover:opacity-60",children:[Ke("h3",{className:"cursor-text pb-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Tracing Path"}),Ke("div",{className:"mb-3 flex cursor-pointer flex-row rounded-md border text-center text-xs dark:border-slate-600",children:[Ke("button",{onClick:()=>r("shortest"),className:("shortest"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-l-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:Ke("span",{children:"Shortest"})}),Ke("button",{onClick:()=>r("all"),className:("all"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-r-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:Ke("span",{children:"All"})})]}),Ke("div",{className:"flex flex-row items-center truncate ",children:[Ke(uo,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"}),e?Ke("div",{className:"group relative flex-1 cursor-pointer flex-col items-center overflow-hidden","data-cy":"resetTraceButton",onClick:o,children:[Ke("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:Ke("span",{children:e})}),Ke("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",Ke("span",{className:"rounded-md p-1",children:Ke(oo,{className:"h-5 w-5"})})]})]}):Ke("p",{className:"text-sm text-slate-500",children:"Select start project"})]}),Ke("div",{children:Ke(ko,{className:"h-5 w-5 text-slate-500 dark:text-slate-400"})}),Ke("div",{className:"flex flex-row items-center truncate ",children:[Ke(co,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"}),t?Ke("div",{className:" group relative flex-1 cursor-pointer flex-col items-center overflow-hidden ","data-cy":"resetTraceButton",onClick:i,children:[Ke("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:Ke("span",{children:t})}),Ke("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",Ke("span",{className:"rounded-md p-1",children:Ke(oo,{className:"h-5 w-5"})})]})]}):Ke("p",{className:"text-sm text-slate-500",children:"Select end project"})]})]})})));class FetchProjectGraphService{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}async getTaskGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}class LocalProjectGraphService{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}async getTaskGraph(e){return new Promise((e=>e(window.taskGraphResponse)))}}class MockProjectGraphService{constructor(e=5e3){this.projectGraphsResponse={hash:"79054025255fb1a26e4bc422aef54eb4",layout:{appsDir:"apps",libsDir:"libs"},projects:[{name:"existing-app-1",type:"app",data:{root:"apps/app1",tags:[],files:[{file:"some/file.ts",hash:"ecccd8481d2e5eae0e59928be1bc4c2d071729d7",dependencies:[{target:"existing-lib-1",source:"existing-app-1",type:"static"}]}]}},{name:"existing-lib-1",type:"lib",data:{root:"libs/lib1",tags:[],files:[]}}],dependencies:{"existing-app-1":[{source:"existing-app-1",target:"existing-lib-1",type:"static"}],"existing-lib-1":[]},affected:[],focus:null,exclude:[],groupByFolder:!1},this.taskGraphsResponse={taskGraphs:{},errors:{}},setInterval((()=>this.updateResponse()),e)}async getHash(){return new Promise((e=>e(this.projectGraphsResponse.hash)))}getProjectGraph(e){return new Promise((e=>e(this.projectGraphsResponse)))}getTaskGraph(e){return new Promise((e=>e(this.taskGraphsResponse)))}createNewProject(){const e=Math.random()>.25?"lib":"app",t=`${e}-${this.projectGraphsResponse.projects.length+1}`;return{name:t,type:e,data:{root:"app"===e?`apps/${t}`:`libs/${t}`,tags:[],files:[]}}}updateResponse(){const e=this.createNewProject(),t=this.projectGraphsResponse.projects.filter((e=>"lib"===e.type)),n=t[Math.floor(Math.random()*t.length)],r=[{source:e.name,target:n.name,type:"static"}];this.projectGraphsResponse=Object.assign({},this.projectGraphsResponse,{projects:[...this.projectGraphsResponse.projects,e],dependencies:Object.assign({},this.projectGraphsResponse.dependencies,{[e.name]:r})})}}let Po;function jo(){return void 0===Po&&("dev"===window.environment||"nx-console"===window.environment?Po=new FetchProjectGraphService:"watch"===window.environment?Po=new MockProjectGraphService:"release"===window.environment&&(Po="build"===window.localMode?new LocalProjectGraphService:new FetchProjectGraphService)),Po}function Co(){const e=Rt(),t=Or(),n=Hr(Xr),o=Hr($r),i=Hr(Kr),a=Hr(Jr),s=Hr(eo),l=Hr(Zr),u=Hr(Qr),c=t.getSnapshot().matches("tracing"),d=Hr(to),f=jo(),h=(0,ut.useParams)(),p=pr(),[v,g]=(0,ut.useSearchParams)(),y=(0,ut.useRouteLoaderData)("selectedWorkspace"),m=(0,ut.useParams)(),b=(0,ut.useNavigate)(),x=Nr();(0,r.useEffect)((()=>{t.send({type:"setProjects",projects:y.projects,dependencies:y.dependencies,affectedProjects:y.affected,workspaceLayout:y.layout})}),[y]),(0,r.useEffect)((()=>{switch(p.currentPath){case"/projects/all":t.send({type:"selectAll"});break;case"/projects/affected":t.send({type:"selectAffected"})}}),[p]),(0,r.useEffect)((()=>{h.focusedProject&&t.send({type:"focusProject",projectName:h.focusedProject}),h.startTrace&&t.send({type:"setTracingStart",projectName:h.startTrace}),h.endTrace&&t.send({type:"setTracingEnd",projectName:h.endTrace})}),[h]),(0,r.useEffect)((()=>{if(v.has("groupByFolder")&&!1===l?t.send({type:"setGroupByFolder",groupByFolder:!0}):v.has("groupByFolder")||!0!==l||t.send({type:"setGroupByFolder",groupByFolder:!1}),v.has("collapseEdges")&&!1===u?t.send({type:"setCollapseEdges",collapseEdges:!0}):v.has("collapseEdges")||!0!==u||t.send({type:"setCollapseEdges",collapseEdges:!1}),v.has("searchDepth")){const e=parseInt(v.get("searchDepth"),10);0===e&&!1!==o.searchDepthEnabled?t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!1}):0!==e&&t.send({type:"setSearchDepth",searchDepth:e})}else!1!==o.searchDepthEnabled&&1===o.searchDepth||(t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!0}),t.send({type:"setSearchDepth",searchDepth:1}));if(v.has("traceAlgorithm")){const e=v.get("traceAlgorithm");"shortest"!==e&&"all"!==e||t.send({type:"setTracingAlgorithm",algorithm:e})}else"shortest"!==d.algorithm&&t.send({type:"setTracingAlgorithm",algorithm:"shortest"})}),[v]),((e,t,n)=>{const o=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{n&&(o.current=e)}),[e,n]),(0,r.useEffect)((()=>{if(n){const e=()=>{o.current()};if(null!==t){let n=setInterval(e,t);return()=>clearInterval(n)}}}),[t,n])})((()=>{var n;const r=null!=(n=m.selectedWorkspaceId)?n:e.appConfig.defaultWorkspaceId,o=e.appConfig.workspaces.find((e=>e.id===r));(async()=>{const e=await f.getProjectGraph(o.projectGraphUrl);t.send({type:"updateGraph",projects:e.projects,dependencies:e.dependencies})})()}),5e3,e.watch);const w=(0,r.useCallback)((e=>{t.send({type:"filterByText",search:e}),b(x("/projects",!0))}),[t]);return Ke(Xe.HY,{children:[n?Ke(io,{focusedLabel:n,resetFocus:function(){t.send({type:"unfocusProject"}),b(x("/projects",!0))}}):null,c?Ke(So,{start:d.start,end:d.end,algorithm:d.algorithm,setAlgorithm:function(e){g((t=>(t.set("traceAlgorithm",e),t)))},resetStart:function(){t.send({type:"clearTraceStart"}),b(x("/projects",!0))},resetEnd:function(){t.send({type:"clearTraceEnd"}),b(x("/projects",!0))}}):null,Ke(Eo,{includePath:i,resetTextFilter:function(){t.send({type:"clearTextFilter"})},textFilter:a,toggleIncludeLibsInPathChange:function(){t.send({type:"setIncludeProjectsByPath",includeProjectsByPath:!i})},updateTextFilter:w}),Ke("div",{children:[Ke(_o,{hideAll:function(){t.send({type:"deselectAll"}),b(x("/projects",!0))},showAll:function(){b(x("/projects/all",!0))},showAffected:function(){b(x("/projects/affected",!0))},hasAffected:s,label:"projects"}),Ke(so,{groupByFolder:l,groupByFolderChanged:function(e){g((t=>(e?t.set("groupByFolder","true"):t.delete("groupByFolder"),t)))}}),Ke(bo,{searchDepth:o.searchDepth,searchDepthEnabled:o.searchDepthEnabled,searchDepthFilterEnabledChange:function(e){g((t=>(e&&o.searchDepth>1?t.set("searchDepth",o.searchDepth.toString()):e&&1===o.searchDepth?t.delete("searchDepth"):t.set("searchDepth","0"),t)))},incrementDepthFilter:function(){const e=o.searchDepth+1;g((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))},decrementDepthFilter:function(){const e=1===o.searchDepth?1:o.searchDepth-1;g((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))}}),Ke(vr,{children:Ke("div",{className:"mx-4 mt-4 rounded-lg border-2 border-dashed border-purple-500 p-4 shadow-lg dark:border-purple-600 dark:bg-[#0B1221]",children:[Ke("h3",{className:"cursor-text px-4 py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Experimental Features"}),Ke(no,{collapseEdges:u,collapseEdgesChanged:function(e){g((t=>(e?t.set("collapseEdges","true"):t.delete("collapseEdges"),t)))}})]})})]}),"nx-console"!==e.environment?Ke(go,{}):null]})}const To=r.forwardRef((function({title:e,titleId:t,...n},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:o,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}))})),Oo=({error:e})=>Ke(Xe.HY,{children:[Ke("h2",{className:"text-lg font-light text-slate-400 dark:text-slate-500",children:"There was a problem calculating the task graph for this task"}),Ke("p",{children:e})]});function Do({project:e,toggleTask:t}){return Ke("li",{className:"relative block cursor-default select-none pb-0 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[Ke("div",{className:"flex items-center",children:Ke("label",{className:"block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>e.error?null:t(e.projectGraphNode.name),children:e.projectGraphNode.name})}),e.error?Ke(Ze,{content:Ke(Oo,{error:e.error}),openAction:"click",strategy:"fixed",children:Ke("span",{className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",children:Ke(To,{className:"h-5 w-5 text-yellow-500 dark:text-yellow-400","aria-hidden":"true"})})}):null,e.isSelected?Ke("span",{title:"This task is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>t(e.projectGraphNode.name),children:Ke(fo,{className:"h-5 w-5"})}):null]})}function No({headerText:e="",projects:t,toggleTask:n}){let r=[...t];return r.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name))),Ke(Xe.HY,{children:[""!==e?Ke("h3",{className:"mt-4 cursor-text py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:e}):null,Ke("ul",{className:"mt-2 -ml-3",children:r.map((e=>Ke(Do,{project:e,toggleTask:n},e.projectGraphNode.name)))})]})}function Ao(e,t,n,r){var o;const i=Ir(e.name,n);return{projectGraphNode:e,isSelected:t.includes(e.name),error:null!=(o=null==r?void 0:r[i])?o:null}}function Ro({projects:e,workspaceLayout:t,selectedTarget:n,selectedProjects:r,toggleProject:o,children:i,errors:a}){const s=e.filter((e=>{var t;return null==(t=e.data.targets)?void 0:t.hasOwnProperty(n)})).sort(((e,t)=>e.name.localeCompare(t.name))),l=Rr("app",s),u=Rr("lib",s),c=Rr("e2e",s),d=Mr(l,t),f=Mr(u,t),h=Mr(c,t),p=Object.keys(d).sort(),v=Object.keys(f).sort(),g=Object.keys(h).sort();return Ke("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[i,Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"}),p.map((e=>Ke(No,{headerText:e,projects:d[e].map((e=>Ao(e,r,n,a))),toggleTask:o},"app-"+e))),Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"}),g.map((e=>Ke(No,{headerText:e,projects:h[e].map((e=>Ao(e,r,n,a))),toggleTask:o},"e2e-"+e))),Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"}),v.map((e=>Ke(No,{headerText:e,projects:f[e].map((e=>Ao(e,r,n,a))),toggleTask:o},"lib-"+e)))]})}function Mo(){var e;const t=yt(),n=(0,ut.useNavigate)(),o=(0,ut.useParams)(),i=Nr(),[a,s]=(0,ut.useSearchParams)(),l="true"===a.get("groupByProject"),u=(0,ut.useRouteLoaderData)("selectedWorkspace"),c=u.layout,d=(0,ut.useRouteLoaderData)("selectedTarget"),{taskGraphs:f,errors:h}=d;let{projects:p,targets:v}=u;const g=null!=(e=o.selectedTarget)?e:v[0],y=pr().currentPath===`/tasks/${g}/all`,m=p.filter((e=>{var t;return(null==(t=e.data.targets)?void 0:t.hasOwnProperty(g))&&!(null!=h&&h.hasOwnProperty(Ir(e.name,g)))})),b=(0,r.useMemo)((()=>{var e,t;return y?m.map((({name:e})=>e)):null!=(e=null==(t=a.get("projects"))?void 0:t.split(" "))?e:[]}),[m,a,y]);function x(){a.delete("projects"),n(i({pathname:`/tasks/${encodeURIComponent(g)}`,search:a.toString()},!1))}return(0,r.useEffect)((()=>{t.handleTaskEvent({type:"notifyTaskGraphSetProjects",projects:u.projects,taskGraphs:f})}),[u]),(0,r.useEffect)((()=>{l?t.handleTaskEvent({type:"setGroupByProject",groupByProject:!0}):t.handleTaskEvent({type:"setGroupByProject",groupByProject:!1})}),[a]),(0,r.useEffect)((()=>{t.handleTaskEvent({type:"notifyTaskGraphSetTasks",taskIds:b.map((e=>Ir(e,g)))})}),[t,b,g]),Ke(Xe.HY,{children:[Ke(_o,{showAll:()=>(a.delete("projects"),void n(i({pathname:`/tasks/${encodeURIComponent(g)}/all`,search:a.toString()},!1))),hideAll:()=>x(),showAffected:()=>{},hasAffected:!1,label:"tasks"}),Ke(ao,{checked:l,checkChanged:function(e){s((t=>(e?t.set("groupByProject","true"):t.delete("groupByProject"),t)),{relative:"path"})},name:"groupByProject",label:"Group by project",description:"Visually arrange tasks by project."}),Ke(Ro,{projects:p,selectedProjects:b,workspaceLayout:c,selectedTarget:g,toggleProject:function(e){b.includes(e)?function(e){const t=b.filter((t=>t!==e));0===t.length?a.delete("projects"):a.set("projects",t.join(" "));n(i({pathname:`/tasks/${encodeURIComponent(g)}`,search:a.toString()},!1))}(e):function(e){const t=[...b,e],r=t.length===m.length;r?a.delete("projects"):a.set("projects",t.join(" "));n(i({pathname:r?`/tasks/${encodeURIComponent(g)}/all`:`/tasks/${encodeURIComponent(g)}`,search:a.toString()},!1))}(e)},errors:h,children:[Ke("label",{htmlFor:"selectedTarget",className:"my-2 block text-sm font-medium text-gray-700",children:"Target Name"}),Ke(it,{id:"selectedTarget",className:"w-full","data-cy":"selected-target-dropdown",defaultValue:g,onChange:e=>{var t;(t=e.currentTarget.value)!==g&&(x(),o.selectedTarget?n({pathname:`../${encodeURIComponent(t)}`,search:a.toString()}):n({pathname:`${encodeURIComponent(t)}`,search:a.toString()}))},children:v.map((e=>Ke("option",{value:e,children:e},e)))})]})]})}function Io(){let e=(0,ut.useRouteError)();return console.error(e),Ke("div",{className:"mt-8 px-4",children:[Ke("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"Error"}),Ke("p",{children:"There was a problem loading your task graph."})]})}const{appConfig:Lo}=Mt(),Bo=jo();function Fo(){return"dev"===Mt().environment?Go:Uo}const zo=async e=>{const t=Lo.workspaces.find((t=>t.id===e)),n=await Bo.getProjectGraph(t.projectGraphUrl),r=new Set;n.projects.forEach((e=>{var t;Object.keys(null!=(t=e.data.targets)?t:{}).forEach((e=>{r.add(e)}))}));const o=Array.from(r).sort(((e,t)=>e.localeCompare(t)));return Object.assign({},n,{targets:o})},Vo=[{path:"projects",children:[{index:!0,element:Ke(Co,{})},{path:"all",element:Ke(Co,{})},{path:"affected",element:Ke(Co,{})},{path:":focusedProject",element:Ke(Co,{})},{path:"trace/:startTrace",element:Ke(Co,{})},{path:"trace/:startTrace/:endTrace",element:Ke(Co,{})}]},{loader:async({request:e,params:t})=>{var n;return(async e=>{const t=Lo.workspaces.find((t=>t.id===e));return await Bo.getTaskGraph(t.taskGraphUrl)})(null!=(n=t.selectedWorkspaceId)?n:Lo.defaultWorkspaceId)},path:"tasks",id:"selectedTarget",errorElement:Ke(Io,{}),shouldRevalidate:({currentParams:e,nextParams:t})=>!e.selectedWorkspaceId||e.selectedWorkspaceId!==t.selectedWorkspaceId,children:[{index:!0,element:Ke(Mo,{})},{path:":selectedTarget",element:Ke(Mo,{}),children:[{path:"all",element:Ke(Mo,{})}]}]}],Go=[{path:"/",children:[{index:!0,loader:async({request:e,params:t})=>{const{search:n}=new URL(e.url);return(0,ut.redirect)(`/${Lo.defaultWorkspaceId}/projects${n}`)}},{path:":selectedWorkspaceId",id:"selectedWorkspace",element:Ke(Gr,{}),shouldRevalidate:({currentParams:e,nextParams:t})=>e.selectedWorkspaceId!==t.selectedWorkspaceId,loader:async({request:e,params:t})=>{var n;const r=null!=(n=t.selectedWorkspaceId)?n:Lo.defaultWorkspaceId;return zo(r)},children:Vo}]}],Uo=[{path:"/",id:"selectedWorkspace",loader:async({request:e,params:t})=>{const n=Lo.defaultWorkspaceId;return zo(n)},shouldRevalidate:()=>!1,element:Ke(Gr,{}),children:[{index:!0,loader:({request:e})=>{const{search:t}=new URL(e.url);return(0,ut.redirect)(`/projects${t}`)}},...Vo]}];let Ho;function Wo(){if(!Ho){const e=Mt();let t=ut.createBrowserRouter;"build"===e.localMode&&(t=ut.createHashRouter),Ho=t(Fo())}return Ho}var Yo;function qo(){return Ke(ut.RouterProvider,{router:Wo()})}Et(null!=(Yo=localStorage.getItem(bt))?Yo:"system"),function(){var e;jt(null!=(e=localStorage.getItem(St))?e:"TB")}();!0===window.useXstateInspect&&(0,o.XY)({url:"https://stately.ai/viz?inspect",iframe:!1}),window.externalApi=new class ExternalApi{constructor(){this._projectGraphService=Or(),this._graphIsReady=new Promise((e=>{this._projectGraphService.subscribe((t=>{t.matches("idle")||e()}))})),this.router=Wo(),this.projectGraphService={send:e=>{this.handleLegacyProjectGraphEvent(e)}}}get depGraphService(){return this.projectGraphService}focusProject(e){this.router.navigate(`/projects/${encodeURIComponent(e)}`)}selectAllProjects(){this.router.navigate("/projects/all")}enableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","true"),window.appConfig.showExperimentalFeatures=!0}disableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","false"),window.appConfig.showExperimentalFeatures=!1}handleLegacyProjectGraphEvent(e){switch(e.type){case"focusProject":this.focusProject(e.projectName);break;case"selectAll":this.selectAllProjects();break;default:this._graphIsReady.then((()=>this._projectGraphService.send(e)))}}};const Xo=document.getElementById("app");window.appConfig?(0,Xe.sY)(Ke(r.StrictMode,{children:Ke(qo,{})}),Xo):(0,Xe.sY)(Ke("p",{children:["No environment could be found. Please run"," ",Ke("pre",{children:"npx nx run graph-client:generate-dev-environment-js"}),"."]}),Xo)},19798:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GraphService:()=>GraphService});n(15735),n(6886),n(77950),n(94908);var r=n(93218),o=n.n(r),i=n(81368),a=n.n(i),s=n(10404),l=n.n(s);n(43430),n(43105),n(85940);let u;!function(e){e.blue_500="hsla(217, 91%, 60%, 1)",e.blue_600="hsla(221, 83%, 53%, 1)",e.sky_500="hsla(199, 89%, 48%, 1)",e.sky_600="hsla(200, 98%, 39%, 1)",e.pink_400="hsla(329, 86%, 70%, 1)",e.pink_500="hsla(330, 81%, 60%, 1)",e.fuchsia_500="hsla(292, 84%, 61%, 1)",e.fuchsia_600="hsla(293, 69%, 49%, 1)",e.fuchsia_700="hsla(295, 72%, 40%, 1)",e.fuchsia_800="hsla(295, 70%, 33%, 1)",e.slate_50="hsla(210, 40%, 98%, 1)",e.slate_100="hsla(210, 40%, 96%, 1)",e.slate_200="hsla(214, 32%, 91%, 1)",e.slate_300="hsla(213, 27%, 84%, 1)",e.slate_400="hsla(213, 27%, 84%, 1)",e.slate_500="hsla(215, 16%, 47%, 1)",e.slate_600="hsla(215, 19%, 35%, 1)",e.slate_700="hsla(215, 25%, 27%, 1)",e.slate_800="hsla(217, 33%, 17%, 1)",e.white="#fff"}(u||(u={}));const c="NX_GRAPH_DARK_MODE";function d(e,t,n){return function(e){return!0===e.scratch(c)}(e)?t:n}const f=[{selector:"edge",style:{width:"1px","line-color":e=>d(e,u.slate_400,u.slate_500),"text-outline-color":e=>d(e,u.slate_400,u.slate_500),"text-outline-width":"0px",color:e=>d(e,u.slate_400,u.slate_500),"curve-style":"unbundled-bezier","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":e=>d(e,u.slate_400,u.slate_500)}},{selector:"edge.affected",style:{"line-color":e=>d(e,u.fuchsia_500,u.pink_500),"target-arrow-color":e=>d(e,u.fuchsia_500,u.pink_500),"curve-style":"unbundled-bezier"}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","curve-style":"unbundled-bezier","text-rotation":"autorotate"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed","curve-style":"unbundled-bezier"}},{selector:"edge.transparent",style:{opacity:.2}}];const h=new class LabelWidthCalculator{constructor(){this.cache=new Map,this.ctx=void 0}calculateWidth(e){this.ctx||(this.ctx=document.createElement("canvas").getContext("2d"));const t=e.data("id"),n=e.style("font-style"),r=e.style("font-size"),o=e.style("font-family"),i=e.style("font-weight");this.ctx.font=n+" "+i+" "+r+" "+o;const a=this.cache.get(t);if(a)return a;{const n=this.ctx.measureText(e.data("id")).width;return this.cache.set(t,n),n}}},p=[{selector:"node",style:{"font-size":"32px","font-family":'system-ui, "Helvetica Neue", sans-serif',backgroundColor:e=>d(e,u.slate_600,u.slate_200),"border-style":"solid","border-color":e=>d(e,u.slate_700,u.slate_300),"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",color:e=>d(e,u.slate_200,u.slate_600),label:"data(id)",width:e=>h.calculateWidth(e),"transition-property":"background-color, border-color, line-color, target-arrow-color","transition-duration":250,"transition-timing-function":"ease-out",shape:"round-rectangle"}},{selector:"node.focused",style:{color:u.white,"border-color":e=>d(e,u.slate_700,u.slate_200),backgroundColor:e=>d(e,u.sky_500,u.blue_500),width:e=>h.calculateWidth(e)}},{selector:"node.affected",style:{color:u.white,"border-color":e=>d(e,u.fuchsia_800,u.pink_500),backgroundColor:e=>d(e,u.fuchsia_700,u.pink_400)}},{selector:"node.parentNode",style:{"background-opacity":e=>d(e,.5,.8),backgroundColor:e=>d(e,u.slate_700,u.slate_50),"border-color":e=>d(e,u.slate_500,u.slate_400),"border-style":"dashed","border-width":2,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}},{selector:"node.highlight",style:{color:u.white,"border-color":e=>d(e,u.sky_600,u.blue_600),backgroundColor:e=>d(e,u.sky_500,u.blue_500)}},{selector:"node.transparent:childless",style:{opacity:.5}},{selector:"node.transparent:parent",style:{"text-opacity":.5,"background-opacity":.25,"border-opacity":.5}},{selector:"node.taskNode",style:{label:"data(label)"}}],v={name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,rankDir:"TB",edgeSep:50,ranker:"network-simplex"};class RenderGraph{constructor(e,t,n,r="TB"){this.container=e,this.renderMode=n,this.cy=void 0,this.collapseEdges=!1,this._theme=void 0,this._rankDir="TB",this.listeners=new Map,this._theme=t,this._rankDir=r}set theme(e){this._theme=e,this.render()}set rankDir(e){this._rankDir=e,this.render()}get activeContainer(){return"string"==typeof this.container?document.getElementById(this.container):this.container}broadcast(e){this.listeners.forEach((t=>t(e)))}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}setElements(e){let t;this.cy&&(t=this.cy.nodes(".focused").first().id(),this.cy.destroy(),delete this.cy),this.cy=o()({headless:null===this.activeContainer,container:this.activeContainer,boxSelectionEnabled:!1,style:[...p,...f],panningEnabled:!0,userZoomingEnabled:"nx-docs"!==this.renderMode}),this.cy.add(e),t&&this.cy.$id(t).addClass("focused"),this.cy.on("zoom pan",(()=>{this.broadcast({type:"GraphRegenerated"})})),this.listenForProjectNodeClicks(),this.listenForEdgeNodeClicks(),this.listenForProjectNodeHovers(),this.listenForTaskNodeClicks(),this.listenForEmptyClicks()}render(){var e,t,n,r;if(this.cy){const e=this.cy.elements().sort(((e,t)=>e.id().localeCompare(t.id())));e.layout(Object.assign({},v,{rankDir:this._rankDir})).run(),this.collapseEdges&&(this.cy.remove(this.cy.edges()),e.edges().forEach((e=>{const t=e.source(),n=e.target();if(t.parent().first().id()===n.parent().first().id())this.cy.add(e);else{let r,o;const i=e.connectedNodes().commonAncestors();let a,s;if(i.length>0?(r=t.ancestors().filter((e=>!i.contains(e))),o=n.ancestors().filter((e=>!i.contains(e)))):(r=t.ancestors(),o=n.ancestors()),r.length>0&&0===o.length?(a=r.last().id(),s=n.id()):o.length>0&&0===r.length?(a=t.id(),s=o.last().id()):(a=r.last().id(),s=o.last().id()),void 0!==a&&void 0!==s){const e=`${a}|${s}`;if(0===this.cy.$id(e).length){const t={group:"edges",data:{id:e,source:a,target:s}};this.cy.add(t)}}else console.log(`Couldn't figure out how to draw edge ${e.id()}`),console.log("source ancestors",r.map((e=>e.id()))),console.log("target ancestors",o.map((e=>e.id())))}}))),"nx-console"===this.renderMode?this.cy.fit(this.cy.elements(),175).center().resize().panBy({x:150,y:0}):this.cy.fit(this.cy.elements(),25).center().resize(),this.cy.scratch(c,"dark"===this._theme),this.cy.elements().scratch(c,"dark"===this._theme),this.cy.mount(this.activeContainer)}return{numNodes:null!=(e=null==(t=this.cy)?void 0:t.nodes().length)?e:0,numEdges:null!=(n=null==(r=this.cy)?void 0:r.edges().length)?n:0}}listenForProjectNodeClicks(){this.cy.$("node.projectNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"ProjectNodeClick",ref:n,id:t.id(),data:{id:t.id(),type:t.data("type"),tags:t.data("tags"),description:t.data("description")}})}))}listenForTaskNodeClicks(){this.cy.$("node.taskNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"TaskNodeClick",ref:n,id:t.id(),data:{id:t.id(),label:t.data("label"),executor:t.data("executor"),description:t.data("description")}})}))}listenForEdgeNodeClicks(){this.cy.$("edge.projectEdge").on("click",(e=>{var t;const n=e.target;let r=n.popperRef();this.broadcast({type:"EdgeClick",ref:r,id:n.id(),data:{id:n.id(),type:n.data("type"),source:n.source().id(),target:n.target().id(),fileDependencies:(null==(t=n.source().data("files"))?void 0:t.filter((e=>e.dependencies&&e.dependencies.find((e=>e.target===n.target().id())))).map((e=>({fileName:e.file.replace(`${n.source().data("root")}/`,""),target:n.target().id()}))))||[]}})}))}listenForProjectNodeHovers(){this.cy.on("mouseover",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().difference(t.outgoers().union(t.incomers())).not(t).addClass("transparent"),t.addClass("highlight").outgoers().union(t.incomers()).addClass("highlight"))})),this.cy.on("mouseout",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().removeClass("transparent"),t.removeClass("highlight").outgoers().union(t.incomers()).removeClass("highlight"))}))}listenForEmptyClicks(){this.cy.on("click",(e=>{e.target===this.cy&&this.broadcast({type:"BackgroundClick"})}))}getImage(){const e=d(this.cy,"#0F172A","#FFFFFF");return this.cy.png({bg:e,full:!0})}setFocussedElement(e){this.cy.$id(e).addClass("focused")}clearFocussedElement(){var e;null==(e=this.cy)||e.nodes(".focused").removeClass("focused")}getCurrentlyShownProjectIds(){var e,t;return null!=(e=null==(t=this.cy)?void 0:t.nodes().map((e=>e.data("id"))))?e:[]}}n(39529),n(31235),n(634);class ProjectNode{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null,files:this.project.data.files,root:this.project.data.root,description:this.project.data.description}}getClasses(){let e=`projectNode ${this.project.type}`;return this.affected&&(e+=" affected"),e}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){if(!this.project.data.root)return[];return function(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}(this.project.data.root,this.workspaceRoot).map(((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:`dir-${r}`,parentId:t>0?`dir-${[...n].slice(0,t).join("/")}`:null}}))}}class ProjectEdge{constructor(e){this.dep=e,this.affected=!1}getCytoscapeNodeDef(){var e;let t;return t={group:"edges",classes:"projectEdge",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target,type:this.dep.type}},t.classes+=null!=(e=` ${this.dep.type}`)?e:"",this.affected&&(t.classes+=" affected"),t}}class ParentNode{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",classes:"parentNode",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label,type:"dir"},selectable:!1,grabbable:!1,pannable:!0}}}class ProjectTraversalGraph{constructor(){this.cy=void 0}setShownProjects(e){let t=this.cy.collection();e.forEach((e=>{t=t.union(this.cy.$id(e))}));const n=t.ancestors(),r=t.union(n),o=r.edgesTo(r);return r.union(o)}showProjects(e,t){let n=this.cy.collection();e.forEach((e=>{n=n.union(this.cy.$id(e))})),t.forEach((e=>{n=n.union(this.cy.$id(e))}));const r=n.ancestors(),o=n.union(r),i=o.edgesTo(o);return o.union(i)}hideProjects(e,t){let n=this.cy.collection();t.forEach((e=>{n=n.union(this.cy.$id(e))}));let r=this.cy.collection();e.forEach((e=>{r=r.union(this.cy.$id(e))}));const o=n.difference(r).difference(r.ancestors()),i=o.ancestors();let a=o.union(i);const s=a.edgesTo(a);return a.union(s)}showAffectedProjects(){const e=this.cy.nodes(".affected"),t=e.ancestors(),n=e.union(t),r=n.edgesTo(n);return n.union(r)}focusProject(e,t=1){const n=this.cy.$id(e),r=this.includeProjectsByDepth(n,t),o=n.union(r),i=o.ancestors(),a=o.union(i),s=a.edgesTo(a);return a.union(s)}showAllProjects(){return this.cy.elements()}hideAllProjects(){return this.cy.collection()}filterProjectsByText(e,t,n=-1){if(""===e)return this.cy.collection();{const r=e.split(",");let o=this.cy.nodes().filter((e=>r.findIndex((t=>e.id().includes(t)))>-1));t&&(o=o.union(this.includeProjectsByDepth(o,n))),o=o.union(o.ancestors());const i=o.edgesTo(o);return o.union(i)}}traceProjects(e,t){const n=this.cy.elements().dijkstra({root:`[id = "${e}"]`,directed:!0}).pathTo(this.cy.$(`[id = "${t}"]`));return n.union(n.ancestors())}traceAllProjects(e,t){const n=[[this.cy.$id(e).nodes().first()]],r=[];let o=0;for(;n.length>0&&o<=1e3;){const e=n.pop(),i=e[e.length-1].outgoers("node");i.length>0&&i.forEach((o=>{const i=[...e,o];o.id()===t?r.push(i):n.push(i)})),o++}o>=1e3&&console.log("failsafe triggered!");let i=this.cy.collection();return r.forEach((e=>{for(let t=0;t<e.length;t++){i=i.union(e[t]);const n=t+1;n<e.length&&(i=i.union(e[t].edgesTo(e[n])))}})),i.union(i.ancestors())}includeProjectsByDepth(e,t=-1){let n,r;if(-1===t)n=e.predecessors();else{n=e.incomers();for(let e=1;e<t;e++)n=n.union(n.incomers())}if(-1===t)r=e.successors();else{r=e.outgoers();for(let e=1;e<t;e++)r=r.union(r.outgoers())}return e.union(n).union(r)}initGraph(e,t,n,r,o,i){this.generateCytoscapeLayout(e,t,n,r,o)}generateCytoscapeLayout(e,t,n,r,i){const a=this.createElements(e,t,n,r,i);this.cy=o()({headless:!0,elements:[...a],boxSelectionEnabled:!1})}createElements(e,t,n,r,o){let i=[];const a=e.map((e=>e.name)),s=[],l=[],u={};e.forEach((e=>{const i="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,c=new ProjectNode(e,i);if(c.affected=o.includes(e.name),s.push(c),r[e.name].forEach((e=>{if(a.includes(e.target)){const t=new ProjectEdge(e);l.push(t)}})),t){c.getAncestors().forEach((e=>u[e.id]=e))}}));const c=s.map((e=>e.getCytoscapeNodeDef(t))),d=l.map((e=>e.getCytoscapeNodeDef()));if(i=c.concat(d),t){i=Object.keys(u).map((e=>new ParentNode(u[e]).getCytoscapeNodeDef())).concat(i)}return i}}class TaskNode{constructor(e,t){this.task=e,this.project=t}getCytoscapeNodeDef(e){return{group:"nodes",classes:"taskNode",data:this.getData(e),selectable:!1,grabbable:!1,pannable:!0}}getData(e){const t=e?this.task.id.split(":").slice(1).join(":"):this.task.id;return{id:this.task.id,label:t,executor:this.project.data.targets[this.task.target.target].executor,parent:e?this.task.target.project:null,description:this.project.data.description}}}class TaskEdge{constructor(e,t){this.source=e,this.target=t}getCytoscapeNodeDef(){let e;return e={group:"edges",data:{id:`${this.source}|${this.target}`,source:this.source,target:this.target}},e}}class TaskTraversalGraph{constructor(){this.projects=[],this.taskGraphs={},this.cy=void 0,this.groupByProject=!1,this.selectedTasks=new Set}setProjects(e,t){this.selectedTasks.clear(),this.projects=e,this.taskGraphs=t}setGroupByProject(e){return this.groupByProject=e,this.selectedTasks.size>0?this.createElements(Array.from(this.selectedTasks),e):this.cy=o()({headless:!0,elements:[]}),this.cy.elements()}setTasks(e){let t=!1;this.selectedTasks.forEach((n=>{e.includes(n)||(this.selectedTasks.delete(n),t=!0)}));for(const n of e)this.selectedTasks.has(n)||(this.selectedTasks.add(n),t=!0);return t&&this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}selectTask(e){return e.forEach((e=>{this.selectedTasks.add(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}deselectTask(e){return e.forEach((e=>{this.selectedTasks.delete(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}createElements(e,t){const n=[];e.forEach((e=>{const r=this.taskGraphs[e];if(void 0===r)throw new Error(`Could not find task graph for ${e}`);const o={};for(let i in r.tasks){const e=r.tasks[i],a=this.projects.find((t=>t.name===e.target.project));if(void 0===a)throw new Error(`Could not find project ${a.name}`);n.push(new TaskNode(r.tasks[i],a)),t&&(o[a.name]={id:a.name,parentId:null,label:a.name})}for(let t in o)n.push(new ParentNode(o[t]));for(let t in r.dependencies)r.dependencies[t].forEach((e=>n.push(new TaskEdge(t,e))))})),this.cy=o()({headless:!0,elements:n.map((e=>e.getCytoscapeNodeDef(t))),boxSelectionEnabled:!1})}}class GraphService{constructor(e,t,n,o="TB"){this.projectTraversalGraph=void 0,this.taskTraversalGraph=void 0,this.renderGraph=void 0,this.lastPerformanceReport={numEdges:0,numNodes:0,renderTime:0},this.listeners=new Map,(0,r.use)(a()),(0,r.use)(l()),this.renderGraph=new RenderGraph(e,t,n,o),this.renderGraph.listen((e=>this.broadcast(e))),this.projectTraversalGraph=new ProjectTraversalGraph,this.taskTraversalGraph=new TaskTraversalGraph}set theme(e){this.renderGraph.theme=e}set rankDir(e){this.renderGraph.rankDir=e}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}broadcast(e){this.listeners.forEach((t=>t(e)))}handleProjectEvent(e){const t=Date.now();let n;switch("notifyGraphUpdateGraph"!==e.type&&this.renderGraph.clearFocussedElement(),e.type){case"notifyGraphInitGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges);break;case"notifyGraphUpdateGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges),n=this.projectTraversalGraph.setShownProjects(e.selectedProjects.length>0?e.selectedProjects:this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphFocusProject":n=this.projectTraversalGraph.focusProject(e.projectName,e.searchDepth);break;case"notifyGraphFilterProjectsByText":n=this.projectTraversalGraph.filterProjectsByText(e.search,e.includeProjectsByPath,e.searchDepth);break;case"notifyGraphShowProjects":n=this.projectTraversalGraph.showProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphHideProjects":n=this.projectTraversalGraph.hideProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphShowAllProjects":n=this.projectTraversalGraph.showAllProjects();break;case"notifyGraphHideAllProjects":n=this.projectTraversalGraph.hideAllProjects();break;case"notifyGraphShowAffectedProjects":n=this.projectTraversalGraph.showAffectedProjects();break;case"notifyGraphTracing":e.start&&e.end&&(n="shortest"===e.algorithm?this.projectTraversalGraph.traceProjects(e.start,e.end):this.projectTraversalGraph.traceAllProjects(e.start,e.end))}let r=[],o={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph)if(n){var i;this.renderGraph.setElements(n),"notifyGraphFocusProject"===e.type&&this.renderGraph.setFocussedElement(e.projectName);const{numEdges:a,numNodes:s}=this.renderGraph.render();r=(null!=(i=n.nodes('[type!="dir"]'))?i:[]).map((e=>e.id()));o={renderTime:Date.now()-t,numNodes:s,numEdges:a}}else{const{numEdges:e,numNodes:n}=this.renderGraph.render();this.renderGraph.getCurrentlyShownProjectIds();o={renderTime:Date.now()-t,numNodes:n,numEdges:e}}return this.lastPerformanceReport=o,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:o}}handleTaskEvent(e){const t=Date.now();let n;switch(this.broadcast({type:"GraphRegenerated"}),e.type){case"notifyTaskGraphSetProjects":this.taskTraversalGraph.setProjects(e.projects,e.taskGraphs);break;case"notifyTaskGraphSetTasks":n=this.taskTraversalGraph.setTasks(e.taskIds);break;case"notifyTaskGraphTasksSelected":n=this.taskTraversalGraph.selectTask(e.taskIds);break;case"notifyTaskGraphTasksDeselected":n=this.taskTraversalGraph.deselectTask(e.taskIds);break;case"setGroupByProject":n=this.taskTraversalGraph.setGroupByProject(e.groupByProject)}let r=[],o={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph&&n){var i;this.renderGraph.setElements(n);const{numEdges:e,numNodes:a}=this.renderGraph.render();r=(null!=(i=n.nodes('[type!="dir"]'))?i:[]).map((e=>e.id()));o={renderTime:Date.now()-t,numNodes:a,numEdges:e}}return this.lastPerformanceReport=o,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:o}}getImage(){return this.renderGraph.getImage()}}},60367:(e,t)=>{"use strict";function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof n(e).Element||e instanceof Element}function o(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function i(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(t,"__esModule",{value:!0});var a=Math.max,s=Math.min,l=Math.round;function u(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(u())}function d(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),s=1,u=1;t&&o(e)&&(s=e.offsetWidth>0&&l(a.width)/e.offsetWidth||1,u=e.offsetHeight>0&&l(a.height)/e.offsetHeight||1);var d=(r(e)?n(e):window).visualViewport,f=!c()&&i,h=(a.left+(f&&d?d.offsetLeft:0))/s,p=(a.top+(f&&d?d.offsetTop:0))/u,v=a.width/s,g=a.height/u;return{width:v,height:g,top:p,right:h+v,bottom:p+g,left:h,x:h,y:p}}function f(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function p(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function v(e){return d(p(e)).left+f(e).scrollLeft}function g(e){return n(e).getComputedStyle(e)}function y(e){var t=g(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function m(e,t,r){void 0===r&&(r=!1);var i,a,s=o(t),u=o(t)&&function(e){var t=e.getBoundingClientRect(),n=l(t.width)/e.offsetWidth||1,r=l(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),c=p(t),g=d(e,u,r),m={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(s||!s&&!r)&&(("body"!==h(t)||y(c))&&(m=(i=t)!==n(i)&&o(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:f(i)),o(t)?((b=d(t,!0)).x+=t.clientLeft,b.y+=t.clientTop):c&&(b.x=v(c))),{x:g.left+m.scrollLeft-b.x,y:g.top+m.scrollTop-b.y,width:g.width,height:g.height}}function b(e){var t=d(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function x(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(i(e)?e.host:null)||p(e)}function w(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:o(e)&&y(e)?e:w(x(e))}function _(e,t){var r;void 0===t&&(t=[]);var o=w(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=n(o),s=i?[a].concat(a.visualViewport||[],y(o)?o:[]):o,l=t.concat(s);return i?l:l.concat(_(x(s)))}function E(e){return["table","td","th"].indexOf(h(e))>=0}function k(e){return o(e)&&"fixed"!==g(e).position?e.offsetParent:null}function S(e){for(var t=n(e),r=k(e);r&&E(r)&&"static"===g(r).position;)r=k(r);return r&&("html"===h(r)||"body"===h(r)&&"static"===g(r).position)?t:r||function(e){var t=/firefox/i.test(u());if(/Trident/i.test(u())&&o(e)&&"fixed"===g(e).position)return null;var n=x(e);for(i(n)&&(n=n.host);o(n)&&["html","body"].indexOf(h(n))<0;){var r=g(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var P="top",j="bottom",C="right",T="left",O="auto",D=[P,j,C,T],N="start",A="end",R="viewport",M="popper",I=D.reduce((function(e,t){return e.concat([t+"-"+N,t+"-"+A])}),[]),L=[].concat(D,[O]).reduce((function(e,t){return e.concat([t,t+"-"+N,t+"-"+A])}),[]),B=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function F(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function V(e){return e.split("-")[0]}function G(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&i(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function H(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function W(e,t,o){return t===R?H(function(e,t){var r=n(e),o=p(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,l=0,u=0;if(i){a=i.width,s=i.height;var d=c();(d||!d&&"fixed"===t)&&(l=i.offsetLeft,u=i.offsetTop)}return{width:a,height:s,x:l+v(e),y:u}}(e,o)):r(t)?function(e,t){var n=d(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,o):H(function(e){var t,n=p(e),r=f(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=a(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=a(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+v(e),u=-r.scrollTop;return"rtl"===g(o||n).direction&&(l+=a(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:l,y:u}}(p(e)))}function Y(e,t,n,i){var l="clippingParents"===t?function(e){var t=_(x(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&o(e)?S(e):e;return r(n)?t.filter((function(e){return r(e)&&G(e,n)&&"body"!==h(e)})):[]}(e):[].concat(t),u=[].concat(l,[n]),c=u[0],d=u.reduce((function(t,n){var r=W(e,n,i);return t.top=a(r.top,t.top),t.right=s(r.right,t.right),t.bottom=s(r.bottom,t.bottom),t.left=a(r.left,t.left),t}),W(e,c,i));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function q(e){return e.split("-")[1]}function X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?V(o):null,a=o?q(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case P:t={x:s,y:n.y-r.height};break;case j:t={x:s,y:n.y+n.height};break;case C:t={x:n.x+n.width,y:l};break;case T:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=i?X(i):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case N:t[u]=t[u]-(n[c]/2-r[c]/2);break;case A:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function K(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Q(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=void 0===o?e.placement:o,a=n.strategy,s=void 0===a?e.strategy:a,l=n.boundary,u=void 0===l?"clippingParents":l,c=n.rootBoundary,f=void 0===c?R:c,h=n.elementContext,v=void 0===h?M:h,g=n.altBoundary,y=void 0!==g&&g,m=n.padding,b=void 0===m?0:m,x=K("number"!=typeof b?b:Z(b,D)),w=v===M?"reference":M,_=e.rects.popper,E=e.elements[y?w:v],k=Y(r(E)?E:E.contextElement||p(e.elements.popper),u,f,s),S=d(e.elements.reference),T=$({reference:S,element:_,strategy:"absolute",placement:i}),O=H(Object.assign({},_,T)),N=v===M?O:S,A={top:k.top-N.top+x.top,bottom:N.bottom-k.bottom+x.bottom,left:k.left-N.left+x.left,right:N.right-k.right+x.right},I=e.modifiersData.offset;if(v===M&&I){var L=I[i];Object.keys(A).forEach((function(e){var t=[C,j].indexOf(e)>=0?1:-1,n=[P,j].indexOf(e)>=0?"y":"x";A[e]+=L[n]*t}))}return A}var J={placement:"bottom",modifiers:[],strategy:"absolute"};function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function te(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,i=t.defaultOptions,a=void 0===i?J:i;return function(e,t,n){void 0===n&&(n=a);var i,s,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},J,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],c=!1,d={state:l,setOptions:function(n){var i="function"==typeof n?n(l.options):n;f(),l.options=Object.assign({},a,l.options,i),l.scrollParents={reference:r(e)?_(e):e.contextElement?_(e.contextElement):[],popper:_(t)};var s=function(e){var t=F(e);return B.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,l.options.modifiers)));return l.orderedModifiers=s.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:l,name:t,instance:d,options:r}),a=function(){};u.push(i||a)}})),d.update()},forceUpdate:function(){if(!c){var e=l.elements,t=e.reference,n=e.popper;if(ee(t,n)){l.rects={reference:m(t,S(n),"fixed"===l.options.strategy),popper:b(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<l.orderedModifiers.length;r++)if(!0!==l.reset){var o=l.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,u=o.name;"function"==typeof i&&(l=i({state:l,options:s,name:u,instance:d})||l)}else l.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){f(),c=!0}};if(!ee(e,t))return d;function f(){u.forEach((function(e){return e()})),u=[]}return d.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var ne={passive:!0};var re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,l=void 0===s||s,u=n(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach((function(e){e.addEventListener("scroll",r.update,ne)})),l&&u.addEventListener("resize",r.update,ne),function(){a&&c.forEach((function(e){e.removeEventListener("scroll",r.update,ne)})),l&&u.removeEventListener("resize",r.update,ne)}},data:{}};var oe={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(e){var t,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,u=e.position,c=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,h=e.isFixed,v=s.x,y=void 0===v?0:v,m=s.y,b=void 0===m?0:m,x="function"==typeof f?f({x:y,y:b}):{x:y,y:b};y=x.x,b=x.y;var w=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),E=T,k=P,O=window;if(d){var D=S(r),N="clientHeight",R="clientWidth";if(D===n(r)&&"static"!==g(D=p(r)).position&&"absolute"===u&&(N="scrollHeight",R="scrollWidth"),i===P||(i===T||i===C)&&a===A)k=j,b-=(h&&D===O&&O.visualViewport?O.visualViewport.height:D[N])-o.height,b*=c?1:-1;if(i===T||(i===P||i===j)&&a===A)E=C,y-=(h&&D===O&&O.visualViewport?O.visualViewport.width:D[R])-o.width,y*=c?1:-1}var M,I=Object.assign({position:u},d&&ie),L=!0===f?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:l(t*r)/r||0,y:l(n*r)/r||0}}({x:y,y:b}):{x:y,y:b};return y=L.x,b=L.y,c?Object.assign({},I,((M={})[k]=_?"0":"",M[E]=w?"0":"",M.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",M)):Object.assign({},I,((t={})[k]=_?b+"px":"",t[E]=w?y+"px":"",t.transform="",t))}var se={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,u={placement:V(t.placement),variation:q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ae(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ae(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];o(i)&&h(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});o(r)&&h(r)&&(Object.assign(r.style,a),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=L.reduce((function(e,n){return e[n]=function(e,t,n){var r=V(e),o=[T,P].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[T,C].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},ce={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ce[e]}))}var fe={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return fe[e]}))}function pe(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?L:l,c=q(r),d=c?s?I:I.filter((function(e){return q(e)===c})):D,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,n){return t[n]=Q(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[V(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var ve={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,v=n.allowedAutoPlacements,g=t.options.placement,y=V(g),m=l||(y===g||!p?[de(g)]:function(e){if(V(e)===O)return[];var t=de(e);return[he(e),t,he(t)]}(g)),b=[g].concat(m).reduce((function(e,n){return e.concat(V(n)===O?pe(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:v}):n)}),[]),x=t.rects.reference,w=t.rects.popper,_=new Map,E=!0,k=b[0],S=0;S<b.length;S++){var D=b[S],A=V(D),R=q(D)===N,M=[P,j].indexOf(A)>=0,I=M?"width":"height",L=Q(t,{placement:D,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),B=M?R?C:T:R?j:P;x[I]>w[I]&&(B=de(B));var F=de(B),G=[];if(i&&G.push(L[A]<=0),s&&G.push(L[B]<=0,L[F]<=0),G.every((function(e){return e}))){k=D,E=!1;break}_.set(D,G)}if(E)for(var H=function(e){var t=b.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},W=p?3:1;W>0;W--){if("break"===H(W))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ge(e,t,n){return a(e,s(t,n))}var ye={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,l=n.altAxis,u=void 0!==l&&l,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,p=n.tether,v=void 0===p||p,g=n.tetherOffset,y=void 0===g?0:g,m=Q(t,{boundary:c,rootBoundary:d,padding:h,altBoundary:f}),x=V(t.placement),w=q(t.placement),_=!w,E=X(x),k="x"===E?"y":"x",O=t.modifiersData.popperOffsets,D=t.rects.reference,A=t.rects.popper,R="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,M="number"==typeof R?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(O){if(i){var B,F="y"===E?P:T,G="y"===E?j:C,H="y"===E?"height":"width",W=O[E],Y=W+m[F],$=W-m[G],K=v?-A[H]/2:0,Z=w===N?D[H]:A[H],J=w===N?-A[H]:-D[H],ee=t.elements.arrow,te=v&&ee?b(ee):{width:0,height:0},ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},re=ne[F],oe=ne[G],ie=ge(0,D[H],te[H]),ae=_?D[H]/2-K-ie-re-M.mainAxis:Z-ie-re-M.mainAxis,se=_?-D[H]/2+K+ie+oe+M.mainAxis:J+ie+oe+M.mainAxis,le=t.elements.arrow&&S(t.elements.arrow),ue=le?"y"===E?le.clientTop||0:le.clientLeft||0:0,ce=null!=(B=null==I?void 0:I[E])?B:0,de=W+se-ce,fe=ge(v?s(Y,W+ae-ce-ue):Y,W,v?a($,de):$);O[E]=fe,L[E]=fe-W}if(u){var he,pe="x"===E?P:T,ve="x"===E?j:C,ye=O[k],me="y"===k?"height":"width",be=ye+m[pe],xe=ye-m[ve],we=-1!==[P,T].indexOf(x),_e=null!=(he=null==I?void 0:I[k])?he:0,Ee=we?be:ye-D[me]-A[me]-_e+M.altAxis,ke=we?ye+D[me]+A[me]-_e-M.altAxis:xe,Se=v&&we?function(e,t,n){var r=ge(e,t,n);return r>n?n:r}(Ee,ye,ke):ge(v?Ee:be,ye,v?ke:xe);O[k]=Se,L[k]=Se-ye}t.modifiersData[r]=L}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=V(n.placement),l=X(s),u=[T,C].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(e,t){return K("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,D))}(o.padding,n),d=b(i),f="y"===l?P:T,h="y"===l?j:C,p=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],v=a[l]-n.rects.reference[l],g=S(i),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,m=p/2-v/2,x=c[f],w=y-d[u]-c[h],_=y/2-d[u]/2+m,E=ge(x,_,w),k=l;n.modifiersData[r]=((t={})[k]=E,t.centerOffset=E-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&G(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xe(e){return[P,C,j,T].some((function(t){return e[t]>=0}))}var we={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Q(t,{elementContext:"reference"}),s=Q(t,{altBoundary:!0}),l=be(a,r),u=be(s,o,i),c=xe(l),d=xe(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}},_e=te({defaultModifiers:[re,oe,se,le]}),Ee=[re,oe,se,le,ue,ve,ye,me,we],ke=te({defaultModifiers:Ee});t.applyStyles=le,t.arrow=me,t.computeStyles=se,t.createPopper=ke,t.createPopperLite=_e,t.defaultModifiers=Ee,t.detectOverflow=Q,t.eventListeners=re,t.flip=ve,t.hide=we,t.offset=ue,t.popperGenerator=te,t.popperOffsets=oe,t.preventOverflow=ye},44928:(e,t)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0,(r=t.Action||(t.Action={})).Pop="POP",r.Push="PUSH",r.Replace="REPLACE";const o="popstate";function i(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function a(e){return{usr:e.state,key:e.key}}function s(e,t,r,o){return void 0===r&&(r=null),n({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?u(t):t,{state:r,key:t&&t.key||o||Math.random().toString(36).substr(2,8)})}function l(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function u(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function c(e){let t="undefined"!=typeof window&&void 0!==window.location&&"null"!==window.location.origin?window.location.origin:"unknown://unknown",n="string"==typeof e?e:l(e);return new URL(n,t)}function d(e,r,i,u){void 0===u&&(u={});let{window:d=document.defaultView,v5Compat:f=!1}=u,h=d.history,p=t.Action.Pop,v=null;function g(){p=t.Action.Pop,v&&v({action:p,location:y.location})}let y={get action(){return p},get location(){return e(d,h)},listen(e){if(v)throw new Error("A history only accepts one active listener");return d.addEventListener(o,g),v=e,()=>{d.removeEventListener(o,g),v=null}},createHref:e=>r(d,e),encodeLocation(e){let t=c(l(e));return n({},e,{pathname:t.pathname,search:t.search,hash:t.hash})},push:function(e,n){p=t.Action.Push;let r=s(y.location,e,n);i&&i(r,e);let o=a(r),l=y.createHref(r);try{h.pushState(o,"",l)}catch(u){d.location.assign(l)}f&&v&&v({action:p,location:y.location})},replace:function(e,n){p=t.Action.Replace;let r=s(y.location,e,n);i&&i(r,e);let o=a(r),l=y.createHref(r);h.replaceState(o,"",l),f&&v&&v({action:p,location:y.location})},go:e=>h.go(e)};return y}let f;function h(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r=new Set),e.map(((e,o)=>{let i=[...t,o],a="string"==typeof e.id?e.id:i.join("-");if(E(!0!==e.index||!e.children,"Cannot specify children on an index route"),E(!r.has(a),'Found a route id collision on id "'+a+"\".  Route id's must be globally unique within Data Router usages"),r.add(a),function(e){return!0===e.index}(e)){return n({},e,{id:a})}return n({},e,{id:a,children:e.children?h(e.children,i,r):void 0})}))}function p(e,t,n){void 0===n&&(n="/");let r=_(("string"==typeof t?u(t):t).pathname||"/",n);if(null==r)return null;let o=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let a=0;null==i&&a<o.length;++a)i=b(o[a],w(r));return i}function v(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,o)=>{let i={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(E(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(r.length));let a=T([r,i.relativePath]),s=n.concat(i);e.children&&e.children.length>0&&(E(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),v(e.children,t,s,a)),(null!=e.path||e.index)&&t.push({path:a,score:m(a,e.index),routesMeta:s})})),t}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={}));const g=/^:\w+$/,y=e=>"*"===e;function m(e,t){let n=e.split("/"),r=n.length;return n.some(y)&&(r+=-2),t&&(r+=2),n.filter((e=>!y(e))).reduce(((e,t)=>e+(g.test(t)?3:""===t?1:10)),r)}function b(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a<n.length;++a){let e=n[a],s=a===n.length-1,l="/"===o?t:t.slice(o.length)||"/",u=x({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!u)return null;Object.assign(r,u.params);let c=e.route;i.push({params:r,pathname:T([o,u.pathname]),pathnameBase:O(T([o,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(o=T([o,u.pathnameBase]))}return i}function x(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);k("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(r.push(t),"([^\\/]+)")));e.endsWith("*")?(r.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");return[new RegExp(o,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return k(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(s[n]||"",t),e}),{}),pathname:i,pathnameBase:a,pattern:e}}function w(e){try{return decodeURI(e)}catch(t){return k(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function _(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function E(e,t){if(!1===e||null==e)throw new Error(t)}function k(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function S(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"==typeof e?u(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:D(r),hash:N(o)}}function P(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function j(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function C(e,t,r,o){let i;void 0===o&&(o=!1),"string"==typeof e?i=u(e):(i=n({},e),E(!i.pathname||!i.pathname.includes("?"),P("?","pathname","search",i)),E(!i.pathname||!i.pathname.includes("#"),P("#","pathname","hash",i)),E(!i.search||!i.search.includes("#"),P("#","search","hash",i)));let a,s=""===e||""===i.pathname,l=s?"/":i.pathname;if(o||null==l)a=r;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let c=S(i,a),d=l&&"/"!==l&&l.endsWith("/"),f=(s||"."===l)&&r.endsWith("/");return c.pathname.endsWith("/")||!d&&!f||(c.pathname+="/"),c}const T=e=>e.join("/").replace(/\/\/+/g,"/"),O=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),D=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class AbortedDeferredError extends Error{}class DeferredData{constructor(e){let t;this.pendingKeys=new Set,this.subscriber=void 0,E(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,n)=>t=n)),this.controller=new AbortController;let n=()=>t(new AbortedDeferredError("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:this.trackPromise(n,r)})}),{})}trackPromise(e,t){if(!(t instanceof Promise))return t;this.pendingKeys.add(e);let n=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(n,e,null,t)),(t=>this.onSettle(n,e,t)));return n.catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,t,n,r){if(this.controller.signal.aborted&&n instanceof AbortedDeferredError)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);this.pendingKeys.delete(t),this.done&&this.unlistenAbortSignal();const o=this.subscriber;return n?(Object.defineProperty(e,"_error",{get:()=>n}),o&&o(!1),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>r}),o&&o(!1),r)}subscribe(e){this.subscriber=e}cancel(){this.controller.abort(),this.pendingKeys.forEach(((e,t)=>this.pendingKeys.delete(t)));let e=this.subscriber;e&&e(!0)}async resolveData(e){let t=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener("abort",n),t=await new Promise((t=>{this.subscribe((r=>{e.removeEventListener("abort",n),(r||this.done)&&t(r)}))}))}return t}get done(){return 0===this.pendingKeys.size}get unwrappedData(){return E(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:A(r)})}),{})}}function A(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}class ErrorResponse{constructor(e,t,n){this.status=e,this.statusText=t||"",this.data=n}}function R(e){return e instanceof ErrorResponse}const M={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},I={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},L=!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement);const B=new Set(["POST","PUT","PATCH","DELETE"]),F=new Set(["GET","HEAD",...B]);function V(e,t,n){void 0===n&&(n=!1);let r="string"==typeof e?e:l(e);if(!t||!("formMethod"in t)&&!("formData"in t))return{path:r};if(null!=t.formMethod&&"get"!==t.formMethod)return{path:r,submission:{formMethod:t.formMethod,formAction:ie(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData}};if(!t.formData)return{path:r};let o=u(r);try{let e=K(t.formData);n&&o.search&&fe(o.search)&&e.append("index",""),o.search="?"+e}catch(i){return{path:r,error:new ErrorResponse(400,"Bad Request","Cannot submit binary form data using GET")}}return{path:l(o)}}function G(e,t){let{formMethod:n,formAction:r,formEncType:o,formData:i}=e.navigation;return{state:"loading",location:s(e.location,t.location),formMethod:n||void 0,formAction:r||void 0,formEncType:o||void 0,formData:i||void 0}}function H(e,t){let n=e;if(t){let r=e.findIndex((e=>e.route.id===t));r>=0&&(n=e.slice(0,r))}return n}function W(e,t,n,r,o,i,a,s,l,u){let c=l?Object.values(l)[0]:s?Object.values(s)[0]:null,d=H(t,l?Object.keys(l)[0]:void 0).filter(((t,a)=>null!=t.route.loader&&(function(e,t,n){let r=!t||n.route.id!==t.route.id,o=void 0===e[n.route.id];return r||o}(e.loaderData,e.matches[a],t)||i.some((e=>e===t.route.id))||q(e.location,e.matches[a],n,r,t,o,c)))),f=[];return u&&u.forEach(((e,t)=>{let[r,i,s]=e;if(a.includes(t))f.push([t,r,i,s]);else if(o){q(r,i,n,r,i,o,c)&&f.push([t,r,i,s])}})),[d,f]}function Y(e,t){let n=e.route.path;return e.pathname!==t.pathname||n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function q(e,t,r,o,i,a,s){let l=c(e),u=t.params,d=c(o),f=i.params,h=Y(t,i)||l.toString()===d.toString()||l.search!==d.search||a;if(i.route.shouldRevalidate){let e=i.route.shouldRevalidate(n({currentUrl:l,currentParams:u,nextUrl:d,nextParams:f},r,{actionResult:s,defaultShouldRevalidate:h}));if("boolean"==typeof e)return e}return h}async function X(e,t,n,r,o,i,a){let s,u,d;void 0===i&&(i=!1),void 0===a&&(a=!1);let h=new Promise(((e,t)=>d=t)),p=()=>d();t.signal.addEventListener("abort",p);try{let r=n.route[e];E(r,"Could not find the "+e+' to run on the "'+n.route.id+'" route'),u=await Promise.race([r({request:t,params:n.params}),h])}catch(v){s=f.error,u=v}finally{t.signal.removeEventListener("abort",p)}if(u instanceof Response){let e,d=u.status;if(d>=300&&d<=399){let e=u.headers.get("Location");E(e,"Redirects returned/thrown from loaders/actions must have a Location header");let a=C(e,j(r.slice(0,r.indexOf(n)+1)).map((e=>e.pathnameBase)),c(t.url).pathname);if(E(l(a),"Unable to resolve redirect location: "+u.headers.get("Location")),o){let e=a.pathname;a.pathname="/"===e?o:T([o,e])}if(e=l(a),i)throw u.headers.set("Location",e),u;return{type:f.redirect,status:d,location:e,revalidate:null!==u.headers.get("X-Remix-Revalidate")}}if(a)throw{type:s||f.data,response:u};let h=u.headers.get("Content-Type");return e=h&&h.startsWith("application/json")?await u.json():await u.text(),s===f.error?{type:s,error:new ErrorResponse(d,u.statusText,e),headers:u.headers}:{type:f.data,data:e,statusCode:u.status,headers:u.headers}}return s===f.error?{type:s,error:u}:u instanceof DeferredData?{type:f.deferred,deferredData:u}:{type:f.data,data:u}}function $(e,t,n){let r=c(ie(e)).toString(),o={signal:t};if(n){let{formMethod:e,formEncType:t,formData:r}=n;o.method=e.toUpperCase(),o.body="application/x-www-form-urlencoded"===t?K(r):r}return new Request(r,o)}function K(e){let t=new URLSearchParams;for(let[n,r]of e.entries())E("string"==typeof r,'File inputs are not supported with encType "application/x-www-form-urlencoded", please use "multipart/form-data" instead.'),t.append(n,r);return t}function Z(e,t,n,r,o){let i,a={},s=null,l=!1,u={};return n.forEach(((n,c)=>{let d=t[c].route.id;if(E(!le(n),"Cannot handle redirect results in processLoaderData"),se(n)){let t=ee(e,d),o=n.error;r&&(o=Object.values(r)[0],r=void 0),s=Object.assign(s||{},{[t.route.id]:o}),l||(l=!0,i=R(n.error)?n.error.status:500),n.headers&&(u[d]=n.headers)}else ae(n)?(o&&o.set(d,n.deferredData),a[d]=n.deferredData.data):(a[d]=n.data,null==n.statusCode||200===n.statusCode||l||(i=n.statusCode),n.headers&&(u[d]=n.headers))})),r&&(s=r),{loaderData:a,errors:s,statusCode:i||200,loaderHeaders:u}}function Q(e,t,r,o,i,a,s,l){let{loaderData:u,errors:c}=Z(t,r,o,i,l);for(let d=0;d<a.length;d++){let[t,,r]=a[d];E(void 0!==s&&void 0!==s[d],"Did not find corresponding fetcher result");let o=s[d];if(se(o)){let i=ee(e.matches,r.route.id);c&&c[i.route.id]||(c=n({},c,{[i.route.id]:o.error})),e.fetchers.delete(t)}else{if(le(o))throw new Error("Unhandled fetcher revalidation redirect");if(ae(o))throw new Error("Unhandled fetcher deferred data");{let n={state:"idle",data:o.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};e.fetchers.set(t,n)}}}return{loaderData:u,errors:c}}function J(e,t,r){let o=n({},t);return r.forEach((n=>{let r=n.route.id;void 0===t[r]&&void 0!==e[r]&&(o[r]=e[r])})),o}function ee(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function te(e,t,n){let r=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-"+t+"-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r,error:new ErrorResponse(t,n,null)}}function ne(e){return te(e,404,"Not Found")}function re(e){let t="string"==typeof e?e:l(e);return console.warn("You're trying to submit to a route that does not have an action.  To fix this, please add an `action` function to the route for ["+t+"]"),{type:f.error,error:new ErrorResponse(405,"Method Not Allowed","")}}function oe(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(le(n))return n}}function ie(e){return l(n({},"string"==typeof e?u(e):e,{hash:""}))}function ae(e){return e.type===f.deferred}function se(e){return e.type===f.error}function le(e){return(e&&e.type)===f.redirect}function ue(e){if(!(e instanceof Response))return!1;let t=e.status,n=e.headers.get("Location");return t>=300&&t<=399&&null!=n}async function ce(e,t,n,r,o,i){for(let a=0;a<n.length;a++){let s=n[a],l=t[a],u=e.find((e=>e.route.id===l.route.id)),c=null!=u&&!Y(u,l)&&void 0!==(i&&i[l.route.id]);ae(s)&&(o||c)&&await de(s,r,o).then((e=>{e&&(n[a]=e||n[a])}))}}async function de(e,t,n){if(void 0===n&&(n=!1),!(await e.deferredData.resolveData(t))){if(n)try{return{type:f.data,data:e.deferredData.unwrappedData}}catch(r){return{type:f.error,error:r}}return{type:f.data,data:e.deferredData.data}}}function fe(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function he(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function pe(e,t){let n="string"==typeof t?u(t).search:t.search;if(e[e.length-1].route.index&&fe(n||""))return e[e.length-1];let r=j(e);return r[r.length-1]}t.AbortedDeferredError=AbortedDeferredError,t.ErrorResponse=ErrorResponse,t.IDLE_FETCHER=I,t.IDLE_NAVIGATION=M,t.UNSAFE_convertRoutesToDataRoutes=h,t.UNSAFE_getPathContributingMatches=j,t.createBrowserHistory=function(e){return void 0===e&&(e={}),d((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return s("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:l(t)}),null,e)},t.createHashHistory=function(e){return void 0===e&&(e={}),d((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=u(e.location.hash.substr(1));return s("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:l(t))}),(function(e,t){i("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)},t.createMemoryHistory=function(e){void 0===e&&(e={});let n,{initialEntries:r=["/"],initialIndex:o,v5Compat:a=!1}=e;n=r.map(((e,t)=>p(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let u=f(o??n.length-1),c=t.Action.Pop,d=null;function f(e){return Math.min(Math.max(e,0),n.length-1)}function h(){return n[u]}function p(e,t,r){void 0===t&&(t=null);let o=s(n?h().pathname:"/",e,t,r);return i("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}return{get index(){return u},get action(){return c},get location(){return h()},createHref:e=>"string"==typeof e?e:l(e),encodeLocation:e=>e,push(e,r){c=t.Action.Push;let o=p(e,r);u+=1,n.splice(u,n.length,o),a&&d&&d({action:c,location:o})},replace(e,r){c=t.Action.Replace;let o=p(e,r);n[u]=o,a&&d&&d({action:c,location:o})},go(e){c=t.Action.Pop,u=f(u+e),d&&d({action:c,location:h()})},listen:e=>(d=e,()=>{d=null})}},t.createPath=l,t.createRouter=function(e){E(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=h(e.routes),o=null,i=new Set,a=null,l=null,u=null,c=!1,d=p(r,e.history.location,e.basename),f=null;if(null==d){let{matches:e,route:t,error:n}=ne(r);d=e,f={[t.id]:n}}let v,g,y=!d.some((e=>e.route.loader))||null!=e.hydrationData,m={historyAction:e.history.action,location:e.history.location,matches:d,initialized:y,navigation:M,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||f,fetchers:new Map},b=t.Action.Pop,x=!1,w=!1,_=!1,k=[],S=[],P=new Map,j=0,C=-1,T=new Map,O=new Set,D=new Map,N=new Map;function A(e){m=n({},m,e),i.forEach((e=>e(m)))}function R(r,o){var i;A(n({},null!=m.actionData&&null!=m.navigation.formMethod&&"loading"===m.navigation.state&&(null==(i=m.navigation.formAction)?void 0:i.split("?")[0])===r.pathname?{}:{actionData:null},o,o.loaderData?{loaderData:J(m.loaderData,o.loaderData,o.matches||[])}:{},{historyAction:b,location:r,initialized:!0,navigation:M,revalidation:"idle",restoreScrollPosition:!m.navigation.formData&&ve(r,o.matches||m.matches),preventScrollReset:x})),w||b===t.Action.Pop||(b===t.Action.Push?e.history.push(r,r.state):b===t.Action.Replace&&e.history.replace(r,r.state)),b=t.Action.Pop,x=!1,w=!1,_=!1,k=[],S=[]}async function B(o,i,c){g&&g.abort(),g=null,b=o,w=!0===(c&&c.startUninterruptedRevalidation),function(e,t){if(a&&l&&u){let n=t.map((e=>he(e,m.loaderData))),r=l(e,n)||e.key;a[r]=u()}}(m.location,m.matches),x=!0===(c&&c.preventScrollReset);let d=c&&c.overrideNavigation,f=p(r,i,e.basename);if(!f){let{matches:e,route:t,error:n}=ne(r);return fe(),void R(i,{matches:e,loaderData:{},errors:{[t.id]:n}})}if(h=m.location,y=i,h.pathname===y.pathname&&h.search===y.search&&h.hash!==y.hash)return void R(i,{matches:f});var h,y;g=new AbortController;let T,M,I=$(i,g.signal,c&&c.submission);if(c&&c.pendingError)M={[ee(f).route.id]:c.pendingError};else if(c&&c.submission){let e=await async function(e,r,o,i,a){let l;q(),A({navigation:n({state:"submitting",location:r},o)});let u=pe(i,r);if(u.route.action){if(l=await X("action",e,u,i,v.basename),e.signal.aborted)return{shortCircuited:!0}}else l=re(r);if(le(l)){let e=n({state:"loading",location:s(m.location,l.location)},o);return await H(l,e,a&&a.replace),{shortCircuited:!0}}if(se(l)){let e=ee(i,u.route.id);return!0!==(a&&a.replace)&&(b=t.Action.Push),{pendingActionError:{[e.route.id]:l.error}}}if(ae(l))throw new Error("defer() is not supported in actions");return{pendingActionData:{[u.route.id]:l.data}}}(I,i,c.submission,f,{replace:c.replace});if(e.shortCircuited)return;T=e.pendingActionData,M=e.pendingActionError,d=n({state:"loading",location:i},c.submission)}let{shortCircuited:L,loaderData:B,errors:F}=await async function(e,t,r,o,i,a,s,l){let u=o;if(!u){u={state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0}}let[c,d]=W(m,r,i,t,_,k,S,s,l,D);if(fe((e=>!(r&&r.some((t=>t.route.id===e)))||c&&c.some((t=>t.route.id===e)))),0===c.length&&0===d.length)return R(t,{matches:r,loaderData:J(m.loaderData,{},r),errors:l||null,actionData:s||null}),{shortCircuited:!0};w||(d.forEach((e=>{let[t]=e,n=m.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};m.fetchers.set(t,r)})),A(n({navigation:u,actionData:s||m.actionData||null},d.length>0?{fetchers:new Map(m.fetchers)}:{})));C=++j,d.forEach((e=>{let[t]=e;return P.set(t,g)}));let{results:f,loaderResults:h,fetcherResults:p}=await Y(m.matches,r,c,d,e);if(e.signal.aborted)return{shortCircuited:!0};d.forEach((e=>{let[t]=e;return P.delete(t)}));let v=oe(f);if(v){let e=G(m,v);return await H(v,e,a),{shortCircuited:!0}}let{loaderData:y,errors:b}=Q(m,r,c,h,l,d,p,N);N.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&N.delete(t)}))})),function(){let e=[];for(let t of O){let n=m.fetchers.get(t);E(n,"Expected fetcher: "+t),"loading"===n.state&&(O.delete(t),e.push(t))}ie(e)}();let x=ue(C);return n({loaderData:y,errors:b},x||d.length>0?{fetchers:new Map(m.fetchers)}:{})}(I,i,f,d,c&&c.submission,c&&c.replace,T,M);L||(g=null,R(i,{matches:f,loaderData:B,errors:F}))}function F(e){return m.fetchers.get(e)||I}async function H(e,n,r){e.revalidate&&(_=!0),E(n.location,"Expected a location on the redirect navigation"),g=null;let o=!0===r?t.Action.Replace:t.Action.Push;await B(o,n.location,{overrideNavigation:n})}async function Y(e,t,n,r,o){let i=await Promise.all([...n.map((e=>X("loader",o,e,t,v.basename))),...r.map((e=>{let[,t,n,r]=e;return X("loader",$(t,o.signal),n,r,v.basename)}))]),a=i.slice(0,n.length),s=i.slice(n.length);return await Promise.all([ce(e,n,a,o.signal,!1,m.loaderData),ce(e,r.map((e=>{let[,,t]=e;return t})),s,o.signal,!0)]),{results:i,loaderResults:a,fetcherResults:s}}function q(){_=!0,k.push(...fe()),D.forEach(((e,t)=>{P.has(t)&&(S.push(t),te(t))}))}function K(e,t,n){let r=ee(m.matches,t);Z(e),A({errors:{[r.route.id]:n},fetchers:new Map(m.fetchers)})}function Z(e){P.has(e)&&te(e),D.delete(e),T.delete(e),O.delete(e),m.fetchers.delete(e)}function te(e){let t=P.get(e);E(t,"Expected fetch controller: "+e),t.abort(),P.delete(e)}function ie(e){for(let t of e){let e={state:"idle",data:F(t).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};m.fetchers.set(t,e)}}function ue(e){let t=[];for(let[n,r]of T)if(r<e){let e=m.fetchers.get(n);E(e,"Expected fetcher: "+n),"loading"===e.state&&(te(n),T.delete(n),t.push(n))}return ie(t),t.length>0}function fe(e){let t=[];return N.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),N.delete(r))})),t}function ve(e,t){if(a&&l&&u){let n=t.map((e=>he(e,m.loaderData))),r=l(e,n)||e.key,o=a[r];if("number"==typeof o)return o}return null}return v={get basename(){return e.basename},get state(){return m},get routes(){return r},initialize:function(){return o=e.history.listen((e=>{let{action:t,location:n}=e;return B(t,n)})),m.initialized||B(t.Action.Pop,m.location),v},subscribe:function(e){return i.add(e),()=>i.delete(e)},enableScrollRestoration:function(e,t,n){if(a=e,u=t,l=n||(e=>e.key),!c&&m.navigation===M){c=!0;let e=ve(m.location,m.matches);null!=e&&A({restoreScrollPosition:e})}return()=>{a=null,u=null,l=null}},navigate:async function(n,r){if("number"==typeof n)return void e.history.go(n);let{path:o,submission:i,error:a}=V(n,r),l=s(m.location,o,r&&r.state);l=e.history.encodeLocation(l);let u=!0===(r&&r.replace)||null!=i?t.Action.Replace:t.Action.Push,c=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0;return await B(u,l,{submission:i,pendingError:a,preventScrollReset:c,replace:r&&r.replace})},fetch:function(t,o,i,a){if(L)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");P.has(t)&&te(t);let l=p(r,i,e.basename);if(!l)return void K(t,o,new ErrorResponse(404,"Not Found",null));let{path:u,submission:c}=V(i,a,!0),d=pe(l,u);c?async function(t,o,i,a,l,u){if(q(),D.delete(t),!a.route.action){let{error:e}=re(i);return void K(t,o,e)}let c=m.fetchers.get(t),d=n({state:"submitting"},u,{data:c&&c.data});m.fetchers.set(t,d),A({fetchers:new Map(m.fetchers)});let f=new AbortController,h=$(i,f.signal,u);P.set(t,f);let y=await X("action",h,a,l,v.basename);if(h.signal.aborted)return void(P.get(t)===f&&P.delete(t));if(le(y)){P.delete(t),O.add(t);let e=n({state:"loading"},u,{data:void 0});m.fetchers.set(t,e),A({fetchers:new Map(m.fetchers)});let r=n({state:"loading",location:s(m.location,y.location)},u);return void(await H(y,r))}if(se(y))return void K(t,o,y.error);ae(y)&&E(!1,"defer() is not supported in actions");let x=m.navigation.location||m.location,w=$(x,f.signal),M="idle"!==m.navigation.state?p(r,m.navigation.location,e.basename):m.matches;E(M,"Didn't find any matches after fetcher action");let I=++j;T.set(t,I);let L=n({state:"loading",data:y.data},u);m.fetchers.set(t,L);let[B,F]=W(m,M,u,x,_,k,S,{[a.route.id]:y.data},void 0,D);F.filter((e=>{let[n]=e;return n!==t})).forEach((e=>{let[t]=e,n=m.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};m.fetchers.set(t,r),P.set(t,f)})),A({fetchers:new Map(m.fetchers)});let{results:V,loaderResults:Z,fetcherResults:ee}=await Y(m.matches,M,B,F,w);if(f.signal.aborted)return;T.delete(t),P.delete(t),F.forEach((e=>{let[t]=e;return P.delete(t)}));let te=oe(V);if(te){let e=G(m,te);return void(await H(te,e))}let{loaderData:ne,errors:ie}=Q(m,m.matches,B,Z,void 0,F,ee,N),ce={state:"idle",data:y.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};m.fetchers.set(t,ce);let de=ue(I);"loading"===m.navigation.state&&I>C?(E(b,"Expected pending action"),g&&g.abort(),R(m.navigation.location,{matches:M,loaderData:ne,errors:ie,fetchers:new Map(m.fetchers)})):(A(n({errors:ie,loaderData:J(m.loaderData,ne,M)},de?{fetchers:new Map(m.fetchers)}:{})),_=!1)}(t,o,u,d,l,c):(D.set(t,[u,d,l]),async function(e,t,n,r,o){let i=m.fetchers.get(e),a={state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,data:i&&i.data};m.fetchers.set(e,a),A({fetchers:new Map(m.fetchers)});let s=new AbortController,l=$(n,s.signal);P.set(e,s);let u=await X("loader",l,r,o,v.basename);ae(u)&&(u=await de(u,l.signal,!0)||u);P.get(e)===s&&P.delete(e);if(l.signal.aborted)return;if(le(u)){let e=G(m,u);return void(await H(u,e))}if(se(u)){let n=ee(m.matches,t);return m.fetchers.delete(e),void A({fetchers:new Map(m.fetchers),errors:{[n.route.id]:u.error}})}E(!ae(u),"Unhandled fetcher deferred data");let c={state:"idle",data:u.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0};m.fetchers.set(e,c),A({fetchers:new Map(m.fetchers)})}(t,o,u,d,l))},revalidate:function(){q(),A({revalidation:"loading"}),"submitting"!==m.navigation.state&&("idle"!==m.navigation.state?B(b||m.historyAction,m.navigation.location,{overrideNavigation:m.navigation}):B(m.historyAction,m.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),getFetcher:F,deleteFetcher:Z,dispose:function(){o&&o(),i.clear(),g&&g.abort(),m.fetchers.forEach(((e,t)=>Z(t)))},_internalFetchControllers:P,_internalActiveDeferreds:N},v},t.defer=function(e){return new DeferredData(e)},t.generatePath=function(e,t){return void 0===t&&(t={}),e.replace(/:(\w+)/g,((e,n)=>(E(null!=t[n],'Missing ":'+n+'" param'),t[n]))).replace(/(\/?)\*/,((e,n,r,o)=>null==t["*"]?"/*"===o?"/":"":""+n+t["*"]))},t.getStaticContextFromError=function(e,t,r){return n({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})},t.getToPathname=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?u(e).pathname:e.pathname},t.invariant=E,t.isRouteErrorResponse=R,t.joinPaths=T,t.json=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,o=new Headers(r.headers);return o.has("Content-Type")||o.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),n({},r,{headers:o}))},t.matchPath=x,t.matchRoutes=p,t.normalizePathname=O,t.parsePath=u,t.redirect=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let o=new Headers(r.headers);return o.set("Location",e),new Response(null,n({},r,{headers:o}))},t.resolvePath=S,t.resolveTo=C,t.stripBasename=_,t.unstable_createStaticHandler=function(e){E(e.length>0,"You must provide a non-empty routes array to unstable_createStaticHandler");let t=h(e);async function r(e,t,r,a){E(e.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(B.has(e.method)){let s=await async function(e,t,r,a){let s;if(r.route.action){if(s=await X("action",e,r,t,void 0,!0,a),e.signal.aborted){throw new Error((a?"queryRoute":"query")+"() call aborted")}}else{if(a)throw i(null,{status:405,statusText:"Method Not Allowed"});s=re(e.url)}if(le(s))throw new Response(null,{status:s.status,headers:{Location:s.location}});if(ae(s))throw new Error("defer() is not supported in actions");if(a){if(se(s)){return{matches:[r],loaderData:{},actionData:null,errors:{[ee(t,r.route.id).route.id]:s.error},statusCode:500,loaderHeaders:{},actionHeaders:{}}}return{matches:[r],loaderData:{},actionData:{[r.route.id]:s.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{}}}if(se(s)){let i=ee(t,r.route.id);return n({},await o(e,t,void 0,{[i.route.id]:s.error}),{statusCode:R(s.error)?s.error.status:500,actionData:null,actionHeaders:n({},s.headers?{[r.route.id]:s.headers}:{})})}return n({},await o(e,t),s.statusCode?{statusCode:s.statusCode}:{},{actionData:{[r.route.id]:s.data},actionHeaders:n({},s.headers?{[r.route.id]:s.headers}:{})})}(e,r,a||pe(r,t),null!=a);return s}let s=await o(e,r,a);return s instanceof Response?s:n({},s,{actionData:null,actionHeaders:{}})}catch(l){if((s=l)&&s.response instanceof Response&&(s.type===f.data||f.error)){if(l.type===f.error&&!ue(l.response))throw l.response;return l.response}if(ue(l))return l;throw l}var s}async function o(e,t,r,o){let i=null!=r,a=(r?[r]:H(t,Object.keys(o||{})[0])).filter((e=>e.route.loader));if(0===a.length)return{matches:t,loaderData:{},errors:o||null,statusCode:200,loaderHeaders:{}};let s=await Promise.all([...a.map((n=>X("loader",e,n,t,void 0,!0,i)))]);if(e.signal.aborted){throw new Error((i?"queryRoute":"query")+"() call aborted")}return s.forEach((e=>{ae(e)&&e.deferredData.cancel()})),n({},Z(t,a,s,o),{matches:t})}function i(e,t){return new Response(e,n({},t,{headers:n({},t.headers,{"X-Remix-Router-Error":"yes"})}))}return{dataRoutes:t,query:async function(e){let o=s("",l(new URL(e.url)),null,"default"),i=p(t,o);if(!F.has(e.method)){let{matches:e,route:n,error:r}=function(e){return te(e,405,"Method Not Allowed")}(t);return{location:o,matches:e,loaderData:{},actionData:null,errors:{[n.id]:r},statusCode:r.status,loaderHeaders:{},actionHeaders:{}}}if(!i){let{matches:e,route:n,error:r}=ne(t);return{location:o,matches:e,loaderData:{},actionData:null,errors:{[n.id]:r},statusCode:r.status,loaderHeaders:{},actionHeaders:{}}}let a=await r(e,o,i);return a instanceof Response?a:n({location:o},a)},queryRoute:async function(e,n){let o=s("",l(new URL(e.url)),null,"default"),a=p(t,o);if(!F.has(e.method))throw i(null,{status:405,statusText:"Method Not Allowed"});if(!a)throw i(null,{status:404,statusText:"Not Found"});let u=n?a.find((e=>e.route.id===n)):pe(a,o);if(!u)throw i(null,{status:404,statusText:"Not Found"});let c=await r(e,o,a,u);if(c instanceof Response)return c;let d=c.errors?Object.values(c.errors)[0]:void 0;if(void 0!==d)throw d;let f=[c.actionData,c.loaderData].find((e=>e));return Object.values(f||{})[0]}}},t.warning=k},36021:(e,t,n)=>{"use strict";t.f0=void 0;var r=n(96524),o=n(30412);function i(e){return(0,r.assign)((function(t,n,r){return(0,o.produce)(t,(function(t){e(t,n,r)}))}))}t.f0=i},98362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.__assign.apply(this,arguments)},t.__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},t.__values=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}},52721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(98362),o=n(96524),i=n(40753),a=n(36098),s=n(37769),l=new Map;function u(){var e=new Set,t=new Set;return{services:e,register:function(n){e.add(n),l.set(n.sessionId,n),t.forEach((function(e){return e(n)})),n.onStop((function(){e.delete(n),l.delete(n.sessionId)}))},unregister:function(t){e.delete(t),l.delete(t.sessionId)},onRegister:function(n){return t.add(n),e.forEach((function(e){return n(e)})),{unsubscribe:function(){t.delete(n)}}}}}var c={url:"https://stately.ai/viz?inspect",iframe:function(){return document.querySelector("iframe[data-xstate]")},devTools:function(){var e=u();return globalThis.__xstate__=e,e},serialize:void 0},d=new Set;t.createDevTools=u,t.createWebSocketReceiver=function(e){var t,n=e.protocol,r=new WebSocket("".concat(void 0===n?"ws":n,"://").concat(e.server)),i=new Set,a=o.toActorRef({id:"xstate.webSocketReceiver",send:function(t){r.send(s.stringify(t,e.serialize))},subscribe:function(e,t,n){var r=o.toObserver(e,t,n);return i.add(r),{unsubscribe:function(){i.delete(r)}}},getSnapshot:function(){return t}});return r.onopen=function(){a.send({type:"xstate.inspecting"})},r.onmessage=function(e){if("string"==typeof e.data)try{var n=JSON.parse(e.data);s.isReceiverEvent(n)&&(t=s.parseReceiverEvent(n),i.forEach((function(e){e.next(t)})))}catch(r){console.error(r)}},r.onerror=function(e){i.forEach((function(t){var n;null===(n=t.error)||void 0===n||n.call(t,e)}))},a},t.createWindowReceiver=function(e){var t,n=e||{},r=n.window,i=void 0===r?window:r,a=n.targetWindow,l=void 0===a?window.self===window.top?window.opener:window.parent:a,u=new Set,c=function(e){var n=e.data;s.isReceiverEvent(n)&&(t=s.parseReceiverEvent(n),u.forEach((function(e){return e.next(t)})))};i.addEventListener("message",c);var d=o.toActorRef({id:"xstate.windowReceiver",send:function(e){l&&l.postMessage(e,"*")},subscribe:function(e,t,n){var r=o.toObserver(e,t,n);return u.add(r),{unsubscribe:function(){u.delete(r)}}},stop:function(){u.clear(),i.removeEventListener("message",c)},getSnapshot:function(){return t}});return d.send({type:"xstate.inspecting"}),d},t.inspect=function(e){var t=function(e){var t=r.__assign(r.__assign({},c),e);return r.__assign(r.__assign({},t),{url:new URL(t.url),iframe:s.getLazy(t.iframe),devTools:s.getLazy(t.devTools)})}(e),n=t.iframe,l=t.url,u=t.devTools;if(null!==n){var f,h,p=i.createInspectMachine(u,e),v=o.interpret(p).start(),g=new Set,y=v.subscribe((function(e){g.forEach((function(t){return t.next(e)}))})),m=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){n&&!f&&(f=n.contentWindow),h||(h={send:function(e){f.postMessage(e,l.origin)}});var t=r.__assign(r.__assign({},e.data),{client:h});v.send(t)}};window.addEventListener("message",m),window.addEventListener("unload",(function(){v.send({type:"unload"})}));var b=function(t){return s.stringify(t,null==e?void 0:e.serialize)};return u.onRegister((function(t){var n,r=t.state||t.initialState;if(v.send({type:"service.register",machine:a.stringifyMachine(t.machine,null==e?void 0:e.serialize),state:a.stringifyState(r,null==e?void 0:e.serialize),sessionId:t.sessionId,id:t.id,parent:null===(n=t.parent)||void 0===n?void 0:n.sessionId}),v.send({type:"service.event",event:b(r._event),sessionId:t.sessionId}),!d.has(t)){d.add(t);var i=t.send.bind(t);t.send=function(e,n){return v.send({type:"service.event",event:b(o.toSCXMLEvent(o.toEventObject(e,n))),sessionId:t.sessionId}),i(e,n)}}t.subscribe((function(n){void 0!==n&&v.send({type:"service.state",state:a.stringifyState(n,null==e?void 0:e.serialize),sessionId:t.sessionId})})),t.onStop((function(){v.send({type:"service.stop",sessionId:t.sessionId})}))})),n?(n.addEventListener("load",(function(){f=n.contentWindow})),n.setAttribute("src",String(l))):f=window.open(String(l),"xstateinspector"),{send:function(e){v.send(e)},subscribe:function(e,t,n){var r=o.toObserver(e,t,n);return g.add(r),r.next(v.state),{unsubscribe:function(){g.delete(r)}}},disconnect:function(){v.send("disconnect"),window.removeEventListener("message",m),y.unsubscribe()}}}console.warn("No suitable <iframe> found to embed the inspector. Please pass an <iframe> element to `inspect(iframe)` or create an <iframe data-xstate></iframe> element.")},t.serviceMap=l},995:(e,t,n)=>{"use strict";var r=n(52721);r.createDevTools,r.createWebSocketReceiver,r.createWindowReceiver,t.XY=r.inspect},40753:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(96524),o=n(36098);t.createInspectMachine=function(e,t){void 0===e&&(e=globalThis.__xstate__);var n=new Map,i=e.onRegister((function(e){n.set(e.sessionId,e)}));return r.createMachine({initial:"pendingConnection",context:{client:void 0},states:{pendingConnection:{},connected:{on:{"service.state":{actions:function(e,t){return e.client.send(t)}},"service.event":{actions:function(e,t){return e.client.send(t)}},"service.register":{actions:function(e,t){return e.client.send(t)}},"service.stop":{actions:function(e,t){return e.client.send(t)}},"xstate.event":{actions:function(e,t){var r=t.event,o=JSON.parse(r),i=n.get(o.origin);null==i||i.send(o)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){i.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[r.assign({client:function(e,t){return t.client}}),function(n){e.services.forEach((function(e){var r;null===(r=n.client)||void 0===r||r.send({type:"service.register",machine:o.stringifyMachine(e.machine,null==t?void 0:t.serialize),state:o.stringifyState(e.state||e.initialState,null==t?void 0:t.serialize),sessionId:e.sessionId})}))}]}}})}},36098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(98362),o=n(37769);function i(e,t,n){var i,a,s={};try{for(var l=r.__values(t),u=l.next();!u.done;u=l.next()){var c=u.value;s[c]=e[c]}}catch(f){i={error:f}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var d=JSON.parse(o.stringify(s,n));return o.stringify(r.__assign(r.__assign({},e),d))}t.selectivelyStringify=i,t.stringifyMachine=function(e,t){return i(e.definition,["context"],t)},t.stringifyState=function(e,t){return e.machine,e.configuration,e.history,i(r.__rest(e,["machine","configuration","history"]),["context","event","_event"],t)}},37769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(98362),o=n(77847),i=n(96524);function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(o);function l(e){var t=i.State.create(JSON.parse(e));return delete t.history,t}t.getLazy=function(e){return"function"==typeof e?e():e},t.isReceiverEvent=function(e){if(!e)return!1;try{if("object"==typeof e&&"type"in e&&e.type.startsWith("service."))return!0}catch(t){return!1}return!1},t.parseReceiverEvent=function(e){switch(e.type){case"service.event":return r.__assign(r.__assign({},e),{event:JSON.parse(e.event)});case"service.register":return r.__assign(r.__assign({},e),{machine:i.createMachine(JSON.parse(e.machine)),state:l(e.state)});case"service.state":return r.__assign(r.__assign({},e),{state:l(e.state)});default:return e}},t.parseState=l,t.stringify=function(e,t){try{return JSON.stringify(e,t)}catch(n){return s.default(e,t)}}},59399:(e,t,n)=>{"use strict";t.v9=void 0;var r=n(96567);var o=n(66904);var i=n(37440);var a=n(44776);Object.defineProperty(t,"v9",{enumerable:!0,get:function(){return a.useSelector}});var s=n(50510);var l=n(94553)},66904:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useActor=t.isActorWithState=void 0;var r=n(12139),o=n(17767),i=n(33551),a=n(43100);function s(e){return"state"in e}function l(e){return"deferred"in e}function u(e){return"getSnapshot"in e?e.getSnapshot():s(e)?e.state:void 0}t.isActorWithState=s,t.useActor=function(e,t){void 0===t&&(t=u);var n=(0,r.useRef)(e),s=(0,r.useRef)([]),c=(0,r.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]),d=(0,r.useCallback)((function(){return t(e)}),[e,t]),f=(0,a.useSyncExternalStore)(c,d,d),h=(0,i.default)((function(){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0];var o=n.current;l(o)&&o.deferred?s.current.push(r):o.send(r)}}));return(0,o.default)((function(){for(n.current=e;s.current.length>0;){var t=s.current.shift();e.send(t)}}),[e]),[f,h]}},33551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12139);t.default=function(e){var t=r.useRef();return t.current||(t.current={v:e()}),t.current.v}},37440:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.useInterpret=t.useIdleInterpreter=void 0;var a=n(12139),s=n(17767),l=n(96524),u=n(33551);function c(e,t){var n=(0,u.default)((function(){return"function"==typeof e?e():e})),i=t.context,a=t.guards,c=t.actions,d=t.activities,f=t.services,h=t.delays,p=(t.state,o(t,["context","guards","actions","activities","services","delays","state"])),v=(0,u.default)((function(){var e={context:i,guards:a,actions:c,activities:d,services:f,delays:h},t=n.withConfig(e,(function(){return r(r({},n.context),i)}));return(0,l.interpret)(t,p)}));return(0,s.default)((function(){Object.assign(v.machine.options.actions,c),Object.assign(v.machine.options.guards,a),Object.assign(v.machine.options.activities,d),Object.assign(v.machine.options.services,f),Object.assign(v.machine.options.delays,h)}),[c,a,d,f,h]),v}t.useIdleInterpreter=c,t.useInterpret=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=i(t,2),o=r[0],s=void 0===o?{}:o,u=r[1],d=c(e,s);return(0,a.useEffect)((function(){if(u){var e=d.subscribe((0,l.toObserver)(u));return function(){e.unsubscribe()}}}),[u]),(0,a.useEffect)((function(){var e=s.state;return d.start(e?l.State.create(e):void 0),function(){d.stop(),d.status=l.InterpreterStatus.NotStarted}}),[]),d}},96567:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.useMachine=void 0;var o=n(12139),i=n(41110),a=n(96524),s=n(37440);function l(e){return e}t.useMachine=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var u=r(t,1),c=u[0],d=void 0===c?{}:c,f=(0,s.useIdleInterpreter)(e,d),h=(0,o.useCallback)((function(){return f.status===a.InterpreterStatus.NotStarted?d.state?a.State.create(d.state):f.machine.initialState:f.state}),[f]),p=(0,o.useCallback)((function(e,t){if(f.status===a.InterpreterStatus.NotStarted)return!0;var n=void 0===t.changed&&(Object.keys(t.children).length>0||"boolean"==typeof e.changed);return!(t.changed||n)}),[f]),v=(0,o.useCallback)((function(e){return f.subscribe(e).unsubscribe}),[f]),g=(0,i.useSyncExternalStoreWithSelector)(v,h,h,l,p);return(0,o.useEffect)((function(){var e=d.state;return f.start(e?a.State.create(e):void 0),function(){f.stop(),f.status=a.InterpreterStatus.NotStarted}}),[]),[g,f.send,f]}},44776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useSelector=void 0;var r=n(12139),o=n(41110),i=n(66904),a=n(94553);var s=function(e,t){return e===t};t.useSelector=function(e,t,n,l){void 0===n&&(n=s);var u=(0,r.useRef)(null),c=(0,r.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]),d=(0,r.useCallback)((function(){return l?l(e):function(e,t){if("state"in(r=e)&&"machine"in r){if(0===e.status&&t.current)return t.current;var n=(0,a.getServiceSnapshot)(e);return t.current=0===e.status?n:null,n}var r;return(0,i.isActorWithState)(e)?e.state:void 0}(e,u)}),[e,l]);return(0,o.useSyncExternalStoreWithSelector)(c,d,d,t,n)}},50510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useSpawn=void 0;var r=n(96524),o=n(33551);t.useSpawn=function(e){return(0,o.default)((function(){return(0,r.spawnBehavior)(e)}))}},94553:function(e,t){"use strict";var n=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}Object.defineProperty(t,"__esModule",{value:!0}),t.shallowEqual=t.getServiceSnapshot=t.partition=void 0,t.partition=function(e,t){var o,i,a=n([[],[]],2),s=a[0],l=a[1];try{for(var u=r(e),c=u.next();!c.done;c=u.next()){var d=c.value;t(d)?s.push(d):l.push(d)}}catch(f){o={error:f}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return[s,l]},t.getServiceSnapshot=function(e){return 0!==e.status?e.state:e.machine.initialState},t.shallowEqual=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!o(e[n[i]],t[n[i]]))return!1;return!0}},72779:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=(function(){return o}).apply(t,[]))||(e.exports=n)}()},77111:(e,t,n)=>{var r=n(26733),o=n(59821),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a function")}},57988:(e,t,n)=>{var r=n(82359),o=n(59821),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a constructor")}},88505:(e,t,n)=>{var r=n(26733),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},9736:(e,t,n)=>{var r=n(70095),o=n(22391),i=n(31787).f,a=r("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},36637:(e,t,n)=>{"use strict";var r=n(30966).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},57728:(e,t,n)=>{var r=n(91321),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},21176:(e,t,n)=>{var r=n(85052),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not an object")}},19540:(e,t,n)=>{var r=n(10905),o=n(43231),i=n(39646),a=function(e){return function(t,n,a){var s,l=r(t),u=i(l),c=o(a,u);if(e&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},96038:(e,t,n)=>{"use strict";var r=n(24229);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},69794:(e,t,n)=>{var r=n(43231),o=n(39646),i=n(62324),a=Array,s=Math.max;e.exports=function(e,t,n){for(var l=o(e),u=r(t,l),c=r(void 0===n?l:n,l),d=a(s(c-u,0)),f=0;u<c;u++,f++)i(d,f,e[u]);return d.length=f,d}},1909:(e,t,n)=>{var r=n(65968);e.exports=r([].slice)},33867:(e,t,n)=>{var r=n(69794),o=Math.floor,i=function(e,t){var n=e.length,l=o(n/2);return n<8?a(e,t):s(e,i(r(e,0,l),t),i(r(e,l),t),t)},a=function(e,t){for(var n,r,o=e.length,i=1;i<o;){for(r=i,n=e[i];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},s=function(e,t,n,r){for(var o=t.length,i=n.length,a=0,s=0;a<o||s<i;)e[a+s]=a<o&&s<i?r(t[a],n[s])<=0?t[a++]:n[s++]:a<o?t[a++]:n[s++];return e};e.exports=i},74575:(e,t,n)=>{var r=n(70095)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(s){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(s){}return n}},27079:(e,t,n)=>{var r=n(56529),o=r({}.toString),i=r("".slice);e.exports=function(e){return i(o(e),8,-1)}},81589:(e,t,n)=>{var r=n(71601),o=n(26733),i=n(27079),a=n(70095)("toStringTag"),s=Object,l="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=s(e),a))?n:l?i(t):"Object"==(r=i(t))&&o(t.callee)?"Arguments":r}},77081:(e,t,n)=>{var r=n(98270),o=n(4826),i=n(97933),a=n(31787);e.exports=function(e,t,n){for(var s=o(t),l=a.f,u=i.f,c=0;c<s.length;c++){var d=s[c];r(e,d)||n&&r(n,d)||l(e,d,u(t,d))}}},48127:(e,t,n)=>{var r=n(70095)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(o){}}return!1}},27528:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},33684:e=>{e.exports=function(e,t){return{value:e,done:t}}},75762:(e,t,n)=>{var r=n(7400),o=n(31787),i=n(65358);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},65358:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},62324:(e,t,n)=>{"use strict";var r=n(39310),o=n(31787),i=n(65358);e.exports=function(e,t,n){var a=r(t);a in e?o.f(e,a,i(0,n)):e[a]=n}},14768:(e,t,n)=>{var r=n(26733),o=n(31787),i=n(16039),a=n(18400);e.exports=function(e,t,n,s){s||(s={});var l=s.enumerable,u=void 0!==s.name?s.name:t;if(r(n)&&i(n,u,s),s.global)l?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(c){}l?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},18400:(e,t,n)=>{var r=n(9859),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},79563:(e,t,n)=>{"use strict";var r=n(59821),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw o("Cannot delete property "+r(t)+" of "+r(e))}},7400:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},63777:e=>{var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},22635:(e,t,n)=>{var r=n(9859),o=n(85052),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},95694:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},18865:(e,t,n)=>{var r=n(22635)("span").classList,o=r&&r.constructor&&r.constructor.prototype;e.exports=o===Object.prototype?void 0:o},22671:(e,t,n)=>{var r=n(80598).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},48639:(e,t,n)=>{var r=n(95189),o=n(28801);e.exports=!r&&!o&&"object"==typeof window&&"object"==typeof document},95189:e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},48506:(e,t,n)=>{var r=n(80598);e.exports=/MSIE|Trident/.test(r)},8983:(e,t,n)=>{var r=n(80598),o=n(9859);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},32023:(e,t,n)=>{var r=n(80598);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},28801:(e,t,n)=>{var r=n(27079),o=n(9859);e.exports="process"==r(o.process)},10263:(e,t,n)=>{var r=n(80598);e.exports=/web0s(?!.*chrome)/i.test(r)},80598:(e,t,n)=>{var r=n(31333);e.exports=r("navigator","userAgent")||""},6358:(e,t,n)=>{var r,o,i=n(9859),a=n(80598),s=i.process,l=i.Deno,u=s&&s.versions||l&&l.version,c=u&&u.v8;c&&(o=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},49811:(e,t,n)=>{var r=n(80598).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},13837:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},23103:(e,t,n)=>{var r=n(9859),o=n(97933).f,i=n(75762),a=n(14768),s=n(18400),l=n(77081),u=n(46541);e.exports=function(e,t){var n,c,d,f,h,p=e.target,v=e.global,g=e.stat;if(n=v?r:g?r[p]||s(p,{}):(r[p]||{}).prototype)for(c in t){if(f=t[c],d=e.dontCallGetSet?(h=o(n,c))&&h.value:n[c],!u(v?c:p+(g?".":"#")+c,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;l(f,d)}(e.sham||d&&d.sham)&&i(f,"sham",!0),a(n,c,f,e)}}},24229:e=>{e.exports=function(e){try{return!!e()}catch(t){return!0}}},94954:(e,t,n)=>{"use strict";n(77950);var r=n(65968),o=n(14768),i=n(63466),a=n(24229),s=n(70095),l=n(75762),u=s("species"),c=RegExp.prototype;e.exports=function(e,t,n,d){var f=s(e),h=!a((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),p=h&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t}));if(!h||!p||n){var v=r(/./[f]),g=t(f,""[e],(function(e,t,n,o,a){var s=r(e),l=t.exec;return l===i||l===c.exec?h&&!a?{done:!0,value:v(t,n,o)}:{done:!0,value:s(n,t,o)}:{done:!1}}));o(String.prototype,e,g[0]),o(c,f,g[1])}d&&l(c[f],"sham",!0)}},53171:(e,t,n)=>{var r=n(57188),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},97636:(e,t,n)=>{var r=n(65968),o=n(77111),i=n(57188),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},57188:(e,t,n)=>{var r=n(24229);e.exports=!r((function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},20266:(e,t,n)=>{var r=n(57188),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},51805:(e,t,n)=>{var r=n(7400),o=n(98270),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),l=s&&"something"===(function(){}).name,u=s&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:u}},56529:(e,t,n)=>{var r=n(57188),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},65968:(e,t,n)=>{var r=n(27079),o=n(56529);e.exports=function(e){if("Function"===r(e))return o(e)}},31333:(e,t,n)=>{var r=n(9859),o=n(26733),i=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e]):r[e]&&r[e][t]}},78830:(e,t,n)=>{var r=n(81589),o=n(55300),i=n(9650),a=n(45495),s=n(70095)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[r(e)]}},28403:(e,t,n)=>{var r=n(20266),o=n(77111),i=n(21176),a=n(59821),s=n(78830),l=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(o(n))return i(r(n,e));throw l(a(e)+" is not iterable")}},55300:(e,t,n)=>{var r=n(77111),o=n(9650);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},70017:(e,t,n)=>{var r=n(65968),o=n(92991),i=Math.floor,a=r("".charAt),s=r("".replace),l=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,d,f){var h=n+e.length,p=r.length,v=c;return void 0!==d&&(d=o(d),v=u),s(f,v,(function(o,s){var u;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,h);case"<":u=d[l(s,1,-1)];break;default:var c=+s;if(0===c)return o;if(c>p){var f=i(c/10);return 0===f?o:f<=p?void 0===r[f-1]?a(s,1):r[f-1]+a(s,1):o}u=r[c-1]}return void 0===u?"":u}))}},9859:(e,t,n)=>{var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},98270:(e,t,n)=>{var r=n(65968),o=n(92991),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},95977:e=>{e.exports={}},14665:(e,t,n)=>{var r=n(9859);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},53777:(e,t,n)=>{var r=n(31333);e.exports=r("document","documentElement")},64394:(e,t,n)=>{var r=n(7400),o=n(24229),i=n(22635);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},9337:(e,t,n)=>{var r=n(65968),o=n(24229),i=n(27079),a=Object,s=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):a(e)}:a},8511:(e,t,n)=>{var r=n(65968),o=n(26733),i=n(85353),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},56407:(e,t,n)=>{var r,o,i,a=n(51180),s=n(9859),l=n(85052),u=n(75762),c=n(98270),d=n(85353),f=n(44399),h=n(95977),p="Object already initialized",v=s.TypeError,g=s.WeakMap;if(a||d.state){var y=d.state||(d.state=new g);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw v(p);return t.facade=e,y.set(e,t),t},o=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var m=f("state");h[m]=!0,r=function(e,t){if(c(e,m))throw v(p);return t.facade=e,u(e,m,t),t},o=function(e){return c(e,m)?e[m]:{}},i=function(e){return c(e,m)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=o(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return n}}}},91943:(e,t,n)=>{var r=n(70095),o=n(45495),i=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},26733:(e,t,n)=>{var r=n(63777),o=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},82359:(e,t,n)=>{var r=n(65968),o=n(24229),i=n(26733),a=n(81589),s=n(31333),l=n(8511),u=function(){},c=[],d=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,h=r(f.exec),p=!f.exec(u),v=function(e){if(!i(e))return!1;try{return d(u,c,e),!0}catch(t){return!1}},g=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(f,l(e))}catch(t){return!0}};g.sham=!0,e.exports=!d||o((function(){var e;return v(v.call)||!v(Object)||!v((function(){e=!0}))||e}))?g:v},46541:(e,t,n)=>{var r=n(24229),o=n(26733),i=/#|\.prototype\./,a=function(e,t){var n=l[s(e)];return n==c||n!=u&&(o(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},l=a.data={},u=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},9650:e=>{e.exports=function(e){return null==e}},85052:(e,t,n)=>{var r=n(26733),o=n(63777),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===i}:function(e){return"object"==typeof e?null!==e:r(e)}},24231:e=>{e.exports=!1},48311:(e,t,n)=>{var r=n(85052),o=n(27079),i=n(70095)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},49395:(e,t,n)=>{var r=n(31333),o=n(26733),i=n(91321),a=n(66969),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,s(e))}},89003:(e,t,n)=>{var r=n(97636),o=n(20266),i=n(21176),a=n(59821),s=n(91943),l=n(39646),u=n(91321),c=n(28403),d=n(78830),f=n(57281),h=TypeError,p=function(e,t){this.stopped=e,this.result=t},v=p.prototype;e.exports=function(e,t,n){var g,y,m,b,x,w,_,E=n&&n.that,k=!(!n||!n.AS_ENTRIES),S=!(!n||!n.IS_RECORD),P=!(!n||!n.IS_ITERATOR),j=!(!n||!n.INTERRUPTED),C=r(t,E),T=function(e){return g&&f(g,"normal",e),new p(!0,e)},O=function(e){return k?(i(e),j?C(e[0],e[1],T):C(e[0],e[1])):j?C(e,T):C(e)};if(S)g=e.iterator;else if(P)g=e;else{if(!(y=d(e)))throw h(a(e)+" is not iterable");if(s(y)){for(m=0,b=l(e);b>m;m++)if((x=O(e[m]))&&u(v,x))return x;return new p(!1)}g=c(e,y)}for(w=S?e.next:g.next;!(_=o(w,g)).done;){try{x=O(_.value)}catch(D){f(g,"throw",D)}if("object"==typeof x&&x&&u(v,x))return x}return new p(!1)}},57281:(e,t,n)=>{var r=n(20266),o=n(21176),i=n(55300);e.exports=function(e,t,n){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(l){s=!0,a=l}if("throw"===t)throw n;if(s)throw a;return o(a),n}},42247:(e,t,n)=>{"use strict";var r=n(60693).IteratorPrototype,o=n(22391),i=n(65358),a=n(54555),s=n(45495),l=function(){return this};e.exports=function(e,t,n,u){var c=t+" Iterator";return e.prototype=o(r,{next:i(+!u,n)}),a(e,c,!1,!0),s[c]=l,e}},12707:(e,t,n)=>{"use strict";var r=n(23103),o=n(20266),i=n(24231),a=n(51805),s=n(26733),l=n(42247),u=n(67567),c=n(56540),d=n(54555),f=n(75762),h=n(14768),p=n(70095),v=n(45495),g=n(60693),y=a.PROPER,m=a.CONFIGURABLE,b=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,w=p("iterator"),_="keys",E="values",k="entries",S=function(){return this};e.exports=function(e,t,n,a,p,g,P){l(n,t,a);var j,C,T,O=function(e){if(e===p&&M)return M;if(!x&&e in A)return A[e];switch(e){case _:case E:case k:return function(){return new n(this,e)}}return function(){return new n(this)}},D=t+" Iterator",N=!1,A=e.prototype,R=A[w]||A["@@iterator"]||p&&A[p],M=!x&&R||O(p),I="Array"==t&&A.entries||R;if(I&&(j=u(I.call(new e)))!==Object.prototype&&j.next&&(i||u(j)===b||(c?c(j,b):s(j[w])||h(j,w,S)),d(j,D,!0,!0),i&&(v[D]=S)),y&&p==E&&R&&R.name!==E&&(!i&&m?f(A,"name",E):(N=!0,M=function(){return o(R,this)})),p)if(C={values:O(E),keys:g?M:O(_),entries:O(k)},P)for(T in C)(x||N||!(T in A))&&h(A,T,C[T]);else r({target:t,proto:!0,forced:x||N},C);return i&&!P||A[w]===M||h(A,w,M,{name:p}),v[t]=M,C}},60693:(e,t,n)=>{"use strict";var r,o,i,a=n(24229),s=n(26733),l=n(85052),u=n(22391),c=n(67567),d=n(14768),f=n(70095),h=n(24231),p=f("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):v=!0),!l(r)||a((function(){var e={};return r[p].call(e)!==e}))?r={}:h&&(r=u(r)),s(r[p])||d(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},45495:e=>{e.exports={}},39646:(e,t,n)=>{var r=n(34237);e.exports=function(e){return r(e.length)}},16039:(e,t,n)=>{var r=n(24229),o=n(26733),i=n(98270),a=n(7400),s=n(51805).CONFIGURABLE,l=n(8511),u=n(56407),c=u.enforce,d=u.get,f=Object.defineProperty,h=a&&!r((function(){return 8!==f((function(){}),"length",{value:8}).length})),p=String(String).split("String"),v=e.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||s&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),h&&n&&i(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(o){}var r=c(e);return i(r,"source")||(r.source=p.join("string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return o(this)&&d(this).source||l(this)}),"toString")},50917:e=>{var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},24794:(e,t,n)=>{var r,o,i,a,s,l,u,c,d=n(9859),f=n(97636),h=n(97933).f,p=n(55795).set,v=n(32023),g=n(8983),y=n(10263),m=n(28801),b=d.MutationObserver||d.WebKitMutationObserver,x=d.document,w=d.process,_=d.Promise,E=h(d,"queueMicrotask"),k=E&&E.value;k||(r=function(){var e,t;for(m&&(e=w.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(n){throw o?a():i=void 0,n}}i=void 0,e&&e.enter()},v||m||y||!b||!x?!g&&_&&_.resolve?((u=_.resolve(void 0)).constructor=_,c=f(u.then,u),a=function(){c(r)}):m?a=function(){w.nextTick(r)}:(p=f(p,d),a=function(){p(r)}):(s=!0,l=x.createTextNode(""),new b(r).observe(l,{characterData:!0}),a=function(){l.data=s=!s})),e.exports=k||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},16485:(e,t,n)=>{"use strict";var r=n(77111),o=TypeError,i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw o("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},47272:(e,t,n)=>{var r=n(48311),o=TypeError;e.exports=function(e){if(r(e))throw o("The method doesn't accept regular expressions");return e}},47:(e,t,n)=>{"use strict";var r=n(7400),o=n(65968),i=n(20266),a=n(24229),s=n(65632),l=n(10894),u=n(19195),c=n(92991),d=n(9337),f=Object.assign,h=Object.defineProperty,p=o([].concat);e.exports=!f||a((function(){if(r&&1!==f({b:1},f(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=f({},e)[n]||s(f({},t)).join("")!=o}))?function(e,t){for(var n=c(e),o=arguments.length,a=1,f=l.f,h=u.f;o>a;)for(var v,g=d(arguments[a++]),y=f?p(s(g),f(g)):s(g),m=y.length,b=0;m>b;)v=y[b++],r&&!i(h,g,v)||(n[v]=g[v]);return n}:f},22391:(e,t,n)=>{var r,o=n(21176),i=n(90219),a=n(13837),s=n(95977),l=n(53777),u=n(22635),c=n(44399),d=c("IE_PROTO"),f=function(){},h=function(e){return"<script>"+e+"</"+"script>"},p=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(o){}var e,t;v="undefined"!=typeof document?document.domain&&r?p(r):((t=u("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):p(r);for(var n=a.length;n--;)delete v.prototype[a[n]];return v()};s[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=o(e),n=new f,f.prototype=null,n[d]=e):n=v(),void 0===t?n:i.f(n,t)}},90219:(e,t,n)=>{var r=n(7400),o=n(17137),i=n(31787),a=n(21176),s=n(10905),l=n(65632);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),o=l(t),u=o.length,c=0;u>c;)i.f(e,n=o[c++],r[n]);return e}},31787:(e,t,n)=>{var r=n(7400),o=n(64394),i=n(17137),a=n(21176),s=n(39310),l=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",f="configurable",h="writable";t.f=r?i?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&h in n&&!n.writable){var r=c(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:f in n?n.configurable:r.configurable,enumerable:d in n?n.enumerable:r.enumerable,writable:!1})}return u(e,t,n)}:u:function(e,t,n){if(a(e),t=s(t),a(n),o)try{return u(e,t,n)}catch(r){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},97933:(e,t,n)=>{var r=n(7400),o=n(20266),i=n(19195),a=n(65358),s=n(10905),l=n(39310),u=n(98270),c=n(64394),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=l(t),c)try{return d(e,t)}catch(n){}if(u(e,t))return a(!o(i.f,e,t),e[t])}},78151:(e,t,n)=>{var r=n(90140),o=n(13837).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},10894:(e,t)=>{t.f=Object.getOwnPropertySymbols},67567:(e,t,n)=>{var r=n(98270),o=n(26733),i=n(92991),a=n(44399),s=n(27528),l=a("IE_PROTO"),u=Object,c=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(r(t,l))return t[l];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof u?c:null}},91321:(e,t,n)=>{var r=n(65968);e.exports=r({}.isPrototypeOf)},90140:(e,t,n)=>{var r=n(65968),o=n(98270),i=n(10905),a=n(19540).indexOf,s=n(95977),l=r([].push);e.exports=function(e,t){var n,r=i(e),u=0,c=[];for(n in r)!o(s,n)&&o(r,n)&&l(c,n);for(;t.length>u;)o(r,n=t[u++])&&(~a(c,n)||l(c,n));return c}},65632:(e,t,n)=>{var r=n(90140),o=n(13837);e.exports=Object.keys||function(e){return r(e,o)}},19195:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},56540:(e,t,n)=>{var r=n(65968),o=n(21176),i=n(88505);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(a){}return function(n,r){return o(n),i(r),t?e(n,r):n.__proto__=r,n}}():void 0)},32914:(e,t,n)=>{var r=n(20266),o=n(26733),i=n(85052),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&o(n=e.toString)&&!i(s=r(n,e)))return s;if(o(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&o(n=e.toString)&&!i(s=r(n,e)))return s;throw a("Can't convert object to primitive value")}},4826:(e,t,n)=>{var r=n(31333),o=n(65968),i=n(78151),a=n(10894),s=n(21176),l=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=a.f;return n?l(t,n(e)):t}},64624:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},38321:(e,t,n)=>{var r=n(9859),o=n(74473),i=n(26733),a=n(46541),s=n(8511),l=n(70095),u=n(48639),c=n(95189),d=n(24231),f=n(6358),h=o&&o.prototype,p=l("species"),v=!1,g=i(r.PromiseRejectionEvent),y=a("Promise",(function(){var e=s(o),t=e!==String(o);if(!t&&66===f)return!0;if(d&&(!h.catch||!h.finally))return!0;if(!f||f<51||!/native code/.test(e)){var n=new o((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[p]=r,!(v=n.then((function(){}))instanceof r))return!0}return!t&&(u||c)&&!g}));e.exports={CONSTRUCTOR:y,REJECTION_EVENT:g,SUBCLASSING:v}},74473:(e,t,n)=>{var r=n(9859);e.exports=r.Promise},62391:(e,t,n)=>{var r=n(21176),o=n(85052),i=n(16485);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},96866:(e,t,n)=>{var r=n(74473),o=n(74575),i=n(38321).CONSTRUCTOR;e.exports=i||!o((function(e){r.all(e).then(void 0,(function(){}))}))},93358:e=>{var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},98115:(e,t,n)=>{var r=n(20266),o=n(21176),i=n(26733),a=n(27079),s=n(63466),l=TypeError;e.exports=function(e,t){var n=e.exec;if(i(n)){var u=r(n,e,t);return null!==u&&o(u),u}if("RegExp"===a(e))return r(s,e,t);throw l("RegExp#exec called on incompatible receiver")}},63466:(e,t,n)=>{"use strict";var r,o,i=n(20266),a=n(65968),s=n(83326),l=n(30895),u=n(25650),c=n(33036),d=n(22391),f=n(56407).get,h=n(42926),p=n(10461),v=c("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,m=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),_=(o=/b*/g,i(g,r=/a/,"a"),i(g,o,"a"),0!==r.lastIndex||0!==o.lastIndex),E=u.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(_||k||E||h||p)&&(y=function(e){var t,n,r,o,a,u,c,h=this,p=f(h),S=s(e),P=p.raw;if(P)return P.lastIndex=h.lastIndex,t=i(y,P,S),h.lastIndex=P.lastIndex,t;var j=p.groups,C=E&&h.sticky,T=i(l,h),O=h.source,D=0,N=S;if(C&&(T=x(T,"y",""),-1===b(T,"g")&&(T+="g"),N=w(S,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==m(S,h.lastIndex-1))&&(O="(?: "+O+")",N=" "+N,D++),n=new RegExp("^(?:"+O+")",T)),k&&(n=new RegExp("^"+O+"$(?!\\s)",T)),_&&(r=h.lastIndex),o=i(g,C?n:h,N),C?o?(o.input=w(o.input,D),o[0]=w(o[0],D),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:_&&o&&(h.lastIndex=h.global?o.index+o[0].length:r),k&&o&&o.length>1&&i(v,o[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&j)for(o.groups=u=d(null),a=0;a<j.length;a++)u[(c=j[a])[0]]=o[c[1]];return o}),e.exports=y},30895:(e,t,n)=>{"use strict";var r=n(21176);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},25650:(e,t,n)=>{var r=n(24229),o=n(9859).RegExp,i=r((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=i||r((function(){return!o("a","y").sticky})),s=i||r((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:i}},42926:(e,t,n)=>{var r=n(24229),o=n(9859).RegExp;e.exports=r((function(){var e=o(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},10461:(e,t,n)=>{var r=n(24229),o=n(9859).RegExp;e.exports=r((function(){var e=o("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},58885:(e,t,n)=>{var r=n(9650),o=TypeError;e.exports=function(e){if(r(e))throw o("Can't call method on "+e);return e}},72101:e=>{e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},71832:(e,t,n)=>{"use strict";var r=n(31333),o=n(31787),i=n(70095),a=n(7400),s=i("species");e.exports=function(e){var t=r(e),n=o.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},54555:(e,t,n)=>{var r=n(31787).f,o=n(98270),i=n(70095)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!o(e,i)&&r(e,i,{configurable:!0,value:t})}},44399:(e,t,n)=>{var r=n(33036),o=n(81441),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},85353:(e,t,n)=>{var r=n(9859),o=n(18400),i="__core-js_shared__",a=r[i]||o(i,{});e.exports=a},33036:(e,t,n)=>{var r=n(24231),o=n(85353);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:r?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"})},37942:(e,t,n)=>{var r=n(21176),o=n(57988),i=n(9650),a=n(70095)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||i(n=r(s)[a])?t:o(n)}},30966:(e,t,n)=>{var r=n(65968),o=n(43329),i=n(83326),a=n(58885),s=r("".charAt),l=r("".charCodeAt),u=r("".slice),c=function(e){return function(t,n){var r,c,d=i(a(t)),f=o(n),h=d.length;return f<0||f>=h?e?"":void 0:(r=l(d,f))<55296||r>56319||f+1===h||(c=l(d,f+1))<56320||c>57343?e?s(d,f):r:e?u(d,f,f+2):c-56320+(r-55296<<10)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},44860:(e,t,n)=>{var r=n(6358),o=n(24229);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},55795:(e,t,n)=>{var r,o,i,a,s=n(9859),l=n(53171),u=n(97636),c=n(26733),d=n(98270),f=n(24229),h=n(53777),p=n(1909),v=n(22635),g=n(77579),y=n(32023),m=n(28801),b=s.setImmediate,x=s.clearImmediate,w=s.process,_=s.Dispatch,E=s.Function,k=s.MessageChannel,S=s.String,P=0,j={},C="onreadystatechange";try{r=s.location}catch(A){}var T=function(e){if(d(j,e)){var t=j[e];delete j[e],t()}},O=function(e){return function(){T(e)}},D=function(e){T(e.data)},N=function(e){s.postMessage(S(e),r.protocol+"//"+r.host)};b&&x||(b=function(e){g(arguments.length,1);var t=c(e)?e:E(e),n=p(arguments,1);return j[++P]=function(){l(t,void 0,n)},o(P),P},x=function(e){delete j[e]},m?o=function(e){w.nextTick(O(e))}:_&&_.now?o=function(e){_.now(O(e))}:k&&!y?(a=(i=new k).port2,i.port1.onmessage=D,o=u(a.postMessage,a)):s.addEventListener&&c(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!f(N)?(o=N,s.addEventListener("message",D,!1)):o=C in v("script")?function(e){h.appendChild(v("script")).onreadystatechange=function(){h.removeChild(this),T(e)}}:function(e){setTimeout(O(e),0)}),e.exports={set:b,clear:x}},43231:(e,t,n)=>{var r=n(43329),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},10905:(e,t,n)=>{var r=n(9337),o=n(58885);e.exports=function(e){return r(o(e))}},43329:(e,t,n)=>{var r=n(50917);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},34237:(e,t,n)=>{var r=n(43329),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},92991:(e,t,n)=>{var r=n(58885),o=Object;e.exports=function(e){return o(r(e))}},92066:(e,t,n)=>{var r=n(20266),o=n(85052),i=n(49395),a=n(55300),s=n(32914),l=n(70095),u=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,l=a(e,c);if(l){if(void 0===t&&(t="default"),n=r(l,e,t),!o(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},39310:(e,t,n)=>{var r=n(92066),o=n(49395);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},71601:(e,t,n)=>{var r={};r[n(70095)("toStringTag")]="z",e.exports="[object z]"===String(r)},83326:(e,t,n)=>{var r=n(81589),o=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},59821:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(n){return"Object"}}},81441:(e,t,n)=>{var r=n(65968),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},66969:(e,t,n)=>{var r=n(44860);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},17137:(e,t,n)=>{var r=n(7400),o=n(24229);e.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},77579:e=>{var t=TypeError;e.exports=function(e,n){if(e<n)throw t("Not enough arguments");return e}},51180:(e,t,n)=>{var r=n(9859),o=n(26733),i=r.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},70095:(e,t,n)=>{var r=n(9859),o=n(33036),i=n(98270),a=n(81441),s=n(44860),l=n(66969),u=o("wks"),c=r.Symbol,d=c&&c.for,f=l?c:c&&c.withoutSetter||a;e.exports=function(e){if(!i(u,e)||!s&&"string"!=typeof u[e]){var t="Symbol."+e;s&&i(c,e)?u[e]=c[e]:u[e]=l&&d?d(t):f(t)}return u[e]}},39529:(e,t,n)=>{"use strict";var r=n(23103),o=n(19540).includes,i=n(24229),a=n(9736);r({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},15735:(e,t,n)=>{"use strict";var r=n(10905),o=n(9736),i=n(45495),a=n(56407),s=n(31787).f,l=n(12707),u=n(33684),c=n(24231),d=n(7400),f="Array Iterator",h=a.set,p=a.getterFor(f);e.exports=l(Array,"Array",(function(e,t){h(this,{type:f,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,u(void 0,!0)):u("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var v=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!c&&d&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(g){}},43430:(e,t,n)=>{"use strict";var r=n(23103),o=n(65968),i=n(77111),a=n(92991),s=n(39646),l=n(79563),u=n(83326),c=n(24229),d=n(33867),f=n(96038),h=n(22671),p=n(48506),v=n(6358),g=n(49811),y=[],m=o(y.sort),b=o(y.push),x=c((function(){y.sort(void 0)})),w=c((function(){y.sort(null)})),_=f("sort"),E=!c((function(){if(v)return v<70;if(!(h&&h>3)){if(p)return!0;if(g)return g<603;var e,t,n,r,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)y.push({k:t+r,v:n})}for(y.sort((function(e,t){return t.v-e.v})),r=0;r<y.length;r++)t=y[r].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}}));r({target:"Array",proto:!0,forced:x||!w||!_||!E},{sort:function(e){void 0!==e&&i(e);var t=a(this);if(E)return void 0===e?m(t):m(t,e);var n,r,o=[],c=s(t);for(r=0;r<c;r++)r in t&&b(o,t[r]);for(d(o,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:u(t)>u(n)?1:-1}}(e)),n=s(o),r=0;r<n;)t[r]=o[r++];for(;r<c;)l(t,r++);return t}})},43105:(e,t,n)=>{var r=n(23103),o=n(47);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},56032:(e,t,n)=>{"use strict";var r=n(23103),o=n(20266),i=n(77111),a=n(16485),s=n(64624),l=n(89003);r({target:"Promise",stat:!0,forced:n(96866)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,u=n.reject,c=s((function(){var n=i(t.resolve),a=[],s=0,c=1;l(e,(function(e){var i=s++,l=!1;c++,o(n,t,e).then((function(e){l||(l=!0,a[i]=e,--c||r(a))}),u)})),--c||r(a)}));return c.error&&u(c.value),n.promise}})},6135:(e,t,n)=>{"use strict";var r=n(23103),o=n(24231),i=n(38321).CONSTRUCTOR,a=n(74473),s=n(31333),l=n(26733),u=n(14768),c=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&l(a)){var d=s("Promise").prototype.catch;c.catch!==d&&u(c,"catch",d,{unsafe:!0})}},86087:(e,t,n)=>{"use strict";var r,o,i,a=n(23103),s=n(24231),l=n(28801),u=n(9859),c=n(20266),d=n(14768),f=n(56540),h=n(54555),p=n(71832),v=n(77111),g=n(26733),y=n(85052),m=n(57728),b=n(37942),x=n(55795).set,w=n(24794),_=n(14665),E=n(64624),k=n(93358),S=n(56407),P=n(74473),j=n(38321),C=n(16485),T="Promise",O=j.CONSTRUCTOR,D=j.REJECTION_EVENT,N=j.SUBCLASSING,A=S.getterFor(T),R=S.set,M=P&&P.prototype,I=P,L=M,B=u.TypeError,F=u.document,V=u.process,G=C.f,H=G,W=!!(F&&F.createEvent&&u.dispatchEvent),Y="unhandledrejection",q=function(e){var t;return!(!y(e)||!g(t=e.then))&&t},X=function(e,t){var n,r,o,i=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&J(t),t.rejection=1),!0===s?n=i:(d&&d.enter(),n=s(i),d&&(d.exit(),o=!0)),n===e.promise?u(B("Promise-chain cycle")):(r=q(n))?c(r,n,l,u):l(n)):u(i)}catch(f){d&&!o&&d.exit(),u(f)}},$=function(e,t){e.notified||(e.notified=!0,w((function(){for(var n,r=e.reactions;n=r.get();)X(n,e);e.notified=!1,t&&!e.rejection&&Z(e)})))},K=function(e,t,n){var r,o;W?((r=F.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},!D&&(o=u["on"+e])?o(r):e===Y&&_("Unhandled promise rejection",n)},Z=function(e){c(x,u,(function(){var t,n=e.facade,r=e.value;if(Q(e)&&(t=E((function(){l?V.emit("unhandledRejection",r,n):K(Y,n,r)})),e.rejection=l||Q(e)?2:1,t.error))throw t.value}))},Q=function(e){return 1!==e.rejection&&!e.parent},J=function(e){c(x,u,(function(){var t=e.facade;l?V.emit("rejectionHandled",t):K("rejectionhandled",t,e.value)}))},ee=function(e,t,n){return function(r){e(t,r,n)}},te=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,$(e,!0))},ne=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw B("Promise can't be resolved itself");var r=q(t);r?w((function(){var n={done:!1};try{c(r,t,ee(ne,n,e),ee(te,n,e))}catch(o){te(n,o,e)}})):(e.value=t,e.state=1,$(e,!1))}catch(o){te({done:!1},o,e)}}};if(O&&(L=(I=function(e){m(this,L),v(e),c(r,this);var t=A(this);try{e(ee(ne,t),ee(te,t))}catch(n){te(t,n)}}).prototype,(r=function(e){R(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new k,rejection:!1,state:0,value:void 0})}).prototype=d(L,"then",(function(e,t){var n=A(this),r=G(b(this,I));return n.parent=!0,r.ok=!g(e)||e,r.fail=g(t)&&t,r.domain=l?V.domain:void 0,0==n.state?n.reactions.add(r):w((function(){X(r,n)})),r.promise})),o=function(){var e=new r,t=A(e);this.promise=e,this.resolve=ee(ne,t),this.reject=ee(te,t)},C.f=G=function(e){return e===I||undefined===e?new o(e):H(e)},!s&&g(P)&&M!==Object.prototype)){i=M.then,N||d(M,"then",(function(e,t){var n=this;return new I((function(e,t){c(i,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete M.constructor}catch(re){}f&&f(M,L)}a({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:I}),h(I,T,!1,!0),p(T)},73439:(e,t,n)=>{n(86087),n(56032),n(6135),n(26767),n(39320),n(52047)},26767:(e,t,n)=>{"use strict";var r=n(23103),o=n(20266),i=n(77111),a=n(16485),s=n(64624),l=n(89003);r({target:"Promise",stat:!0,forced:n(96866)},{race:function(e){var t=this,n=a.f(t),r=n.reject,u=s((function(){var a=i(t.resolve);l(e,(function(e){o(a,t,e).then(n.resolve,r)}))}));return u.error&&r(u.value),n.promise}})},39320:(e,t,n)=>{"use strict";var r=n(23103),o=n(20266),i=n(16485);r({target:"Promise",stat:!0,forced:n(38321).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return o(t.reject,void 0,e),t.promise}})},52047:(e,t,n)=>{"use strict";var r=n(23103),o=n(31333),i=n(24231),a=n(74473),s=n(38321).CONSTRUCTOR,l=n(62391),u=o("Promise"),c=i&&!s;r({target:"Promise",stat:!0,forced:i||s},{resolve:function(e){return l(c&&this===u?a:this,e)}})},77950:(e,t,n)=>{"use strict";var r=n(23103),o=n(63466);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},31235:(e,t,n)=>{"use strict";var r=n(23103),o=n(65968),i=n(47272),a=n(58885),s=n(83326),l=n(48127),u=o("".indexOf);r({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~u(s(a(this)),s(i(e)),arguments.length>1?arguments[1]:void 0)}})},85940:(e,t,n)=>{"use strict";var r=n(53171),o=n(20266),i=n(65968),a=n(94954),s=n(24229),l=n(21176),u=n(26733),c=n(9650),d=n(43329),f=n(34237),h=n(83326),p=n(58885),v=n(36637),g=n(55300),y=n(70017),m=n(98115),b=n(70095)("replace"),x=Math.max,w=Math.min,_=i([].concat),E=i([].push),k=i("".indexOf),S=i("".slice),P="$0"==="a".replace(/./,"$0"),j=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(e,t,n){var i=j?"$":"$0";return[function(e,n){var r=p(this),i=c(e)?void 0:g(e,b);return i?o(i,e,r,n):o(t,h(r),e,n)},function(e,o){var a=l(this),s=h(e);if("string"==typeof o&&-1===k(o,i)&&-1===k(o,"$<")){var c=n(t,a,s,o);if(c.done)return c.value}var p=u(o);p||(o=h(o));var g=a.global;if(g){var b=a.unicode;a.lastIndex=0}for(var P=[];;){var j=m(a,s);if(null===j)break;if(E(P,j),!g)break;""===h(j[0])&&(a.lastIndex=v(s,f(a.lastIndex),b))}for(var C,T="",O=0,D=0;D<P.length;D++){for(var N=h((j=P[D])[0]),A=x(w(d(j.index),s.length),0),R=[],M=1;M<j.length;M++)E(R,void 0===(C=j[M])?C:String(C));var I=j.groups;if(p){var L=_([N],R,A,s);void 0!==I&&E(L,I);var B=h(r(o,void 0,L))}else B=y(N,s,A,R,I,o);A>=O&&(T+=S(s,O,A)+B,O=A+N.length)}return T+S(s,O)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!P||j)},94908:(e,t,n)=>{"use strict";var r=n(20266),o=n(94954),i=n(21176),a=n(9650),s=n(58885),l=n(72101),u=n(83326),c=n(55300),d=n(98115);o("search",(function(e,t,n){return[function(t){var n=s(this),o=a(t)?void 0:c(t,e);return o?r(o,t,n):new RegExp(t)[e](u(n))},function(e){var r=i(this),o=u(e),a=n(t,r,o);if(a.done)return a.value;var s=r.lastIndex;l(s,0)||(r.lastIndex=0);var c=d(r,o);return l(r.lastIndex,s)||(r.lastIndex=s),null===c?-1:c.index}]}))},634:(e,t,n)=>{"use strict";var r=n(23103),o=n(7400),i=n(9859),a=n(65968),s=n(98270),l=n(26733),u=n(91321),c=n(83326),d=n(31787).f,f=n(77081),h=i.Symbol,p=h&&h.prototype;if(o&&l(h)&&(!("description"in p)||void 0!==h().description)){var v={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),t=u(p,this)?new h(e):void 0===e?h():h(e);return""===e&&(v[t]=!0),t};f(g,h),g.prototype=p,p.constructor=g;var y="Symbol(test)"==String(h("test")),m=a(p.valueOf),b=a(p.toString),x=/^Symbol\((.*)\)[^)]+$/,w=a("".replace),_=a("".slice);d(p,"description",{configurable:!0,get:function(){var e=m(this);if(s(v,e))return"";var t=b(e),n=y?_(t,7,-1):w(t,x,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:g})}},6886:(e,t,n)=>{var r=n(9859),o=n(95694),i=n(18865),a=n(15735),s=n(75762),l=n(70095),u=l("iterator"),c=l("toStringTag"),d=a.values,f=function(e,t){if(e){if(e[u]!==d)try{s(e,u,d)}catch(r){e[u]=d}if(e[c]||s(e,c,t),o[t])for(var n in a)if(e[n]!==a[n])try{s(e,n,a[n])}catch(r){e[n]=a[n]}}};for(var h in o)f(r[h]&&r[h].prototype,h);f(i,"DOMTokenList")},81368:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,(function(t){return e[t]}).bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),o=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(2),i=n(3),a=n(4);function s(e){this.options=i({},o,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},i=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===i.x2&&(i.x2=i.x1+i.w),void 0===i.w&&(i.w=i.x2-i.x1),void 0===i.y2&&(i.y2=i.y1+i.h),void 0===i.h&&(i.h=i.y2-i.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),l={},u=function(e,t){null!=t&&(l[e]=t)};u("nodesep",e.nodeSep),u("edgesep",e.edgeSep),u("ranksep",e.rankSep),u("rankdir",e.rankDir),u("align",e.align),u("ranker",e.ranker),u("acyclicer",e.acyclicer),s.setGraph(l),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var c=n.nodes(),d=0;d<c.length;d++){var f=c[d],h=f.layoutDimensions(e);s.setNode(f.id(),{width:h.w,height:h.h,name:f.id()})}for(var p=0;p<c.length;p++){var v=c[p];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),y=0;y<g.length;y++){var m=g[y];s.setEdge(m.source().id(),m.target().id(),{minlen:o(m,e.minLen),weight:o(m,e.edgeWeight),name:m.id()},m.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var _=x[w],E=s.node(_);t.getElementById(_).scratch().dagre=E}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},c.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=i,c.layoutPositions(this,e,(function(t){var n=(t="object"===r(t)?t:this).scratch().dagre;return function(t){if(e.boundingBox){var n=0===b.w?0:(t.x-b.x1)/b.w,r=0===b.h?0:(t.y-b.y1)/b.h;return{x:i.x1+n*i.w,y:i.y1+r*i.h}}return t}({x:n.x,y:n.y})})),this},e.exports=s},function(e,t){var n={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}};e.exports=n},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n(46506))},10404:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),o=n(1).getRef,i=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=o(e,t),l=i(e,t.content),u=r({},a,t.popper);return s(n,l,u)}}},function(e,t,n){"use strict";var r=n(0),o=n(2).getPopper,i=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},o=e.cy(),i={renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e),o=r.w/2,i=r.h/2;return{x:n.x-o,y:n.y-i}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:o};return r({},i,t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),o(this[0],a(this[0],e))},popperRef:function(e){return s(this),i(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),o=n(2).getPopper,i=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return o(this,a(this,e))},popperRef:function(e){return i(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.cy,o=t.renderedDimensions,i=r.container().getBoundingClientRect(),a=o(e),s=n(e);return{top:s.y+i.top,left:s.x+i.left,right:s.x+a.w+i.left,bottom:s.y+a.h+i.top,width:a.w,height:a.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n=null;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),o=n(3),i=function(e){e&&(e("core","popper",r.popper),e("collection","popper",o.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",o.popperRef))};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(t,n){t.exports=e}])},e.exports=r(n(60367))},93218:(e,t,n)=>{"use strict";var r=n(54073),o=n(71254),i=n(72579),a=n(16765),s=n(25497);function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(r),c=l(o),d=l(i),f=l(a),h=l(s);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w="undefined"==typeof window?null:window,_=w?w.navigator:null;w&&w.document;var E=p(""),k=p({}),S=p((function(){})),P="undefined"==typeof HTMLElement?"undefined":p(HTMLElement),j=function(e){return e&&e.instanceString&&T(e.instanceString)?e.instanceString():null},C=function(e){return null!=e&&p(e)==E},T=function(e){return null!=e&&p(e)===S},O=function(e){return!R(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},D=function(e){return null!=e&&p(e)===k&&!O(e)&&e.constructor===Object},N=function(e){return null!=e&&p(e)===p(1)&&!isNaN(e)},A=function(e){return"undefined"===P?void 0:null!=e&&e instanceof HTMLElement},R=function(e){return M(e)||I(e)},M=function(e){return"collection"===j(e)&&e._private.single},I=function(e){return"collection"===j(e)&&!e._private.single},L=function(e){return"core"===j(e)},B=function(e){return"stylesheet"===j(e)},F=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},V=function(e){return function(e){return null!=e&&p(e)===k}(e)&&T(e.then)},G=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,o=this,i=arguments,a=t.apply(o,i),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(o,i)),r};return n.cache={},n},H=G((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),W=G((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),Y=G((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),q=function(e){return F(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},X="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",$=function(e,t){return e<t?-1:e>t?1:0},K=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var o=Object.keys(r),i=0;i<o.length;i++){var a=o[i];e[a]=r[a]}}return e},Z=function(e){return(O(e)?e:null)||function(e){return Q[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,o=16;return 4===e.length?(t=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),r=parseInt(e[3]+e[3],o)):(t=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),r=parseInt(e[5]+e[6],o)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(n){t=[];for(var r=[],o=1;o<=3;o++){var i=n[o];if("%"===i[i.length-1]&&(r[o]=!0),i=parseFloat(i),r[o]&&(i=i/100*255),i<0||i>255)return;t.push(Math.floor(i))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,o,i,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(o=parseFloat(c[3]))<0||o>100)return;if(o/=100,void 0!==(i=c[4])&&((i=parseFloat(i))<0||i>1))return;if(0===r)a=s=l=Math.round(255*o);else{var d=o<.5?o*(1+r):o+r-o*r,f=2*o-d;a=Math.round(255*u(f,d,n+1/3)),s=Math.round(255*u(f,d,n)),l=Math.round(255*u(f,d,n-1/3))}t=[a,s,l,i]}return t}(e)},Q={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]},J=function(e){for(var t=e.map,n=e.keys,r=n.length,o=0;o<r;o++){var i=n[o];if(D(i))throw Error("Tried to set map with object key");o<n.length-1?(null==t[i]&&(t[i]={}),t=t[i]):t[i]=e.value}},ee=function(e){for(var t=e.map,n=e.keys,r=n.length,o=0;o<r;o++){var i=n[o];if(D(i))throw Error("Tried to get map with object key");if(null==(t=t[i]))return t}return t},te=w?w.performance:null,ne=te&&te.now?function(){return te.now()}:function(){return Date.now()},re=function(){if(w){if(w.requestAnimationFrame)return function(e){w.requestAnimationFrame(e)};if(w.mozRequestAnimationFrame)return function(e){w.mozRequestAnimationFrame(e)};if(w.webkitRequestAnimationFrame)return function(e){w.webkitRequestAnimationFrame(e)};if(w.msRequestAnimationFrame)return function(e){w.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(ne())}),1e3/60)}}(),oe=function(e){return re(e)},ie=ne,ae=9261,se=65599,le=5381,ue=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae,r=n;!(t=e.next()).done;)r=r*se+t.value|0;return r},ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae;return t*se+e|0},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le;return(t<<5)+t+e|0},fe=function(e){return 2097152*e[0]+e[1]},he=function(e,t){return[ce(e[0],t[0]),de(e[1],t[1])]},pe=function(e,t){var n={value:0,done:!1},r=0,o=e.length;return ue({next:function(){return r<o?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},ve=function(){return ge(arguments)},ge=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?pe(r):pe(r,t)}return t},ye=!0,me=null!=console.warn,be=null!=console.trace,xe=Number.MAX_SAFE_INTEGER||9007199254740991,we=function(){return!0},_e=function(){return!1},Ee=function(){return 0},ke=function(){},Se=function(e){throw new Error(e)},Pe=function(e){if(void 0===e)return ye;ye=!!e},je=function(e){Pe()&&(me?console.warn(e):(console.log(e),be&&console.trace()))},Ce=function(e){return null==e?e:O(e)?e.slice():D(e)?function(e){return K({},e)}(e):e},Te=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},Oe={},De=function(){return Oe},Ne=function(e){var t=Object.keys(e);return function(n){for(var r={},o=0;o<t.length;o++){var i=t[o],a=null==n?void 0:n[i];r[i]=void 0===a?e[i]:a}return r}},Ae=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},Re=function(e){e.splice(0,e.length)},Me=function(e,t,n){return n&&(t=Y(n,t)),e[t]},Ie=function(e,t,n,r){n&&(t=Y(n,t)),e[t]=r},Le="undefined"!=typeof Map?Map:function(){function e(){v(this,e),this._obj={}}return y(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Be=function(){function e(t){if(v(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return y(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Fe="undefined"!==("undefined"==typeof Set?"undefined":p(Set))?Set:Be,ze=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&L(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var o=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Fe,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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(null==o.position.x&&(o.position.x=0),null==o.position.y&&(o.position.y=0),t.renderedPosition){var i=t.renderedPosition,a=e.pan(),s=e.zoom();o.position={x:(i.x-a.x)/s,y:(i.y-a.y)/s}}var l=[];O(t.classes)?l=t.classes:C(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var d=l[u];d&&""!==d&&o.classes.add(d)}this.createEmitter();var f=t.style||t.css;f&&(je("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."),this.style(f)),(void 0===n||n)&&this.restore()}else Se("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Se("An element must have a core reference and parameters set")},Ve=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var o;D(t)&&!R(t)&&(t=(o=t).roots||o.root,n=o.visit,r=o.directed),r=2!==arguments.length||T(n)?r:n,n=T(n)?n:function(){};for(var i,a=this._private.cy,s=t=C(t)?this.filter(t):t,l=[],u=[],c={},d={},f={},h=0,p=this.byGroup(),v=p.nodes,g=p.edges,y=0;y<s.length;y++){var m=s[y],b=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(f[b]=!0,u.push(m)),d[b]=0)}for(var x=function(){var t=e.bfs?l.shift():l.pop(),o=t.id();if(e.dfs){if(f[o])return"continue";f[o]=!0,u.push(t)}var a,s=d[o],p=c[o],y=null!=p?p.source():null,m=null!=p?p.target():null,b=null==p?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,p,b,h++,s)))return i=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var _=x[w],E=_.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),k=E.id();0===E.length||f[k]||(E=E[0],l.push(E),e.bfs&&(f[k]=!0,u.push(E)),c[k]=_,d[k]=d[o]+1)}};0!==l.length;){var w=x();if("continue"!==w&&"break"===w)break}for(var _=a.collection(),E=0;E<u.length;E++){var k=u[E],S=c[k.id()];null!=S&&_.push(S),_.push(k)}return{path:a.collection(_),found:a.collection(i)}}},Ge={breadthFirstSearch:Ve({bfs:!0}),depthFirstSearch:Ve({dfs:!0})};Ge.bfs=Ge.breadthFirstSearch,Ge.dfs=Ge.depthFirstSearch;var Ue=Ne({root:null,weight:function(e){return 1},directed:!1}),He={dijkstra:function(e){if(!D(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Ue(e),r=n.root,o=n.weight,i=n.directed,a=this,s=o,l=C(r)?this.filter(r)[0]:r[0],u={},d={},f={},h=this.byGroup(),p=h.nodes,v=h.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return u[e.id()]},y=function(e,t){u[e.id()]=t,m.updateItem(e)},m=new c.default((function(e,t){return g(e)-g(t)})),b=0;b<p.length;b++){var x=p[b];u[x.id()]=x.same(l)?0:1/0,m.push(x)}for(var w=function(e,t){for(var n,r=(i?e.edgesTo(t):e.edgesWith(t)).intersect(v),o=1/0,a=0;a<r.length;a++){var l=r[a],u=s(l);(u<o||!n)&&(o=u,n=l)}return{edge:n,dist:o}};m.size()>0;){var _=m.pop(),E=g(_),k=_.id();if(f[k]=E,E!==1/0)for(var S=_.neighborhood().intersect(p),P=0;P<S.length;P++){var j=S[P],T=j.id(),O=w(_,j),N=E+O.dist;N<g(j)&&(y(j,N),d[T]={node:_,edge:O.edge})}}return{distanceTo:function(e){var t=C(e)?p.filter(e)[0]:e[0];return f[t.id()]},pathTo:function(e){var t=C(e)?p.filter(e)[0]:e[0],n=[],r=t,o=r.id();if(t.length>0)for(n.unshift(t);d[o];){var i=d[o];n.unshift(i.edge),n.unshift(i.node),o=(r=i.node).id()}return a.spawn(n)}}}},We={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,o=n.length,i=new Array(o),a=n,s=function(e){for(var t=0;t<i.length;t++){if(i[t].has(e))return t}},l=0;l<o;l++)i[l]=this.spawn(n[l]);for(var u=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<u.length;c++){var d=u[c],f=d.source()[0],h=d.target()[0],p=s(f),v=s(h),g=i[p],y=i[v];p!==v&&(a.merge(d),g.merge(y),i.splice(v,1))}return a}},Ye=Ne({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),qe={aStar:function(e){var t=this.cy(),n=Ye(e),r=n.root,o=n.goal,i=n.heuristic,a=n.directed,s=n.weight;r=t.collection(r)[0],o=t.collection(o)[0];var l,u,d=r.id(),f=o.id(),h={},p={},v={},g=new c.default((function(e,t){return p[e.id()]-p[t.id()]})),y=new Fe,m={},b={},x=function(e,t){g.push(e),y.add(t)};x(r,d),h[d]=0,p[d]=i(r);for(var w,_=0;g.size()>0;){if(l=g.pop(),u=l.id(),y.delete(u),_++,u===f){for(var E=[],k=o,S=f,P=b[S];E.unshift(k),null!=P&&E.unshift(P),null!=(k=m[S]);)P=b[S=k.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:_}}v[u]=!0;for(var j=l._private.edges,C=0;C<j.length;C++){var T=j[C];if(this.hasElementWithId(T.id())&&(!a||T.data("source")===u)){var O=T.source(),D=T.target(),N=O.id()!==u?O:D,A=N.id();if(this.hasElementWithId(A)&&!v[A]){var R=h[u]+s(T);w=A,y.has(w)?R<h[A]&&(h[A]=R,p[A]=R+i(N),m[A]=l,b[A]=T):(h[A]=R,p[A]=R+i(N),x(N,A),m[A]=l,b[A]=T)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},Xe=Ne({weight:function(e){return 1},directed:!1}),$e={floydWarshall:function(e){for(var t=this.cy(),n=Xe(e),r=n.weight,o=n.directed,i=r,a=this.byGroup(),s=a.nodes,l=a.edges,u=s.length,c=u*u,d=function(e){return s.indexOf(e)},f=function(e){return s[e]},h=new Array(c),p=0;p<c;p++){var v=p%u,g=(p-v)/u;h[p]=g===v?0:1/0}for(var y=new Array(c),m=new Array(c),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],_=x.target()[0];if(w!==_){var E=d(w),k=d(_),S=E*u+k,P=i(x);if(h[S]>P&&(h[S]=P,y[S]=k,m[S]=x),!o){var j=k*u+E;!o&&h[j]>P&&(h[j]=P,y[j]=E,m[j]=x)}}}for(var T=0;T<u;T++)for(var O=0;O<u;O++)for(var D=O*u+T,N=0;N<u;N++){var A=O*u+N,R=T*u+N;h[D]+h[R]<h[A]&&(h[A]=h[D]+h[R],y[A]=y[D])}var M=function(e){return d(function(e){return(C(e)?t.filter(e):e)[0]}(e))},I={distance:function(e,t){var n=M(e),r=M(t);return h[n*u+r]},path:function(e,n){var r=M(e),o=M(n),i=f(r);if(r===o)return i.collection();if(null==y[r*u+o])return t.collection();var a,s=t.collection(),l=r;for(s.merge(i);r!==o;)l=r,r=y[r*u+o],a=m[l*u+r],s.merge(a),s.merge(f(r));return s}};return I}},Ke=Ne({weight:function(e){return 1},directed:!1,root:null}),Ze={bellmanFord:function(e){var t=this,n=Ke(e),r=n.weight,o=n.directed,i=n.root,a=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,d=u.nodes,f=d.length,h=new Le,p=!1,v=[];i=l.collection(i)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var g=c.length,y=function(e){var t=h.get(e.id());return t||(t={},h.set(e.id(),t)),t},m=function(e){return(C(e)?l.$(e):e)[0]},b=0;b<f;b++){var x=d[b],w=y(x);x.same(i)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var _=!1,E=function(e,t,n,r,o,i){var a=r.dist+i;a<o.dist&&!n.same(r.edge)&&(o.dist=a,o.pred=e,o.edge=n,_=!0)},k=1;k<f;k++){_=!1;for(var S=0;S<g;S++){var P=c[S],j=P.source(),T=P.target(),O=a(P),D=y(j),N=y(T);E(j,0,P,D,N,O),o||E(T,0,P,N,D,O)}if(!_)break}if(_)for(var A=[],R=0;R<g;R++){var M=c[R],I=M.source(),L=M.target(),B=a(M),F=y(I).dist,V=y(L).dist;if(F+B<V||!o&&V+B<F){if(p||(je("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var G=[];F+B<V&&G.push(I),!o&&V+B<F&&G.push(L);for(var H=G.length,W=0;W<H;W++){var Y=G[W],q=[Y];q.push(y(Y).edge);for(var X=y(Y).pred;-1===q.indexOf(X);)q.push(X),q.push(y(X).edge),X=y(X).pred;for(var $=(q=q.slice(q.indexOf(X)))[0].id(),K=0,Z=2;Z<q.length;Z+=2)q[Z].id()<$&&($=q[Z].id(),K=Z);(q=q.slice(K).concat(q.slice(0,K))).push(q[0]);var Q=q.map((function(e){return e.id()})).join(",");-1===A.indexOf(Q)&&(v.push(s.spawn(q)),A.push(Q))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=m(e),o=[],a=r;;){if(null==a)return t.spawn();var l=y(a),u=l.edge,c=l.pred;if(o.unshift(a[0]),a.same(n)&&o.length>0)break;null!=u&&o.unshift(u),a=c}return s.spawn(o)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},Qe=Math.sqrt(2),Je=function(e,t,n){0===n.length&&Se("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],o=r[1],i=r[2],a=t[o],s=t[i],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],f=c[2];(t[d]===a&&t[f]===s||t[d]===s&&t[f]===a)&&l.splice(u,1)}for(var h=0;h<l.length;h++){var p=l[h];p[1]===s?(l[h]=p.slice(),l[h][1]=a):p[2]===s&&(l[h]=p.slice(),l[h][2]=a)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=a);return l},et=function(e,t,n,r){for(;n>r;){var o=Math.floor(Math.random()*t.length);t=Je(o,e,t),n--}return t},tt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var o=n.length,i=r.length,a=Math.ceil(Math.pow(Math.log(o)/Math.LN2,2)),s=Math.floor(o/Qe);if(!(o<2)){for(var l=[],u=0;u<i;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,f=[],h=new Array(o),p=new Array(o),v=new Array(o),g=function(e,t){for(var n=0;n<o;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<o;m++)p[m]=m;var b=et(p,l.slice(),o,s),x=b.slice();g(p,v);var w=et(p,b,s,2),_=et(v,x,s,2);w.length<=_.length&&w.length<d?(d=w.length,f=w,g(p,h)):_.length<=w.length&&_.length<d&&(d=_.length,f=_,g(v,h))}for(var E=this.spawn(f.map((function(e){return r[e[0]]}))),k=this.spawn(),S=this.spawn(),P=h[0],j=0;j<h.length;j++){var C=h[j],T=n[j];C===P?k.merge(T):S.merge(T)}var O=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!E.contains(t)&&n.merge(t)}))})),n},D=[O(k),O(S)];return{cut:E,components:D,partition1:k,partition2:S}}Se("At least 2 nodes are required for Karger-Stein algorithm")}},nt=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},rt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},ot=function(e){return{x:e[0],y:e[1]}},it=function(e,t){return Math.atan2(t,e)-Math.PI/2},at=Math.log2||function(e){return Math.log(e)/Math.log(2)},st=function(e){return e>0?1:e<0?-1:0},lt=function(e,t){return Math.sqrt(ut(e,t))},ut=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},ct=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var o=0;o<t;o++)e[o]=e[o]/n;return e},dt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},ft=function(e,t,n,r){return{x:dt(e.x,t.x,n.x,r),y:dt(e.y,t.y,n.y,r)}},ht=function(e,t,n){return Math.max(e,Math.min(n,t))},pt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&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(null!=e.w&&null!=e.h&&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}}},vt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),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},gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},yt=function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===i.length)t=n=r=o=i[0];else if(2===i.length)t=r=i[0],o=n=i[1];else if(4===i.length){var a=b(i,4);t=a[0],n=a[1],r=a[2],o=a[3]}return e.x1-=o,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},mt=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},bt=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},xt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},wt=function(e,t){return xt(e,t.x1,t.y1)&&xt(e,t.x2,t.y2)},_t=function(e,t,n,r,o,i,a){var s,l=zt(o,i),u=o/2,c=i/2,d=r-c-a;if((s=Rt(e,t,n,r,n-u+l-a,d,n+u-l+a,d,!1)).length>0)return s;var f=n+u+a;if((s=Rt(e,t,n,r,f,r-c+l-a,f,r+c-l+a,!1)).length>0)return s;var h=r+c+a;if((s=Rt(e,t,n,r,n-u+l-a,h,n+u-l+a,h,!1)).length>0)return s;var p,v=n-u-a;if((s=Rt(e,t,n,r,v,r-c+l-a,v,r+c-l+a,!1)).length>0)return s;var g=n-u+l,y=r-c+l;if((p=Nt(e,t,n,r,g,y,l+a)).length>0&&p[0]<=g&&p[1]<=y)return[p[0],p[1]];var m=n+u-l,b=r-c+l;if((p=Nt(e,t,n,r,m,b,l+a)).length>0&&p[0]>=m&&p[1]<=b)return[p[0],p[1]];var x=n+u-l,w=r+c-l;if((p=Nt(e,t,n,r,x,w,l+a)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var _=n-u+l,E=r+c-l;return(p=Nt(e,t,n,r,_,E,l+a)).length>0&&p[0]<=_&&p[1]>=E?[p[0],p[1]]:[]},Et=function(e,t,n,r,o,i,a){var s=a,l=Math.min(n,o),u=Math.max(n,o),c=Math.min(r,i),d=Math.max(r,i);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},kt=function(e,t,n,r,o,i,a,s,l){var u=Math.min(n,a,o)-l,c=Math.max(n,a,o)+l,d=Math.min(r,s,i)-l,f=Math.max(r,s,i)+l;return!(e<u||e>c||t<d||t>f)},St=function(e,t,n,r,o,i,a,s){var l=[];!function(e,t,n,r,o){var i,a,s,l,u,c,d,f;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),i=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,o[1]=0,d=t/3,i>0?(u=(u=s+Math.sqrt(i))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(i))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),o[0]=-d+u+c,d+=(u+c)/2,o[4]=o[2]=-d,d=Math.sqrt(3)*(-c+u)/2,o[3]=d,o[5]=-d):(o[5]=o[3]=0,0===i?(f=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),o[0]=2*f-d,o[4]=o[2]=-(f+d)):(l=(a=-a)*a*a,l=Math.acos(s/Math.sqrt(l)),f=2*Math.sqrt(a),o[0]=-d+f*Math.cos(l/3),o[2]=-d+f*Math.cos((l+2*Math.PI)/3),o[4]=-d+f*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*o+2*n*a+4*o*o-4*o*a+a*a+r*r-4*r*i+2*r*s+4*i*i-4*i*s+s*s,9*n*o-3*n*n-3*n*a-6*o*o+3*o*a+9*r*i-3*r*r-3*r*s-6*i*i+3*i*s,3*n*n-6*n*o+n*a-n*e+2*o*o+2*o*e-a*e+3*r*r-6*r*i+r*s-r*t+2*i*i+2*i*t-s*t,1*n*o-n*n+n*e-o*e+r*i-r*r+r*t-i*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var d,f,h,p=-1,v=0;v<u.length;v++)d=Math.pow(1-u[v],2)*n+2*(1-u[v])*u[v]*o+u[v]*u[v]*a,f=Math.pow(1-u[v],2)*r+2*(1-u[v])*u[v]*i+u[v]*u[v]*s,h=Math.pow(d-e,2)+Math.pow(f-t,2),p>=0?h<p&&(p=h):p=h;return p},Pt=function(e,t,n,r,o,i){var a=[e-n,t-r],s=[o-n,i-r],l=s[0]*s[0]+s[1]*s[1],u=a[0]*a[0]+a[1]*a[1],c=a[0]*s[0]+a[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-o)*(e-o)+(t-i)*(t-i):u-d},jt=function(e,t,n){for(var r,o,i,a,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],o=n[2*l+1],l+1<n.length/2?(i=n[2*(l+1)],a=n[2*(l+1)+1]):(i=n[2*(l+1-n.length/2)],a=n[2*(l+1-n.length/2)+1]),r==e&&i==e);else{if(!(r>=e&&e>=i||r<=e&&e<=i))continue;(e-r)/(i-r)*(a-o)+o>t&&s++}return s%2!=0},Ct=function(e,t,n,r,o,i,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,f=Math.cos(-u),h=Math.sin(-u),p=0;p<c.length/2;p++)c[2*p]=i/2*(n[2*p]*f-n[2*p+1]*h),c[2*p+1]=a/2*(n[2*p+1]*f+n[2*p]*h),c[2*p]+=r,c[2*p+1]+=o;if(l>0){var v=Ot(c,-l);d=Tt(v)}else d=c;return jt(e,t,d)},Tt=function(e){for(var t,n,r,o,i,a,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],o=e[4*c+3],c<e.length/4-1?(i=e[4*(c+1)],a=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(i=e[0],a=e[1],s=e[2],l=e[3]);var d=Rt(t,n,r,o,i,a,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},Ot=function(e,t){for(var n,r,o,i,a=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(o=e[2*(s+1)],i=e[2*(s+1)+1]):(o=e[0],i=e[1]);var l=i-r,u=-(o-n),c=Math.sqrt(l*l+u*u),d=l/c,f=u/c;a[4*s]=n+d*t,a[4*s+1]=r+f*t,a[4*s+2]=o+d*t,a[4*s+3]=i+f*t}return a},Dt=function(e,t,n,r,o,i,a){return e-=o,t-=i,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},Nt=function(e,t,n,r,o,i,a){var s=[n-e,r-t],l=[e-o,t-i],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-a*a);if(d<0)return[];var f=(-c+Math.sqrt(d))/(2*u),h=(-c-Math.sqrt(d))/(2*u),p=Math.min(f,h),v=Math.max(f,h),g=[];if(p>=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var y=g[0]*s[0]+e,m=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[y,m]:[y,m,g[1]*s[0]+e,g[1]*s[1]+t]:[y,m]},At=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Rt=function(e,t,n,r,o,i,a,s,l){var u=e-o,c=n-e,d=a-o,f=t-i,h=r-t,p=s-i,v=d*f-p*u,g=c*f-h*u,y=p*c-d*h;if(0!==y){var m=v/y,b=g/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*h]:[]}return 0===v||0===g?At(e,n,a)===a?[a,s]:At(e,n,o)===o?[o,i]:At(o,a,n)===n?[n,r]:[]:[]},Mt=function(e,t,n,r,o,i,a,s){var l,u,c,d,f,h,p=[],v=new Array(n.length),g=!0;if(null==i&&(g=!1),g){for(var y=0;y<v.length/2;y++)v[2*y]=n[2*y]*i+r,v[2*y+1]=n[2*y+1]*a+o;if(s>0){var m=Ot(v,-s);u=Tt(m)}else u=v}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],d=u[2*b+1],b<u.length/2-1?(f=u[2*(b+1)],h=u[2*(b+1)+1]):(f=u[0],h=u[1]),0!==(l=Rt(e,t,r,o,c,d,f,h)).length&&p.push(l[0],l[1]);return p},It=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],o=Math.sqrt(r[0]*r[0]+r[1]*r[1]),i=(o-n)/o;return i<0&&(i=1e-5),[t[0]+i*r[0],t[1]+i*r[1]]},Lt=function(e,t){var n=Ft(e,t);return n=Bt(n)},Bt=function(e){for(var t,n,r=e.length/2,o=1/0,i=1/0,a=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],o=Math.min(o,t),a=Math.max(a,t),i=Math.min(i,n),s=Math.max(s,n);for(var u=2/(a-o),c=2/(s-i),d=0;d<r;d++)t=e[2*d]=e[2*d]*u,n=e[2*d+1]=e[2*d+1]*c,o=Math.min(o,t),a=Math.max(a,t),i=Math.min(i,n),s=Math.max(s,n);if(i<-1)for(var f=0;f<r;f++)n=e[2*f+1]=e[2*f+1]+(-1-i);return e},Ft=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var o,i=new Array(2*e),a=0;a<e;a++)o=a*n+r,i[2*a]=Math.cos(o),i[2*a+1]=Math.sin(-o);return i},zt=function(e,t){return Math.min(e/4,t/4,8)},Vt=function(e,t){return Math.min(e/10,t/10,8)},Gt=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Ut=Ne({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Ht={pageRank:function(e){for(var t=Ut(e),n=t.dampingFactor,r=t.precision,o=t.iterations,i=t.weight,a=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,f=u.length,h=new Array(d),p=new Array(c),v=(1-n)/c,g=0;g<c;g++){for(var y=0;y<c;y++){h[g*c+y]=0}p[g]=0}for(var m=0;m<f;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var _=l.indexOfId(x),E=l.indexOfId(w),k=i(b);h[E*c+_]+=k,p[_]+=k}}for(var S=1/c+v,P=0;P<c;P++)if(0===p[P])for(var j=0;j<c;j++){h[j*c+P]=S}else for(var C=0;C<c;C++){var T=C*c+P;h[T]=h[T]/p[P]+v}for(var O,D=new Array(c),N=new Array(c),A=0;A<c;A++)D[A]=1;for(var R=0;R<o;R++){for(var M=0;M<c;M++)N[M]=0;for(var I=0;I<c;I++)for(var L=0;L<c;L++){var B=I*c+L;N[I]+=h[B]*D[L]}ct(N),O=D,D=N,N=O;for(var F=0,V=0;V<c;V++){var G=O[V]-D[V];F+=G*G}if(F<r)break}return{rank:function(e){return e=a.collection(e)[0],D[l.indexOf(e)]}}}},Wt=Ne({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Yt={degreeCentralityNormalized:function(e){e=Wt(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var o={},i={},a=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),o[c]=d.indegree,i[c]=d.outdegree}return{indegree:function(e){return 0==a?0:(C(e)&&(e=t.filter(e)),o[e.id()]/a)},outdegree:function(e){return 0===s?0:(C(e)&&(e=t.filter(e)),i[e.id()]/s)}}}for(var f={},h=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);h<g.degree&&(h=g.degree),f[v.id()]=g.degree}return{degree:function(e){return 0===h?0:(C(e)&&(e=t.filter(e)),f[e.id()]/h)}}},degreeCentrality:function(e){e=Wt(e);var t=this.cy(),n=this,r=e,o=r.root,i=r.weight,a=r.directed,s=r.alpha;if(o=t.collection(o)[0],a){for(var l=o.connectedEdges(),u=l.filter((function(e){return e.target().same(o)&&n.has(e)})),c=l.filter((function(e){return e.source().same(o)&&n.has(e)})),d=u.length,f=c.length,h=0,p=0,v=0;v<u.length;v++)h+=i(u[v]);for(var g=0;g<c.length;g++)p+=i(c[g]);return{indegree:Math.pow(d,1-s)*Math.pow(h,s),outdegree:Math.pow(f,1-s)*Math.pow(p,s)}}for(var y=o.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=i(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};Yt.dc=Yt.degreeCentrality,Yt.dcn=Yt.degreeCentralityNormalised=Yt.degreeCentralityNormalized;var qt=Ne({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Xt={closenessCentralityNormalized:function(e){for(var t=qt(e),n=t.harmonic,r=t.weight,o=t.directed,i=this.cy(),a={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:o}),c=0;c<l.length;c++){for(var d=0,f=l[c],h=0;h<l.length;h++)if(c!==h){var p=u.distance(f,l[h]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),a[f.id()]=d}return{closeness:function(e){return 0==s?0:(e=C(e)?i.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=qt(e),n=t.root,r=t.weight,o=t.directed,i=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:o}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var d=a.distanceTo(c);s+=i?1/d:d}}return i?s:1/s}};Xt.cc=Xt.closenessCentrality,Xt.ccn=Xt.closenessCentralityNormalised=Xt.closenessCentralityNormalized;var $t=Ne({weight:null,directed:!1}),Kt={betweennessCentrality:function(e){for(var t=$t(e),n=t.directed,r=t.weight,o=null!=r,i=this.cy(),a=this.nodes(),s={},l={},u=0,d=function(e,t){l[e]=t,t>u&&(u=t)},f=function(e){return l[e]},h=0;h<a.length;h++){var p=a[h],v=p.id();s[v]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=a[e].id(),n=[],l={},u={},h={},p=new c.default((function(e,t){return h[e]-h[t]})),v=0;v<a.length;v++){var g=a[v].id();l[g]=[],u[g]=0,h[g]=1/0}for(u[t]=1,h[t]=0,p.push(t);!p.empty();){var y=p.pop();if(n.push(y),o)for(var m=0;m<s[y].length;m++){var b=s[y][m],x=i.getElementById(y),w=void 0;w=x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var _=r(w);b=b.id(),h[b]>h[y]+_&&(h[b]=h[y]+_,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[y]+_&&(u[b]=u[b]+u[y],l[b].push(y))}else for(var E=0;E<s[y].length;E++){var k=s[y][E].id();h[k]==1/0&&(p.push(k),h[k]=h[y]+1),h[k]==h[y]+1&&(u[k]=u[k]+u[y],l[k].push(y))}}for(var S={},P=0;P<a.length;P++)S[a[P].id()]=0;for(;n.length>0;){for(var j=n.pop(),C=0;C<l[j].length;C++){var T=l[j][C];S[T]=S[T]+u[T]/u[j]*(1+S[j])}j!=a[e].id()&&d(j,f(j)+S[j])}},y=0;y<a.length;y++)g(y);var m={betweenness:function(e){var t=i.collection(e).id();return f(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=i.collection(e).id();return f(t)/u}};return m.betweennessNormalised=m.betweennessNormalized,m}};Kt.bc=Kt.betweennessCentrality;var Zt=Ne({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Qt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Jt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var o=0;o<t;o++)n+=e[o*t+r];for(var i=0;i<t;i++)e[i*t+r]=e[i*t+r]/n}},en=function(e,t,n){for(var r=new Array(n*n),o=0;o<n;o++){for(var i=0;i<n;i++)r[o*n+i]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[o*n+s]+=e[o*n+a]*t[a*n+s]}return r},tn=function(e,t,n){for(var r=e.slice(0),o=1;o<n;o++)e=en(e,r,t);return e},nn=function(e,t,n){for(var r=new Array(t*t),o=0;o<t*t;o++)r[o]=Math.pow(e[o],n);return Jt(r,t),r},rn=function(e,t,n,r){for(var o=0;o<n;o++){if(Math.round(e[o]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[o]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},on=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},an=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),o=function(e){return Zt(e)}(e),i={},a=0;a<t.length;a++)i[t[a].id()]=a;for(var s,l=t.length,u=l*l,c=new Array(u),d=0;d<u;d++)c[d]=0;for(var f=0;f<n.length;f++){var h=n[f],p=i[h.source().id()],v=i[h.target().id()],g=Qt(h,o.attributes);c[p*l+v]+=g,c[v*l+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,o.multFactor),Jt(c,l);for(var y=!0,m=0;y&&m<o.maxIterations;)y=!1,s=tn(c,l,o.expandFactor),c=nn(s,l,o.inflateFactor),rn(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var o=[],i=0;i<t;i++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[i*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&o.push(r.collection(a))}return o}(c,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&on(e[t],e[n])&&e.splice(n,1);return e}(b),b},sn={markovClustering:an,mcl:an},ln=function(e){return e},un=function(e,t){return Math.abs(t-e)},cn=function(e,t,n){return e+un(t,n)},dn=function(e,t,n){return e+Math.pow(n-t,2)},fn=function(e){return Math.sqrt(e)},hn=function(e,t,n){return Math.max(e,un(t,n))},pn=function(e,t,n,r,o){for(var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:ln,a=r,s=0;s<e;s++)a=o(a,t(s),n(s));return i(a)},vn={euclidean:function(e,t,n){return e>=2?pn(e,t,n,0,dn,fn):pn(e,t,n,0,cn)},squaredEuclidean:function(e,t,n){return pn(e,t,n,0,dn)},manhattan:function(e,t,n){return pn(e,t,n,0,cn)},max:function(e,t,n){return pn(e,t,n,-1/0,hn)}};function gn(e,t,n,r,o,i){var a;return a=T(e)?e:vn[e]||vn.euclidean,0===t&&T(e)?a(o,i):a(t,n,r,o,i)}vn["squared-euclidean"]=vn.squaredEuclidean,vn.squaredeuclidean=vn.squaredEuclidean;var yn=Ne({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),mn=function(e){return yn(e)},bn=function(e,t,n,r,o){var i="kMedoids"!==o?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return gn(e,r.length,i,(function(e){return r[e](t)}),a,s)},xn=function(e,t,n){for(var r=n.length,o=new Array(r),i=new Array(r),a=new Array(t),s=null,l=0;l<r;l++)o[l]=e.min(n[l]).value,i[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(i[c]-o[c])+o[c];a[u]=s}return a},wn=function(e,t,n,r,o){for(var i=1/0,a=0,s=0;s<t.length;s++){var l=bn(n,e,t[s],r,o);l<i&&(i=l,a=s)}return a},_n=function(e,t,n){for(var r=[],o=null,i=0;i<t.length;i++)n[(o=t[i]).id()]===e&&r.push(o);return r},En=function(e,t,n){for(var r=0;r<e.length;r++)for(var o=0;o<e[r].length;o++){if(Math.abs(e[r][o]-t[r][o])>n)return!1}return!0},kn=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},Sn=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var o=e[Math.floor(Math.random()*e.length)];kn(o,n,r);)o=e[Math.floor(Math.random()*e.length)];n[r]=o}else for(var i=0;i<t;i++)n[i]=e[Math.floor(Math.random()*e.length)];return n},Pn=function(e,t,n){for(var r=0,o=0;o<t.length;o++)r+=bn("manhattan",t[o],e,n,"kMedoids");return r},jn=function(e,t,n,r,o){for(var i,a,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],o.m);for(var u=0;u<e.length;u++)for(var c=0;c<o.attributes.length;c++){i=0,a=0;for(var d=0;d<t.length;d++)i+=r[d][u]*o.attributes[c](t[d]),a+=r[d][u];e[u][c]=i/a}},Cn=function(e,t,n,r,o){for(var i=0;i<e.length;i++)t[i]=e[i].slice();for(var a,s,l,u=2/(o.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){a=0;for(var f=0;f<n.length;f++)s=bn(o.distance,r[d],n[c],o.attributes,"cmeans"),l=bn(o.distance,r[d],n[f],o.attributes,"cmeans"),a+=Math.pow(s/l,u);e[d][c]=1/a}},Tn=function(e){var t,n,r,o,i,a=this.cy(),s=this.nodes(),l=mn(e);o=new Array(s.length);for(var u=0;u<s.length;u++)o[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var d=0;d<s.length;d++){for(var f=0,h=0;h<l.k;h++)r[d][h]=Math.random(),f+=r[d][h];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/f}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);i=new Array(s.length);for(var g=0;g<s.length;g++)i[g]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,jn(n,s,r,i,l),Cn(r,o,n,s,l),En(r,o,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var o,i,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l=0;l<t.length;l++){o=-1/0,i=-1;for(var u=0;u<t[0].length;u++)t[l][u]>o&&(o=t[l][u],i=u);a[i].push(e[l])}for(var c=0;c<a.length;c++)a[c]=r.collection(a[c]);return a}(s,r,l,a),{clusters:t,degreeOfMembership:r}},On={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),o=null,i=mn(e),a=new Array(i.k),s={};i.testMode?"number"==typeof i.testCentroids?(i.testCentroids,t=xn(r,i.k,i.attributes)):t="object"===p(i.testCentroids)?i.testCentroids:xn(r,i.k,i.attributes):t=xn(r,i.k,i.attributes);for(var l,u,c,d=!0,f=0;d&&f<i.maxIterations;){for(var h=0;h<r.length;h++)s[(o=r[h]).id()]=wn(o,t,i.distance,i.attributes,"kMeans");d=!1;for(var v=0;v<i.k;v++){var g=_n(v,r,s);if(0!==g.length){for(var y=i.attributes.length,m=t[v],b=new Array(y),x=new Array(y),w=0;w<y;w++){x[w]=0;for(var _=0;_<g.length;_++)o=g[_],x[w]+=i.attributes[w](o);b[w]=x[w]/g.length,l=b[w],u=m[w],c=i.sensitivityThreshold,Math.abs(u-l)<=c||(d=!0)}t[v]=b,a[v]=n.collection(g)}}f++}return a},kMedoids:function(e){var t,n,r=this.cy(),o=this.nodes(),i=null,a=mn(e),s=new Array(a.k),l={},u=new Array(a.k);a.testMode?"number"==typeof a.testCentroids||(t="object"===p(a.testCentroids)?a.testCentroids:Sn(o,a.k)):t=Sn(o,a.k);for(var c=!0,d=0;c&&d<a.maxIterations;){for(var f=0;f<o.length;f++)l[(i=o[f]).id()]=wn(i,t,a.distance,a.attributes,"kMedoids");c=!1;for(var h=0;h<t.length;h++){var v=_n(h,o,l);if(0!==v.length){u[h]=Pn(t[h],v,a.attributes);for(var g=0;g<v.length;g++)(n=Pn(v[g],v,a.attributes))<u[h]&&(u[h]=n,t[h]=v[g],c=!0);s[h]=r.collection(v)}}d++}return s},fuzzyCMeans:Tn,fcm:Tn},Dn=Ne({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Nn={single:"min",complete:"max"},An=function(e,t,n,r,o){for(var i,a=0,s=1/0,l=o.attributes,u=function(e,t){return gn(o.distance,l.length,(function(t){return l[t](e)}),(function(e){return l[e](t)}),e,t)},c=0;c<e.length;c++){var d=e[c].key,f=n[d][r[d]];f<s&&(a=d,s=f)}if("threshold"===o.mode&&s>=o.threshold||"dendrogram"===o.mode&&1===e.length)return!1;var h,p=t[a],v=t[r[a]];h="dendrogram"===o.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=h,e.splice(v.index,1),t[p.key]=h;for(var g=0;g<e.length;g++){var y=e[g];p.key===y.key?i=1/0:"min"===o.linkage?(i=n[p.key][y.key],n[p.key][y.key]>n[v.key][y.key]&&(i=n[v.key][y.key])):"max"===o.linkage?(i=n[p.key][y.key],n[p.key][y.key]<n[v.key][y.key]&&(i=n[v.key][y.key])):i="mean"===o.linkage?(n[p.key][y.key]*p.size+n[v.key][y.key]*v.size)/(p.size+v.size):"dendrogram"===o.mode?u(y.value,p.value):u(y.value[0],p.value[0]),n[p.key][y.key]=n[y.key][p.key]=i}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var _=e[w].key;n[b][_]<n[b][x]&&(x=_)}r[b]=x}e[m].index=m}return p.key=v.key=p.index=v.index=null,!0},Rn=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},Mn=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),o=e(t.right,n),i=n.add({group:"nodes",data:{id:r+","+o}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:o,target:i.id()}}),i.id()}return t.value?t.value.id():void 0},In=function e(t,n,r){if(!t)return[];var o=[],i=[],a=[];return 0===n?(t.left&&Rn(t.left,o),t.right&&Rn(t.right,i),a=o.concat(i),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&Rn(t.left,o),t.right&&Rn(t.right,i),[r.collection(o),r.collection(i)]):t.value?[r.collection(t.value)]:(t.left&&(o=e(t.left,n-1,r)),t.right&&(i=e(t.right,n-1,r)),o.concat(i))},Ln=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=Dn(e),n=Nn[t.linkage];return null!=n&&(t.linkage=n),t}(e),o=r.attributes,i=function(e,t){return gn(r.distance,o.length,(function(t){return o[t](e)}),(function(e){return o[e](t)}),e,t)},a=[],s=[],l=[],u=[],c=0;c<n.length;c++){var d={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};a[c]=d,u[c]=d,s[c]=[],l[c]=0}for(var f=0;f<a.length;f++)for(var h=0;h<=f;h++){var p=void 0;p="dendrogram"===r.mode?f===h?1/0:i(a[f].value,a[h].value):f===h?1/0:i(a[f].value[0],a[h].value[0]),s[f][h]=p,s[h][f]=p,p<s[f][l[f]]&&(l[f]=h)}for(var v,g=An(a,u,s,l,r);g;)g=An(a,u,s,l,r);return"dendrogram"===r.mode?(v=In(a[0],r.dendrogramDepth,t),r.addDendrogram&&Mn(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},Bn={hierarchicalClustering:Ln,hca:Ln},Fn=Ne({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),zn=function(e,t,n,r){var o=function(e,t){return r[t](e)};return-gn(e,r.length,(function(e){return o(t,e)}),(function(e){return o(n,e)}),t,n)},Vn=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var i=0,a=e.length-1;a>=0;a--){var s=e[a];o?isFinite(s)||(e[a]=-1/0,i++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+i]:(e[u-1+i]+e[u+i])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,o=0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r+=a,o++)}return r/o}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,o=t;o<n;o++){var i=e[o];isFinite(i)&&(r=Math.min(i,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,o=t;o<n;o++){var i=e[o];isFinite(i)&&(r=Math.max(i,r))}return r}(e):t,n},Gn=function(e,t,n){for(var r=[],o=0;o<e;o++){for(var i=-1,a=-1/0,s=0;s<n.length;s++){var l=n[s];t[o*e+l]>a&&(i=l,a=t[o*e+l])}i>0&&r.push(i)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},Un=function(e){for(var t,n,r,o,i,a,s=this.cy(),l=this.nodes(),u=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Se("Damping must range on [0.5, 1).  Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||N(n)||Se("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number.  Got: ").concat(n)),Fn(e)}(e),c={},d=0;d<l.length;d++)c[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var f=0;f<n;f++)r[f]=-1/0;for(var h=0;h<t;h++)for(var p=0;p<t;p++)h!==p&&(r[h*t+p]=zn(u.distance,l[h],l[p],u.attributes));o=Vn(r,u.preference);for(var v=0;v<t;v++)r[v*t+v]=o;i=new Array(n);for(var g=0;g<n;g++)i[g]=0;a=new Array(n);for(var y=0;y<n;y++)a[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var _,E=new Array(t*u.minIterations),k=0;k<E.length;k++)E[k]=0;for(_=0;_<u.maxIterations;_++){for(var S=0;S<t;S++){for(var P=-1/0,j=-1/0,C=-1,T=0,O=0;O<t;O++)m[O]=i[S*t+O],(T=a[S*t+O]+r[S*t+O])>=P?(j=P,P=T,C=O):T>j&&(j=T);for(var D=0;D<t;D++)i[S*t+D]=(1-u.damping)*(r[S*t+D]-P)+u.damping*m[D];i[S*t+C]=(1-u.damping)*(r[S*t+C]-j)+u.damping*m[C]}for(var A=0;A<t;A++){for(var R=0,M=0;M<t;M++)m[M]=a[M*t+A],b[M]=Math.max(0,i[M*t+A]),R+=b[M];R-=b[A],b[A]=i[A*t+A],R+=b[A];for(var I=0;I<t;I++)a[I*t+A]=(1-u.damping)*Math.min(0,R-b[I])+u.damping*m[I];a[A*t+A]=(1-u.damping)*(R-b[A])+u.damping*m[A]}for(var L=0,B=0;B<t;B++){var F=a[B*t+B]+i[B*t+B]>0?1:0;E[_%u.minIterations*t+B]=F,L+=F}if(L>0&&(_>=u.minIterations-1||_==u.maxIterations-1)){for(var V=0,G=0;G<t;G++){x[G]=0;for(var H=0;H<u.minIterations;H++)x[G]+=E[H*t+G];0!==x[G]&&x[G]!==u.minIterations||V++}if(V===t)break}}for(var W=function(e,t,n){for(var r=[],o=0;o<e;o++)t[o*e+o]+n[o*e+o]>0&&r.push(o);return r}(t,i,a),Y=function(e,t,n){for(var r=Gn(e,t,n),o=0;o<n.length;o++){for(var i=[],a=0;a<r.length;a++)r[a]===n[o]&&i.push(a);for(var s=-1,l=-1/0,u=0;u<i.length;u++){for(var c=0,d=0;d<i.length;d++)c+=t[i[d]*e+i[u]];c>l&&(s=u,l=c)}n[o]=i[s]}return Gn(e,t,n)}(t,r,W),q={},X=0;X<W.length;X++)q[W[X]]=[];for(var $=0;$<l.length;$++){var K=Y[c[l[$].id()]];null!=K&&q[K].push(l[$])}for(var Z=new Array(W.length),Q=0;Q<W.length;Q++)Z[Q]=s.collection(q[W[Q]]);return Z},Hn={affinityPropagation:Un,ap:Un},Wn=Ne({root:void 0,directed:!1}),Yn=function(){var e=this,t={},n=0,r=0,o=[],i=[],a={},s=function s(l,u,c){l===c&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var d,f,h,p,v=e.getElementById(u).connectedEdges().intersection(e);0===v.size()?o.push(e.spawn(e.getElementById(u))):v.forEach((function(n){d=n.source().id(),f=n.target().id(),(h=d===u?f:d)!==c&&(p=n.id(),a[p]||(a[p]=!0,i.push({x:u,y:h,edge:n})),h in t?t[u].low=Math.min(t[u].low,t[h].id):(s(l,h,u),t[u].low=Math.min(t[u].low,t[h].low),t[u].id<=t[h].low&&(t[u].cutVertex=!0,function(n,r){for(var a=i.length-1,s=[],l=e.spawn();i[a].x!=n||i[a].y!=r;)s.push(i.pop().edge),a--;s.push(i.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach((function(n){var r=n.id(),o=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(o.filter((function(e){return e.isLoop()}))):l.merge(o)}))})),o.push(l)}(u,h))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:o}},qn=function(){var e=this,t={},n=0,r=[],o=[],i=e.spawn(e),a=function a(s){if(o.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=o.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),i=i.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:i,components:r}},Xn={};[Ge,He,We,qe,$e,Ze,tt,Ht,Yt,Xt,Kt,sn,On,Bn,Hn,{hierholzer:function(e){if(!D(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,o,i=Wn(e),a=i.root,s=i.directed,l=this,u=!1;a&&(o=C(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var o=e.indegree(!0),i=e.outdegree(!0),a=o-i,s=i-o;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var f={found:!1,trail:void 0};if(u)return f;if(r&&n)if(s){if(o&&r!=o)return f;o=r}else{if(o&&r!=o&&n!=o)return f;o||(o=r)}else o||(o=l[0].id());var h=function(e){for(var t,n,r,o=e,i=[e];c[o].length;)t=c[o].shift(),n=d[t][0],o!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),o=r):s||o==n||(c[n]=c[n].filter((function(e){return e!=t})),o=n),i.unshift(t),i.unshift(o);return i},p=[],v=[];for(v=h(o);1!=v.length;)0==c[v[0]].length?(p.unshift(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=h(v.shift()).concat(v);for(var g in p.unshift(l.getElementById(v.shift())),c)if(c[g].length)return f;return f.found=!0,f.trail=this.spawn(p,!0),f}},{hopcroftTarjanBiconnected:Yn,htbc:Yn,htb:Yn,hopcroftTarjanBiconnectedComponents:Yn},{tarjanStronglyConnected:qn,tsc:qn,tscc:qn,tarjanStronglyConnectedComponents:qn}].forEach((function(e){K(Xn,e)}));var $n=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};$n.prototype={fulfill:function(e){return Kn(this,1,"fulfillValue",e)},reject:function(e){return Kn(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new $n;return n.onFulfilled.push(Jn(e,r,"fulfill")),n.onRejected.push(Jn(t,r,"reject")),Zn(n),r.proxy}};var Kn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Zn(e)),e},Zn=function(e){1===e.state?Qn(e,"onFulfilled",e.fulfillValue):2===e.state&&Qn(e,"onRejected",e.rejectReason)},Qn=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var o=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(o):setTimeout(o,0)}},Jn=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var o;try{o=e(r)}catch(i){return void t.reject(i)}er(t,o)}}},er=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===p(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(i){return void t.reject(i)}if("function"!=typeof r)t.fulfill(n);else{var o=!1;try{r.call(n,(function(r){o||(o=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){o||(o=!0,t.reject(e))}))}catch(i){o||t.reject(i)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};$n.all=function(e){return new $n((function(t,n){for(var r=new Array(e.length),o=0,i=function(n,i){r[n]=i,++o===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){i(t,e)}),(function(e){n(e)})):i(t,r)}(a)}))},$n.resolve=function(e){return new $n((function(t,n){t(e)}))},$n.reject=function(e){return new $n((function(t,n){n(e)}))};var tr="undefined"!=typeof Promise?Promise:$n,nr=function(e,t,n){var r=L(e),o=!r,i=this._private=K({duration:1e3},t,n);if(i.target=e,i.style=i.style||i.css,i.started=!1,i.playing=!1,i.hooked=!1,i.applying=!1,i.progress=0,i.completes=[],i.frames=[],i.complete&&T(i.complete)&&i.completes.push(i.complete),o){var a=e.position();i.startPosition=i.startPosition||{x:a.x,y:a.y},i.startStyle=i.startStyle||e.cy().style().getAnimationStartStyle(e,i.style)}if(r){var s=e.pan();i.startPan={x:s.x,y:s.y},i.startZoom=e.zoom()}this.length=1,this[0]=this},rr=nr.prototype;K(rr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),R(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(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 t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var o=e.style[r],i=o.name,a=e.startStyle[i];e.startStyle[i]=o,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;if("frame"===e)t=n.frames;else t=n.completes;return new tr((function(e,n){t.push((function(){e()}))}))}}),rr.complete=rr.completed,rr.run=rr.play,rr.running=rr.playing;var or={animated:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){t[n]._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=void 0!==n.length,o=r?n:[n],i=this._private.cy||this,a=!r,s=!a;if(!i.styleEnabled())return this;var l=i.style();if(e=K({},e,t),0===Object.keys(e).length)return new nr(o[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&null!=e.renderedPosition){var u=e.renderedPosition,c=i.pan(),d=i.zoom();e.position=rt(u,d,c)}if(a&&null!=e.panBy){var f=e.panBy,h=i.pan();e.pan={x:h.x+f.x,y:h.y+f.y}}var p=e.center||e.centre;if(a&&null!=p){var v=i.getCenterPan(p.eles,e.zoom);null!=v&&(e.pan=v)}if(a&&null!=e.fit){var g=e.fit,y=i.getFitViewport(g.eles||g.boundingBox,g.padding);null!=y&&(e.pan=y.pan,e.zoom=y.zoom)}if(a&&D(e.zoom)){var m=i.getZoomedViewport(e.zoom);null!=m?(m.zoomed&&(e.zoom=m.zoom),m.panned&&(e.pan=m.pan)):e.zoom=null}return new nr(o[0],e)}},animate:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=K({},e,t));for(var o=0;o<r.length;o++){var i=r[o],a=i.animated()&&(void 0===e.queue||e.queue);i.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var i=0;i<r.length;i++){for(var a=r[i]._private,s=a.animation.current,l=0;l<s.length;l++){var u=s[l]._private;t&&(u.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return o.notify("draw"),this}}},ir={data:function(e){return e=K({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,o=this,i=void 0!==o.length,a=i?o:[o],s=i?o[0]:o;if(C(t)){var l,u=-1!==t.indexOf(".")&&h.default(t);if(r.allowGetting&&void 0===n)return s&&(r.beforeGet(s),l=u&&void 0===s._private[r.field][t]?d.default(s._private[r.field],u):s._private[r.field][t]),l;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var c=m({},t,n);r.beforeSet(o,c);for(var p=0,v=a.length;p<v;p++){var g=a[p];r.canSet(g)&&(u&&void 0===s._private[r.field][t]?f.default(g._private[r.field],u,n):g._private[r.field][t]=n)}r.updateStyle&&o.updateStyle(),r.onSet(o),r.settingTriggersEvent&&o[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&D(t)){var y,b,x=t,w=Object.keys(x);r.beforeSet(o,x);for(var _=0;_<w.length;_++){if(b=x[y=w[_]],!r.immutableKeys[y])for(var E=0;E<a.length;E++){var k=a[E];r.canSet(k)&&(k._private[r.field][y]=b)}}r.updateStyle&&o.updateStyle(),r.onSet(o),r.settingTriggersEvent&&o[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&T(t)){var S=t;o.on(r.bindingEvent,S)}else if(r.allowGetting&&void 0===t){var P;return s&&(r.beforeGet(s),P=s._private[r.field]),P}return o}},removeData:function(e){return e=K({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,o=void 0!==r.length?r:[r];if(C(t)){for(var i=t.split(/\s+/),a=i.length,s=0;s<a;s++){var l=i[s];if(!F(l))if(!n.immutableKeys[l])for(var u=0,c=o.length;u<c;u++)o[u]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===t){for(var d=0,f=o.length;d<f;d++)for(var h=o[d]._private[n.field],p=Object.keys(h),v=0;v<p.length;v++){var g=p[v];!n.immutableKeys[g]&&(h[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},ar={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new tr((function(e,t){var o=r.concat([function(t){n.off.apply(n,i),e(t)}]),i=o.concat([]);n.on.apply(n,o)}))}}},sr={};[or,ir,ar].forEach((function(e){K(sr,e)}));var lr={animate:sr.animate(),animation:sr.animation(),animated:sr.animated(),clearQueue:sr.clearQueue(),delay:sr.delay(),delayAnimation:sr.delayAnimation(),stop:sr.stop()},ur={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach((function(e){return n.push(e)})),n}O(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],o=new Fe(e),i=0;i<t.length;i++){for(var a=t[i],s=a._private,l=s.classes,u=!1,c=0;c<e.length;c++){var d=e[c];if(!l.has(d)){u=!0;break}}u||(u=l.size!==e.length),u&&(s.classes=o,r.push(a))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){O(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,o=[],i=0,a=n.length;i<a;i++)for(var s=n[i],l=s._private.classes,u=!1,c=0;c<e.length;c++){var d=e[c],f=l.has(d),h=!1;t||r&&!f?(l.add(d),h=!0):(!t||r&&f)&&(l.delete(d),h=!0),!u&&h&&(o.push(s),u=!0)}return o.length>0&&this.spawn(o).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};ur.className=ur.classNames=ur.classes;var cr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:X,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};cr.variable="(?:[\\w-.]|(?:\\\\"+cr.metaChar+"))+",cr.className="(?:[\\w-]|(?:\\\\"+cr.metaChar+"))+",cr.value=cr.string+"|"+cr.number,cr.id=cr.variable,function(){var e,t,n;for(e=cr.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],cr.comparatorOp+="|@"+t;for(e=cr.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(cr.comparatorOp+="|\\!"+t)}();var dr=0,fr=1,hr=2,pr=3,vr=4,gr=5,yr=6,mr=7,br=8,xr=9,wr=10,_r=11,Er=12,kr=13,Sr=14,Pr=15,jr=16,Cr=17,Tr=18,Or=19,Dr=20,Nr=[{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(e,t){return function(e,t){return-1*$(e,t)}(e.selector,t.selector)})),Ar=function(){for(var e,t={},n=0;n<Nr.length;n++)t[(e=Nr[n]).selector]=e.matches;return t}(),Rr="("+Nr.map((function(e){return e.selector})).join("|")+")",Mr=function(e){return e.replace(new RegExp("\\\\("+cr.metaChar+")","g"),(function(e,t){return t}))},Ir=function(e,t,n){e[e.length-1]=n},Lr=[{name:"group",query:!0,regex:"("+cr.group+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:dr,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Rr,populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:mr,value:r})}},{name:"id",query:!0,regex:"\\#("+cr.id+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:br,value:Mr(r)})}},{name:"className",query:!0,regex:"\\.("+cr.className+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:xr,value:Mr(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+cr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:vr,field:Mr(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+cr.variable+")\\s*("+cr.comparatorOp+")\\s*("+cr.value+")\\s*\\]",populate:function(e,t,n){var r=b(n,3),o=r[0],i=r[1],a=r[2];a=null!=new RegExp("^"+cr.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:pr,field:Mr(o),operator:i,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+cr.boolOp+")\\s*("+cr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,2),o=r[0],i=r[1];t.checks.push({type:gr,field:Mr(i),operator:o})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+cr.meta+")\\s*("+cr.comparatorOp+")\\s*("+cr.number+")\\s*\\]\\]",populate:function(e,t,n){var r=b(n,3),o=r[0],i=r[1],a=r[2];t.checks.push({type:yr,field:Mr(o),operator:i,value:parseFloat(a)})}},{name:"nextQuery",separator:!0,regex:cr.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,o=e.compoundCount,i=e[e.length-1];return null!=n&&(i.subject=n,e.currentSubject=null),i.edgeCount=r,i.compoundCount=o,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:cr.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,o={checks:[]};return n.checks.push({type:_r,source:r,target:o}),Ir(e,0,n),e.edgeCount++,o}var i={checks:[]},a=t,s={checks:[]};return i.checks.push({type:Er,source:a,target:s}),Ir(e,0,i),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:cr.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,o={checks:[]};return n.checks.push({type:wr,nodes:[r,o]}),Ir(e,0,n),e.edgeCount++,o}var i={checks:[]},a=t,s={checks:[]};return i.checks.push({type:Sr,node:a,neighbor:s}),Ir(e,0,i),s}},{name:"child",separator:!0,regex:cr.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},o=e[e.length-1];return n.checks.push({type:Pr,parent:o,child:r}),Ir(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var i={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]};return i.checks.push({type:Or,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Dr}],c.checks.push({type:Dr}),s.checks.push({type:Cr,parent:c,child:u}),Ir(e,0,i),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},f={checks:[]},h=[{type:Cr,parent:d,child:f}];return d.checks=t.checks,t.checks=h,e.compoundCount++,f}},{name:"descendant",separator:!0,regex:cr.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},o=e[e.length-1];return n.checks.push({type:jr,ancestor:o,descendant:r}),Ir(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var i={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]};return i.checks.push({type:Or,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Dr}],c.checks.push({type:Dr}),s.checks.push({type:Tr,ancestor:c,descendant:u}),Ir(e,0,i),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},f={checks:[]},h=[{type:Tr,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=h,e.compoundCount++,f}},{name:"subject",modifier:!0,regex:cr.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return je("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===_r?n.type=kr:r===wr&&(n.type=Sr,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Lr.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Br=function(e){for(var t,n,r,o=0;o<Lr.length;o++){var i=Lr[o],a=i.name,s=e.match(i.regexObj);if(null!=s){n=s,t=i,r=a;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},Fr={parse:function(e){var t=this,n=t.inputText=e,r=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e}(n);;){var o=Br(n);if(null==o.expr)return je("The selector `"+e+"`is invalid"),!1;var i=o.match.slice(1),a=o.expr.populate(t,r,i);if(!1===a)return!1;if(null!=a&&(r=a),(n=o.remaining).match(/^\s*$/))break}var s=t[t.length-1];null!=t.currentSubject&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var u=t[l];if(u.compoundCount>0&&u.edgeCount>0)return je("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return je("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&je("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},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return e??""},t=function(t){return C(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,i){var a=r.type,s=r.value;switch(a){case dr:var l=e(s);return l.substring(0,l.length-1);case pr:var u=r.field,c=r.operator;return"["+u+n(e(c))+t(s)+"]";case gr:var d=r.operator,f=r.field;return"["+e(d)+f+"]";case vr:return"["+r.field+"]";case yr:var h=r.operator;return"[["+r.field+n(e(h))+t(s)+"]]";case mr:return s;case br:return"#"+s;case xr:return"."+s;case Cr:case Pr:return o(r.parent,i)+n(">")+o(r.child,i);case Tr:case jr:return o(r.ancestor,i)+" "+o(r.descendant,i);case Or:var p=o(r.left,i),v=o(r.subject,i),g=o(r.right,i);return p+(p.length>0?" ":"")+v+g;case Dr:return""}},o=function(e,t){return e.checks.reduce((function(n,o,i){return n+(t===e&&0===i?"$":"")+r(o,t)}),"")},i="",a=0;a<this.length;a++){var s=this[a];i+=o(s,s.subject),this.length>1&&a<this.length-1&&(i+=", ")}return this.toStringCache=i,i}},zr=function(e,t,n){var r,o,i,a=C(e),s=N(e),l=C(n),u=!1,c=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(o=a||s?""+e:"",i=""+n),u&&(e=o=o.toLowerCase(),n=i=i.toLowerCase()),t){case"*=":r=o.indexOf(i)>=0;break;case"$=":r=o.indexOf(i,o.length-i.length)>=0;break;case"^=":r=0===o.indexOf(i);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!c||null==e&&d||(r=!r),r},Vr=function(e,t){return e.data(t)},Gr=[],Ur=function(e,t){return e.checks.every((function(e){return Gr[e.type](e,t)}))};Gr[dr]=function(e,t){var n=e.value;return"*"===n||n===t.group()},Gr[mr]=function(e,t){return function(e,t){return Ar[e](t)}(e.value,t)},Gr[br]=function(e,t){var n=e.value;return t.id()===n},Gr[xr]=function(e,t){var n=e.value;return t.hasClass(n)},Gr[yr]=function(e,t){var n=e.field,r=e.operator,o=e.value;return zr(function(e,t){return e[t]()}(t,n),r,o)},Gr[pr]=function(e,t){var n=e.field,r=e.operator,o=e.value;return zr(Vr(t,n),r,o)},Gr[gr]=function(e,t){var n=e.field,r=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Vr(t,n),r)},Gr[vr]=function(e,t){var n=e.field;return e.operator,void 0!==Vr(t,n)},Gr[wr]=function(e,t){var n=e.nodes[0],r=e.nodes[1],o=t.source(),i=t.target();return Ur(n,o)&&Ur(r,i)||Ur(r,o)&&Ur(n,i)},Gr[Sr]=function(e,t){return Ur(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Ur(e.neighbor,t)}))},Gr[_r]=function(e,t){return Ur(e.source,t.source())&&Ur(e.target,t.target())},Gr[Er]=function(e,t){return Ur(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Ur(e.target,t)}))},Gr[kr]=function(e,t){return Ur(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Ur(e.source,t)}))},Gr[Pr]=function(e,t){return Ur(e.child,t)&&Ur(e.parent,t.parent())},Gr[Cr]=function(e,t){return Ur(e.parent,t)&&t.children().some((function(t){return Ur(e.child,t)}))},Gr[jr]=function(e,t){return Ur(e.descendant,t)&&t.ancestors().some((function(t){return Ur(e.ancestor,t)}))},Gr[Tr]=function(e,t){return Ur(e.ancestor,t)&&t.descendants().some((function(t){return Ur(e.descendant,t)}))},Gr[Or]=function(e,t){return Ur(e.subject,t)&&Ur(e.left,t)&&Ur(e.right,t)},Gr[Dr]=function(){return!0},Gr[fr]=function(e,t){return e.value.has(t)},Gr[hr]=function(e,t){return(0,e.value)(t)};var Hr={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Ur(n,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===br)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Ur(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Wr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||C(e)&&e.match(/^\s*$/)||(R(e)?this.addQuery({checks:[{type:fr,value:e.collection()}]}):T(e)?this.addQuery({checks:[{type:hr,value:e}]}):C(e)?this.parse(e)||(this.invalid=!0):Se("A selector must be created from a string; found "))},Yr=Wr.prototype;[Fr,Hr].forEach((function(e){return K(Yr,e)})),Yr.text=function(){return this.inputText},Yr.size=function(){return this.length},Yr.eq=function(e){return this[e]},Yr.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Yr.addQuery=function(e){this[this.length++]=e},Yr.selector=Yr.toString;var qr={allAre:function(e){var t=new Wr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Wr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++){if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};qr.allAreNeighbours=qr.allAreNeighbors,qr.has=qr.contains,qr.equal=qr.equals=qr.same;var Xr,$r,Kr=function(e,t){return function(n,r,o,i){var a,s=n,l=this;if(null==s?a="":R(s)&&1===s.length&&(a=s.id()),1===l.length&&a){var u=l[0]._private,c=u.traversalCache=u.traversalCache||{},d=c[t]=c[t]||[],f=pe(a),h=d[f];return h||(d[f]=e.call(l,n,r,o,i))}return e.call(l,n,r,o,i)}},Zr={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var o=this[r]._private.parent;o&&t.push(o)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var o=n[r];t.push(o)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:Kr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,o=0;o<r.length;o++)t.push(r[o]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var o=n[r];t.push(o),o.children().nonempty()&&e(o.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Qr(e,t,n,r){for(var o=[],i=new Fe,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?o.push(l):a&&r(o,i,l)}for(;o.length>0;){var u=o.shift();t(u),i.add(u.id()),a&&r(o,i,u)}return e}function Jr(e,t,n){if(n.isParent())for(var r=n._private.children,o=0;o<r.length;o++){var i=r[o];t.has(i.id())||e.push(i)}}function eo(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function to(e,t,n){eo(e,t,n),Jr(e,t,n)}Zr.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Qr(this,e,t,Jr)},Zr.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Qr(this,e,t,eo)},Zr.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Qr(this,e,t,to)},Zr.ancestors=Zr.parents,(Xr=$r={data:sr.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:sr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:sr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:sr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:sr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:sr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Xr.data,Xr.removeAttr=Xr.removeData;var no,ro,oo=$r,io={};function ao(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,o=n[0],i=o._private.edges,a=0;a<i.length;a++){var s=i[a];!t&&s.isLoop()||(r+=e(o,s))}return r}}}function so(e,t){return function(n){for(var r,o=this.nodes(),i=0;i<o.length;i++){var a=o[i][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}K(io,{degree:ao((function(e,t){return t.source().same(t.target())?2:1})),indegree:ao((function(e,t){return t.target().same(e)?1:0})),outdegree:ao((function(e,t){return t.source().same(e)?1:0}))}),K(io,{minDegree:so("degree",(function(e,t){return e<t})),maxDegree:so("degree",(function(e,t){return e>t})),minIndegree:so("indegree",(function(e,t){return e<t})),maxIndegree:so("indegree",(function(e,t){return e>t})),minOutdegree:so("outdegree",(function(e,t){return e<t})),maxOutdegree:so("outdegree",(function(e,t){return e>t}))}),K(io,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var lo=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r];if(!o.locked()){var i=o._private.position,a={x:null!=t.x?t.x-i.x:0,y:null!=t.y?t.y-i.y:0};!o.isParent()||0===a.x&&0===a.y||o.children().shift(a,n),o.dirtyBoundingBoxCache()}}},uo={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,t){lo(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};no=ro={position:sr.data(uo),silentPosition:sr.data(K({},uo,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){lo(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(D(e))t?this.silentPosition(e):this.position(e);else if(T(e)){var n=e,r=this.cy();r.startBatch();for(var o=0;o<this.length;o++){var i,a=this[o];(i=n(a,o))&&(t?a.silentPosition(i):a.position(i))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(D(e)?(r={x:N(e.x)?e.x:0,y:N(e.y)?e.y:0},n=t):C(e)&&N(t)&&((r={x:0,y:0})[e]=t),null!=r){var o=this.cy();o.startBatch();for(var i=0;i<this.length;i++){var a=this[i];if(!(o.hasCompoundNodes()&&a.isChild()&&a.ancestors().anySame(this))){var s=a.position(),l={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(l):a.position(l)}}o.endBatch()}return this},silentShift:function(e,t){return D(e)?this.shift(e,!0):C(e)&&N(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),o=r.zoom(),i=r.pan(),a=D(e)?e:void 0,s=void 0!==a||void 0!==t&&C(e);if(n&&n.isNode()){if(!s){var l=n.position();return a=nt(l,o,i),void 0===e?a:a[e]}for(var u=0;u<this.length;u++){var c=this[u];void 0!==t?c.position(e,(t-i[e])/o):void 0!==a&&c.position(rt(a,o,i))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),o=D(e)?e:void 0,i=void 0!==o||void 0!==t&&C(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!i){var s=n.position(),l=a?n.parent():null,u=l&&l.length>0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return o={x:s.x-d.x,y:s.y-d.y},void 0===e?o:o[e]}for(var f=0;f<this.length;f++){var h=this[f],p=a?h.parent():null,v=p&&p.length>0,g=v;v&&(p=p[0]);var y=g?p.position():{x:0,y:0};void 0!==t?h.position(e,t+y[e]):void 0!==o&&h.position({x:o.x+y.x,y:o.y+y.y})}}else if(!i)return;return this}},no.modelPosition=no.point=no.position,no.modelPositions=no.points=no.positions,no.renderedPoint=no.renderedPosition,no.relativePoint=no.relativePosition;var co,fo,ho=ro;co=fo={},fo.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),o=n.pan(),i=t.x1*r+o.x,a=t.x2*r+o.x,s=t.y1*r+o.y,l=t.y2*r+o.y;return{x1:i,x2:a,y1:s,y2:l,w:a-i,h:l-s}},fo.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},fo.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,o={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},i=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==i.w&&0!==i.h||((i={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-i.w/2,i.x2=a.x+i.w/2,i.y1=a.y-i.h/2,i.y2=a.y+i.h/2);var s=o.width.left.value;"px"===o.width.left.units&&o.width.val>0&&(s=100*s/o.width.val);var l=o.width.right.value;"px"===o.width.right.units&&o.width.val>0&&(l=100*l/o.width.val);var u=o.height.top.value;"px"===o.height.top.units&&o.height.val>0&&(u=100*u/o.height.val);var c=o.height.bottom.value;"px"===o.height.bottom.units&&o.height.val>0&&(c=100*c/o.height.val);var d=y(o.width.val-i.w,s,l),f=d.biasDiff,h=d.biasComplementDiff,p=y(o.height.val-i.h,u,c),v=p.biasDiff,g=p.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(i.w,i.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(i.w,o.width.val),a.x=(-f+i.x1+i.x2+h)/2,t.autoHeight=Math.max(i.h,o.height.val),a.y=(-v+i.y1+i.y2+g)/2}function y(e,t,n){var r=0,o=0,i=t+n;return e>0&&i>0&&(r=t/i*e,o=n/i*e),{biasDiff:r,biasComplementDiff:o}}}for(var r=0;r<this.length;r++){var o=this[r],i=o._private;i.compoundBoundsClean&&!e||(n(o),t.batching()||(i.compoundBoundsClean=!0))}return this};var po=function(e){return e===1/0||e===-1/0?0:e},vo=function(e,t,n,r,o){r-t!=0&&o-n!=0&&null!=t&&null!=n&&null!=r&&null!=o&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=o>e.y2?o:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},go=function(e,t){return null==t?e:vo(e,t.x1,t.y1,t.x2,t.y2)},yo=function(e,t,n){return Me(e,t,n)},mo=function(e,t,n){if(!t.cy().headless()){var r,o,i=t._private,a=i.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,o=a.srcY):"target"===n?(r=a.tgtX,o=a.tgtY):(r=a.midX,o=a.midY);var l=i.arrowBounds=i.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=o-s,u.x2=r+s,u.y2=o+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,gt(u,1),vo(e,u.x1,u.y1,u.x2,u.y2)}}},bo=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var o=t._private,i=o.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),f=yo(i,"labelWidth",n),h=yo(i,"labelHeight",n),p=yo(i,"labelX",n),v=yo(i,"labelY",n),g=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,_=t.pstyle("text-background-padding").pfValue,E=h,k=f,S=k/2,P=E/2;if(m)a=p-S,s=p+S,l=v-P,u=v+P;else{switch(c.value){case"left":a=p-k,s=p;break;case"center":a=p-S,s=p+S;break;case"right":a=p,s=p+k}switch(d.value){case"top":l=v-E,u=v;break;case"center":l=v-P,u=v+P;break;case"bottom":l=v,u=v+E}}a+=g-Math.max(x,w)-_-2,s+=g+Math.max(x,w)+_+2,l+=y-Math.max(x,w)-_-2,u+=y+Math.max(x,w)+_+2;var j=n||"main",C=o.labelBounds,T=C[j]=C[j]||{};T.x1=a,T.y1=l,T.x2=s,T.y2=u,T.w=s-a,T.h=u-l;var O=m&&"autorotate"===b.strValue,D=null!=b.pfValue&&0!==b.pfValue;if(O||D){var N=O?yo(o.rstyle,"labelAngle",n):b.pfValue,A=Math.cos(N),R=Math.sin(N),M=(a+s)/2,I=(l+u)/2;if(!m){switch(c.value){case"left":M=s;break;case"right":M=a}switch(d.value){case"top":I=u;break;case"bottom":I=l}}var L=function(e,t){return{x:(e-=M)*A-(t-=I)*R+M,y:e*R+t*A+I}},B=L(a,l),F=L(a,u),V=L(s,l),G=L(s,u);a=Math.min(B.x,F.x,V.x,G.x),s=Math.max(B.x,F.x,V.x,G.x),l=Math.min(B.y,F.y,V.y,G.y),u=Math.max(B.y,F.y,V.y,G.y)}var H=j+"Rot",W=C[H]=C[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,vo(e,a,l,s,u),vo(o.labelBounds.all,a,l,s,u)}return e}},xo=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},wo=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,o=e.length;return ue({next:function(){return r<o?n.value=e[r++]:n.done=!0,n}},t)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},_o=function(e,t){var n,r=e._private,o=e.isEdge(),i=(null==t?ko:xo(t))===ko,a=wo(e),s=r.bbCachePosKey===a,l=t.useCache&&s,u=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!l||u(e)||o&&u(e.source())||u(e.target())?(s||e.recalculateRenderedStyle(l),n=function(e,t){var n,r,o,i,a,s,l,u=e._private.cy,c=u.styleEnabled(),d=u.headless(),f=pt(),h=e._private,p=e.isNode(),v=e.isEdge(),g=h.rstyle,y=p&&c?e.pstyle("bounds-expansion").pfValue:[0],m=function(e){return"none"!==e.pstyle("display").value},b=!c||m(e)&&(!v||m(e.source())&&m(e.target()));if(b){var x=0;c&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;c&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(w=e.pstyle("underlay-padding").value);var _=Math.max(x,w),E=0;if(c&&(E=e.pstyle("width").pfValue/2),p&&t.includeNodes){var k=e.position();a=k.x,s=k.y;var S=e.outerWidth()/2,P=e.outerHeight()/2;vo(f,n=a-S,o=s-P,r=a+S,i=s+P)}else if(v&&t.includeEdges)if(c&&!d){var j=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),o=Math.min(g.srcY,g.midY,g.tgtY),i=Math.max(g.srcY,g.midY,g.tgtY),vo(f,n-=E,o-=E,r+=E,i+=E),"haystack"===j){var C=g.haystackPts;if(C&&2===C.length){if(n=C[0].x,o=C[0].y,n>(r=C[1].x)){var T=n;n=r,r=T}if(o>(i=C[1].y)){var O=o;o=i,i=O}vo(f,n-E,o-E,r+E,i+E)}}else if("bezier"===j||"unbundled-bezier"===j||"segments"===j||"taxi"===j){var D;switch(j){case"bezier":case"unbundled-bezier":D=g.bezierPts;break;case"segments":case"taxi":D=g.linePts}if(null!=D)for(var N=0;N<D.length;N++){var A=D[N];n=A.x-E,r=A.x+E,o=A.y-E,i=A.y+E,vo(f,n,o,r,i)}}}else{var R=e.source().position(),M=e.target().position();if((n=R.x)>(r=M.x)){var I=n;n=r,r=I}if((o=R.y)>(i=M.y)){var L=o;o=i,i=L}vo(f,n-=E,o-=E,r+=E,i+=E)}if(c&&t.includeEdges&&v&&(mo(f,e,"mid-source"),mo(f,e,"mid-target"),mo(f,e,"source"),mo(f,e,"target")),c&&"yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;vo(f,f.x1+B,f.y1+F,f.x2+B,f.y2+F)}var V=h.bodyBounds=h.bodyBounds||{};mt(V,f),yt(V,y),gt(V,1),c&&(n=f.x1,r=f.x2,o=f.y1,i=f.y2,vo(f,n-_,o-_,r+_,i+_));var G=h.overlayBounds=h.overlayBounds||{};mt(G,f),yt(G,y),gt(G,1);var H=h.labelBounds=h.labelBounds||{};null!=H.all?((l=H.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):H.all=pt(),c&&t.includeLabels&&(t.includeMainLabels&&bo(f,e,null),v&&(t.includeSourceLabels&&bo(f,e,"source"),t.includeTargetLabels&&bo(f,e,"target")))}return f.x1=po(f.x1),f.y1=po(f.y1),f.x2=po(f.x2),f.y2=po(f.y2),f.w=po(f.x2-f.x1),f.h=po(f.y2-f.y1),f.w>0&&f.h>0&&b&&(yt(f,y),gt(f,1)),f}(e,Eo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!i){var c=e.isNode();n=pt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?go(n,r.overlayBounds):go(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!o||t.includeSourceLabels&&t.includeTargetLabels)?go(n,r.labelBounds.all):(t.includeMainLabels&&go(n,r.labelBounds.mainRot),t.includeSourceLabels&&go(n,r.labelBounds.sourceRot),t.includeTargetLabels&&go(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Eo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},ko=xo(Eo),So=Ne(Eo);fo.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=pt();var n=So(e=e||Eo),r=this;if(r.cy().styleEnabled())for(var o=0;o<r.length;o++){var i=r[o],a=i._private,s=wo(i),l=a.bbCachePosKey===s,u=n.useCache&&l&&!a.styleDirty;i.recalculateRenderedStyle(u)}this.updateCompoundBounds(!e.useCache);for(var c=0;c<r.length;c++){var d=r[c];go(t,_o(d,n))}}else e=void 0===e?Eo:So(e),t=_o(this[0],e);return t.x1=po(t.x1),t.y1=po(t.y1),t.x2=po(t.x2),t.y2=po(t.y2),t.w=po(t.x2-t.x1),t.h=po(t.y2-t.y1),t},fo.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},fo.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),o=n.collection();if(r&&(o=t.filter((function(e){return e.isParent()})),t=t.not(o)),D(e)){var i=e;e=function(){return i}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(o.dirtyCompoundBoundsCache(),o.dirtyBoundingBoxCache(),o.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(o.dirtyCompoundBoundsCache(),o.dirtyBoundingBoxCache(),o.updateCompoundBounds(!0)),n.endBatch(),a},co.boundingbox=co.bb=co.boundingBox,co.renderedBoundingbox=co.renderedBoundingBox;var Po,jo,Co=fo;Po=jo={};var To=function(e){e.uppercaseName=q(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=q(e.outerName),Po[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var o=t.pstyle(e.name);return"label"===o.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):o.pfValue}return 1}},Po["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},Po["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},Po["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};To({name:"width"}),To({name:"height"}),jo.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},jo.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},jo.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var Oo=jo,Do={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},No=Object.keys(Do).reduce((function(e,t){var n=Do[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},n.mult?e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),o=n.zoom();return t(e).map((function(e){return nt(e,o,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return nt(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),Ao=K({},ho,Co,Oo,No),Ro=function(e,t){this.recycle(e,t)};function Mo(){return!1}function Io(){return!0}Ro.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Mo,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Io:Mo):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),o=this.cy.pan();this.renderedPosition={x:n.x*r+o.x,y:n.y*r+o.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Io;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Io;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Io,this.stopPropagation()},isDefaultPrevented:Mo,isPropagationStopped:Mo,isImmediatePropagationStopped:Mo};var Lo=/^([^.]+)(\.(?:[^.]+))?$/,Bo={qualifierCompare:function(e,t){return e===t},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},Fo=Object.keys(Bo),zo={};function Vo(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zo,t=arguments.length>1?arguments[1]:void 0,n=0;n<Fo.length;n++){var r=Fo[n];this[r]=e[r]||Bo[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Go=Vo.prototype,Uo=function(e,t,n,r,o,i,a){T(r)&&(o=r,r=null),a&&(i=null==i?a:K({},i,a));for(var s=O(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!F(u)){var c=u.match(Lo);if(c)if(!1===t(e,u,c[1],c[2]?c[2]:null,r,o,i))break}}},Ho=function(e,t){return e.addEventFields(e.context,t),new Ro(t.type,t)},Wo=function(e,t,n){if("event"!==j(n))if(D(n))t(e,Ho(e,n));else for(var r=O(n)?n:n.split(/\s+/),o=0;o<r.length;o++){var i=r[o];if(!F(i)){var a=i.match(Lo);if(a){var s=a[1],l=a[2]?a[2]:null;t(e,Ho(e,{type:s,namespace:l,target:e.context}))}}}else t(e,n)};Go.on=Go.addListener=function(e,t,n,r,o){return Uo(this,(function(e,t,n,r,o,i,a){T(i)&&e.listeners.push({event:t,callback:i,type:n,namespace:r,qualifier:o,conf:a})}),e,t,n,r,o),this},Go.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Go.removeListener=Go.off=function(e,t,n,r){var o=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var i=this.listeners,a=function(a){var s=i[a];Uo(o,(function(t,n,r,o,l,u){if((s.type===r||"*"===e)&&(!o&&".*"!==s.namespace||s.namespace===o)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!u||s.callback===u))return i.splice(a,1),!1}),e,t,n,r)},s=i.length-1;s>=0;s--)a(s);return this},Go.removeAllListeners=function(){return this.removeListener("*")},Go.emit=Go.trigger=function(e,t,n){var r=this.listeners,o=r.length;return this.emitting++,O(t)||(t=[t]),Wo(this,(function(e,i){null!=n&&(r=[{event:i.event,type:i.type,namespace:i.namespace,callback:n}],o=r.length);for(var a=function(n){var o=r[n];if(o.type===i.type&&(!o.namespace||o.namespace===i.namespace||".*"===o.namespace)&&e.eventMatches(e.context,o,i)){var a=[i];null!=t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}}(a,t),e.beforeEmit(e.context,o,i),o.conf&&o.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==o})));var s=e.callbackContext(e.context,o,i),l=o.callback.apply(s,a);e.afterEmit(e.context,o,i),!1===l&&(i.stopPropagation(),i.preventDefault())}},s=0;s<o;s++)a(s);e.bubble(e.context)&&!i.isPropagationStopped()&&e.parent(e.context).emit(i,t)}),e),this.emitting--,this};var Yo={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&M(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},qo=function(e){return C(e)?new Wr(e):e},Xo={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Vo(Yo,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=qo(t),o=0;o<this.length;o++){this[o].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=qo(t),o=0;o<this.length;o++){this[o].emitter().removeListener(e,r,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){this[e].emitter().removeAllListeners()}return this},one:function(e,t,n){for(var r=qo(t),o=0;o<this.length;o++){this[o].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=qo(t),o=0;o<this.length;o++){this[o].emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){this[n].emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};sr.eventAliasesOn(Xo);var $o={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(C(e)||R(e))return new Wr(e).filter(this);if(T(e)){for(var n=this.spawn(),r=this,o=0;o<r.length;o++){var i=r[o];(t?e.apply(t,[i,o,r]):e(i,o,r))&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){C(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(C(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,o=this.length<e.length,i=o?this:r,a=o?r:this,s=0;s<i.length;s++){var l=i[s];a.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;C(e)&&(e=t.$(e));var n=this.spawn(),r=e,o=function(e,t){for(var r=0;r<e.length;r++){var o=e[r],i=o._private.data.id;t.hasElementWithId(i)||n.push(o)}};return o(this,r),o(r,this),n},diff:function(e){var t=this._private.cy;C(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),o=this.spawn(),i=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)?o.merge(i):n.push(i)}};return a(this,i,n),a(i,this,r),{left:n,right:r,both:o}},add:function(e){var t=this._private.cy;if(!e)return this;if(C(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),o=0;o<e.length;o++){var i=e[o],a=!this.has(i);a&&r.push(i)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&C(e)){var r=e;e=n.mutableElements().filter(r)}for(var o=t.map,i=0;i<e.length;i++){var a=e[i],s=a._private.data.id;if(!o.has(s)){var l=this.length++;this[l]=a,o.set(s,{ele:a,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var o=this.length-1,i=this[o],a=i._private.data.id;this[o]=void 0,this[e]=i,n.set(a,{ele:i,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var o=r.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&C(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,o=0;o<r.length;o++){var i=r[o],a=t?e.apply(t,[i,o,r]):e(i,o,r);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=this,o=0;o<r.length;o++)n=e(n,r[o],o,r);return n},max:function(e,t){for(var n,r=-1/0,o=this,i=0;i<o.length;i++){var a=o[i],s=t?e.apply(t,[a,i,o]):e(a,i,o);s>r&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,o=this,i=0;i<o.length;i++){var a=o[i],s=t?e.apply(t,[a,i,o]):e(a,i,o);s<r&&(r=s,n=a)}return{value:r,ele:n}}},Ko=$o;Ko.u=Ko["|"]=Ko["+"]=Ko.union=Ko.or=Ko.add,Ko["\\"]=Ko["!"]=Ko["-"]=Ko.difference=Ko.relativeComplement=Ko.subtract=Ko.not,Ko.n=Ko["&"]=Ko["."]=Ko.and=Ko.intersection=Ko.intersect,Ko["^"]=Ko["(+)"]=Ko["(-)"]=Ko.symmetricDifference=Ko.symdiff=Ko.xor,Ko.fnFilter=Ko.filterFn=Ko.stdFilter=Ko.filter,Ko.complement=Ko.abscomp=Ko.absoluteComplement;var Zo=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?xe:0}var o=r(e)-r(t);if(0!==o)return o;function i(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=i(e)-i(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},Qo={forEach:function(e,t){if(T(e))for(var n=this.length,r=0;r<n;r++){var o=this[r];if(!1===(t?e.apply(t,[o,r,this]):e(o,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var o=e;o>=0&&o<t&&o<r;o++)n.push(this[o]);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 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!T(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Zo)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:xe-1}var r=t.source,o=t.target,i=r.zDepth(),a=o.zDepth();return Math.max(i,a,0)}}};Qo.each=Qo.forEach;var Jo;Jo="undefined",("undefined"==typeof Symbol?"undefined":p(Symbol))!=Jo&&p(Symbol.iterator)!=Jo&&(Qo[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return m({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var ei=Ne({nodeDimensionsIncludeLabels:!1}),ti={layoutDimensions:function(e){var t;if(e=ei(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),o=this.cy(),i=t.eles,a=function(e){return e.id()},s=G(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=t.spacingFactor&&1!==t.spacingFactor,u=function(){if(!l)return null;for(var e=pt(),t=0;t<r.length;t++){var n=r[t],o=s(n,t);vt(e,o.x,o.y)}return e}(),c=G((function(e,n){var r=s(e,n);l&&(r=function(e,t,n){var r=t.x1+t.w/2,o=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:o+(n.y-o)*e}}(Math.abs(t.spacingFactor),u,r));return null!=t.transform&&(r=t.transform(e,r)),r}),a);if(t.animate){for(var d=0;d<r.length;d++){var f=r[d],h=c(f,d);if(null==t.animateFilter||t.animateFilter(f,d)){var p=f.animation({position:h,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(p)}else f.position(h)}if(t.fit){var v=o.animation({fit:{boundingBox:i.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=o.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),tr.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(c),t.fit&&o.fit(t.eles,t.padding),null!=t.zoom&&o.zoom(t.zoom),t.pan&&o.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(K({},e,{eles:this}))}};function ni(e,t,n){var r,o=n._private,i=o.styleCache=o.styleCache||[];return null!=(r=i[e])?r:r=i[e]=t(n)}function ri(e,t){return e=pe(e),function(n){return ni(e,t,n)}}function oi(e,t){e=pe(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return ni(e,n,t)}}ti.createLayout=ti.makeLayout=ti.layout;var ii={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)}));return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var o=n._private.style[e];return null!=o?o:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(D(e)){var o=e;r.applyBypass(this,o,false),this.emitAndNotify("style")}else if(C(e)){if(void 0===t){var i=this[0];return i?r.getStylePropertyValue(i,e):void 0}r.applyBypass(this,e,t,false),this.emitAndNotify("style")}else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style(),r=this;if(void 0===e)for(var o=0;o<r.length;o++){var i=r[o];n.removeAllBypasses(i,false)}else{e=e.split(/\s+/);for(var a=0;a<r.length;a++){var s=r[a];n.removeBypasses(s,e,false)}}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 t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,o=n.pstyle("opacity").value;if(!t)return o;var i=r.data.parent?n.parents():null;if(i)for(var a=0;a<i.length;a++){o*=i[a].pstyle("opacity").value}return o}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function ai(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){if(!t(n[r]))return!1}return!0}function si(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var o=this[0],i=e.hasCompoundNodes();if(o){var a=o._private;if(!t(o))return!1;if(o.isNode())return!i||ai(o,r);var s=a.source,l=a.target;return n(s)&&(!i||ai(s,n))&&(s===l||n(l)&&(!i||ai(l,n)))}}}var li=ri("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));ii.takesUpSpace=oi("takesUpSpace",si({ok:li}));var ui=ri("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&li(e)})),ci=ri("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&li(e)}));ii.interactive=oi("interactive",si({ok:ui,parentOk:ci,edgeOkViaNode:li})),ii.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var di=ri("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&li(e)})),fi=li;ii.visible=oi("visible",si({ok:di,edgeOkViaNode:fi})),ii.hidden=function(){var e=this[0];if(e)return!e.visible()},ii.isBundledBezier=oi("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),ii.bypass=ii.css=ii.style,ii.renderedCss=ii.renderedStyle,ii.removeBypass=ii.removeCss=ii.removeStyle,ii.pstyle=ii.parsedStyle;var hi={};function pi(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],o=t[1];this.on(e.event,r,o)}else if(1===t.length&&T(t[0])){var i=t[0];this.on(e.event,i)}else if(0===t.length||1===t.length&&O(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var l=this[s],u=!e.ableField||l._private[e.ableField],c=l._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(l);if(void 0!==d&&(u=d,!d))return this}u&&(l._private[e.field]=e.value,c&&n.push(l))}var f=this.spawn(n);f.updateStyle(),f.emit(e.event),a&&f.emit(a)}return this}}function vi(e){hi[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},hi[e.on]=pi({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),hi[e.off]=pi({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}vi({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),vi({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),vi({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),vi({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),hi.deselect=hi.unselect,hi.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},vi({field:"active",on:"activate",off:"unactivate"}),vi({field:"pannable",on:"panify",off:"unpanify"}),hi.inactive=function(){var e=this[0];if(e)return!e._private.active};var gi={},yi=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var o=this[r];if(o.isNode()){for(var i=!1,a=o.connectedEdges(),s=0;s<a.length;s++){var l=a[s],u=l.source(),c=l.target();if(e.noIncomingEdges&&c===o&&u!==o||e.noOutgoingEdges&&u===o&&c!==o){i=!0;break}}i||n.push(o)}}return this.spawn(n,!0).filter(t)}},mi=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var o=this[r];if(o.isNode())for(var i=o.connectedEdges(),a=0;a<i.length;a++){var s=i[a],l=s.source(),u=s.target();e.outgoing&&l===o?(n.push(s),n.push(u)):e.incoming&&u===o&&(n.push(s),n.push(l))}}return this.spawn(n,!0).filter(t)}},bi=function(e){return function(t){for(var n=this,r=[],o={};;){var i=e.outgoing?n.outgoers():n.incomers();if(0===i.length)break;for(var a=!1,s=0;s<i.length;s++){var l=i[s],u=l.id();o[u]||(o[u]=!0,r.push(l),a=!0)}if(!a)break;n=i}return this.spawn(r,!0).filter(t)}};function xi(e){return function(t){for(var n=[],r=0;r<this.length;r++){var o=this[r]._private[e.attr];o&&n.push(o)}return this.spawn(n,!0).filter(t)}}function wi(e){return function(t){var n=[],r=this._private.cy,o=e||{};C(t)&&(t=r.$(t));for(var i=0;i<t.length;i++)for(var a=t[i]._private.edges,s=0;s<a.length;s++){var l=a[s],u=l._private.data,c=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),d=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target);if(c||d){if(o.thisIsSrc||o.thisIsTgt){if(o.thisIsSrc&&!c)continue;if(o.thisIsTgt&&!d)continue}n.push(l)}}return this.spawn(n,!0)}}function _i(e){return e=K({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),o=e,i=0;i<r.length;i++)for(var a=r[i]._private,s=a.source,l=s._private.data.id,u=a.data.target,c=s._private.edges,d=0;d<c.length;d++){var f=c[d],h=f._private.data,p=h.target,v=h.source,g=p===u&&v===l,y=l===p&&u===v;(o.codirected&&g||!o.codirected&&(g||y))&&n.push(f)}return this.spawn(n,!0).filter(t)}}gi.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},K(gi,{roots:yi({noIncomingEdges:!0}),leaves:yi({noOutgoingEdges:!0}),outgoers:Kr(mi({outgoing:!0}),"outgoers"),successors:bi({outgoing:!0}),incomers:Kr(mi({incoming:!0}),"incomers"),predecessors:bi({incoming:!0})}),K(gi,{neighborhood:Kr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var o=n[r],i=o.connectedEdges(),a=0;a<i.length;a++){var s=i[a],l=s.source(),u=s.target(),c=o===l?u:l;c.length>0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),gi.neighbourhood=gi.neighborhood,gi.closedNeighbourhood=gi.closedNeighborhood,gi.openNeighbourhood=gi.openNeighborhood,K(gi,{source:Kr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Kr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:xi({attr:"source"}),targets:xi({attr:"target"})}),K(gi,{edgesWith:Kr(wi(),"edgesWith"),edgesTo:Kr(wi({thisIsSrc:!0}),"edgesTo")}),K(gi,{connectedEdges:Kr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var o=r._private.edges,i=0;i<o.length;i++){var a=o[i];t.push(a)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:Kr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:Kr(_i(),"parallelEdges"),codirectedEdges:Kr(_i({codirected:!0}),"codirectedEdges")}),K(gi,{components:function(e){var t=this,n=t.cy(),r=n.collection(),o=null==e?t.nodes():e.nodes(),i=[];null!=e&&o.empty()&&(o=e.sources());var a=function(e,t){r.merge(e),o.unmerge(e),t.merge(e)};if(o.empty())return t.spawn();var s=function(){var e=n.collection();i.push(e);var r=o[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(o.length>0);return i},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),gi.componentsOf=gi.components;var Ei=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var o=new Le,i=!1;if(t){if(t.length>0&&D(t[0])&&!M(t[0])){i=!0;for(var a=[],s=new Fe,l=0,u=t.length;l<u;l++){var c=t[l];null==c.data&&(c.data={});var d=c.data;if(null==d.id)d.id=Te();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var f=new ze(e,c,!1);a.push(f),s.add(d.id)}t=a}}else t=[];this.length=0;for(var h=0,p=t.length;h<p;h++){var v=t[h][0];if(null!=v){var g=v._private.data.id;n&&o.has(g)||(n&&o.set(g,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Le,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=o),i&&!r&&this.restore()}else Se("A collection must have a reference to the core")},ki=ze.prototype=Ei.prototype=Object.create(Array.prototype);ki.instanceString=function(){return"collection"},ki.spawn=function(e,t){return new Ei(this.cy(),e,t)},ki.spawnSelf=function(){return this.spawn(this)},ki.cy=function(){return this._private.cy},ki.renderer=function(){return this._private.cy.renderer()},ki.element=function(){return this[0]},ki.collection=function(){return I(this)?this:new Ei(this._private.cy,[this])},ki.unique=function(){return new Ei(this._private.cy,this,!0)},ki.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},ki.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new Ei(t)},ki.$id=ki.getElementById,ki.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},ki.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},ki.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},ki.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(D(e)){if(n.startBatch(),e.data){t.data(e.data);var o=r.data;if(t.isEdge()){var i=!1,a={},s=e.data.source,l=e.data.target;null!=s&&s!=o.source&&(a.source=""+s,i=!0),null!=l&&l!=o.target&&(a.target=""+l,i=!0),i&&(t=t.move(a))}else{var u="parent"in e.data,c=e.data.parent;!u||null==c&&null==o.parent||c==o.parent||(void 0===c&&(c=null),null!=c&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var d=function(n,o,i){var a=e[n];null!=a&&a!==r[n]&&(a?t[o]():t[i]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var f={data:Ce(r.data),position:Ce(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:(null,"")},h=0;return r.classes.forEach((function(e){return f.classes+=0==h++?e:" "+e})),f}}},ki.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},ki.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),o=new ze(e,r,!1);t.push(o)}return new Ei(e,t)},ki.copy=ki.clone,ki.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=this,i=o.cy(),a=i._private,s=[],l=[],u=0,c=o.length;u<c;u++){var d=o[u];r&&!d.removed()||(d.isNode()?s.push(d):l.push(d))}e=s.concat(l);var f=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var h=e[t],p=h._private,v=p.data;if(h.clearTraversalCache(),r||p.removed)if(void 0===v.id)v.id=Te();else if(N(v.id))v.id=""+v.id;else{if(F(v.id)||!C(v.id)){Se("Can not create element with invalid string ID `"+v.id+"`"),f();continue}if(i.hasElementWithId(v.id)){Se("Can not create second element with ID `"+v.id+"`"),f();continue}}else;var g=v.id;if(h.isNode()){var y=p.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(h.isEdge()){for(var m=h,b=["source","target"],x=b.length,w=!1,_=0;_<x;_++){var E=b[_],k=v[E];N(k)&&(k=v[E]=""+v[E]),null==k||""===k?(Se("Can not create edge `"+g+"` with unspecified "+E),w=!0):i.hasElementWithId(k)||(Se("Can not create edge `"+g+"` with nonexistant "+E+" `"+k+"`"),w=!0)}if(w){f();continue}var S=i.getElementById(v.source),P=i.getElementById(v.target);S.same(P)?S._private.edges.push(m):(S._private.edges.push(m),P._private.edges.push(m)),m._private.source=S,m._private.target=P}p.map=new Le,p.map.set(g,{ele:h,index:0}),p.removed=!1,r&&i.addToPool(h)}for(var j=0;j<s.length;j++){var T=s[j],O=T._private.data;N(O.parent)&&(O.parent=""+O.parent);var D=O.parent,A=null!=D;if(A||T._private.parent){var R=T._private.parent?i.collection().merge(T._private.parent):i.getElementById(D);if(R.empty())O.parent=void 0;else if(R[0].removed())je("Node added with missing parent, reference to parent removed"),O.parent=void 0,T._private.parent=null;else{for(var M=!1,I=R;!I.empty();){if(T.same(I)){M=!0,O.parent=void 0;break}I=I.parent()}M||(R[0]._private.children.push(T),T._private.parent=R[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var L=e.length===o.length?o:new Ei(i,e),B=0;B<L.length;B++){var V=L[B];V.isNode()||(V.parallelEdges().clearTraversalCache(),V.source().clearTraversalCache(),V.target().clearTraversalCache())}(a.hasCompoundNodes?i.collection().merge(L).merge(L.connectedNodes()).merge(L.parent()):L).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?L.emitAndNotify("add"):r&&L.emit("add")}return o},ki.removed=function(){var e=this[0];return e&&e._private.removed},ki.inside=function(){var e=this[0];return e&&!e._private.removed},ki.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],o={},i=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)l(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)l(t[n])}function l(e){var n=o[e.id()];t&&e.removed()||n||(o[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var u=0,c=n.length;u<c;u++){var d=n[u];l(d)}function f(e,t){var n=e._private.edges;Ae(n,t),e.clearTraversalCache()}function h(e){e.clearTraversalCache()}var p=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();Ae(n,t),t._private.parent=null,p.ids[r]||(p.ids[r]=!0,p.push(e))}p.ids={},n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(r);for(var g=0;g<r.length;g++){var y=r[g];if(y.isEdge()){var m=y.source()[0],b=y.target()[0];f(m,y),f(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var _=x[w];h(_),_.isBundledBezier()&&_.dirtyBoundingBoxCache()}}else{var E=y.parent();0!==E.length&&v(E,y)}t&&(y._private.removed=!0)}var k=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<k.length;S++){var P=k[S];if(P.isParent()){i._private.hasCompoundNodes=!0;break}}var j=new Ei(this.cy(),r);j.size()>0&&(e?j.emitAndNotify("remove"):t&&j.emit("remove"));for(var C=0;C<p.length;C++){var T=p[C];t&&T.removed()||T.updateStyle()}return j},ki.move=function(e){var t=this._private.cy,n=this,r=!1,o=!1,i=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var a=i(e.source),s=i(e.target),l=null!=a&&t.hasElementWithId(a),u=null!=s&&t.hasElementWithId(s);(l||u)&&(t.batch((function(){n.remove(r,o),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],i=t._private.data;t.isEdge()&&(l&&(i.source=a),u&&(i.target=s))}n.restore(r,o)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var c=i(e.parent);if(null===c||t.hasElementWithId(c)){var d=null===c?void 0:c;t.batch((function(){var e=n.remove(r,o);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var i=n[t],a=i._private.data;i.isNode()&&(a.parent=d)}e.restore(r,o)})),n.emitAndNotify("move")}}return this},[Xn,lr,ur,qr,Zr,oo,io,Ao,Xo,$o,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},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}},Qo,ti,ii,hi,gi].forEach((function(e){K(ki,e)}));var Si={add:function(e){var t,n=this;if(R(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var o=[],i=0;i<r.length;i++){var a=r[i];o.push(a.json())}t=new Ei(n,o)}}else if(O(e)){t=new Ei(n,e)}else if(D(e)&&(O(e.nodes)||O(e.edges))){for(var s=e,l=[],u=["nodes","edges"],c=0,d=u.length;c<d;c++){var f=u[c],h=s[f];if(O(h))for(var p=0,v=h.length;p<v;p++){var g=K({group:f},h[p]);l.push(g)}}t=new Ei(n,l)}else{t=new ze(n,e).collection()}return t},remove:function(e){if(R(e));else if(C(e)){var t=e;e=this.$(t)}return e.remove()}};var Pi=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var o={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:o.v,dv:e(o)}}function n(n,r){var o={dx:n.v,dv:e(n)},i=t(n,.5*r,o),a=t(n,.5*r,i),s=t(n,r,a),l=1/6*(o.dx+2*(i.dx+a.dx)+s.dx),u=1/6*(o.dv+2*(i.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,o){var i,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,o=o||null,l.tension=t,l.friction=r,a=(i=null!==o)?(c=e(t,r))/o*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return i?function(e){return u[e*(u.length-1)|0]}:c}}(),ji=function(e,t,n,r){var o=function(e,t,n,r){var o=4,i=.001,a=1e-7,s=10,l=11,u=1/(l-1),c="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var f=c?new Float32Array(l):new Array(l);function h(e,t){return 1-3*t+3*e}function p(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((h(t,n)*e+p(t,n))*e+v(t))*e}function y(e,t,n){return 3*h(t,n)*e*e+2*p(t,n)*e+v(t)}function m(t,r){for(var i=0;i<o;++i){var a=y(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<l;++t)f[t]=g(t*u,e,n)}function x(t,r,o){var i,l,u=0;do{(i=g(l=r+(o-r)/2,e,n)-t)>0?o=l:r=l}while(Math.abs(i)>a&&++u<s);return l}function w(t){for(var r=0,o=1,a=l-1;o!==a&&f[o]<=t;++o)r+=u;--o;var s=r+(t-f[o])/(f[o+1]-f[o])*u,c=y(s,e,n);return c>=i?m(t,s):0===c?s:x(t,r,r+u)}var _=!1;function E(){_=!0,e===t&&n===r||b()}var k=function(o){return _||E(),e===t&&n===r?o:0===o?0:1===o?1:g(w(o),t,r)};k.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return k.toString=function(){return S},k}(e,t,n,r);return function(e,t,n){return e+(t-e)*o(n)}},Ci={linear:function(e,t,n){return e+(t-e)*n},ease:ji(.25,.1,.25,1),"ease-in":ji(.42,0,1,1),"ease-out":ji(0,0,.58,1),"ease-in-out":ji(.42,0,.58,1),"ease-in-sine":ji(.47,0,.745,.715),"ease-out-sine":ji(.39,.575,.565,1),"ease-in-out-sine":ji(.445,.05,.55,.95),"ease-in-quad":ji(.55,.085,.68,.53),"ease-out-quad":ji(.25,.46,.45,.94),"ease-in-out-quad":ji(.455,.03,.515,.955),"ease-in-cubic":ji(.55,.055,.675,.19),"ease-out-cubic":ji(.215,.61,.355,1),"ease-in-out-cubic":ji(.645,.045,.355,1),"ease-in-quart":ji(.895,.03,.685,.22),"ease-out-quart":ji(.165,.84,.44,1),"ease-in-out-quart":ji(.77,0,.175,1),"ease-in-quint":ji(.755,.05,.855,.06),"ease-out-quint":ji(.23,1,.32,1),"ease-in-out-quint":ji(.86,0,.07,1),"ease-in-expo":ji(.95,.05,.795,.035),"ease-out-expo":ji(.19,1,.22,1),"ease-in-out-expo":ji(1,0,0,1),"ease-in-circ":ji(.6,.04,.98,.335),"ease-out-circ":ji(.075,.82,.165,1),"ease-in-out-circ":ji(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ci.linear;var r=Pi(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":ji};function Ti(e,t,n,r,o){if(1===r)return n;if(t===n)return n;var i=o(t,n,r);return null==e||((e.roundValue||e.color)&&(i=Math.round(i)),void 0!==e.min&&(i=Math.max(i,e.min)),void 0!==e.max&&(i=Math.min(i,e.max))),i}function Oi(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Di(e,t,n,r,o){var i=null!=o?o.type:null;n<0?n=0:n>1&&(n=1);var a=Oi(e,o),s=Oi(t,o);if(N(a)&&N(s))return Ti(i,a,s,n,r);if(O(a)&&O(s)){for(var l=[],u=0;u<s.length;u++){var c=a[u],d=s[u];if(null!=c&&null!=d){var f=Ti(i,c,d,n,r);l.push(f)}else l.push(d)}return l}}function Ni(e,t,n,r){var o=!r,i=e._private,a=t._private,s=a.easing,l=a.startTime,u=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=Ci.linear;else{var c,d,f;if(C(s))c=u.parse("transition-timing-function",s).value;else c=s;C(c)?(d=c,f=[]):(d=c[1],f=c.slice(2).map((function(e){return+e}))),f.length>0?("spring"===d&&f.push(a.duration),a.easingImpl=Ci[d].apply(null,f)):a.easingImpl=Ci[d]}var h,p=a.easingImpl;if(h=0===a.duration?1:(n-l)/a.duration,a.applying&&(h=a.progress),h<0?h=0:h>1&&(h=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&o&&!e.locked()){var y={};Ai(v.x,g.x)&&(y.x=Di(v.x,g.x,h,p)),Ai(v.y,g.y)&&(y.y=Di(v.y,g.y,h,p)),e.position(y)}var m=a.startPan,b=a.pan,x=i.pan,w=null!=b&&r;w&&(Ai(m.x,b.x)&&(x.x=Di(m.x,b.x,h,p)),Ai(m.y,b.y)&&(x.y=Di(m.y,b.y,h,p)),e.emit("pan"));var _=a.startZoom,E=a.zoom,k=null!=E&&r;k&&(Ai(_,E)&&(i.zoom=ht(i.minZoom,Di(_,E,h,p),i.maxZoom)),e.emit("zoom")),(w||k)&&e.emit("viewport");var S=a.style;if(S&&S.length>0&&o){for(var P=0;P<S.length;P++){var j=S[P],T=j.name,O=j,D=a.startStyle[T],N=Di(D,O,h,p,u.properties[D.name]);u.overrideBypass(e,T,N)}e.emit("style")}}return a.progress=h,h}function Ai(e,t){return null!=e&&null!=t&&(!(!N(e)||!N(t))||!(!e||!t))}function Ri(e,t,n,r){var o=t._private;o.started=!0,o.startTime=n-o.progress*o.duration}function Mi(e,t){var n=t._private.aniEles,r=[];function o(t,n){var o=t._private,i=o.animation.current,a=o.animation.queue,s=!1;if(0===i.length){var l=a.shift();l&&i.push(l)}for(var u=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},c=i.length-1;c>=0;c--){var d=i[c],f=d._private;f.stopped?(i.splice(c,1),f.hooked=!1,f.playing=!1,f.started=!1,u(f.frames)):(f.playing||f.applying)&&(f.playing&&f.applying&&(f.applying=!1),f.started||Ri(0,d,e),Ni(t,d,e,n),f.applying&&(f.applying=!1),u(f.frames),null!=f.step&&f.step(e),d.completed()&&(i.splice(c,1),f.hooked=!1,f.playing=!1,f.started=!1,u(f.completes)),s=!0)}return n||0!==i.length||0!==a.length||r.push(t),s}for(var i=!1,a=0;a<n.length;a++){var s=o(n[a]);i=i||s}var l=o(t,!0);(i||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Ii={animate:sr.animate(),animation:sr.animation(),animated:sr.animated(),clearQueue:sr.clearQueue(),delay:sr.delay(),delayAnimation:sr.delayAnimation(),stop:sr.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Mi(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&oe((function(n){Mi(n,e),t()}))}()}}},Li={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&M(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Bi=function(e){return C(e)?new Wr(e):e},Fi={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Vo(Li,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Bi(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Bi(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Bi(t),n),this},once:function(e,t,n){return this.emitter().one(e,Bi(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};sr.eventAliasesOn(Fi);var zi={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};zi.jpeg=zi.jpg;var Vi={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var o;o=C(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var i=new r(K({},e,{cy:t,eles:o}));return i}Se("No such layout `"+n+"` found.  Did you forget to import it and `cytoscape.use()` it?")}else Se("A `name` must be specified to make a layout");else Se("Layout options must be specified to make a layout")}};Vi.createLayout=Vi.makeLayout=Vi.layout;var Gi={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var o=this.renderer();!this.destroyed()&&o&&o.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.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 null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var o=n[r],i=e[o];t.getElementById(o).data(i)}}))}},Ui=Ne({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Hi={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),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 t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&je("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 r=Ui(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else Se("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Hi.invalidateDimensions=Hi.resize;var Wi={collection:function(e,t){return C(e)?this.$(e):R(e)?e.collection():O(e)?(t||(t={}),new Ei(this,e,t.unique,t.removed)):new Ei(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Wi.elements=Wi.filter=Wi.$;var Yi={},qi="t";Yi.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var o=e[r],i=t.getContextMeta(o);if(!i.empty){var a=t.getContextStyle(i),s=t.applyContextStyle(i,a,o);o._private.appliedInitStyle?t.updateTransitions(o,s.diffProps):o._private.appliedInitStyle=!0,t.updateStyleHints(o)&&n.push(o)}}return n},Yi.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},o=e+"-"+t,i=r[o];if(i)return i;for(var a=[],s={},l=0;l<n.length;l++){var u=n[l],c=e[l]===qi,d=t[l]===qi,f=c!==d,h=u.mappedProperties.length>0;if(f||d&&h){var p=void 0;f&&h||f?p=u.properties:h&&(p=u.mappedProperties);for(var v=0;v<p.length;v++){for(var g=p[v],y=g.name,m=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===qi&&(m=null!=x.properties[g.name]))break}s[y]||m||(s[y]=!0,a.push(y))}}}return r[o]=a,a},Yi.getContextMeta=function(e){for(var t,n=this,r="",o=e._private.styleCxtKey||"",i=0;i<n.length;i++){var a=n[i];r+=a.selector&&a.selector.matches(e)?qi:"f"}return t=n.getPropertiesDiff(o,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Yi.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},o=0;o<this.length;o++){var i=this[o];if(t[o]===qi)for(var a=0;a<i.properties.length;a++){var s=i.properties[a];r[s.name]=s}}return n[t]=r,r},Yi.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,o={},i=this.types,a=0;a<r.length;a++){var s=r[a],l=t[s],u=n.pstyle(s);if(!l){if(!u)continue;l=u.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(u!==l){if(l.mapped===i.fn&&null!=u&&null!=u.mapping&&u.mapping.value===l.value){var c=u.mapping;if((c.fnValue=l.value(n))===c.prevFnValue)continue}var d=o[s]={prev:u};this.applyParsedProperty(n,l),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:o}},Yi.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,o=n.propertyGroupKeys,i=function(e,t,r){return n.getPropertiesHash(e,t,r)},a=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,l=e._private.style;r=Object.keys(l);for(var u=0;u<o.length;u++){var c=o[u];t.styleKeys[c]=[ae,le]}for(var d,f=function(e,n){return t.styleKeys[n][0]=ce(e,t.styleKeys[n][0])},h=function(e,n){return t.styleKeys[n][1]=de(e,t.styleKeys[n][1])},p=function(e,t){f(e,t),h(e,t)},v=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);f(r,t),h(r,t)}},g=0;g<r.length;g++){var y=r[g],m=l[y];if(null!=m){var b=this.properties[y],x=b.type,w=b.groupKey,_=void 0;null!=b.hashOverride?_=b.hashOverride(e,m):null!=m.pfValue&&(_=m.pfValue);var E=null==b.enums?m.value:null,k=null!=_,S=k||null!=E,P=m.units;if(x.number&&S&&!x.multiple)p(-128<(d=k?_:E)&&d<128&&Math.floor(d)!==d?2e9-(1024*d|0):d,w),k||null==P||v(P,w);else v(m.strValue,w)}}for(var j,C,T=[ae,le],O=0;O<o.length;O++){var D=o[O],N=t.styleKeys[D];T[0]=ce(N[0],T[0]),T[1]=de(N[1],T[1])}t.styleKey=(j=T[0],C=T[1],2097152*j+C);var A=t.styleKeys;t.labelDimsKey=fe(A.labelDimensions);var R=i(e,["label"],A.labelDimensions);if(t.labelKey=fe(R),t.labelStyleKey=fe(he(A.commonLabel,R)),!s){var M=i(e,["source-label"],A.labelDimensions);t.sourceLabelKey=fe(M),t.sourceLabelStyleKey=fe(he(A.commonLabel,M));var I=i(e,["target-label"],A.labelDimensions);t.targetLabelKey=fe(I),t.targetLabelStyleKey=fe(he(A.commonLabel,I))}if(s){var L=t.styleKeys,B=L.nodeBody,F=L.nodeBorder,V=L.backgroundImage,G=L.compound,H=L.pie,W=[B,F,V,G,H].filter((function(e){return null!=e})).reduce(he,[ae,le]);t.nodeKey=fe(W),t.hasPie=null!=H&&H[0]!==ae&&H[1]!==le}return a!==t.styleKey},Yi.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},Yi.applyParsedProperty=function(e,t){var n,r=this,o=t,i=e._private.style,a=r.types,s=r.properties[o.name].type,l=o.bypass,u=i[o.name],c=u&&u.bypass,d=e._private,f="mapping",h=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=h(u),n=h(o);r.checkTriggers(e,o.name,t,n)};if(o&&"pie"===o.name.substr(0,3)&&je("The pie style properties are deprecated.  Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(o=t=this.parse(t.name,"bezier",l)),o.delete)return i[o.name]=void 0,p(),!0;if(o.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,p(),!0):(p(),!0);if(o.deleteBypass)return u?!!u.bypass&&(i[o.name]=u.bypassed,p(),!0):(p(),!0);var v=function(){je("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+o.name+"` with data field `"+o.field+"`); try a `["+o.field+"]` selector to limit scope to elements with `"+o.field+"` defined")};switch(o.mapped){case a.mapData:for(var g,y=o.field.split("."),m=d.data,b=0;b<y.length&&m;b++){m=m[y[b]]}if(null==m)return v(),!1;if(!N(m))return je("Do not use continuous mappers without specifying numeric data (i.e. `"+o.field+": "+m+"` for `"+e.id()+"` is non-numeric)"),!1;var x=o.fieldMax-o.fieldMin;if((g=0===x?0:(m-o.fieldMin)/x)<0?g=0:g>1&&(g=1),s.color){var w=o.valueMin[0],_=o.valueMax[0],E=o.valueMin[1],k=o.valueMax[1],S=o.valueMin[2],P=o.valueMax[2],j=null==o.valueMin[3]?1:o.valueMin[3],C=null==o.valueMax[3]?1:o.valueMax[3],T=[Math.round(w+(_-w)*g),Math.round(E+(k-E)*g),Math.round(S+(P-S)*g),Math.round(j+(C-j)*g)];n={bypass:o.bypass,name:o.name,value:T,strValue:"rgb("+T[0]+", "+T[1]+", "+T[2]+")"}}else{if(!s.number)return!1;var O=o.valueMin+(o.valueMax-o.valueMin)*g;n=this.parse(o.name,O,o.bypass,f)}if(!n)return v(),!1;n.mapping=o,o=n;break;case a.data:for(var D=o.field.split("."),A=d.data,R=0;R<D.length&&A;R++){A=A[D[R]]}if(null!=A&&(n=this.parse(o.name,A,o.bypass,f)),!n)return v(),!1;n.mapping=o,o=n;break;case a.fn:var M=o.value,I=null!=o.fnValue?o.fnValue:M(e);if(o.prevFnValue=I,null==I)return je("Custom function mappers may not return null (i.e. `"+o.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(o.name,I,o.bypass,f)))return je("Custom function mappers may not return invalid values for the property type (i.e. `"+o.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=Ce(o),o=n;break;case void 0:break;default:return!1}return l?(o.bypassed=c?u.bypassed:u,i[o.name]=o):c?u.bypassed=o:i[o.name]=o,p(),!0},Yi.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var o=r._private.style,i=Object.keys(o),a=0;a<i.length;a++){var s=i[a],l=o[s];null!=l&&(l.bypass?l.bypassed=null:o[s]=null)}else r._private.style={}}},Yi.update=function(){this._private.cy.mutableElements().updateStyle()},Yi.updateTransitions=function(e,t){var n=this,r=e._private,o=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(o.length>0&&i>0){for(var s={},l=!1,u=0;u<o.length;u++){var c=o[u],d=e.pstyle(c),f=t[c];if(f){var h=f.prev,p=null!=f.next?f.next:d,v=!1,g=void 0,y=1e-6;h&&(N(h.pfValue)&&N(p.pfValue)?(v=p.pfValue-h.pfValue,g=h.pfValue+y*v):N(h.value)&&N(p.value)?(v=p.value-h.value,g=h.value+y*v):O(h.value)&&O(p.value)&&(v=h.value[0]!==p.value[0]||h.value[1]!==p.value[1]||h.value[2]!==p.value[2],g=h.strValue),v&&(s[c]=p.strValue,this.applyBypass(e,c,g),l=!0))}}if(!l)return;r.transitioning=!0,new tr((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:i,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,o),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,o),e.emitAndNotify("style"),r.transitioning=!1)},Yi.checkTrigger=function(e,t,n,r,o,i){var a=this.properties[t],s=o(a);null!=s&&s(n,r)&&i(a)},Yi.checkZOrderTrigger=function(e,t,n,r){var o=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){o._private.cy.notify("zorder",e)}))},Yi.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(o){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!o.triggersBoundsOfParallelBeziers||("curve-style"!==t||"bezier"!==n&&"bezier"!==r)&&("display"!==t||"none"!==n&&"none"!==r)||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Yi.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Xi={applyBypass:function(e,t,n,r){var o=[];if("*"===t||"**"===t){if(void 0!==n)for(var i=0;i<this.properties.length;i++){var a=this.properties[i].name,s=this.parse(a,n,!0);s&&o.push(s)}}else if(C(t)){var l=this.parse(t,n,!0);l&&o.push(l)}else{if(!D(t))return!1;var u=t;r=n;for(var c=Object.keys(u),d=0;d<c.length;d++){var f=c[d],h=u[f];if(void 0===h&&(h=u[W(f)]),void 0!==h){var p=this.parse(f,h,!0);p&&o.push(p)}}}if(0===o.length)return!1;for(var v=!1,g=0;g<e.length;g++){for(var y=e[g],m={},b=void 0,x=0;x<o.length;x++){var w=o[x];if(r){var _=y.pstyle(w.name);b=m[w.name]={prev:_}}v=this.applyParsedProperty(y,Ce(w))||v,r&&(b.next=y.pstyle(w.name))}v&&this.updateStyleHints(y),r&&this.updateTransitions(y,m,true)}return v},overrideBypass:function(e,t,n){t=H(t);for(var r=0;r<e.length;r++){var o=e[r],i=o._private.style[t],a=this.properties[t].type,s=a.color,l=a.mutiple,u=i?null!=i.pfValue?i.pfValue:i.value:null;i&&i.bypass?(i.value=n,null!=i.pfValue&&(i.pfValue=n),i.strValue=s?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(o)):this.applyBypass(o,t,n),this.checkTriggers(o,t,u,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var o=e[r],i={},a=0;a<t.length;a++){var s=t[a],l=this.properties[s],u=o.pstyle(l.name);if(u&&u.bypass){var c=this.parse(s,"",!0),d=i[l.name]={prev:u};this.applyParsedProperty(o,c),d.next=o.pstyle(l.name)}}this.updateStyleHints(o),n&&this.updateTransitions(o,i,true)}}},$i={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(w&&t&&w.getComputedStyle)return w.getComputedStyle(t).getPropertyValue(e)}},Ki={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},o=0;o<n.properties.length;o++){var i=n.properties[o],a=n.getStylePropertyValue(e,i.name,t);null!=a&&(r[i.name]=a,r[W(i.name)]=a)}return r}},getIndexedStyle:function(e,t,n,r){var o=e.pstyle(t)[n][r];return null!=o?o:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var o=r.type,i=e.pstyle(r.name);if(i){var a=i.value,s=i.units,l=i.strValue;if(n&&o.number&&null!=a&&N(a)){var u=e.cy().zoom(),c=function(e){return e*u},d=function(e,t){return c(e)+t},f=O(a);return(f?s.every((function(e){return null!=e})):null!=s)?f?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):f?a.map((function(e){return C(e)?e:""+c(e)})).join(" "):""+c(a)}if(null!=l)return l}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var o=t[r].name,i=e.pstyle(o);void 0!==i&&(i=D(i)?this.parse(o,i.strValue):this.parse(o,i)),i&&(n[o]=i)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var o=Object.keys(n),i=0;i<o.length;i++){var a=o[i],s=n[a],l=r[a]||r[H(a)],u=this.parse(l.name,s);u&&t.push(u)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,o,i,a,s,l,u=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(o=e.pstyle(r,!1)))if(null!=o.pfValue)u[0]=ce(a,u[0]),u[1]=de(a,u[1]);else for(i=o.strValue,l=0;l<i.length;l++)a=i.charCodeAt(l),u[0]=ce(a,u[0]),u[1]=de(a,u[1]);return u}};Ki.getPropertiesHash=Ki.getNonDefaultPropertiesHash;var Zi={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],o=r.selector,i=r.style||r.css,a=Object.keys(i);t.selector(o);for(var s=0;s<a.length;s++){var l=a[s],u=i[l];t.css(l,u)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,o=n.properties,i={},a=0;a<o.length;a++){var s=o[a];i[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:i})}return e}},Qi={appendFromString:function(e){var t,n,r,o=this,i=""+e;function a(){i=i.length>t.length?i.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(i.match(/^\s*$/))break;var l=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){je("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+i);break}t=l[0];var u=l[1];if("core"!==u)if(new Wr(u).invalid){je("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();continue}var c=l[2],d=!1;n=c;for(var f=[];;){if(n.match(/^\s*$/))break;var h=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!h){je("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=h[0];var p=h[1],v=h[2];if(this.properties[p])o.parse(p,v)?(f.push({name:p,val:v}),s()):(je("Skipping property: Invalid property definition in: "+r),s());else je("Skipping property: Invalid property name in: "+r),s()}if(d){a();break}o.selector(u);for(var g=0;g<f.length;g++){var y=f[g];o.css(y.name,y.val)}a()}return o},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Ji={};!function(){var e=X,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Ji.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},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"],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"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},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","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},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"]},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:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,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"]},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(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return C(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\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(e){var t=e.length;return 1===t||2===t||4===t}}};var o={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||(0==e&&0!=t||0!=e&&0==t)},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=F(e),r=F(t);return n&&!r||!n&&r}},i=Ji.types,a=[{name:"label",type:i.text,triggersBounds:o.any,triggersZOrder:o.emptyNonEmpty},{name:"text-rotation",type:i.textRotation,triggersBounds:o.any},{name:"text-margin-x",type:i.bidirectionalSize,triggersBounds:o.any},{name:"text-margin-y",type:i.bidirectionalSize,triggersBounds:o.any}],s=[{name:"source-label",type:i.text,triggersBounds:o.any},{name:"source-text-rotation",type:i.textRotation,triggersBounds:o.any},{name:"source-text-margin-x",type:i.bidirectionalSize,triggersBounds:o.any},{name:"source-text-margin-y",type:i.bidirectionalSize,triggersBounds:o.any},{name:"source-text-offset",type:i.size,triggersBounds:o.any}],l=[{name:"target-label",type:i.text,triggersBounds:o.any},{name:"target-text-rotation",type:i.textRotation,triggersBounds:o.any},{name:"target-text-margin-x",type:i.bidirectionalSize,triggersBounds:o.any},{name:"target-text-margin-y",type:i.bidirectionalSize,triggersBounds:o.any},{name:"target-text-offset",type:i.size,triggersBounds:o.any}],u=[{name:"font-family",type:i.fontFamily,triggersBounds:o.any},{name:"font-style",type:i.fontStyle,triggersBounds:o.any},{name:"font-weight",type:i.fontWeight,triggersBounds:o.any},{name:"font-size",type:i.size,triggersBounds:o.any},{name:"text-transform",type:i.textTransform,triggersBounds:o.any},{name:"text-wrap",type:i.textWrap,triggersBounds:o.any},{name:"text-overflow-wrap",type:i.textOverflowWrap,triggersBounds:o.any},{name:"text-max-width",type:i.size,triggersBounds:o.any},{name:"text-outline-width",type:i.size,triggersBounds:o.any},{name:"line-height",type:i.positiveNumber,triggersBounds:o.any}],c=[{name:"text-valign",type:i.valign,triggersBounds:o.any},{name:"text-halign",type:i.halign,triggersBounds:o.any},{name:"color",type:i.color},{name:"text-outline-color",type:i.color},{name:"text-outline-opacity",type:i.zeroOneNumber},{name:"text-background-color",type:i.color},{name:"text-background-opacity",type:i.zeroOneNumber},{name:"text-background-padding",type:i.size,triggersBounds:o.any},{name:"text-border-opacity",type:i.zeroOneNumber},{name:"text-border-color",type:i.color},{name:"text-border-width",type:i.size,triggersBounds:o.any},{name:"text-border-style",type:i.borderStyle,triggersBounds:o.any},{name:"text-background-shape",type:i.textBackgroundShape,triggersBounds:o.any},{name:"text-justification",type:i.justification}],d=[{name:"events",type:i.bool},{name:"text-events",type:i.bool}],f=[{name:"display",type:i.display,triggersZOrder:o.any,triggersBounds:o.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:i.visibility,triggersZOrder:o.any},{name:"opacity",type:i.zeroOneNumber,triggersZOrder:o.zeroNonZero},{name:"text-opacity",type:i.zeroOneNumber},{name:"min-zoomed-font-size",type:i.size},{name:"z-compound-depth",type:i.zCompoundDepth,triggersZOrder:o.any},{name:"z-index-compare",type:i.zIndexCompare,triggersZOrder:o.any},{name:"z-index",type:i.nonNegativeInt,triggersZOrder:o.any}],h=[{name:"overlay-padding",type:i.size,triggersBounds:o.any},{name:"overlay-color",type:i.color},{name:"overlay-opacity",type:i.zeroOneNumber,triggersBounds:o.zeroNonZero},{name:"overlay-shape",type:i.overlayShape,triggersBounds:o.any}],p=[{name:"underlay-padding",type:i.size,triggersBounds:o.any},{name:"underlay-color",type:i.color},{name:"underlay-opacity",type:i.zeroOneNumber,triggersBounds:o.zeroNonZero},{name:"underlay-shape",type:i.overlayShape,triggersBounds:o.any}],v=[{name:"transition-property",type:i.propList},{name:"transition-duration",type:i.time},{name:"transition-delay",type:i.time},{name:"transition-timing-function",type:i.easing}],g=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},y=[{name:"height",type:i.nodeSize,triggersBounds:o.any,hashOverride:g},{name:"width",type:i.nodeSize,triggersBounds:o.any,hashOverride:g},{name:"shape",type:i.nodeShape,triggersBounds:o.any},{name:"shape-polygon-points",type:i.polygonPointList,triggersBounds:o.any},{name:"background-color",type:i.color},{name:"background-fill",type:i.fill},{name:"background-opacity",type:i.zeroOneNumber},{name:"background-blacken",type:i.nOneOneNumber},{name:"background-gradient-stop-colors",type:i.colors},{name:"background-gradient-stop-positions",type:i.percentages},{name:"background-gradient-direction",type:i.gradientDirection},{name:"padding",type:i.sizeMaybePercent,triggersBounds:o.any},{name:"padding-relative-to",type:i.paddingRelativeTo,triggersBounds:o.any},{name:"bounds-expansion",type:i.boundsExpansion,triggersBounds:o.any}],m=[{name:"border-color",type:i.color},{name:"border-opacity",type:i.zeroOneNumber},{name:"border-width",type:i.size,triggersBounds:o.any},{name:"border-style",type:i.borderStyle}],b=[{name:"background-image",type:i.urls},{name:"background-image-crossorigin",type:i.bgCrossOrigin},{name:"background-image-opacity",type:i.zeroOneNumbers},{name:"background-image-containment",type:i.bgContainment},{name:"background-image-smoothing",type:i.bools},{name:"background-position-x",type:i.bgPos},{name:"background-position-y",type:i.bgPos},{name:"background-width-relative-to",type:i.bgRelativeTo},{name:"background-height-relative-to",type:i.bgRelativeTo},{name:"background-repeat",type:i.bgRepeat},{name:"background-fit",type:i.bgFit},{name:"background-clip",type:i.bgClip},{name:"background-width",type:i.bgWH},{name:"background-height",type:i.bgWH},{name:"background-offset-x",type:i.bgPos},{name:"background-offset-y",type:i.bgPos}],x=[{name:"position",type:i.position,triggersBounds:o.any},{name:"compound-sizing-wrt-labels",type:i.compoundIncludeLabels,triggersBounds:o.any},{name:"min-width",type:i.size,triggersBounds:o.any},{name:"min-width-bias-left",type:i.sizeMaybePercent,triggersBounds:o.any},{name:"min-width-bias-right",type:i.sizeMaybePercent,triggersBounds:o.any},{name:"min-height",type:i.size,triggersBounds:o.any},{name:"min-height-bias-top",type:i.sizeMaybePercent,triggersBounds:o.any},{name:"min-height-bias-bottom",type:i.sizeMaybePercent,triggersBounds:o.any}],w=[{name:"line-style",type:i.lineStyle},{name:"line-color",type:i.color},{name:"line-fill",type:i.fill},{name:"line-cap",type:i.lineCap},{name:"line-opacity",type:i.zeroOneNumber},{name:"line-dash-pattern",type:i.numbers},{name:"line-dash-offset",type:i.number},{name:"line-gradient-stop-colors",type:i.colors},{name:"line-gradient-stop-positions",type:i.percentages},{name:"curve-style",type:i.curveStyle,triggersBounds:o.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:i.zeroOneNumber,triggersBounds:o.any},{name:"source-endpoint",type:i.edgeEndpoint,triggersBounds:o.any},{name:"target-endpoint",type:i.edgeEndpoint,triggersBounds:o.any},{name:"control-point-step-size",type:i.size,triggersBounds:o.any},{name:"control-point-distances",type:i.bidirectionalSizes,triggersBounds:o.any},{name:"control-point-weights",type:i.numbers,triggersBounds:o.any},{name:"segment-distances",type:i.bidirectionalSizes,triggersBounds:o.any},{name:"segment-weights",type:i.numbers,triggersBounds:o.any},{name:"taxi-turn",type:i.bidirectionalSizeMaybePercent,triggersBounds:o.any},{name:"taxi-turn-min-distance",type:i.size,triggersBounds:o.any},{name:"taxi-direction",type:i.axisDirection,triggersBounds:o.any},{name:"edge-distances",type:i.edgeDistances,triggersBounds:o.any},{name:"arrow-scale",type:i.positiveNumber,triggersBounds:o.any},{name:"loop-direction",type:i.angle,triggersBounds:o.any},{name:"loop-sweep",type:i.angle,triggersBounds:o.any},{name:"source-distance-from-node",type:i.size,triggersBounds:o.any},{name:"target-distance-from-node",type:i.size,triggersBounds:o.any}],_=[{name:"ghost",type:i.bool,triggersBounds:o.any},{name:"ghost-offset-x",type:i.bidirectionalSize,triggersBounds:o.any},{name:"ghost-offset-y",type:i.bidirectionalSize,triggersBounds:o.any},{name:"ghost-opacity",type:i.zeroOneNumber}],E=[{name:"selection-box-color",type:i.color},{name:"selection-box-opacity",type:i.zeroOneNumber},{name:"selection-box-border-color",type:i.color},{name:"selection-box-border-width",type:i.size},{name:"active-bg-color",type:i.color},{name:"active-bg-opacity",type:i.zeroOneNumber},{name:"active-bg-size",type:i.size},{name:"outside-texture-bg-color",type:i.color},{name:"outside-texture-bg-opacity",type:i.zeroOneNumber}],k=[];Ji.pieBackgroundN=16,k.push({name:"pie-size",type:i.sizeMaybePercent});for(var S=1;S<=Ji.pieBackgroundN;S++)k.push({name:"pie-"+S+"-background-color",type:i.color}),k.push({name:"pie-"+S+"-background-size",type:i.percent}),k.push({name:"pie-"+S+"-background-opacity",type:i.zeroOneNumber});var P=[],j=Ji.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:i.arrowShape,triggersBounds:o.any},{name:"arrow-color",type:i.color},{name:"arrow-fill",type:i.arrowFill}].forEach((function(e){j.forEach((function(t){var n=t+"-"+e.name,r=e.type,o=e.triggersBounds;P.push({name:n,type:r,triggersBounds:o})}))}),{});var T=Ji.properties=[].concat(d,v,f,h,p,_,c,u,a,s,l,y,m,b,k,x,w,P,E),O=Ji.propertyGroups={behavior:d,transition:v,visibility:f,overlay:h,underlay:p,ghost:_,commonLabel:c,labelDimensions:u,mainLabel:a,sourceLabel:s,targetLabel:l,nodeBody:y,nodeBorder:m,backgroundImage:b,pie:k,compound:x,edgeLine:w,edgeArrow:P,core:E},D=Ji.propertyGroupNames={};(Ji.propertyGroupKeys=Object.keys(O)).forEach((function(e){D[e]=O[e].map((function(e){return e.name})),O[e].forEach((function(t){return t.groupKey=e}))}));var N=Ji.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{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"}];Ji.propertyNames=T.map((function(e){return e.name}));for(var A=0;A<T.length;A++){var R=T[A];T[R.name]=R}for(var M=0;M<N.length;M++){var I=N[M],L=T[I.pointsTo],B={name:I.name,alias:!0,pointsTo:L};T.push(B),T[I.name]=B}}(),Ji.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Ji.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=K({"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","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","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",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1,   1, -1,   1, 1,   -1, 1","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(e,t){for(var n=1;n<=Ji.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),o=t.value;e[r]=o}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"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,"taxi-turn":"50%","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"}].reduce((function(e,t){return Ji.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,o=t.value;e[r]=o})),e}),{})),n={},r=0;r<this.properties.length;r++){var o=this.properties[r];if(!o.pointsTo){var i=o.name,a=t[i],s=this.parse(i,a);n[i]=s}}return e.defaultProperties=n,e.defaultProperties},Ji.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 ea={parse:function(e,t,n,r){var o=this;if(T(t))return o.parseImplWarn(e,t,n,r);var i,a=ve(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),s=o.propCache=o.propCache||[];return(i=s[a])||(i=s[a]=o.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(i=Ce(i))&&(i.value=Ce(i.value)),i},parseImplWarn:function(e,t,n,r){var o=this.parseImpl(e,t,n,r);return o||null==t||je("The style property `".concat(e,": ").concat(t,"` is invalid")),!o||"width"!==o.name&&"height"!==o.name||"label"!==t||je("The style value of `label` is deprecated for `"+o.name+"`"),o}};ea.parseImpl=function(e,t,n,r){var o=this;e=H(e);var i=o.properties[e],a=t,s=o.types;if(!i)return null;if(void 0===t)return null;i.alias&&(i=i.pointsTo,e=i.name);var l=C(t);l&&(t=t.trim());var u,c,d=i.type;if(!d)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(T(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!l||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var f=s.data;return{name:e,value:u,strValue:""+t,mapped:f,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var h=s.mapData;if(!d.color&&!d.number)return!1;var p=this.parse(e,c[4]);if(!p||p.mapped)return!1;var v=this.parse(e,c[5]);if(!v||v.mapped)return!1;if(p.pfValue===v.pfValue||p.strValue===v.strValue)return je("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var g=p.value,y=v.value;if(!(g[0]!==y[0]||g[1]!==y[1]||g[2]!==y[2]||g[3]!==y[3]&&(null!=g[3]&&1!==g[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:h,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:p.value,valueMax:v.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):O(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var b=[],x=[],w=[],_="",E=!1,k=0;k<m.length;k++){var S=o.parse(e,m[k],n,"multiple");E=E||C(S.value),b.push(S.value),w.push(null!=S.pfValue?S.pfValue:S.value),x.push(S.units),_+=(k>0?" ":"")+S.strValue}return d.validate&&!d.validate(b,x)?null:d.singleEnum&&E?1===b.length&&C(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:_,bypass:n,units:x}}var P,j,D=function(){for(var r=0;r<d.enums.length;r++){if(d.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var A,R="px";if(d.units&&(A=d.units),d.implicitUnits&&(R=d.implicitUnits),!d.unitless)if(l){var M="px|em"+(d.allowPercent?"|\\%":"");A&&(M=A);var I=t.match("^("+X+")("+M+")?$");I&&(t=I[1],A=I[2]||R)}else A&&!d.implicitUnits||(A=R);if(t=parseFloat(t),isNaN(t)&&void 0===d.enums)return null;if(isNaN(t)&&void 0!==d.enums)return t=a,D();if(d.integer&&(!N(j=t)||Math.floor(j)!==j))return null;if(void 0!==d.min&&(t<d.min||d.strictMin&&t===d.min)||void 0!==d.max&&(t>d.max||d.strictMax&&t===d.max))return null;var L={name:e,value:t,strValue:""+t+(A||""),units:A,bypass:n};return d.unitless||"px"!==A&&"em"!==A?L.pfValue=t:L.pfValue="px"!==A&&A?this.getEmSizeInPixels()*t:t,"ms"!==A&&"s"!==A||(L.pfValue="ms"===A?t:1e3*t),"deg"!==A&&"rad"!==A||(L.pfValue="rad"===A?t:(P=t,Math.PI*P/180)),"%"===A&&(L.pfValue=t/100),L}if(d.propList){var B=[],F=""+t;if("none"===F);else{for(var V=F.split(/\s*,\s*|\s+/),G=0;G<V.length;G++){var W=V[G].trim();o.properties[W]?B.push(W):je("`"+W+"` is not a valid property name")}if(0===B.length)return null}return{name:e,value:B,strValue:0===B.length?"none":B.join(" "),bypass:n}}if(d.color){var Y=Z(t);return Y?{name:e,value:Y,pfValue:Y,strValue:"rgb("+Y[0]+","+Y[1]+","+Y[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var q=D();if(q)return q}for(var $=d.regexes?d.regexes:[d.regex],K=0;K<$.length;K++){var Q=new RegExp($[K]).exec(t);if(Q)return{name:e,value:d.singleRegexMatchValue?Q[1]:Q,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?D():null};var ta=function e(t){if(!(this instanceof e))return new e(t);L(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Se("A style must have a core reference")},na=ta.prototype;na.instanceString=function(){return"style"},na.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},na.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},na.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},na.selector=function(e){var t="core"===e?null:new Wr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},na.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var o=e.properties[r],i=n[o.name];void 0===i&&(i=n[W(o.name)]),void 0!==i&&this.cssRule(o.name,i)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},na.style=na.css,na.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},na.append=function(e){return B(e)?e.appendToStyle(this):O(e)?this.appendFromJson(e):C(e)&&this.appendFromString(e),this},ta.fromJson=function(e,t){var n=new ta(e);return n.fromJson(t),n},ta.fromString=function(e,t){return new ta(e).fromString(t)},[Yi,Xi,$i,Ki,Zi,Qi,Ji,ea].forEach((function(e){K(na,e)})),ta.types=na.types,ta.properties=na.properties,ta.propertyGroups=na.propertyGroups,ta.propertyGroupNames=na.propertyGroupNames,ta.propertyGroupKeys=na.propertyGroupKeys;var ra={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return B(e)?t.style=e.generateStyle(this):O(e)?t.style=ta.fromJson(this,e):C(e)?t.style=ta.fromString(this,e):t.style=ta(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},oa={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,o,i=arguments,a=this._private.pan;switch(i.length){case 0:return a;case 1:if(C(i[0]))return a[e=i[0]];if(D(i[0])){if(!this._private.panningEnabled)return this;r=(n=i[0]).x,o=n.y,N(r)&&(a.x=r),N(o)&&(a.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=i[0],t=i[1],"x"!==e&&"y"!==e||!N(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,o,i,a,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:D(e)&&(i=(o=s[0]).x,a=o.y,N(i)&&(l.x+=i),N(a)&&(l.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!N(r)||(l[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(N(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(C(e)){var o=e;e=this.$(o)}else if(D(r=e)&&N(r.x1)&&N(r.x2)&&N(r.y1)&&N(r.y2)){var i=e;(n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else R(e)||(e=this.mutableElements());if(!R(e)||!e.empty()){n=n||e.boundingBox();var a,s=this.width(),l=this.height();if(t=N(t)?t:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(n.x1+n.x2))/2,y:(l-a*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return N(e)&&N(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):N(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:N(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,o=r.pan,i=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),N(e)?n=e:D(e)&&(n=e.level,null!=e.position?t=nt(e.position,i,o):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,a||!N(n)||n===i||null!=t&&(!N(t.x)||!N(t.y)))return null;if(null!=t){var s=o,l=i,u=n;return{zoomed:!0,panned:!0,zoom:u,pan:{x:-u/l*(t.x-s.x)+t.x,y:-u/l*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:o}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,o=[],i=!1,a=!1;if(!e)return this;if(N(e.zoom)||(n=!1),D(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?i=!0:(t.zoom=s,o.push("zoom"))}if(r&&(!i||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;N(l.x)&&(t.pan.x=l.x,a=!1),N(l.y)&&(t.pan.y=l.y,a=!1),a||o.push("pan")}return o.length>0&&(o.push("viewport"),this.emit(o.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(C(e)){var n=e;e=this.mutableElements().filter(n)}else R(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),o=this.width(),i=this.height();return{x:(o-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(i-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=w.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("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,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};oa.centre=oa.center,oa.autolockNodes=oa.autolock,oa.autoungrabifyNodes=oa.autoungrabify;var ia={data:sr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:sr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:sr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:sr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ia.attr=ia.data,ia.removeAttr=ia.removeData;var aa=function(e){var t=this,n=(e=K({},e)).container;n&&!A(n)&&A(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var o=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var i=void 0!==w&&void 0!==n&&!e.headless,a=e;a.layout=K({name:i?"grid":"null"},a.layout),a.renderer=K({name:i?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new Ei(this),listeners:[],aniEles:new Ei(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?i:a.styleEnabled,zoom:N(a.zoom)?a.zoom:1,pan:{x:D(a.pan)&&N(a.pan.x)?a.pan.x:0,y:D(a.pan)&&N(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom});l.styleEnabled&&t.setStyle([]);var u=K({},a,a.renderer);t.initRenderer(u);!function(e,t){if(e.some(V))return tr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],i=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var o=t.mutableElements();o.length>0&&o.remove(),null!=e&&(D(e)||O(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var i=K({},t._private.options.layout);i.eles=t.elements(),t.layout(i).run()}(i,(function(){t.startAnimationLoop(),l.ready=!0,T(a.ready)&&t.on("ready",a.ready);for(var e=0;e<o.length;e++){var n=o[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),a.done)}))},sa=aa.prototype;K(sa,{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},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!A(e)&&A(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(K({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ce(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(D(e)){if(t.startBatch(),e.elements){var o={},i=function(e,n){for(var r=[],i=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var l=""+s.data.id,u=t.getElementById(l);o[l]=!0,0!==u.length?i.push({ele:u,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else je("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var c=0;c<i.length;c++){var d=i[c],f=d.ele,h=d.json;f.json(h)}};if(O(e.elements))i(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var l=a[s],u=e.elements[l];O(u)&&i(u,l)}var c=t.collection();r.filter((function(e){return!o[e.id()]})).forEach((function(e){e.isParent()?c.merge(e):e.remove()})),c.forEach((function(e){return e.children().move({parent:null})})),c.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],f=0;f<d.length;f++){var h=d[f];null!=e[h]&&t[h](e[h])}return t.endBatch(),this}var p={};!!e?p.elements=this.elements().map((function(e){return e.json()})):(p.elements={},r.forEach((function(e){var t=e.group();p.elements[t]||(p.elements[t]=[]),p.elements[t].push(e.json())}))),this._private.styleEnabled&&(p.style=t.style().json()),p.data=Ce(t.data());var v=n.options;return p.zoomingEnabled=n.zoomingEnabled,p.userZoomingEnabled=n.userZoomingEnabled,p.zoom=n.zoom,p.minZoom=n.minZoom,p.maxZoom=n.maxZoom,p.panningEnabled=n.panningEnabled,p.userPanningEnabled=n.userPanningEnabled,p.pan=Ce(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=Ce(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p.multiClickDebounceTime=v.multiClickDebounceTime,p}}),sa.$id=sa.getElementById,[Si,Ii,Fi,zi,Vi,Gi,Hi,Wi,ra,oa,ia].forEach((function(e){K(sa,e)}));var la={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},ua=function(e){return e.scratch("breadthfirst")},ca=function(e,t){return e.scratch("breadthfirst",t)};function da(e){this.options=K({},la,e)}da.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,o=n.eles,i=o.nodes().filter((function(e){return!e.isParent()})),a=o,s=n.directed,l=n.maximal||n.maximalAdjustments>0,u=pt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(R(n.roots))e=n.roots;else if(O(n.roots)){for(var c=[],d=0;d<n.roots.length;d++){var f=n.roots[d],h=r.getElementById(f);c.push(h)}e=r.collection(c)}else if(C(n.roots))e=r.$(n.roots);else if(s)e=i.roots();else{var p=o.components();e=r.collection();for(var v=function(t){var n=p[t],r=n.maxDegree(!1),o=n.filter((function(e){return e.degree(!1)===r}));e=e.add(o)},g=0;g<p.length;g++)v(g)}var y=[],m={},b=function(e,t){null==y[t]&&(y[t]=[]);var n=y[t].length;y[t].push(e),ca(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,o){var i=e[0],a=i.id();b(i,o),m[a]=!0}});for(var x=[],w=0;w<i.length;w++){var _=i[w];m[_.id()]||x.push(_)}var E=function(e){for(var t=y[e],n=0;n<t.length;n++){var r=t[n];null!=r?ca(r,{depth:e,index:n}):(t.splice(n,1),n--)}},k=function(){for(var e=0;e<y.length;e++)E(e)},S=function(e,t){for(var n=ua(e),r=e.incomers().filter((function(e){return e.isNode()&&o.has(e)})),i=-1,a=e.id(),s=0;s<r.length;s++){var l=r[s],u=ua(l);i=Math.max(i,u.depth)}return n.depth<=i&&(t[a]?null:(function(e,t){var n=ua(e),r=n.depth,o=n.index;y[r][o]=null,b(e,t)}(e,i+1),t[a]=!0,!0))};if(s&&l){var P=[],j={},T=function(e){return P.push(e)};for(i.forEach((function(e){return P.push(e)}));P.length>0;){var D=P.shift(),N=S(D,j);if(N)D.outgoers().filter((function(e){return e.isNode()&&o.has(e)})).forEach(T);else if(null===N){je("Detected double maximal shift for node `"+D.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}k();var A=0;if(n.avoidOverlap)for(var M=0;M<i.length;M++){var I=i[M].layoutDimensions(n),L=I.w,B=I.h;A=Math.max(A,L,B)}var F={},V=function(e){if(F[e.id()])return F[e.id()];for(var t=ua(e).depth,n=e.neighborhood(),r=0,o=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&i.has(s)){var l=ua(s);if(null!=l){var u=l.index,c=l.depth;if(null!=u&&null!=c){var d=y[c].length;c<t&&(r+=u/d,o++)}}}}return r/=o=Math.max(1,o),0===o&&(r=0),F[e.id()]=r,r},G=function(e,t){var n=V(e)-V(t);return 0===n?$(e.id(),t.id()):n};void 0!==n.depthSort&&(G=n.depthSort);for(var H=0;H<y.length;H++)y[H].sort(G),E(H);for(var W=[],Y=0;Y<x.length;Y++)W.push(x[Y]);y.unshift(W),k();for(var q=0,X=0;X<y.length;X++)q=Math.max(y[X].length,q);var K=u.x1+u.w/2,Z=u.x1+u.h/2,Q=y.reduce((function(e,t){return Math.max(e,t.length)}),0);return o.nodes().layoutPositions(this,n,(function(e){var t=ua(e),r=t.depth,o=t.index,i=y[r].length,a=Math.max(u.w/((n.grid?Q:i)+1),A),s=Math.max(u.h/(y.length+1),A),l=Math.min(u.w/2/y.length,u.h/2/y.length);if(l=Math.max(l,A),n.circle){var c=l*r+l-(y.length>0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*o;return 0===r&&1===y[0].length&&(c=1),{x:K+c*Math.cos(d),y:Z+c*Math.sin(d)}}return{x:K+(o+1-(i+1)/2)*a,y:(r+1)*s}})),this};var fa={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ha(e){this.options=K({},fa,e)}ha.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,o=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var a,s=pt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/i.length:t.sweep)/Math.max(1,i.length-1),d=0,f=0;f<i.length;f++){var h=i[f].layoutDimensions(t),p=h.w,v=h.h;d=Math.max(d,p,v)}if(a=N(t.radius)?t.radius:i.length<=1?0:Math.min(s.h,s.w)/2-d,i.length>1&&t.avoidOverlap){d*=1.75;var g=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(g*g+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(o?1:-1),i=a*Math.cos(r),s=a*Math.sin(r);return{x:l+i,y:u+s}})),this};var pa,va={fit:!0,padding:30,startAngle:1.5*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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ga(e){this.options=K({},va,e)}ga.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,o=t.eles,i=o.nodes().not(":parent"),a=pt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d<i.length;d++){var f,h=i[d];f=t.concentric(h),u.push({value:f,node:h}),h._private.scratch.concentric=f}i.updateStyle();for(var p=0;p<i.length;p++){var v=i[p].layoutDimensions(t);c=Math.max(c,v.w,v.h)}u.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(i),y=[[]],m=y[0],b=0;b<u.length;b++){var x=u[b];if(m.length>0)Math.abs(m[0].value-x.value)>=g&&(m=[],y.push(m));m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var _=y.length>0&&y[0].length>1,E=(Math.min(a.w,a.h)/2-w)/(y.length+_?1:0);w=Math.min(w,E)}for(var k=0,S=0;S<y.length;S++){var P=y[S],j=void 0===t.sweep?2*Math.PI-2*Math.PI/P.length:t.sweep,C=P.dTheta=j/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var T=Math.cos(C)-Math.cos(0),O=Math.sin(C)-Math.sin(0),D=Math.sqrt(w*w/(T*T+O*O));k=Math.max(D,k)}P.r=k,k+=w}if(t.equidistant){for(var N=0,A=0,R=0;R<y.length;R++){var M=y[R].r-A;N=Math.max(N,M)}A=0;for(var I=0;I<y.length;I++){var L=y[I];0===I&&(A=L.r),L.r=A,A+=N}}for(var B={},F=0;F<y.length;F++)for(var V=y[F],G=V.dTheta,H=V.r,W=0;W<V.length;W++){var Y=V[W],q=t.startAngle+(n?1:-1)*G*W,X={x:s+H*Math.cos(q),y:l+H*Math.sin(q)};B[Y.node.id()]=X}return o.nodes().layoutPositions(this,t,(function(e){var t=e.id();return B[t]})),this};var ya={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){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 ma(e){this.options=K({},ya,e),this.options.layout=this}ma.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),pa=!0===e.debug;var r=ba(t,n,e);pa&&undefined(r),e.randomize&&_a(r);var o=ie(),i=function(){ka(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter)&&(Sa(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)i(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),o=Ea(r,e,t);t.layoutPositions(n,e,o)}},l=0,u=!0;if(!0===e.animate){!function t(){for(var n=0;u&&n<e.refresh;)u=a(l),l++,n++;u?(ie()-o>=e.animationThreshold&&i(),oe(t)):(La(r,e),s())}()}else{for(;u;)u=a(l),l++;La(r,e),s()}return this},ma.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ma.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var ba=function(e,t,n){for(var r=n.eles.edges(),o=n.eles.nodes(),i={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:pt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},a=n.eles.components(),s={},l=0;l<a.length;l++)for(var u=a[l],c=0;c<u.length;c++){s[u[c].id()]=l}for(l=0;l<i.nodeSize;l++){var d=(g=o[l]).layoutDimensions(n);(A={}).isLocked=g.locked(),A.id=g.data("id"),A.parentId=g.data("parent"),A.cmptId=s[g.id()],A.children=[],A.positionX=g.position("x"),A.positionY=g.position("y"),A.offsetX=0,A.offsetY=0,A.height=d.w,A.width=d.h,A.maxX=A.positionX+A.width/2,A.minX=A.positionX-A.width/2,A.maxY=A.positionY+A.height/2,A.minY=A.positionY-A.height/2,A.padLeft=parseFloat(g.style("padding")),A.padRight=parseFloat(g.style("padding")),A.padTop=parseFloat(g.style("padding")),A.padBottom=parseFloat(g.style("padding")),A.nodeRepulsion=T(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,i.layoutNodes.push(A),i.idToIndex[A.id]=l}var f=[],h=0,p=-1,v=[];for(l=0;l<i.nodeSize;l++){var g,y=(g=i.layoutNodes[l]).parentId;null!=y?i.layoutNodes[i.idToIndex[y]].children.push(g.id):(f[++p]=g.id,v.push(g.id))}for(i.graphSet.push(v);h<=p;){var m=f[h++],b=i.idToIndex[m],x=i.layoutNodes[b].children;if(x.length>0){i.graphSet.push(x);for(l=0;l<x.length;l++)f[++p]=x[l]}}for(l=0;l<i.graphSet.length;l++){var w=i.graphSet[l];for(c=0;c<w.length;c++){var _=i.idToIndex[w[c]];i.indexToGraph[_]=l}}for(l=0;l<i.edgeSize;l++){var E=r[l],k={};k.id=E.data("id"),k.sourceId=E.data("source"),k.targetId=E.data("target");var S=T(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,P=T(n.edgeElasticity)?n.edgeElasticity(E):n.edgeElasticity,j=i.idToIndex[k.sourceId],C=i.idToIndex[k.targetId];if(i.indexToGraph[j]!=i.indexToGraph[C]){for(var O=xa(k.sourceId,k.targetId,i),D=i.graphSet[O],N=0,A=i.layoutNodes[j];-1===D.indexOf(A.id);)A=i.layoutNodes[i.idToIndex[A.parentId]],N++;for(A=i.layoutNodes[C];-1===D.indexOf(A.id);)A=i.layoutNodes[i.idToIndex[A.parentId]],N++;S*=N*n.nestingFactor}k.idealLength=S,k.elasticity=P,i.layoutEdges.push(k)}return i},xa=function(e,t,n){var r=wa(e,t,0,n);return 2>r.count?0:r.graph},wa=function e(t,n,r,o){var i=o.graphSet[r];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<i.length;s++){var l=i[s],u=o.idToIndex[l],c=o.layoutNodes[u].children;if(0!==c.length){var d=e(t,n,o.indexToGraph[o.idToIndex[c[0]]],o);if(0!==d.count){if(1!==d.count)return d;if(2===++a)break}}}return{count:a,graph:r}},_a=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,o=0;o<e.nodeSize;o++){var i=e.layoutNodes[o];0!==i.children.length||i.isLocked||(i.positionX=Math.random()*n,i.positionY=Math.random()*r)}},Ea=function(e,t,n){var r=e.boundingBox,o={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];o.x1=Math.min(o.x1,n.positionX),o.x2=Math.max(o.x2,n.positionX),o.y1=Math.min(o.y1,n.positionY),o.y2=Math.max(o.y2,n.positionY)})),o.w=o.x2-o.x1,o.h=o.y2-o.y1),function(n,i){var a=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(a.positionX-o.x1)/o.w,l=(a.positionY-o.y1)/o.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}return{x:a.positionX,y:a.positionY}}},ka=function(e,t,n){var r=n.layout,o=n.eles.nodes(),i=Ea(e,n,o);o.positions(i),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},Sa=function(e,t,n){Pa(e,t),Da(e),Na(e,t),Aa(e),Ra(e)},Pa=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],o=r.length,i=0;i<o;i++)for(var a=e.layoutNodes[e.idToIndex[r[i]]],s=i+1;s<o;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];Ca(a,l,e,t)}},ja=function(e){return-e+2*e*Math.random()},Ca=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var o=t.positionX-e.positionX,i=t.positionY-e.positionY;0===o&&0===i&&(o=ja(1),i=ja(1));var a=Ta(e,t,o,i);if(a>0)var s=(u=r.nodeOverlap*a)*o/(v=Math.sqrt(o*o+i*i)),l=u*i/v;else{var u,c=Oa(e,o,i),d=Oa(t,-1*o,-1*i),f=d.x-c.x,h=d.y-c.y,p=f*f+h*h,v=Math.sqrt(p);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/p)*f/v,l=u*h/v}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ta=function(e,t,n,r){if(n>0)var o=e.maxX-t.minX;else o=t.maxX-e.minX;if(r>0)var i=e.maxY-t.minY;else i=t.maxY-e.minY;return o>=0&&i>=0?Math.sqrt(o*o+i*i):0},Oa=function(e,t,n){var r=e.positionX,o=e.positionY,i=e.height||1,a=e.width||1,s=n/t,l=i/a,u={};return 0===t&&0<n||0===t&&0>n?(u.x=r,u.y=o+i/2,u):0<t&&-1*l<=s&&s<=l?(u.x=r+a/2,u.y=o+a*n/2/t,u):0>t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=o-a*n/2/t,u):0<n&&(s<=-1*l||s>=l)?(u.x=r+i*t/2/n,u.y=o+i/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-i*t/2/n,u.y=o-i/2,u):u},Da=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],o=e.idToIndex[r.sourceId],i=e.layoutNodes[o],a=e.idToIndex[r.targetId],s=e.layoutNodes[a],l=s.positionX-i.positionX,u=s.positionY-i.positionY;if(0!==l||0!==u){var c=Oa(i,l,u),d=Oa(s,-1*l,-1*u),f=d.x-c.x,h=d.y-c.y,p=Math.sqrt(f*f+h*h),v=Math.pow(r.idealLength-p,2)/r.elasticity;if(0!==p)var g=v*f/p,y=v*h/p;else g=0,y=0;i.isLocked||(i.offsetX+=g,i.offsetY+=y),s.isLocked||(s.offsetX-=g,s.offsetY-=y)}}},Na=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],o=r.length;if(0===n)var i=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]];i=l.positionX,a=l.positionY}for(var u=0;u<o;u++){var c=e.layoutNodes[e.idToIndex[r[u]]];if(!c.isLocked){var d=i-c.positionX,f=a-c.positionY,h=Math.sqrt(d*d+f*f);if(h>1){var p=t.gravity*d/h,v=t.gravity*f/h;c.offsetX+=p,c.offsetY+=v}}}}},Aa=function(e,t){var n=[],r=0,o=-1;for(n.push.apply(n,e.graphSet[0]),o+=e.graphSet[0].length;r<=o;){var i=n[r++],a=e.idToIndex[i],s=e.layoutNodes[a],l=s.children;if(0<l.length&&!s.isLocked){for(var u=s.offsetX,c=s.offsetY,d=0;d<l.length;d++){var f=e.layoutNodes[e.idToIndex[l[d]]];f.offsetX+=u,f.offsetY+=c,n[++o]=l[d]}s.offsetX=0,s.offsetY=0}}},Ra=function(e,t){for(var n=0;n<e.nodeSize;n++){0<(o=e.layoutNodes[n]).children.length&&(o.maxX=void 0,o.minX=void 0,o.maxY=void 0,o.minY=void 0)}for(n=0;n<e.nodeSize;n++){if(!(0<(o=e.layoutNodes[n]).children.length||o.isLocked)){var r=Ma(o.offsetX,o.offsetY,e.temperature);o.positionX+=r.x,o.positionY+=r.y,o.offsetX=0,o.offsetY=0,o.minX=o.positionX-o.width,o.maxX=o.positionX+o.width,o.minY=o.positionY-o.height,o.maxY=o.positionY+o.height,Ia(o,e)}}for(n=0;n<e.nodeSize;n++){var o;0<(o=e.layoutNodes[n]).children.length&&!o.isLocked&&(o.positionX=(o.maxX+o.minX)/2,o.positionY=(o.maxY+o.minY)/2,o.width=o.maxX-o.minX,o.height=o.maxY-o.minY)}},Ma=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var o={x:n*e/r,y:n*t/r};else o={x:e,y:t};return o},Ia=function e(t,n){var r=t.parentId;if(null!=r){var o=n.layoutNodes[n.idToIndex[r]],i=!1;return(null==o.maxX||t.maxX+o.padRight>o.maxX)&&(o.maxX=t.maxX+o.padRight,i=!0),(null==o.minX||t.minX-o.padLeft<o.minX)&&(o.minX=t.minX-o.padLeft,i=!0),(null==o.maxY||t.maxY+o.padBottom>o.maxY)&&(o.maxY=t.maxY+o.padBottom,i=!0),(null==o.minY||t.minY-o.padTop<o.minY)&&(o.minY=t.minY-o.padTop,i=!0),i?e(o,n):void 0}},La=function(e,t){for(var n=e.layoutNodes,r=[],o=0;o<n.length;o++){var i=n[o],a=i.cmptId;(r[a]=r[a]||[]).push(i)}var s=0;for(o=0;o<r.length;o++){if(v=r[o]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var l=0;l<v.length;l++){var u=v[l];v.x1=Math.min(v.x1,u.positionX-u.width/2),v.x2=Math.max(v.x2,u.positionX+u.width/2),v.y1=Math.min(v.y1,u.positionY-u.height/2),v.y2=Math.max(v.y2,u.positionY+u.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var c=0,d=0,f=0,h=0,p=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(o=0;o<r.length;o++){var v;if(v=r[o]){for(l=0;l<v.length;l++){(u=v[l]).isLocked||(u.positionX+=c-v.x1,u.positionY+=d-v.y1)}c+=v.w+t.componentSpacing,f+=v.w+t.componentSpacing,h=Math.max(h,v.h),f>p&&(d+=h+t.componentSpacing,c=0,f=0,h=0)}}},Ba={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Fa(e){this.options=K({},Ba,e)}Fa.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));var i=pt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===i.h||0===i.w)r.nodes().layoutPositions(this,t,(function(e){return{x:i.x1,y:i.y1}}));else{var a=o.size(),s=Math.sqrt(a*i.h/i.w),l=Math.round(s),u=Math.round(i.w/i.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},f=t.rows,h=null!=t.cols?t.cols:t.columns;if(null!=f&&null!=h)l=f,u=h;else if(null!=f&&null==h)l=f,u=Math.ceil(a/l);else if(null==f&&null!=h)u=h,l=Math.ceil(a/u);else if(u*l>a){var p=c(),v=d();(p-1)*v>=a?c(p-1):(v-1)*p>=a&&d(v-1)}else for(;u*l<a;){var g=c(),y=d();(y+1)*g>=a?d(y+1):c(g+1)}var m=i.w/u,b=i.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<o.length;x++){var w=o[x],_=w._private.position;null!=_.x&&null!=_.y||(_.x=0,_.y=0);var E=w.layoutDimensions(t),k=t.avoidOverlapPadding,S=E.w+k,P=E.h+k;m=Math.max(m,S),b=Math.max(b,P)}for(var j={},C=function(e,t){return!!j["c-"+e+"-"+t]},T=function(e,t){j["c-"+e+"-"+t]=!0},O=0,D=0,N=function(){++D>=u&&(D=0,O++)},A={},R=0;R<o.length;R++){var M=o[R],I=t.position(M);if(I&&(void 0!==I.row||void 0!==I.col)){var L={row:I.row,col:I.col};if(void 0===L.col)for(L.col=0;C(L.row,L.col);)L.col++;else if(void 0===L.row)for(L.row=0;C(L.row,L.col);)L.row++;A[M.id()]=L,T(L.row,L.col)}}o.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var o=A[e.id()];if(o)n=o.col*m+m/2+i.x1,r=o.row*b+b/2+i.y1;else{for(;C(O,D);)N();n=D*m+m/2+i.x1,r=O*b+b/2+i.y1,T(O,D),N()}return{x:n,y:r}}))}return this};var za={ready:function(){},stop:function(){}};function Va(e){this.options=K({},za,e)}Va.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Va.prototype.stop=function(){return this};var Ga={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ua(e){this.options=K({},Ga,e)}Ua.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=T(e.positions);return t.layoutPositions(this,e,(function(t,r){var o=function(t){return null==e.positions?function(e){return{x:e.x,y:e.y}}(t.position()):n?e.positions(t):e.positions[t._private.data.id]??null}(t);return!t.locked()&&null!=o&&o})),this};var Ha={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Wa(e){this.options=K({},Ha,e)}Wa.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var Ya=[{name:"breadthfirst",impl:da},{name:"circle",impl:ha},{name:"concentric",impl:ga},{name:"cose",impl:ma},{name:"grid",impl:Fa},{name:"null",impl:Va},{name:"preset",impl:Ua},{name:"random",impl:Wa}];function qa(e){this.options=e,this.notifications=0}var Xa=function(){},$a=function(){throw new Error("A headless instance can not render images")};qa.prototype={recalculateRenderedStyle:Xa,notify:function(){this.notifications++},init:Xa,isHeadless:function(){return!0},png:$a,jpg:$a};var Ka={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,o,i,a){var s=o.x-n/2-a,l=o.x+n/2+a,u=o.y-n/2-a,c=o.y+n/2+a;return s<=e&&e<=l&&u<=t&&t<=c},r=function(e,t,n,r,o){var i=e*Math.cos(r)-t*Math.sin(r),a=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:i*n+o.x,y:a+o.y}},o=function(e,t,n,o){for(var i=[],a=0;a<e.length;a+=2){var s=e[a],l=e[a+1];i.push(r(s,l,t,n,o))}return i},i=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){C(s)&&(s=e[s]),e[r]=K({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var l=i(o(this.points,n+2*s,r,a));return jt(e,t,l)},roughCollide:n,draw:function(e,n,r,i){var a=o(this.points,n,r,i);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:_e,roughCollide:_e,draw:ke,spacing:Ee,gap:Ee}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,i,a,s){var l=o(this.points,n,i,a),u=this.controlPoint,c=r(u[0],u[1],n,i,a);t.arrowShapeImpl(this.name)(e,l,c)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,l){var u=i(o(this.points,n+2*l,r,a)),c=i(o(this.pointsTee,n+2*l,r,a));return jt(e,t,u)||jt(e,t,c)},draw:function(e,n,r,i,a){var s=o(this.points,n,r,i),l=o(this.pointsTee,n,r,i);t.arrowShapeImpl(this.name)(e,s,l)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,l){var u=a,c=Math.pow(u.x-e,2)+Math.pow(u.y-t,2)<=Math.pow((n+2*l)*this.radius,2),d=i(o(this.points,n+2*l,r,a));return jt(e,t,d)||c},draw:function(e,n,r,i,a){var s=o(this.pointsTr,n,r,i);t.arrowShapeImpl(this.name)(e,s,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,l){var u=i(o(this.points,n+2*l,r,a)),c=i(o(this.crossLinePts(n,s),n+2*l,r,a));return jt(e,t,u)||jt(e,t,c)},draw:function(e,n,r,i,a){var s=o(this.points,n,r,i),l=o(this.crossLinePts(n,a),n,r,i);t.arrowShapeImpl(this.name)(e,s,l)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,o,i,a){var s=o;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,o,i){t.arrowShapeImpl(this.name)(e,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},Za={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),o=r[0],i=r[1],a=r[4],s=n.pan(),l=n.zoom();return[((e-o)/a-s.x)/l,((t-i)/a-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=w.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},o=r("padding-left"),i=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),l=r("border-left-width"),u=r("border-right-width"),c=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth),f=e.clientHeight,h=o+i,p=a+s,v=l+u,g=t.width/(d+v),y=d-h,m=f-p,b=t.left+o+l,x=t.top+a+c;return this.containerBB=[b,x,y,m,g]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var o,i,a=this,s=this,l=s.getCachedZSortedEles(),u=[],c=s.cy.zoom(),d=s.cy.hasCompoundNodes(),f=(r?24:8)/c,h=(r?8:2)/c,p=(r?8:2)/c,v=1/0;function g(e,t){if(e.isNode()){if(i)return;i=e,u.push(e)}if(e.isEdge()&&(null==t||t<v))if(o){if(o.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&o.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<u.length;n++)if(u[n].isEdge()){u[n]=e,o=e,v=null!=t?t:v;break}}else u.push(e),o=e,v=null!=t?t:v}function y(n){var r=n.outerWidth()+2*h,o=n.outerHeight()+2*h,i=r/2,l=o/2,u=n.position();if(u.x-i<=e&&e<=u.x+i&&u.y-l<=t&&t<=u.y+l&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,o,u.x,u.y))return g(n,0),!0}function m(n){var r,o=n._private,i=o.rscratch,l=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,h=l/2+f,p=h*h,v=2*h,m=o.source,b=o.target;if("segments"===i.edgeType||"straight"===i.edgeType||"haystack"===i.edgeType){for(var x=i.allpts,w=0;w+3<x.length;w+=2)if(Et(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&p>(r=Pt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===i.edgeType||"multibezier"===i.edgeType||"self"===i.edgeType||"compound"===i.edgeType)for(x=i.allpts,w=0;w+5<i.allpts.length;w+=4)if(kt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&p>(r=St(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return g(n,r),!0;m=m||o.source,b=b||o.target;var _=a.getArrowWidth(l,c),E=[{name:"source",x:i.arrowStartX,y:i.arrowStartY,angle:i.srcArrowAngle},{name:"target",x:i.arrowEndX,y:i.arrowEndY,angle:i.tgtArrowAngle},{name:"mid-source",x:i.midX,y:i.midY,angle:i.midsrcArrowAngle},{name:"mid-target",x:i.midX,y:i.midY,angle:i.midtgtArrowAngle}];for(w=0;w<E.length;w++){var k=E[w],S=s.arrowShapes[n.pstyle(k.name+"-arrow-shape").value],P=n.pstyle("width").pfValue;if(S.roughCollide(e,t,_,k.angle,{x:k.x,y:k.y},P,f)&&S.collide(e,t,_,k.angle,{x:k.x,y:k.y},P,f))return g(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Me(e,t,n)}function x(n,r){var o,i=n._private,a=p;o=r?r+"-":"",n.boundingBox();var s=i.labelBounds[r||"main"],l=n.pstyle(o+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(i.rscratch,"labelX",r),c=b(i.rscratch,"labelY",r),d=b(i.rscratch,"labelAngle",r),f=n.pstyle(o+"text-margin-x").pfValue,h=n.pstyle(o+"text-margin-y").pfValue,v=s.x1-a-f,y=s.x2+a-f,m=s.y1-a-h,x=s.y2+a-h;if(d){var w=Math.cos(d),_=Math.sin(d),E=function(e,t){return{x:(e-=u)*w-(t-=c)*_+u,y:e*_+t*w+c}},k=E(v,m),S=E(v,x),P=E(y,m),j=E(y,x),C=[k.x+f,k.y+h,P.x+f,P.y+h,j.x+f,j.y+h,S.x+f,S.y+h];if(jt(e,t,C))return g(n),!0}else if(xt(s,e,t))return g(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var _=l[w];_.isNode()?y(_)||x(_):m(_)||x(_)||x(_,"source")||x(_,"target")}return u},getAllInBox:function(e,t,n,r){for(var o,i,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),f=pt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),h=0;h<a.length;h++){var p=a[h];if(p.isNode()){var v=p,g=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});bt(f,g)&&!wt(g,f)&&s.push(v)}else{var y=p,m=y._private,b=m.rscratch;if(null!=b.startX&&null!=b.startY&&!xt(f,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!xt(f,b.endX,b.endY))continue;if("bezier"===b.edgeType||"multibezier"===b.edgeType||"self"===b.edgeType||"compound"===b.edgeType||"segments"===b.edgeType||"haystack"===b.edgeType){for(var x=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,_=0;_<x.length;_++)if(o=f,i=x[_],!xt(o,i.x,i.y)){w=!1;break}w&&s.push(y)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(y)}}return s}},Qa={calculateArrowAngles:function(e){var t,n,r,o,i,a,s=e._private.rscratch,l="haystack"===s.edgeType,u="bezier"===s.edgeType,c="multibezier"===s.edgeType,d="segments"===s.edgeType,f="compound"===s.edgeType,h="self"===s.edgeType;if(l?(r=s.haystackPts[0],o=s.haystackPts[1],i=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,o=s.arrowStartY,i=s.arrowEndX,a=s.arrowEndY),v=s.midX,g=s.midY,d)t=r-s.segpts[0],n=o-s.segpts[1];else if(c||f||h||u){var p=s.allpts;t=r-dt(p[0],p[2],p[4],.1),n=o-dt(p[1],p[3],p[5],.1)}else t=r-v,n=o-g;s.srcArrowAngle=it(t,n);var v=s.midX,g=s.midY;if(l&&(v=(r+i)/2,g=(o+a)/2),t=i-r,n=a-o,d)if((p=s.allpts).length/2%2==0){var y=(m=p.length/2)-2;t=p[m]-p[y],n=p[m+1]-p[y+1]}else{y=(m=p.length/2-1)-2;var m,b=m+2;t=p[m]-p[y],n=p[m+1]-p[y+1]}else if(c||f||h){var x,w,_,E,p=s.allpts;if(s.ctrlpts.length/2%2==0){var k=(S=(P=p.length/2-1)+2)+2;x=dt(p[P],p[S],p[k],0),w=dt(p[P+1],p[S+1],p[k+1],0),_=dt(p[P],p[S],p[k],1e-4),E=dt(p[P+1],p[S+1],p[k+1],1e-4)}else{var S,P;k=(S=p.length/2-1)+2;x=dt(p[P=S-2],p[S],p[k],.4999),w=dt(p[P+1],p[S+1],p[k+1],.4999),_=dt(p[P],p[S],p[k],.5),E=dt(p[P+1],p[S+1],p[k+1],.5)}t=_-x,n=E-w}(s.midtgtArrowAngle=it(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d)&&((p=s.allpts).length/2%2==0||(t=-(p[b=(m=p.length/2-1)+2]-p[m]),n=-(p[b+1]-p[m+1])));if(s.midsrcArrowAngle=it(t,n),d)t=i-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(c||f||h||u){var j=(p=s.allpts).length;t=i-dt(p[j-6],p[j-4],p[j-2],.9),n=a-dt(p[j-5],p[j-3],p[j-1],.9)}else t=i-v,n=a-g;s.tgtArrowAngle=it(t,n)}};Qa.getArrowWidth=Qa.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var Ja={};function es(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t.push({x:r,y:o})}return t}}Ja.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,o=r.rscratch;if(!o.haystack){var i=2*Math.random()*Math.PI;o.source={x:Math.cos(i),y:Math.sin(i)},i=2*Math.random()*Math.PI,o.target={x:Math.cos(i),y:Math.sin(i)}}var a=r.source,s=r.target,l=a.position(),u=s.position(),c=a.width(),d=s.width(),f=a.height(),h=s.height(),p=n.pstyle("haystack-radius").value/2;o.haystackPts=o.allpts=[o.source.x*c*p+l.x,o.source.y*f*p+l.y,o.target.x*d*p+u.x,o.target.y*h*p+u.y],o.midX=(o.allpts[0]+o.allpts[2])/2,o.midY=(o.allpts[1]+o.allpts[3])/2,o.edgeType="haystack",o.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Ja.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,o=t.intersectionPts,i=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),l=e.pstyle("segment-distances"),u=Math.min(s.pfValue.length,l.pfValue.length);n.edgeType="segments",n.segpts=[];for(var c=0;c<u;c++){var d=s.pfValue[c],f=l.pfValue[c],h=1-d,p=d,v="node-position"===a?r:o,g={x:v.x1*h+v.x2*p,y:v.y1*h+v.y2*p};n.segpts.push(g.x+i.x*f,g.y+i.y*f)}},Ja.findLoopPoints=function(e,t,n,r){var o=e._private.rscratch,i=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;o.edgeType="self";var f=n,h=d;r&&(f=0,h=l);var p=u-Math.PI/2,v=p-c/2,g=p+c/2,y=String(u+"_"+c);f=void 0===i[y]?i[y]=0:++i[y],o.ctrlpts=[a.x+1.4*Math.cos(v)*h*(f/3+1),a.y+1.4*Math.sin(v)*h*(f/3+1),a.x+1.4*Math.cos(g)*h*(f/3+1),a.y+1.4*Math.sin(g)*h*(f/3+1)]},Ja.findCompoundLoopPoints=function(e,t,n,r){var o=e._private.rscratch;o.edgeType="compound";var i=t.srcPos,a=t.tgtPos,s=t.srcW,l=t.srcH,u=t.tgtW,c=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,f=e.pstyle("control-point-distances"),h=f?f.pfValue[0]:void 0,p=n,v=d;r&&(p=0,v=h);var g={x:i.x-s/2,y:i.y-l/2},y={x:a.x-u/2,y:a.y-c/2},m={x:Math.min(g.x,y.x),y:Math.min(g.y,y.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*u));o.ctrlpts=[m.x,m.y-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*b,m.x-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*x,m.y]},Ja.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Ja.findBezierPoints=function(e,t,n,r,o){var i=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,l=t.intersectionPts,u=e.pstyle("edge-distances").value,c=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),f=e.pstyle("control-point-weights"),h=d&&f?Math.min(d.value.length,f.value.length):1,p=d?d.pfValue[0]:void 0,v=f.value[0],g=r;i.edgeType=g?"multibezier":"bezier",i.ctrlpts=[];for(var y=0;y<h;y++){var m=(.5-t.eles.length/2+n)*c*(o?-1:1),b=void 0,x=st(m);g&&(p=d?d.pfValue[y]:c,v=f.value[y]);var w=void 0!==(b=r?p:void 0!==p?x*p:void 0)?b:m,_=1-v,E=v,k="node-position"===u?s:l,S={x:k.x1*_+k.x2*E,y:k.y1*_+k.y2*E};i.ctrlpts.push(S.x+a.x*w,S.y+a.y*w)}},Ja.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",o="horizontal",i="leftward",a="rightward",s="downward",l="upward",u=t.posPts,c=t.srcW,d=t.srcH,f=t.tgtW,h=t.tgtH,p="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,g=v,y=e.pstyle("taxi-turn"),m="%"===y.units,b=y.pfValue,x=b<0,w=e.pstyle("taxi-turn-min-distance").pfValue,_=p?(c+f)/2:0,E=p?(d+h)/2:0,k=u.x2-u.x1,S=u.y2-u.y1,P=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},j=P(k,_),C=P(S,E),T=!1;"auto"===g?v=Math.abs(j)>Math.abs(C)?o:r:g===l||g===s?(v=r,T=!0):g!==i&&g!==a||(v=o,T=!0);var O,D=v===r,N=D?C:j,A=D?S:k,R=st(A),M=!1;(T&&(m||x)||!(g===s&&A<0||g===l&&A>0||g===i&&A>0||g===a&&A<0)||(N=(R*=-1)*Math.abs(N),M=!0),m)?O=(b<0?1+b:b)*N:O=(b<0?N:0)+b*R;var I=function(e){return Math.abs(e)<w||Math.abs(e)>=Math.abs(N)},L=I(O),B=I(Math.abs(N)-Math.abs(O));if((L||B)&&!M)if(D){var F=Math.abs(A)<=d/2,V=Math.abs(k)<=f/2;if(F){var G=(u.x1+u.x2)/2,H=u.y1,W=u.y2;n.segpts=[G,H,G,W]}else if(V){var Y=(u.y1+u.y2)/2,q=u.x1,X=u.x2;n.segpts=[q,Y,X,Y]}else n.segpts=[u.x1,u.y2]}else{var $=Math.abs(A)<=c/2,K=Math.abs(S)<=h/2;if($){var Z=(u.y1+u.y2)/2,Q=u.x1,J=u.x2;n.segpts=[Q,Z,J,Z]}else if(K){var ee=(u.x1+u.x2)/2,te=u.y1,ne=u.y2;n.segpts=[ee,te,ee,ne]}else n.segpts=[u.x2,u.y1]}else if(D){var re=u.y1+O+(p?d/2*R:0),oe=u.x1,ie=u.x2;n.segpts=[oe,re,ie,re]}else{var ae=u.x1+O+(p?c/2*R:0),se=u.y1,le=u.y2;n.segpts=[ae,se,ae,le]}},Ja.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,o=t.tgtPos,i=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=!N(n.startX)||!N(n.startY),f=!N(n.arrowStartX)||!N(n.arrowStartY),h=!N(n.endX)||!N(n.endY),p=!N(n.arrowEndX)||!N(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),g=lt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=g<v,m=lt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<v,x=!1;if(d||f||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(w.x*w.x+w.y*w.y),E={x:w.x/_,y:w.y/_},k=Math.max(i,a),S={x:n.ctrlpts[0]+2*E.x*k,y:n.ctrlpts[1]+2*E.y*k},P=u.intersectLine(r.x,r.y,i,a,S.x,S.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+E.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+E.y*(v-g)):(n.ctrlpts[0]=P[0]+E.x*v,n.ctrlpts[1]=P[1]+E.y*v)}if(h||p||b){x=!0;var j={x:n.ctrlpts[0]-o.x,y:n.ctrlpts[1]-o.y},C=Math.sqrt(j.x*j.x+j.y*j.y),T={x:j.x/C,y:j.y/C},O=Math.max(i,a),D={x:n.ctrlpts[0]+2*T.x*O,y:n.ctrlpts[1]+2*T.y*O},A=c.intersectLine(o.x,o.y,s,l,D.x,D.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(v-m),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(v-m)):(n.ctrlpts[0]=A[0]+T.x*v,n.ctrlpts[1]=A[1]+T.y*v)}x&&this.findEndpoints(e)}},Ja.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,.5,t.midX=dt(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=dt(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var o=t.segpts.length/2,i=o-2;t.midX=(t.segpts[i]+t.segpts[o])/2,t.midY=(t.segpts[i+1]+t.segpts[o+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},Ja.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||N(t.startX)&&N(t.startY)&&N(t.endX)&&N(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,je("Edge `"+e.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."))},Ja.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),o={map:new Le,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Le,this.map.set(e[0],n)),n.set(e[1],t)}},i=[],a=[],s=0;s<e.length;s++){var l=e[s],u=l._private,c=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace())if("haystack"!==c){var d="unbundled-bezier"===c||"segments"===c||"straight"===c||"straight-triangle"===c||"taxi"===c,f="unbundled-bezier"===c||"bezier"===c,h=u.source,p=u.target,v=[h.poolIndex(),p.poolIndex()].sort(),g=o.get(v);null==g&&(g={eles:[]},o.set(v,g),i.push(v)),g.eles.push(l),d&&(g.hasUnbundled=!0),f&&(g.hasBezier=!0)}else a.push(l)}for(var y=function(e){var a=i[e],s=o.get(a),l=void 0;if(!s.hasUnbundled){var u=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));Re(s.eles),u.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=s.eles[0],d=c.source(),f=c.target();if(d.poolIndex()>f.poolIndex()){var h=d;d=f,f=h}var p=s.srcPos=d.position(),v=s.tgtPos=f.position(),g=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=f.outerWidth(),b=s.tgtH=f.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(f)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_<s.eles.length;_++){var E=s.eles[_],k=E[0]._private.rscratch,S=E.pstyle("curve-style").value,P="unbundled-bezier"===S||"segments"===S||"taxi"===S,j=!d.same(E.source());if(!s.calculatedIntersection&&d!==f&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var C=x.intersectLine(p.x,p.y,g,y,v.x,v.y,0),T=s.srcIntn=C,O=w.intersectLine(v.x,v.y,m,b,p.x,p.y,0),D=s.tgtIntn=O,A=s.intersectionPts={x1:C[0],x2:O[0],y1:C[1],y2:O[1]},R=s.posPts={x1:p.x,x2:v.x,y1:p.y,y2:v.y},M=O[1]-C[1],I=O[0]-C[0],L=Math.sqrt(I*I+M*M),B=s.vector={x:I,y:M},F=s.vectorNorm={x:B.x/L,y:B.y/L},V={x:-F.y,y:F.x};s.nodesOverlap=!N(L)||w.checkPoint(C[0],C[1],0,m,b,v.x,v.y)||x.checkPoint(O[0],O[1],0,g,y,p.x,p.y),s.vectorNormInverse=V,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:v,tgtPos:p,srcW:m,srcH:b,tgtW:g,tgtH:y,srcIntn:D,tgtIntn:T,srcShape:w,tgtShape:x,posPts:{x1:R.x2,y1:R.y2,x2:R.x1,y2:R.y1},intersectionPts:{x1:A.x2,y1:A.y2,x2:A.x1,y2:A.y1},vector:{x:-B.x,y:-B.y},vectorNorm:{x:-F.x,y:-F.y},vectorNormInverse:{x:-V.x,y:-V.y}}}var G=j?l:s;k.nodesOverlap=G.nodesOverlap,k.srcIntn=G.srcIntn,k.tgtIntn=G.tgtIntn,r&&(d.isParent()||d.isChild()||f.isParent()||f.isChild())&&(d.parents().anySame(f)||f.parents().anySame(d)||d.same(f)&&d.isParent())?t.findCompoundLoopPoints(E,G,_,P):d===f?t.findLoopPoints(E,G,_,P):"segments"===S?t.findSegmentsPoints(E,G):"taxi"===S?t.findTaxiPoints(E,G):"straight"===S||!P&&s.eles.length%2==1&&_===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(E):t.findBezierPoints(E,G,_,P,j),t.findEndpoints(E),t.tryToCorrectInvalidPoints(E,G),t.checkForInvalidEdgeWarning(E),t.storeAllpts(E),t.storeEdgeProjections(E),t.calculateArrowAngles(E),t.recalculateEdgeLabelProjections(E),t.calculateLabelAngles(E)}},m=0;m<i.length;m++)y(m);this.findHaystackPoints(a)}},Ja.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),es(t.segpts)},Ja.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),es(t.ctrlpts)},Ja.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var ts={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),o=e.outerHeight();if(2===t.value.length){var i=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(i[0]=i[0]*r),"%"===t.units[1]&&(i[1]=i[1]*o),i[0]+=n.x,i[1]+=n.y,i}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,o),l=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,o,l[0],l[1],0)},findEndpoints:function(e){var t,n,r,o,i,a=this,s=e.source()[0],l=e.target()[0],u=s.position(),c=l.position(),d=e.pstyle("target-arrow-shape").value,f=e.pstyle("source-arrow-shape").value,h=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,y=g.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,_="segments"===y,E=b||x||w,k=m||"taxi"===v,S=e.pstyle("source-endpoint"),P=k?"outside-to-node":S.value,j=e.pstyle("target-endpoint"),C=k?"outside-to-node":j.value;if(g.srcManEndpt=S,g.tgtManEndpt=j,b){var T=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:T,r=T}else if(w){var O=_?g.segpts.slice(0,2):[c.x,c.y];n=_?g.segpts.slice(g.segpts.length-2):[u.x,u.y],r=O}if("inside-to-node"===C)t=[c.x,c.y];else if(j.units)t=this.manualEndptToPx(l,j);else if("outside-to-line"===C)t=g.tgtIntn;else if("outside-to-node"===C||"outside-to-node-or-label"===C?o=n:"outside-to-line"!==C&&"outside-to-line-or-label"!==C||(o=[u.x,u.y]),t=a.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===C||"outside-to-line-or-label"===C){var D=l._private.rscratch,A=D.labelWidth,R=D.labelHeight,M=D.labelX,I=D.labelY,L=A/2,B=R/2,F=l.pstyle("text-valign").value;"top"===F?I-=B:"bottom"===F&&(I+=B);var V=l.pstyle("text-halign").value;"left"===V?M-=L:"right"===V&&(M+=L);var G=Mt(o[0],o[1],[M-L,I-B,M+L,I-B,M+L,I+B,M-L,I+B],c.x,c.y);if(G.length>0){var H=u,W=ut(H,ot(t)),Y=ut(H,ot(G)),q=W;if(Y<W&&(t=G,q=Y),G.length>2)ut(H,{x:G[2],y:G[3]})<q&&(t=[G[2],G[3]])}}var X=It(t,n,a.arrowShapes[d].spacing(e)+h),$=It(t,n,a.arrowShapes[d].gap(e)+h);if(g.endX=$[0],g.endY=$[1],g.arrowEndX=X[0],g.arrowEndY=X[1],"inside-to-node"===P)t=[u.x,u.y];else if(S.units)t=this.manualEndptToPx(s,S);else if("outside-to-line"===P)t=g.srcIntn;else if("outside-to-node"===P||"outside-to-node-or-label"===P?i=r:"outside-to-line"!==P&&"outside-to-line-or-label"!==P||(i=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===P||"outside-to-line-or-label"===P){var K=s._private.rscratch,Z=K.labelWidth,Q=K.labelHeight,J=K.labelX,ee=K.labelY,te=Z/2,ne=Q/2,re=s.pstyle("text-valign").value;"top"===re?ee-=ne:"bottom"===re&&(ee+=ne);var oe=s.pstyle("text-halign").value;"left"===oe?J-=te:"right"===oe&&(J+=te);var ie=Mt(i[0],i[1],[J-te,ee-ne,J+te,ee-ne,J+te,ee+ne,J-te,ee+ne],u.x,u.y);if(ie.length>0){var ae=c,se=ut(ae,ot(t)),le=ut(ae,ot(ie)),ue=se;if(le<se&&(t=[ie[0],ie[1]],ue=le),ie.length>2)ut(ae,{x:ie[2],y:ie[3]})<ue&&(t=[ie[2],ie[3]])}}var ce=It(t,r,a.arrowShapes[f].spacing(e)+p),de=It(t,r,a.arrowShapes[f].gap(e)+p);g.startX=de[0],g.startY=de[1],g.arrowStartX=ce[0],g.arrowStartY=ce[1],E&&(N(g.startX)&&N(g.startY)&&N(g.endX)&&N(g.endY)?g.badLine=!1:g.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},ns={};function rs(e,t,n){for(var r=function(e,t,n,r){return dt(e,t,n,r)},o=t._private.rstyle.bezierPts,i=0;i<e.bezierProjPcts.length;i++){var a=e.bezierProjPcts[i];o.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}ns.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var o=0;o+5<n.allpts.length;o+=4)rs(this,e,n.allpts.slice(o,o+6))}else if("segments"===r){var i=t.rstyle.linePts=[];for(o=0;o+1<n.allpts.length;o+=2)i.push({x:n.allpts[o],y:n.allpts[o+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},ns.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var os={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!F(t)){var n,r,o=e._private,i=e.width(),a=e.height(),s=e.padding(),l=e.position(),u=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,d=o.rscratch,f=o.rstyle;switch(u){case"left":n=l.x-i/2-s;break;case"right":n=l.x+i/2+s;break;default:n=l.x}switch(c){case"top":r=l.y-a/2-s;break;case"bottom":r=l.y+a/2+s;break;default:r=l.y}d.labelX=n,d.labelY=r,f.labelX=n,f.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},is=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},as=function(e,t){var n=t.x-e.x,r=t.y-e.y;return is(n,r)};os.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,o=this,i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target){t={x:r.midX,y:r.midY};var a=function(e,t,r){Ie(n.rscratch,e,t,r),Ie(n.rstyle,e,t,r)};a("labelX",null,t.x),a("labelY",null,t.y);var s=is(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var l=function e(){if(e.cache)return e.cache;for(var t=[],i=0;i+5<r.allpts.length;i+=4){var a={x:r.allpts[i],y:r.allpts[i+1]},s={x:r.allpts[i+2],y:r.allpts[i+3]},l={x:r.allpts[i+4],y:r.allpts[i+5]};t.push({p0:a,p1:s,p2:l,startDist:0,length:0,segments:[]})}var u=n.rstyle.bezierPts,c=o.bezierProjPcts.length;function d(e,t,n,r,o){var i=lt(t,n),a=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:o,startDist:a?a.startDist+a.length:0,length:i};e.segments.push(s),e.length+=i}for(var f=0;f<t.length;f++){var h=t[f],p=t[f-1];p&&(h.startDist=p.startDist+p.length),d(h,h.p0,u[f*c],0,o.bezierProjPcts[0]);for(var v=0;v<c-1;v++)d(h,u[f*c+v],u[f*c+v+1],o.bezierProjPcts[v],o.bezierProjPcts[v+1]);d(h,u[f*c+c-1],h.p2,o.bezierProjPcts[c-1],1)}return e.cache=t},u=function(n){var o,s="source"===n;if(i[n]){var u=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var c,d=l(),f=0,h=0,p=0;p<d.length;p++){for(var v=d[s?p:d.length-1-p],g=0;g<v.segments.length;g++){var y=v.segments[s?g:v.segments.length-1-g],m=p===d.length-1&&g===v.segments.length-1;if(f=h,(h+=y.length)>=u||m){c={cp:v,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-f)/x.length,_=x.t1-x.t0,E=s?x.t0+_*w:x.t1-_*w;E=ht(0,E,1),t=ft(b.p0,b.p1,b.p2,E),o=function(e,t,n,r){var o=ht(0,r-.001,1),i=ht(0,r+.001,1),a=ft(e,t,n,o),s=ft(e,t,n,i);return as(a,s)}(b.p0,b.p1,b.p2,E);break;case"straight":case"segments":case"haystack":for(var k,S,P,j,C=0,T=r.allpts.length,O=0;O+3<T&&(s?(P={x:r.allpts[O],y:r.allpts[O+1]},j={x:r.allpts[O+2],y:r.allpts[O+3]}):(P={x:r.allpts[T-2-O],y:r.allpts[T-1-O]},j={x:r.allpts[T-4-O],y:r.allpts[T-3-O]}),S=C,!((C+=k=lt(P,j))>=u));O+=2);var D=(u-S)/k;D=ht(0,D,1),t=function(e,t,n,r){var o=t.x-e.x,i=t.y-e.y,a=lt(e,t),s=o/a,l=i/a;return n=n??0,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(P,j,D),o=as(P,j)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,o)}};u("source"),u("target"),this.applyLabelDimensions(e)}},os.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},os.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),o=this.calculateLabelDimensions(e,r),i=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Me(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=o.height/l,c=u*i,d=o.width,f=o.height+(l-1)*(i-1)*u;Ie(n.rstyle,"labelWidth",t,d),Ie(n.rscratch,"labelWidth",t,d),Ie(n.rstyle,"labelHeight",t,f),Ie(n.rscratch,"labelHeight",t,f),Ie(n.rscratch,"labelLineHeight",t,c)},os.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",o=e.pstyle(r+"label").strValue,i=e.pstyle("text-transform").value,a=function(e,r){return r?(Ie(n.rscratch,e,t,r),r):Me(n.rscratch,e,t)};if(!o)return"";"none"==i||("uppercase"==i?o=o.toUpperCase():"lowercase"==i&&(o=o.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=o.split("\n"),c=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,f=[],h=/[\s\u200b]+/,p=d?"":" ",v=0;v<u.length;v++){var g=u[v],y=this.calculateLabelDimensions(e,g).width;if(d){var m=g.split("").join("\u200b");g=m}if(y>c){for(var b=g.split(h),x="",w=0;w<b.length;w++){var _=b[w],E=0===x.length?_:x+p+_;this.calculateLabelDimensions(e,E).width<=c?x+=_+p:(x&&f.push(x),x=_+p)}x.match(/^[\s\u200b]+$/)||f.push(x)}else f.push(g)}a("labelWrapCachedLines",f),o=a("labelWrapCachedText",f.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var k=e.pstyle("text-max-width").pfValue,S="",P=!1;if(this.calculateLabelDimensions(e,o).width<k)return o;for(var j=0;j<o.length;j++){if(this.calculateLabelDimensions(e,S+o[j]+"\u2026").width>k)break;S+=o[j],j===o.length-1&&(P=!0)}return P||(S+="\u2026"),S}return o},os.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},os.calculateLabelDimensions=function(e,t){var n=pe(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),o=r[n];if(null!=o)return o;var i=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,l=e.pstyle("font-weight").strValue,u=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=u.getContext("2d");var d=u.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}c.font="".concat(i," ").concat(l," ").concat(a,"px ").concat(s);for(var f=0,h=0,p=t.split("\n"),v=0;v<p.length;v++){var g=p[v],y=c.measureText(g),m=Math.ceil(y.width),b=a;f=Math.max(m,f),h+=b}return f+=0,h+=0,r[n]={width:f,height:h}},os.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),o=t?t+"-":"",i=e.pstyle(o+"text-rotation"),a=i.strValue;return"none"===a?0:r&&"autorotate"===a?n.labelAutoAngle:"autorotate"===a?0:i.pfValue},os.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var ss={},ls=!1;ss.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return ls||(je("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),ls=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var us={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var o=e[r],i=o._private,a=i.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var o=function(o){if(o){var i=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(i)for(var u=0;u<i.length;u++){(0,i[u])(o,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){o(!0)},n.beforeRender(o,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],o=[];if(!this.destroyed){void 0===t&&(t=!0);for(var i=0;i<e.length;i++){var a=e[i],s=a._private,l=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(l.clean=!1),t&&l.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?o.push(a):r.push(a),l.clean=!0)}for(var u=0;u<o.length;u++){var c=o[u],d=c._private.rstyle,f=c.position();this.recalculateNodeLabelProjection(c),d.nodeX=f.x,d.nodeY=f.y,d.nodeW=c.pstyle("width").pfValue,d.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var h=0;h<r.length;h++){var p=r[h]._private,v=p.rstyle,g=p.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},cs={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(o=e[n])._private.rscratch;o.grabbed()&&!o.isParent()?t.push(o):r.inDragLayer?e.drag.push(o):e.nondrag.push(o)}for(n=0;n<t.length;n++){var o=t[n];e.drag.push(o)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Zo),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},ds={};[Za,Qa,Ja,ts,ns,os,ss,us,cs].forEach((function(e){K(ds,e)}));var fs={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},o=r[e];if(o)return o.image.complete||o.image.addEventListener("load",n),o.image;var i=(o=r[e]=r[e]||{}).image=new Image;i.addEventListener("load",n),i.addEventListener("error",(function(){i.error=!0}));var a="data:";return e.substring(0,a.length).toLowerCase()===a||(i.crossOrigin=t),i.src=e,i}},hs={registerBinding:function(e,t,n,r){var o=Array.prototype.slice.apply(arguments,[1]),i=this.binder(e);return i.on.apply(i,o)}};hs.binder=function(e){var t,n=this,r=e===window||e===document||e===document.body||(t=e,"undefined"!=typeof HTMLElement&&t instanceof HTMLElement);if(null==n.supportsPassiveEvents){var o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return o=!0,!0}});window.addEventListener("test",null,i)}catch(s){}n.supportsPassiveEvents=o}var a=function(t,o,i){var a=Array.prototype.slice.call(arguments);return r&&n.supportsPassiveEvents&&(a[2]={capture:null!=i&&i,passive:!1,once:!1}),n.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:a,addEventListener:a,addListener:a,bind:a}},hs.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},hs.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},hs.load=function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,o){null==t&&(t=e.cy);for(var i=0;i<n.length;i++){var a=n[i];t.emit({originalEvent:r,type:a,position:o})}},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var o=0;n&&o<n.length;o++){if((t=n[o]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},i=function(e){e[0]._private.rscratch.inDragLayer=!0},a=function(e){e[0]._private.rscratch.isGrabTarget=!0},s=function(e,t){var n=t.addToList;n.has(e)||!e.grabbable()||e.locked()||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},l=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(i),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(i)),n.addToList&&t.forEach((function(e){s(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(i),n.connectedEdges().forEach(i)),t.addToList&&s(n,t)}}(t,n),f(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},c=l,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},f=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),o=r.connectedEdges();t.inDragLayer&&(o.forEach(i),r.forEach(i)),t.addToList&&r.forEach((function(e){s(e,t)}))}}},h=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},p="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;p?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var o=0;o<r.length;o++){if(r[o]===e.container){e.destroy();break}}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=u.default((function(){e.cy.resize()}),100);p&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var y=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",y),e.registerBinding(t,"animationend",y),e.registerBinding(t,"scroll",y)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var m,b,x,w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],o=n[1],i=n[2],a=n[3],s=t.touches?t.touches:[t],l=!1,u=0;u<s.length;u++){var c=s[u];if(r<=c.clientX&&c.clientX<=r+i&&o<=c.clientY&&c.clientY<=o+a){l=!0;break}}if(!l)return!1;for(var d=e.container,f=t.target.parentNode,h=!1;f;){if(f===d){h=!0;break}f=f.parentNode}return!!h};e.registerBinding(e.container,"mousedown",(function(t){if(w(t)){t.preventDefault(),h(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,o=[t.clientX,t.clientY],i=e.projectIntoViewport(o[0],o[1]),s=e.selection,u=e.findNearestElements(i[0],i[1],!0,!1),d=u[0],f=e.dragData.possibleDragElements;e.hoverData.mdownPos=i,e.hoverData.mdownGPos=o;if(3==t.which){e.hoverData.cxtStarted=!0;var p={originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}};d?(d.activate(),d.emit(p),e.hoverData.down=d):r.emit(p),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};if(a(d),d.selected()){f=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(g,{addToList:f}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else f=e.dragData.possibleDragElements=r.collection(),c(d,{addToList:f}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=u,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==d?(s[4]=1,e.data.bgActivePosistion={x:i[0],y:i[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(s[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:i[0],y:i[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:i[0],y:i[1]}})}}),e.tapholdDuration)}s[0]=s[2]=i[0],s[1]=s[3]=i[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var i=!1,a=e.cy,s=a.zoom(),u=[t.clientX,t.clientY],c=e.projectIntoViewport(u[0],u[1]),f=e.hoverData.mdownPos,h=e.hoverData.mdownGPos,p=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(c[0],c[1],!0,!1));var g,y=e.hoverData.last,m=e.hoverData.down,b=[c[0]-p[2],c[1]-p[3]],x=e.dragData.possibleDragElements;if(h){var _=u[0]-h[0],E=_*_,k=u[1]-h[1],S=E+k*k;e.hoverData.isOverThresholdDrag=g=S>=e.desktopTapThreshold2}var P=r(t);g&&(e.hoverData.tapholdCancelled=!0);i=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var j=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),p[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var C={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};m?m.emit(C):a.emit(C),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(i=!0,a.panningEnabled()&&a.userPanningEnabled()){var T;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;T={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else T={x:b[0]*s,y:b[1]*s};a.panBy(T),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=p[4]||null!=m&&!m.pannable()){if(m&&m.pannable()&&m.active()&&m.unactivate(),m&&m.grabbed()||v==y||(y&&n(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=v),m)if(g){if(a.boxSelectionEnabled()&&P)m&&m.grabbed()&&(d(x),m.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(m.emit("dragfreeon"),x.emit("dragfree"))),j();else if(m&&m.grabbed()&&e.nodeIsDraggable(m)){var D=!e.dragData.didDrag;D&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||l(x,{inDragLayer:!0});var A={x:0,y:0};if(N(b[0])&&N(b[1])&&(A.x+=b[0],A.y+=b[1],D)){var R=e.hoverData.dragDelta;R&&N(R[0])&&N(R[1])&&(A.x+=R[0],A.y+=R[1])}e.hoverData.draggingEles=!0,x.silentShift(A).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();i=!0}else if(g){if(e.hoverData.dragging||!a.boxSelectionEnabled()||!P&&a.panningEnabled()&&a.userPanningEnabled()){if(!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()){o(m,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=ot(f),e.redrawHint("select",!0),e.redraw())}}else j();m&&m.pannable()&&m.active()&&m.unactivate()}return p[2]=c[0],p[3]=c[1],i?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(o){if(e.hoverData.capture){e.hoverData.capture=!1;var i=e.cy,a=e.projectIntoViewport(o.clientX,o.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,f=r(o);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var h={originalEvent:o,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(h):i.emit(h),!e.hoverData.cxtDragged){var p={originalEvent:o,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(p):i.emit(p)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(l,["mouseup","tapend","vmouseup"],o,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(n(c,["click","tap","vclick"],o,{x:a[0],y:a[1]}),b=!1,o.timeStamp-x<=i.multiClickDebounceTime()?(m&&clearTimeout(m),b=!0,x=null,n(c,["dblclick","dbltap","vdblclick"],o,{x:a[0],y:a[1]})):(m=setTimeout((function(){b||n(c,["oneclick","onetap","voneclick"],o,{x:a[0],y:a[1]})}),i.multiClickDebounceTime()),x=o.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(o)||(i.$(t).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=i.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===i.selectionType()||f?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):f||(i.$(t).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=i.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),i.emit({type:"boxend",originalEvent:o,position:{x:a[0],y:a[1]}});var g=function(e){return e.selectable()&&!e.selected()};"additive"===i.selectionType()||f||i.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(g).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var y=c&&c.grabbed();d(u),y&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var _,E,k,S,P,j,C,T,O,D,A,R,M,I=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),o=n.pan(),i=e.projectIntoViewport(t.clientX,t.clientY),a=[i[0]*r+o.x,i[1]*r+o.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",I,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||I(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var L,B,F,V,G,H,W,Y=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},q=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",L=function(t){if(e.hasTouchStarted=!0,w(t)){h(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,o=e.touchData.now,i=e.touchData.earlier;if(t.touches[0]){var s=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);o[0]=s[0],o[1]=s[1]}if(t.touches[1]){s=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);o[2]=s[0],o[3]=s[1]}if(t.touches[2]){s=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);o[4]=s[0],o[5]=s[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var u=e.findContainerClientCoords();O=u[0],D=u[1],A=u[2],R=u[3],_=t.touches[0].clientX-O,E=t.touches[0].clientY-D,k=t.touches[1].clientX-O,S=t.touches[1].clientY-D,M=0<=_&&_<=A&&0<=k&&k<=A&&0<=E&&E<=R&&0<=S&&S<=R;var f=r.pan(),p=r.zoom();P=Y(_,E,k,S),j=q(_,E,k,S),T=[((C=[(_+k)/2,(E+S)/2])[0]-f.x)/p,(C[1]-f.y)/p];if(j<4e4&&!t.touches[2]){var v=e.findNearestElement(o[0],o[1],!0,!0),g=e.findNearestElement(o[2],o[3],!0,!0);return v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}}),e.touchData.start=v):g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}}),e.touchData.start=g):r.emit({originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(o[0],o[1],!0,!0),m=y[0];if(null!=m&&(m.activate(),e.touchData.start=m,e.touchData.starts=y,e.nodeIsGrabbable(m))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),m.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(x,{addToList:b})):c(m,{addToList:b}),a(m);var N=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};m.emit(N("grabon")),x?x.forEach((function(e){e.emit(N("grab"))})):m.emit(N("grab"))}n(m,["touchstart","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==m&&(e.data.bgActivePosistion={x:s[0],y:s[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:o[0],y:o[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var I=e.touchData.startPosition=[],L=0;L<o.length;L++)I[L]=i[L]=o[L];var B=t.touches[0];e.touchData.startGPosition=[B.clientX,B.clientY]}}},!1),e.registerBinding(window,"touchmove",B=function(t){var r=e.touchData.capture;if(r||w(t)){var i=e.selection,a=e.cy,s=e.touchData.now,u=e.touchData.earlier,c=a.zoom();if(t.touches[0]){var f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}if(t.touches[1]){f=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=f[0],s[3]=f[1]}if(t.touches[2]){f=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=f[0],s[5]=f[1]}var h,p=e.touchData.startGPosition;if(r&&t.touches[0]&&p){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-u[g];var y=t.touches[0].clientX-p[0],m=y*y,b=t.touches[0].clientY-p[1];h=m+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-O,C=t.touches[0].clientY-D,A=t.touches[1].clientX-O,R=t.touches[1].clientY-D,I=q(x,C,A,R);if(I/j>=2.25||I>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var L={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(L),e.touchData.start=null):a.emit(L)}}if(r&&e.touchData.cxt){L={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(L):a.emit(L),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var B=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&B===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=B,B&&B.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ne=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F<ne.length;F++){var V=ne[F]._private;V.grabbed=!1,V.rscratch.inDragLayer=!1}}var G=e.touchData.start,H=(x=t.touches[0].clientX-O,C=t.touches[0].clientY-D,A=t.touches[1].clientX-O,R=t.touches[1].clientY-D,Y(x,C,A,R)),W=H/P;if(M){var X=(x-_+(A-k))/2,$=(C-E+(R-S))/2,K=a.zoom(),Z=K*W,Q=a.pan(),J=T[0]*K+Q.x,ee=T[1]*K+Q.y,te={x:-Z/K*(J-Q.x-X)+J,y:-Z/K*(ee-Q.y-$)+ee};if(G&&G.active()){var ne=e.dragData.touchDragEles;d(ne),e.redrawHint("drag",!0),e.redrawHint("eles",!0),G.unactivate().emit("freeon"),ne.emit("free"),e.dragData.didDrag&&(G.emit("dragfreeon"),ne.emit("dragfree"))}a.viewport({zoom:Z,pan:te,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),P=H,_=x,E=C,k=A,S=R,e.pinching=!0}if(t.touches[0]){f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}if(t.touches[1]){f=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=f[0],s[3]=f[1]}if(t.touches[2]){f=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=f[0],s[5]=f[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var re=e.touchData.start,oe=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(B=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=re&&t.preventDefault(),r&&null!=re&&e.nodeIsDraggable(re))if(h){ne=e.dragData.touchDragEles;var ie=!e.dragData.didDrag;ie&&l(ne,{inDragLayer:!0}),e.dragData.didDrag=!0;var ae={x:0,y:0};if(N(v[0])&&N(v[1]))if(ae.x+=v[0],ae.y+=v[1],ie)e.redrawHint("eles",!0),(se=e.touchData.dragDelta)&&N(se[0])&&N(se[1])&&(ae.x+=se[0],ae.y+=se[1]);e.hoverData.draggingEles=!0,ne.silentShift(ae).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==u[0]&&e.touchData.startPosition[1]==u[1]&&e.redrawHint("eles",!0),e.redraw()}else{var se;0===(se=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(se.push(v[0]),se.push(v[1])):(se[0]+=v[0],se[1]+=v[1])}if(n(re||B,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),re&&re.grabbed()||B==oe||(oe&&oe.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),B&&B.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=B,r)for(F=0;F<s.length;F++)s[F]&&e.touchData.startPosition[F]&&h&&(e.touchData.singleTouchMoved=!0);if(r&&(null==re||re.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){o(re,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=ot(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:v[0]*c,y:v[1]*c}),a.emit("dragpan")):h&&(e.swipePanning=!0,a.panBy({x:y*c,y:b*c}),a.emit("dragpan"),re&&(re.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}}for(g=0;g<s.length;g++)u[g]=s[g];r&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",F=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",V=function(r){var o=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var i=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(r.touches[0]){var f=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);u[0]=f[0],u[1]=f[1]}if(r.touches[1]){f=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);u[2]=f[0],u[3]=f[1]}if(r.touches[2]){f=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);u[4]=f[0],u[5]=f[1]}if(o&&o.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:u[0],y:u[1]}},o?o.emit(a):s.emit(a),!e.touchData.cxtDragged){var h={originalEvent:r,type:"cxttap",position:{x:u[0],y:u[1]}};o?o.emit(h):s.emit(h)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var p=s.collection(e.getAllInBox(i[0],i[1],i[2],i[3]));i[0]=void 0,i[1]=void 0,i[2]=void 0,i[3]=void 0,i[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:u[0],y:u[1]}});p.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),p.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=o&&o.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var v=e.dragData.touchDragEles;if(null!=o){var g=o._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),g&&(o.emit("freeon"),v.emit("free"),e.dragData.didDrag&&(o.emit("dragfreeon"),v.emit("dragfree"))),n(o,["touchend","tapend","vmouseup","tapdragout"],r,{x:u[0],y:u[1]}),o.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);n(y,["touchend","tapend","vmouseup","tapdragout"],r,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(o||s.$(":selected").unselect(["tapunselect"]),n(o,["tap","vclick"],r,{x:u[0],y:u[1]}),G=!1,r.timeStamp-W<=s.multiClickDebounceTime()?(H&&clearTimeout(H),G=!0,W=null,n(o,["dbltap","vdblclick"],r,{x:u[0],y:u[1]})):(H=setTimeout((function(){G||n(o,["onetap","voneclick"],r,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),W=r.timeStamp)),null!=o&&!e.dragData.didDrag&&o._private.selectable&&w<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(o).unselect(["tapunselect"]),o.select(["tapselect"])):o.selected()?o.unselect(["tapunselect"]):o.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var _=0;_<u.length;_++)c[_]=u[_];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var X=[],$=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},K=function(e){X.push(function(e){return{event:e,touch:$(e)}}(e))},Z=function(e){for(var t=0;t<X.length;t++){if(X[t].event.pointerId===e.pointerId)return void X.splice(t,1)}},Q=function(e){e.touches=X.map((function(e){return e.touch}))},J=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){J(e)||(e.preventDefault(),K(e),Q(e),L(e))})),e.registerBinding(e.container,"pointerup",(function(e){J(e)||(Z(e),Q(e),V(e))})),e.registerBinding(e.container,"pointercancel",(function(e){J(e)||(Z(e),Q(e),F())})),e.registerBinding(e.container,"pointermove",(function(e){J(e)||(e.preventDefault(),function(e){var t=X.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=$(e)}(e),Q(e),B(e))}))}};var ps={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl("polygon",e,t,n,r,o,this.points)},intersectLine:function(e,t,n,r,o,i,a){return Mt(o,i,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,o,i,a){return Ct(e,t,this.points,i,a,r,o,[0,-1],n)}}}};ps.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a){return function(e,t,n,r,o,i){var a=n-e,s=r-t;a/=o,s/=i;var l=Math.sqrt(a*a+s*s),u=l-1;if(u<0)return[];var c=u/l;return[(n-e)*c+e,(r-t)*c+t]}(o,i,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,o,i,a){return Dt(e,t,r,o,i,a,n)}}},ps.generateRoundPolygon=function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var o=2*r,i=void 0;i=r<t.length/2-1?2*(r+1):0,n[4*r]=t[o],n[4*r+1]=t[o+1];var a=t[i]-t[o],s=t[i+1]-t[o+1],l=Math.sqrt(a*a+s*s);n[4*r+2]=a/l,n[4*r+3]=s/l}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,o,this.points)},intersectLine:function(e,t,n,r,o,i,a){return function(e,t,n,r,o,i,a,s){for(var l,u=[],c=new Array(n.length),d=i/2,f=a/2,h=Vt(i,a),p=0;p<n.length/4;p++){var v,g=void 0;g=0===p?n.length-2:4*p-2,v=4*p+2;var y=r+d*n[4*p],m=o+f*n[4*p+1],b=-n[g]*n[v]-n[g+1]*n[v+1],x=h/Math.tan(Math.acos(b)/2),w=y-x*n[g],_=m-x*n[g+1],E=y+x*n[v],k=m+x*n[v+1];0===p?(c[n.length-2]=w,c[n.length-1]=_):(c[4*p-2]=w,c[4*p-1]=_),c[4*p]=E,c[4*p+1]=k;var S=n[g+1],P=-n[g];S*n[v]+P*n[v+1]<0&&(S*=-1,P*=-1),0!==(l=Nt(e,t,r,o,w+S*h,_+P*h,h)).length&&u.push(l[0],l[1])}for(var j=0;j<c.length/4;j++)0!==(l=Rt(e,t,r,o,c[4*j],c[4*j+1],c[4*j+2],c[4*j+3],!1)).length&&u.push(l[0],l[1]);if(u.length>2){for(var C=[u[0],u[1]],T=Math.pow(C[0]-e,2)+Math.pow(C[1]-t,2),O=1;O<u.length/2;O++){var D=Math.pow(u[2*O]-e,2)+Math.pow(u[2*O+1]-t,2);D<=T&&(C[0]=u[2*O],C[1]=u[2*O+1],T=D)}return C}return u}(o,i,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,o,i,a){return function(e,t,n,r,o,i,a){for(var s=new Array(n.length),l=i/2,u=a/2,c=Vt(i,a),d=c*c,f=0;f<n.length/4;f++){var h,p=void 0;p=0===f?n.length-2:4*f-2,h=4*f+2;var v=r+l*n[4*f],g=o+u*n[4*f+1],y=-n[p]*n[h]-n[p+1]*n[h+1],m=c/Math.tan(Math.acos(y)/2),b=v-m*n[p],x=g-m*n[p+1],w=v+m*n[h],_=g+m*n[h+1];s[4*f]=b,s[4*f+1]=x,s[4*f+2]=w,s[4*f+3]=_;var E=n[p+1],k=-n[p];E*n[h]+k*n[h+1]<0&&(E*=-1,k*=-1);var S=b+E*c,P=x+k*c;if(Math.pow(S-e,2)+Math.pow(P-t,2)<=d)return!0}return jt(e,t,s)}(e,t,this.points,i,a,r,o)}}},ps.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Lt(4,0),draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a){return _t(o,i,e,t,n,r,a)},checkPoint:function(e,t,n,r,o,i,a){var s=zt(r,o),l=2*s;return!!Ct(e,t,this.points,i,a,r,o-l,[0,-1],n)||(!!Ct(e,t,this.points,i,a,r-l,o,[0,-1],n)||(!!Dt(e,t,l,l,i-r/2+s,a-o/2+s,n)||(!!Dt(e,t,l,l,i+r/2-s,a-o/2+s,n)||(!!Dt(e,t,l,l,i+r/2-s,a+o/2-s,n)||!!Dt(e,t,l,l,i-r/2+s,a+o/2-s,n)))))}}},ps.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Lt(4,0),draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},generateCutTrianglePts:function(e,t,n,r){var o=this.cornerLength,i=t/2,a=e/2,s=n-a,l=n+a,u=r-i,c=r+i;return{topLeft:[s,u+o,s+o,u,s+o,u+o],topRight:[l-o,u,l,u+o,l-o,u+o],bottomRight:[l,c-o,l-o,c,l-o,c-o],bottomLeft:[s+o,c,s,c-o,s+o,c-o]}},intersectLine:function(e,t,n,r,o,i,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),l=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return Mt(o,i,l,e,t)},checkPoint:function(e,t,n,r,o,i,a){if(Ct(e,t,this.points,i,a,r,o-2*this.cornerLength,[0,-1],n))return!0;if(Ct(e,t,this.points,i,a,r-2*this.cornerLength,o,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,o,i,a);return jt(e,t,s.topLeft)||jt(e,t,s.topRight)||jt(e,t,s.bottomRight)||jt(e,t,s.bottomLeft)}}},ps.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Lt(4,0),draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),l=function(e){var t=ft({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=ft({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=ft({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},u=[].concat(l(s.topLeft),l(s.topRight),l(s.bottomRight),l(s.bottomLeft));return Mt(o,i,u,e,t)},generateBarrelBezierPts:function(e,t,n,r){var o=t/2,i=e/2,a=n-i,s=n+i,l=r-o,u=r+o,c=Gt(e,t),d=c.heightOffset,f=c.widthOffset,h=c.ctrlPtOffsetPct*e,p={topLeft:[a,l+d,a+h,l,a+f,l],topRight:[s-f,l,s-h,l,s,l+d],bottomRight:[s,u-d,s-h,u,s-f,u],bottomLeft:[a+f,u,a+h,u,a,u-d]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,r,o,i,a){var s=Gt(r,o),l=s.heightOffset,u=s.widthOffset;if(Ct(e,t,this.points,i,a,r,o-2*l,[0,-1],n))return!0;if(Ct(e,t,this.points,i,a,r-2*u,o,[0,-1],n))return!0;for(var c=this.generateBarrelBezierPts(r,o,i,a),d=function(e,t,n){var r,o,i=n[4],a=n[2],s=n[0],l=n[5],u=n[1],c=Math.min(i,s),d=Math.max(i,s),f=Math.min(l,u),h=Math.max(l,u);if(c<=e&&e<=d&&f<=t&&t<=h){var p=[(r=i)-2*(o=a)+s,2*(o-r),r],v=function(e,t,n,r){var o=t*t-4*e*(n-=r);if(o<0)return[];var i=Math.sqrt(o),a=2*e;return[(-t+i)/a,(-t-i)/a]}(p[0],p[1],p[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},f=Object.keys(c),h=0;h<f.length;h++){var p=c[f[h]],v=d(e,t,p);if(null!=v){var g=p[5],y=p[3],m=p[1],b=dt(g,y,m,v);if(p.isTop&&b<=t)return!0;if(p.isBottom&&t<=b)return!0}}return!1}}},ps.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Lt(4,0),draw:function(e,t,n,r,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a){var s=t-(r/2+a),l=Rt(o,i,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return l.length>0?l:_t(o,i,e,t,n,r,a)},checkPoint:function(e,t,n,r,o,i,a){var s=zt(r,o),l=2*s;if(Ct(e,t,this.points,i,a,r,o-l,[0,-1],n))return!0;if(Ct(e,t,this.points,i,a,r-l,o,[0,-1],n))return!0;var u=r/2+2*n,c=o/2+2*n;return!!jt(e,t,[i-u,a-c,i-u,a,i+u,a,i+u,a-c])||(!!Dt(e,t,l,l,i+r/2-s,a+o/2-s,n)||!!Dt(e,t,l,l,i-r/2+s,a+o/2-s,n))}}},ps.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Lt(3,0)),this.generateRoundPolygon("round-triangle",Lt(3,0)),this.generatePolygon("rectangle",Lt(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",Lt(5,0)),this.generateRoundPolygon("round-pentagon",Lt(5,0)),this.generatePolygon("hexagon",Lt(6,0)),this.generateRoundPolygon("round-hexagon",Lt(6,0)),this.generatePolygon("heptagon",Lt(7,0)),this.generateRoundPolygon("round-heptagon",Lt(7,0)),this.generatePolygon("octagon",Lt(8,0)),this.generateRoundPolygon("round-octagon",Lt(8,0));var r=new Array(20),o=Ft(5,0),i=Ft(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<i.length/2;s++)i[2*s]*=a,i[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=o[2*s],r[4*s+1]=o[2*s+1],r[4*s+2]=i[2*s],r[4*s+3]=i[2*s+1];r=Bt(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var vs={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||De();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&Se("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},gs=function(e,t,n){for(var r=e.beforeRenderCallbacks,o=0;o<r.length;o++)r[o].fn(t,n)};vs.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;oe((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){gs(e,!0,r);var o=ie();e.render(e.renderOptions);var i=e.lastDrawTime=ie();void 0===e.averageRedrawTime&&(e.averageRedrawTime=i-o),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=i-o;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else gs(e,!1,r);e.skipFrame=!1,oe(n)}}))}};var ys=function(e){this.init(e)},ms=ys.prototype;ms.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ms.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(w){var r=w.document,o=r.head,i="__________cytoscape_stylesheet",a="__________cytoscape_container",s=null!=r.getElementById(i);if(n.className.indexOf(a)<0&&(n.className=(n.className||"")+" "+a),!s){var l=r.createElement("style");l.id=i,l.innerHTML="."+a+" { position: relative; }",o.insertBefore(l,o.children[0])}"static"===w.getComputedStyle(n).getPropertyValue("position")&&je("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.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]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=N(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},ms.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},ms.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(o){}},ms.isHeadless=function(){return!1},[Ka,ds,fs,hs,ps,vs].forEach((function(e){K(ms,e)}));var bs=1e3/60,xs=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=u.default((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),o=e.priority||ke;n.beforeRender((function(o,i){var a=ie(),s=n.averageRedrawTime,l=n.lastRedrawTime,u=[],c=n.cy.extent(),d=n.getPixelRatio();for(o||n.flushRenderedStyleQueue();;){var f=ie(),h=f-a,p=f-i;if(l<bs){var v=bs-(o?s:0);if(p>=e.deqFastCost*v)break}else if(o){if(h>=e.deqCost*l||h>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*bs)break;var g=e.deq(t,d,c);if(!(g.length>0))break;for(var y=0;y<g.length;y++)u.push(g[y])}u.length>0&&(e.onDeqd(t,u),!o&&e.shouldRedraw(t,u,d,c)&&r())}),o(t))}}},ws=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;v(this,e),this.idsByKey=new Le,this.keyForId=new Le,this.cachesByLvl=new Le,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return y(e,[{key:"getIdsFor",value:function(e){null==e&&Se("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Fe,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Le,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),_s={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Es=Ne({getKey:null,doesEleInvalidateKey:_e,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:we,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ks=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Es(t);K(n,r),n.lookup=new ws(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Ss=ks.prototype;Ss.reasons=_s,Ss.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Ss.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Ss.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new c.default((function(e,t){return t.reqs-e.reqs}))},Ss.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Ss.getElement=function(e,t,n,r,o){var i=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(at(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,f=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,f))return null;var h,p=l.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;if(h=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var v=i.getTextureQueue(h),g=v[v.length-2],y=function(){return i.recycleTexture(h,d)||i.addTexture(h,d)};g||(g=v[v.length-1]),g||(g=y()),g.width-g.usedWidth<d&&(g=y());for(var m,b=function(e){return e&&e.scaledLabelShown===f},x=o&&o===_s.dequeue,w=o&&o===_s.highQuality,_=o&&o===_s.downscale,E=r+1;E<=3;E++){var k=l.get(e,E);if(k){m=k;break}}var S=m&&m.level===r+1?m:null,P=function(){g.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,g.usedWidth,0,d,c)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,h),b(S))P();else if(b(m)){if(!w)return i.queueElement(e,m.level-1),m;for(var j=m.level;j>r;j--)S=i.getElement(e,t,n,j,_s.downscale);P()}else{var C;if(!x&&!w&&!_)for(var T=r-1;T>=-4;T--){var O=l.get(e,T);if(O){C=O;break}}if(b(C))return i.queueElement(e,r),C;g.context.translate(g.usedWidth,0),g.context.scale(u,u),this.drawElement(g.context,e,t,f,!1),g.context.scale(1/u,1/u),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:u,width:d,height:c,scaledLabelShown:f},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(p),l.set(e,r,p),i.checkTextureFullness(g),p},Ss.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},Ss.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var o=-4;o<=3;o++){var i=n.getForCachedKey(e,o);i&&r.push(i)}if(n.invalidate(e))for(var a=0;a<r.length;a++){var s=r[a],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},Ss.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},Ss.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ae(t,e):e.fullnessChecks++},Ss.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ae(n,e),e.retired=!0;for(var o=e.eleCaches,i=0;i<o.length;i++){var a=o[i];r.deleteCache(a.key,a.level)}Re(o),this.getRetiredTextureQueue(t).push(e)},Ss.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},Ss.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),o=0;o<r.length;o++){var i=r[o];if(i.width>=t)return i.retired=!1,i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,Re(i.eleCaches),i.context.setTransform(1,0,0,1,0,0),i.context.clearRect(0,0,i.width,i.height),Ae(r,i),n.push(i),i}},Ss.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),o=this.getKey(e),i=r[o];if(i)i.level=Math.max(i.level,t),i.eles.merge(e),i.reqs++,n.updateItem(i);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:o};n.push(a),r[o]=a}},Ss.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),o=[],i=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=i.hasCache(u,s.level);if(r[l]=null,!c){o.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,_s.dequeue)}}return o},Ss.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),o=n[r];null!=o&&(1===o.eles.length?(o.reqs=xe,t.updateItem(o),t.pop(),n[r]=null):o.eles.unmerge(e))},Ss.onDequeue=function(e){this.onDequeues.push(e)},Ss.offDequeue=function(e){Ae(this.onDequeues,e)},Ss.setupDequeueing=xs({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){(0,e.onDequeues[n])(t)}},shouldRedraw:function(e,t,n,r){for(var o=0;o<t.length;o++)for(var i=t[o].eles,a=0;a<i.length;a++){var s=i[a].boundingBox();if(bt(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ps=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=ie()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=u.default((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);t.layersQueue=new c.default((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},js=Ps.prototype,Cs=0,Ts=Math.pow(2,53)-1;js.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),o=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,o),a={id:Cs=++Cs%Ts,bb:e,level:t,width:r,height:o,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,l=-a.bb.x1,u=-a.bb.y1;return s.scale(n,n),s.translate(l,u),a},js.getLayers=function(e,t,n){var r=this,o=r.renderer.cy.zoom(),i=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(at(o*t)))<-4)n=-4;else if(o>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},o=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};o(1),o(-1);for(var i=c.length-1;i>=0;i--){var a=c[i];a.invalid&&Ae(c,a)}}();var d=function(t){var o=(t=t||{}).after;if(function(){if(!a){a=pt();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*u*(a.h*u)>16e6)return null;var i=r.makeLayer(a,n);if(null!=o){var s=c.indexOf(o)+1;c.splice(s,0,i)}else(void 0===t.insert||t.insert)&&c.unshift(i);return i};if(r.skipping&&!i)return null;for(var f=null,h=e.length/1,p=!i,v=0;v<e.length;v++){var g=e[v],y=g._private.rscratch,m=y.imgLayerCaches=y.imgLayerCaches||{},b=m[n];if(b)f=b;else{if((!f||f.eles.length>=h||!wt(f.bb,g.boundingBox()))&&!(f=d({insert:!0,after:f})))return null;s||p?r.queueLayer(f,g):r.drawEleInLayer(f,g,n,t),f.eles.push(g),m[n]=f}}return s||(p?null:c)},js.getEleLevelForLayerLevel=function(e,t){return e},js.drawEleInLayer=function(e,t,n,r){var o=this.renderer,i=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),o.setImgSmoothing(i,!1),o.drawCachedElement(i,t,null,null,n,true),o.setImgSmoothing(i,!0))},js.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,o=0;o<n.length;o++){var i=n[o];if(i.reqs>0)return!1;if(i.invalid)return!1;r+=i.eles.length}return r===t.length},js.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var o=n[r],i=-1,a=0;a<t.length;a++)if(o.eles[0]===t[a]){i=a;break}if(i<0)this.invalidateLayer(o);else{var s=i;for(a=0;a<o.eles.length;a++)if(o.eles[a]!==t[s+a]){this.invalidateLayer(o);break}}}},js.updateElementsInLayers=function(e,t){for(var n=M(e[0]),r=0;r<e.length;r++)for(var o=n?null:e[r],i=n?e[r]:e[r].ele,a=i._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},l=-4;l<=2;l++){var u=s[l];u&&(o&&this.getEleLevelForLayerLevel(u.level)!==o.level||t(u,i,o))}},js.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},js.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=ie(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},js.invalidateLayer=function(e){if(this.lastInvalidationTime=ie(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ae(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var o=0;o<n.length;o++){var i=n[o]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},js.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var o=e.replacement;if(o||((o=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,o.eles=e.eles),!o.reqs)for(var i=0;i<o.eles.length;i++)t.queueLayer(o,o.eles[i])}))},js.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},js.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,o=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(o[t.id()])return;r.push(t),o[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},js.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],o=0;o<1&&0!==n.size();){var i=n.peek();if(i.replacement)n.pop();else if(i.replaces&&i!==i.replaces.replacement)n.pop();else if(i.invalid)n.pop();else{var a=i.elesQueue.shift();a&&(t.drawEleInLayer(i,a,i.level,e),o++),0===r.length&&r.push(!0),0===i.elesQueue.length&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}}return r},js.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var o=0;o<e.eles.length;o++){var i=e.eles[o]._private,a=i.imgLayerCaches=i.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},js.requestRedraw=u.default((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),js.setupDequeueing=xs({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:ke,shouldRedraw:we,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Os,Ds={};function Ns(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function As(e,t,n){for(var r,o=0;o<t.length;o++){var i=t[o];0===o&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Rs(e,t,n){e.beginPath&&e.beginPath();for(var r=t,o=0;o<r.length;o++){var i=r[o];e.lineTo(i.x,i.y)}var a=n,s=n[0];e.moveTo(s.x,s.y);for(o=1;o<a.length;o++){i=a[o];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function Ms(e,t,n,r,o){e.beginPath&&e.beginPath(),e.arc(n,r,o,0,2*Math.PI,!1);var i=t,a=i[0];e.moveTo(a.x,a.y);for(var s=0;s<i.length;s++){var l=i[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function Is(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}Ds.arrowShapeImpl=function(e){return(Os||(Os={polygon:Ns,"triangle-backcurve":As,"triangle-tee":Rs,"circle-triangle":Ms,"triangle-cross":Rs,circle:Is}))[e]};var Ls={drawElement:function(e,t,n,r,o,i){t.isNode()?this.drawNode(e,t,n,r,o,i):this.drawEdge(e,t,n,r,o,i)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,o,i,a,s){var l=this,u=n.getBoundingBox(t);if(0!==u.w&&0!==u.h){var c=n.getElement(t,u,r,o,i);if(null!=c){var d=s(l,t);if(0===d)return;var f,h,p,v,g,y,m=a(l,t),b=u.x1,x=u.y1,w=u.w,_=u.h;if(0!==m){var E=n.getRotationPoint(t);p=E.x,v=E.y,e.translate(p,v),e.rotate(m),(g=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var k=n.getRotationOffset(t);f=k.x,h=k.y}else f=b,h=x;1!==d&&(y=e.globalAlpha,e.globalAlpha=y*d),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,f,h,w,_),1!==d&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-p,-v),g||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Bs=function(){return 0},Fs=function(e,t){return e.getTextAngle(t,null)},zs=function(e,t){return e.getTextAngle(t,"source")},Vs=function(e,t){return e.getTextAngle(t,"target")},Gs=function(e,t){return t.effectiveOpacity()},Us=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Ls.drawCachedElement=function(e,t,n,r,o,i){var a=this,s=a.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,f=t.boundingBox(),h=!0===i?l.reasons.highQuality:null;if(0!==f.w&&0!==f.h&&t.visible()&&(!r||bt(f,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,l,n,o,h,Bs,Gs),p&&v||a.drawCachedElementPortion(e,t,u,n,o,h,Fs,Us),p&&!v&&(a.drawCachedElementPortion(e,t,c,n,o,h,zs,Us),a.drawCachedElementPortion(e,t,d,n,o,h,Vs,Us)),a.drawElementOverlay(e,t)}},Ls.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},Ls.drawCachedElements=function(e,t,n,r){for(var o=0;o<t.length;o++){var i=t[o];this.drawCachedElement(e,i,n,r)}},Ls.drawCachedNodes=function(e,t,n,r){for(var o=0;o<t.length;o++){var i=t[o];i.isNode()&&this.drawCachedElement(e,i,n,r)}},Ls.drawLayeredElements=function(e,t,n,r){var o=this.data.lyrTxrCache.getLayers(t,n);if(o)for(var i=0;i<o.length;i++){var a=o[i],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Hs={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!i||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=i?t.pstyle("opacity").value:1,c=i?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,f=t.pstyle("line-style").value,h=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,v=u*c,g=u*c,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=h,e.lineCap=p,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,f),e.lineCap="butt")},m=function(){o&&a.drawEdgeOverlay(e,t)},b=function(){o&&a.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;a.drawArrowheads(e,t,n)},w=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var _="yes"===t.pstyle("ghost").value;if(_){var E=t.pstyle("ghost-offset-x").pfValue,k=t.pstyle("ghost-offset-y").pfValue,S=t.pstyle("ghost-opacity").value,P=v*S;e.translate(E,k),y(P),x(P),e.translate(-E,-k)}b(),y(),x(),m(),w(),n&&e.translate(l.x1,l.y1)}}},Ws=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var o=this,i=o.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||i?t.lineCap="round":t.lineCap="butt",o.colorStrokeStyle(t,l[0],l[1],l[2],r),o.drawEdgePath(n,t,a.allpts,"solid")}}}};Hs.drawEdgeOverlay=Ws("overlay"),Hs.drawEdgeUnderlay=Ws("underlay"),Hs.drawEdgePath=function(e,t,n,r){var o,i=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var d=n.join("$");i.pathCacheKey&&i.pathCacheKey===d?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=d,i.pathCache=o)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var f=2;f+3<n.length;f+=4)t.quadraticCurveTo(n[f],n[f+1],n[f+2],n[f+3]);break;case"straight":case"segments":case"haystack":for(var h=2;h+1<n.length;h+=2)t.lineTo(n[h],n[h+1])}t=a,l?t.stroke(o):t.stroke(),t.setLineDash&&t.setLineDash([])},Hs.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,o=0;o+1<n.length;o+=2){var i=[n[o+2]-n[o],n[o+3]-n[o+1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/a,-i[0]/a],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[o]-l[0],n[o+1]-l[1]),t.lineTo(n[o]+l[0],n[o+1]+l[1]),t.lineTo(n[o+2],n[o+3]),t.closePath(),t.fill()}},Hs.drawArrowheads=function(e,t,n){var r=t._private.rscratch,o="haystack"===r.edgeType;o||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),o||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Hs.drawArrowhead=function(e,t,n,r,o,i,a){if(!(isNaN(r)||null==r||isNaN(o)||null==o||isNaN(i)||null==i)){var s=this,l=t.pstyle(n+"-arrow-shape").value;if("none"!==l){var u="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",c=t.pstyle(n+"-arrow-fill").value,d=t.pstyle("width").pfValue,f=t.pstyle("opacity").value;void 0===a&&(a=f);var h=e.globalCompositeOperation;1===a&&"hollow"!==c||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,u,d,l,r,o,i),e.globalCompositeOperation=h);var p=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,p[0],p[1],p[2],a),s.colorStrokeStyle(e,p[0],p[1],p[2],a),s.drawArrowShape(t,e,c,d,l,r,o,i)}}},Hs.drawArrowShape=function(e,t,n,r,o,i,a,s){var l,u=this,c=this.usePaths()&&"triangle-cross"!==o,d=!1,f=t,h={x:i,y:a},p=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,p),g=u.arrowShapes[o];if(c){var y=u.arrowPathCache=u.arrowPathCache||[],m=pe(o),b=y[m];null!=b?(l=t=b,d=!0):(l=t=new Path2D,y[m]=l)}d||(t.beginPath&&t.beginPath(),c?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,h,r),t.closePath&&t.closePath()),t=f,c&&(t.translate(i,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(c?t.fill(l):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(c?v:1),t.lineJoin="miter",c?t.stroke(l):t.stroke()),c&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-i,-a))};var Ys={safeDrawImage:function(e,t,n,r,o,i,a,s,l,u){if(!(o<=0||i<=0||l<=0||u<=0))try{e.drawImage(t,n,r,o,i,a,s,l,u)}catch(c){je(c)}},drawInscribedImage:function(e,t,n,r,o){var i=this,a=n.position(),s=a.x,l=a.y,u=n.cy().style(),c=u.getIndexedStyle.bind(u),d=c(n,"background-fit","value",r),f=c(n,"background-repeat","value",r),h=n.width(),p=n.height(),v=2*n.padding(),g=h+("inner"===c(n,"background-width-relative-to","value",r)?0:v),y=p+("inner"===c(n,"background-height-relative-to","value",r)?0:v),m=n._private.rscratch,b="node"===c(n,"background-clip","value",r),x=c(n,"background-image-opacity","value",r)*o,w=c(n,"background-image-smoothing","value",r),_=t.width||t.cachedW,E=t.height||t.cachedH;null!=_&&null!=E||(document.body.appendChild(t),_=t.cachedW=t.width||t.offsetWidth,E=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var k=_,S=E;if("auto"!==c(n,"background-width","value",r)&&(k="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*g:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(S="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*y:c(n,"background-height","pfValue",r)),0!==k&&0!==S){if("contain"===d)k*=P=Math.min(g/k,y/S),S*=P;else if("cover"===d){var P;k*=P=Math.max(g/k,y/S),S*=P}var j=s-g/2,C=c(n,"background-position-x","units",r),T=c(n,"background-position-x","pfValue",r);j+="%"===C?(g-k)*T:T;var O=c(n,"background-offset-x","units",r),D=c(n,"background-offset-x","pfValue",r);j+="%"===O?(g-k)*D:D;var N=l-y/2,A=c(n,"background-position-y","units",r),R=c(n,"background-position-y","pfValue",r);N+="%"===A?(y-S)*R:R;var M=c(n,"background-offset-y","units",r),I=c(n,"background-offset-y","pfValue",r);N+="%"===M?(y-S)*I:I,m.pathCache&&(j-=s,N-=l,s=0,l=0);var L=e.globalAlpha;e.globalAlpha=x;var B=i.getImgSmoothing(e),F=!1;if("no"===w&&B?(i.setImgSmoothing(e,!1),F=!0):"yes"!==w||B||(i.setImgSmoothing(e,!0),F=!0),"no-repeat"===f)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,s,l,g,y),e.clip())),i.safeDrawImage(e,t,0,0,_,E,j,N,k,S),b&&e.restore();else{var V=e.createPattern(t,f);e.fillStyle=V,i.nodeShapes[i.getNodeShape(n)].draw(e,s,l,g,y),e.translate(j,N),e.fill(),e.translate(-j,-N)}e.globalAlpha=L,F&&i.setImgSmoothing(e,B)}}},qs={};function Xs(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill()}qs.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),o=Math.ceil(at(n*r));t=Math.pow(2,o)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},qs.drawElementText=function(e,t,n,r,o){var i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(i&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),f=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!f||!f.value))return;e.textAlign="center",e.textBaseline="bottom"}var h,p=!n;n&&(h=n,e.translate(-h.x1,-h.y1)),null==o?(a.drawText(e,t,null,p,i),t.isEdge()&&(a.drawText(e,t,"source",p,i),a.drawText(e,t,"target",p,i))):a.drawText(e,t,o,p,i),n&&e.translate(h.x1,h.y1)},qs.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},qs.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+o+" "+i,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},qs.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",o=e.pstyle(r+"text-rotation"),i=Me(n,"labelAngle",t);return"autorotate"===o.strValue?e.isEdge()?i:0:"none"===o.strValue?0:o.pfValue},qs.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=t._private,a=i.rscratch,s=o?t.effectiveOpacity():1;if(!o||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var l,u,c=Me(a,"labelX",n),d=Me(a,"labelY",n),f=this.getLabelText(t,n);if(null!=f&&""!==f&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,o);var h,p=n?n+"-":"",v=Me(a,"labelWidth",n),g=Me(a,"labelHeight",n),y=t.pstyle(p+"text-margin-x").pfValue,m=t.pstyle(p+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),c+=y,d+=m,0!==(h=r?this.getTextAngle(t,n):0)&&(l=c,u=d,e.translate(l,u),e.rotate(h),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var _=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,S=t.pstyle("text-background-padding").pfValue;if(_>0||k>0&&E>0){var P=c-S;switch(x){case"left":P-=v;break;case"center":P-=v/2}var j=d-g-S,C=v+2*S,T=g+2*S;if(_>0){var O=e.fillStyle,D=t.pstyle("text-background-color").value;e.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+_*s+")";var N=t.pstyle("text-background-shape").strValue;0===N.indexOf("round")?Xs(e,P,j,C,T,2):e.fillRect(P,j,C,T),e.fillStyle=O}if(k>0&&E>0){var A=e.strokeStyle,R=e.lineWidth,M=t.pstyle("text-border-color").value,I=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+M[0]+","+M[1]+","+M[2]+","+E*s+")",e.lineWidth=k,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(P,j,C,T),"double"===I){var L=k/2;e.strokeRect(P+L,j+L,C-2*L,T-2*L)}e.setLineDash&&e.setLineDash([]),e.lineWidth=R,e.strokeStyle=A}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Me(a,"labelWrapCachedLines",n),V=Me(a,"labelLineHeight",n),G=v/2,H=this.getLabelJustification(t);switch("auto"===H||("left"===x?"left"===H?c+=-v:"center"===H&&(c+=-G):"center"===x?"left"===H?c+=-G:"right"===H&&(c+=G):"right"===x&&("center"===H?c+=G:"right"===H&&(c+=v))),w){case"top":case"center":case"bottom":d-=(F.length-1)*V}for(var W=0;W<F.length;W++)B>0&&e.strokeText(F[W],c,d),e.fillText(F[W],c,d),d+=V}else B>0&&e.strokeText(f,c,d),e.fillText(f,c,d);0!==h&&(e.rotate(-h),e.translate(-l,-u))}}};var $s={drawNode:function(e,t,n){var r,o,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(N(d.x)&&N(d.y)&&(!s||t.visible())){var f,h,p=s?t.effectiveOpacity():1,v=l.usePaths(),g=!1,y=t.padding();r=t.width()+2*y,o=t.height()+2*y,n&&(h=n,e.translate(-h.x1,-h.y1));for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),_=0,E=0;E<b.length;E++){var k=b[E],S=x[E]=null!=k&&"none"!==k;if(S){var P=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",E);_++,w[E]=l.getCachedImage(k,P,(function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var j=t.pstyle("background-blacken").value,C=t.pstyle("border-width").pfValue,T=t.pstyle("background-opacity").value*p,O=t.pstyle("border-color").value,D=t.pstyle("border-style").value,A=t.pstyle("border-opacity").value*p;e.lineJoin="miter";var R=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;l.eleFillStyle(e,t,n)},M=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;l.colorStrokeStyle(e,O[0],O[1],O[2],t)},I=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var B=l.nodePathCache=l.nodePathCache||[],F=ve("polygon"===I?I+","+L.join(","):I,""+o,""+r),V=B[F];null!=V?(f=V,g=!0,c.pathCache=f):(f=new Path2D,B[F]=c.pathCache=f)}var G=function(){if(!g){var n=d;v&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(f||e,n.x,n.y,r,o)}v?e.fill(f):e.fill()},H=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=u.backgrounding,i=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?i++:x[a]&&w[a].complete&&!w[a].error&&(i++,l.drawInscribedImage(e,w[a],t,a,n))}u.backgrounding=!(i===_),o!==u.backgrounding&&t.updateStyle(!1)},W=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;l.hasPie(t)&&(l.drawPie(e,t,i),n&&(v||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,o)))},Y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=(j>0?j:-j)*t,r=j>0?0:255;0!==j&&(l.colorFillStyle(e,r,r,r,n),v?e.fill(f):e.fill())},q=function(){if(C>0){if(e.lineWidth=C,e.lineCap="butt",e.setLineDash)switch(D){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(v?e.stroke(f):e.stroke(),"double"===D){e.lineWidth=C/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(f):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},X=function(){a&&l.drawNodeOverlay(e,t,d,r,o)},$=function(){a&&l.drawNodeUnderlay(e,t,d,r,o)},K=function(){l.drawElementText(e,t,null,i)},Z="yes"===t.pstyle("ghost").value;if(Z){var Q=t.pstyle("ghost-offset-x").pfValue,J=t.pstyle("ghost-offset-y").pfValue,ee=t.pstyle("ghost-opacity").value,te=ee*p;e.translate(Q,J),R(ee*T),G(),H(te,!0),M(ee*A),q(),W(0!==j||0!==C),H(te,!1),Y(te),e.translate(-Q,-J)}v&&e.translate(-d.x,-d.y),$(),v&&e.translate(d.x,d.y),R(),G(),H(p,!0),M(),q(),W(0!==j||0!==C),H(p,!1),Y(),v&&e.translate(-d.x,-d.y),K(),X(),n&&e.translate(h.x1,h.y1)}}},Ks=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,o,i){if(n.visible()){var a=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,l=n.pstyle("".concat(e,"-color")).value,u=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==o||null==i){var c=n.padding();o=n.width()+2*c,i=n.height()+2*c}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,o+2*a,i+2*a),t.fill()}}}};$s.drawNodeOverlay=Ks("overlay"),$s.drawNodeUnderlay=Ks("underlay"),$s.hasPie=function(e){return(e=e[0])._private.hasPie},$s.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var o=t.cy().style(),i=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===i.units?c*=i.pfValue:void 0!==i.pfValue&&(c=i.pfValue/2);for(var f=1;f<=o.pieBackgroundN;f++){var h=t.pstyle("pie-"+f+"-background-size").value,p=t.pstyle("pie-"+f+"-background-color").value,v=t.pstyle("pie-"+f+"-background-opacity").value*n,g=h/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*g;0===h||d>=1||d+g>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=g)}};var Zs={};Zs.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},Zs.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,o=0;o<n.length;o++)if((t=n[o]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},Zs.createGradientStyleFor=function(e,t,n,r,o){var i,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var u=n.sourceEndpoint(),c=n.targetEndpoint(),d=n.midpoint(),f=lt(u,d),h=lt(c,d);i=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,h))}else{var p=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,g))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();i=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":i=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":i=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":i=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":i=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!i)return null;for(var _=l.length===s.length,E=s.length,k=0;k<E;k++)i.addColorStop(_?l[k]:k/(E-1),"rgba("+s[k][0]+","+s[k][1]+","+s[k][2]+","+o+")");return i},Zs.gradientFillStyle=function(e,t,n,r){var o=this.createGradientStyleFor(e,"background",t,n,r);if(!o)return null;e.fillStyle=o},Zs.colorFillStyle=function(e,t,n,r,o){e.fillStyle="rgba("+t+","+n+","+r+","+o+")"},Zs.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var o=t.pstyle("background-color").value;this.colorFillStyle(e,o[0],o[1],o[2],n)}},Zs.gradientStrokeStyle=function(e,t,n,r){var o=this.createGradientStyleFor(e,"line",t,n,r);if(!o)return null;e.strokeStyle=o},Zs.colorStrokeStyle=function(e,t,n,r,o){e.strokeStyle="rgba("+t+","+n+","+r+","+o+")"},Zs.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var o=t.pstyle("line-color").value;this.colorStrokeStyle(e,o[0],o[1],o[2],n)}},Zs.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),o=r[2],i=r[3],a=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=s);var l,u=o*a,c=i*a;if(u!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=o+"px",d.style.height=i+"px";for(var f=0;f<t.CANVAS_LAYERS;f++)(l=n.canvases[f]).width=u,l.height=c,l.style.width=o+"px",l.style.height=i+"px";for(f=0;f<t.BUFFER_COUNT;f++)(l=n.bufferCanvases[f]).width=u,l.height=c,l.style.width=o+"px",l.style.height=i+"px";t.textureMult=1,a<=1&&(l=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,l.width=u*t.textureMult,l.height=c*t.textureMult),t.canvasWidth=u,t.canvasHeight=c}},Zs.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Zs.render=function(e){var t=(e=e||De()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,o=e.forcedZoom,i=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,l=a.cy,u=a.data,c=u.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),f=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,h=a.motionBlurPxRatio,p=l.hasCompoundNodes(),v=a.hoverData.draggingEles,g=!(!a.hoverData.selecting&&!a.touchData.selecting),y=f=f&&!t&&a.motionBlurEnabled&&!g;t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),f&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(y=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==o?o:b,w=l.pan(),_={x:w.x,y:w.y},E={zoom:b,pan:{x:w.x,y:w.y}},k=a.prevViewport;void 0===k||E.zoom!==k.zoom||E.pan.x!==k.pan.x||E.pan.y!==k.pan.y||v&&!p||(a.motionBlurPxRatio=1),i&&(_=i),x*=s,_.x*=s,_.y*=s;var S=a.getCachedZSortedEles();function P(e,t,n,r,o){var i=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,o),e.globalCompositeOperation=i}function j(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=_,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*h,y:w.y*h},l=b*h,c=a.canvasWidth*h,d=a.canvasHeight*h),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?P(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),i&&e.translate(i.x,i.y),o&&e.scale(o,o)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var C=a.data.bufferContexts[a.TEXTURE_BUFFER];C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:C,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(E=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var T=u.contexts[a.NODE],O=a.textureCache.texture;E=a.textureCache.viewport;T.setTransform(1,0,0,1,0,0),f?P(T,0,0,E.width,E.height):T.clearRect(0,0,E.width,E.height);var D=m.core("outside-texture-bg-color").value,N=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(T,D[0],D[1],D[2],N),T.fillRect(0,0,E.width,E.height);b=l.zoom();j(T,!1),T.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),T.drawImage(O,E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var A=l.extent(),R=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),M=a.hideEdgesOnViewport&&R,I=[];if(I[a.NODE]=!c[a.NODE]&&f&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,I[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),I[a.DRAG]=!c[a.DRAG]&&f&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,I[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||I[a.NODE]){var L=f&&!I[a.NODE]&&1!==h;j(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),f&&!L?"motionBlur":void 0),M?a.drawCachedNodes(T,S.nondrag,s,A):a.drawLayeredElements(T,S.nondrag,s,A),a.debug&&a.drawDebugPoints(T,S.nondrag),n||f||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||I[a.DRAG])){L=f&&!I[a.DRAG]&&1!==h;j(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),f&&!L?"motionBlur":void 0),M?a.drawCachedNodes(T,S.drag,s,A):a.drawCachedElements(T,S.drag,s,A),a.debug&&a.drawDebugPoints(T,S.drag),n||f||(c[a.DRAG]=!1)}if(a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(j(T=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var B=m.core("selection-box-border-width").value/b;T.lineWidth=B,T.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",T.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),B>0&&(T.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",T.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var F=u.bgActivePosistion;T.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",T.beginPath(),T.arc(F.x,F.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),T.fill()}var V=a.lastRedrawTime;if(a.showFps&&V){V=Math.round(V);var G=Math.round(1e3/V);T.setTransform(1,0,0,1,0,0),T.fillStyle="rgba(255, 0, 0, 0.75)",T.strokeStyle="rgba(255, 0, 0, 0.75)",T.lineWidth=1,T.fillText("1 frame = "+V+" ms = "+G+" fps",0,20);T.strokeRect(0,30,250,20),T.fillRect(0,30,250*Math.min(G/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(f&&1!==h){var H=u.contexts[a.NODE],W=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],Y=u.contexts[a.DRAG],q=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],X=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):P(e,0,0,a.canvasWidth,a.canvasHeight);var r=h;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||I[a.NODE])&&(X(H,W,I[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||I[a.DRAG])&&(X(Y,q,I[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=E,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),f&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")};for(var Qs={drawPolygonPath:function(e,t,n,r,o,i){var a=r/2,s=o/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*i[0],n+s*i[1]);for(var l=1;l<i.length/2;l++)e.lineTo(t+a*i[2*l],n+s*i[2*l+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,o,i){var a=r/2,s=o/2,l=Vt(r,o);e.beginPath&&e.beginPath();for(var u=0;u<i.length/4;u++){var c,d=void 0;d=0===u?i.length-2:4*u-2,c=4*u+2;var f=t+a*i[4*u],h=n+s*i[4*u+1],p=-i[d]*i[c]-i[d+1]*i[c+1],v=l/Math.tan(Math.acos(p)/2),g=f-v*i[d],y=h-v*i[d+1],m=f+v*i[c],b=h+v*i[c+1];0===u?e.moveTo(g,y):e.lineTo(g,y),e.arcTo(f,h,m,b,l)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,o){var i=r/2,a=o/2,s=zt(r,o);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+i,n-a,t+i,n,s),e.arcTo(t+i,n+a,t,n+a,s),e.arcTo(t-i,n+a,t-i,n,s),e.arcTo(t-i,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,o){var i=r/2,a=o/2,s=zt(r,o);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+i,n-a),e.lineTo(t+i,n),e.arcTo(t+i,n+a,t,n+a,s),e.arcTo(t-i,n+a,t-i,n,s),e.lineTo(t-i,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,o){var i=r/2,a=o/2;e.beginPath&&e.beginPath(),e.moveTo(t-i+8,n-a),e.lineTo(t+i-8,n-a),e.lineTo(t+i,n-a+8),e.lineTo(t+i,n+a-8),e.lineTo(t+i-8,n+a),e.lineTo(t-i+8,n+a),e.lineTo(t-i,n+a-8),e.lineTo(t-i,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,o){var i=r/2,a=o/2,s=t-i,l=t+i,u=n-a,c=n+a,d=Gt(r,o),f=d.widthOffset,h=d.heightOffset,p=d.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(s,u+h),e.lineTo(s,c-h),e.quadraticCurveTo(s+p,c,s+f,c),e.lineTo(l-f,c),e.quadraticCurveTo(l-p,c,l,c-h),e.lineTo(l,u+h),e.quadraticCurveTo(l-p,u,l-f,u),e.lineTo(s+f,u),e.quadraticCurveTo(s+p,u,s,u+h),e.closePath()}},Js=Math.sin(0),el=Math.cos(0),tl={},nl={},rl=Math.PI/40,ol=0*Math.PI;ol<2*Math.PI;ol+=rl)tl[ol]=Math.sin(ol),nl[ol]=Math.cos(ol);Qs.drawEllipsePath=function(e,t,n,r,o){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,o/2,0,0,2*Math.PI);else for(var i,a,s=r/2,l=o/2,u=0*Math.PI;u<2*Math.PI;u+=rl)i=t-s*tl[u]*Js+s*nl[u]*el,a=n+l*nl[u]*Js+l*tl[u]*el,0===u?e.moveTo(i,a):e.lineTo(i,a);e.closePath()};var il={};function al(e){var t=e.indexOf(",");return e.substr(t+1)}function sl(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new tr((function(r,o){try{t.toBlob((function(e){null!=e?r(e):o(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(i){o(i)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})}(al(r()),n);case"base64":return al(r());default:return r()}}il.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},il.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),o=e.full?Math.ceil(n.w):r[2],i=e.full?Math.ceil(n.h):r[3],a=N(e.maxWidth)||N(e.maxHeight),s=this.getPixelRatio(),l=1;if(void 0!==e.scale)o*=e.scale,i*=e.scale,l=e.scale;else if(a){var u=1/0,c=1/0;N(e.maxWidth)&&(u=l*e.maxWidth/o),N(e.maxHeight)&&(c=l*e.maxHeight/i),o*=l=Math.min(u,c),i*=l}a||(o*=s,i*=s,l*=s);var d=document.createElement("canvas");d.width=o,d.height=i,d.style.width=o+"px",d.style.height=i+"px";var f=d.getContext("2d");if(o>0&&i>0){f.clearRect(0,0,o,i),f.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*l,-n.y1*l),f.scale(l,l),this.drawElements(f,h),f.scale(1/l,1/l),f.translate(n.x1*l,n.y1*l);else{var p=t.pan(),v={x:p.x*l,y:p.y*l};l*=t.zoom(),f.translate(v.x,v.y),f.scale(l,l),this.drawElements(f,h),f.scale(1/l,1/l),f.translate(-v.x,-v.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,o,i),f.fill())}return d},il.png=function(e){return sl(e,this.bufferCanvasImage(e),"image/png")},il.jpg=function(e){return sl(e,this.bufferCanvasImage(e),"image/jpeg")};var ll={nodeShapeImpl:function(e,t,n,r,o,i,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,o,i);case"polygon":return this.drawPolygonPath(t,n,r,o,i,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,o,i,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,o,i);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,o,i);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,o,i);case"barrel":return this.drawBarrelPath(t,n,r,o,i)}}},ul=dl,cl=dl.prototype;function dl(e){var t=this;t.data={canvases:new Array(cl.CANVAS_LAYERS),contexts:new Array(cl.CANVAS_LAYERS),canvasNeedsRedraw:new Array(cl.CANVAS_LAYERS),bufferCanvases:new Array(cl.BUFFER_COUNT),bufferContexts:new Array(cl.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,o.position="relative",o.zIndex="0",o.overflow="hidden";var i=e.cy.container();i.appendChild(t.data.canvasContainer),i.style[n]=r;var a={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};_&&_.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s<cl.CANVAS_LAYERS;s++){var l=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=l.getContext("2d"),Object.keys(a).forEach((function(e){l.style[e]=a[e]})),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(cl.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[cl.NODE].setAttribute("data-id","layer"+cl.NODE+"-node"),t.data.canvases[cl.SELECT_BOX].setAttribute("data-id","layer"+cl.SELECT_BOX+"-selectbox"),t.data.canvases[cl.DRAG].setAttribute("data-id","layer"+cl.DRAG+"-drag");for(s=0;s<cl.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var u=pt(),c=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e.boundingBox(),e[0]._private.bodyBounds},f=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||u},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||u},p=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||u},v=function(e,t){return t},g=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},y=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},m=t.data.eleTxrCache=new ks(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,o,i){return t.drawElement(e,n,r,!1,!1,i)},getBoundingBox:d,getRotationPoint:function(e){return{x:((t=d(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return c(d(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),b=t.data.lblTxrCache=new ks(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,o,i){return t.drawElementText(e,n,r,o,"main",i)},getBoundingBox:f,getRotationPoint:function(e){return g("",y(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=f(e),n=c(f(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:v}),x=t.data.slbTxrCache=new ks(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,o,i){return t.drawElementText(e,n,r,o,"source",i)},getBoundingBox:h,getRotationPoint:function(e){return g("source",y(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return c(h(e))},isVisible:v}),w=t.data.tlbTxrCache=new ks(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,o,i){return t.drawElementText(e,n,r,o,"target",i)},getBoundingBox:p,getRotationPoint:function(e){return g("target",y(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return c(p(e))},isVisible:v}),E=t.data.lyrTxrCache=new Ps(t);t.onUpdateEleCalcs((function(e,t){m.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t),E.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var k=function(e){for(var t=0;t<e.length;t++)E.enqueueElementRefinement(e[t].ele)};m.onDequeue(k),b.onDequeue(k),x.onDequeue(k),w.onDequeue(k)}cl.CANVAS_LAYERS=3,cl.SELECT_BOX=0,cl.DRAG=1,cl.NODE=2,cl.BUFFER_COUNT=3,cl.TEXTURE_BUFFER=0,cl.MOTIONBLUR_BUFFER_NODE=1,cl.MOTIONBLUR_BUFFER_DRAG=2,cl.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[cl.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[cl.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[cl.SELECT_BOX]=t}};var fl="undefined"!=typeof Path2D;cl.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},cl.usePaths=function(){return fl&&this.pathsEnabled},cl.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},cl.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},cl.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":p(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[Ds,Ls,Hs,Ys,qs,$s,Zs,Qs,il,ll].forEach((function(e){K(cl,e)}));var hl=[{type:"layout",extensions:Ya},{type:"renderer",extensions:[{name:"null",impl:qa},{name:"base",impl:ys},{name:"canvas",impl:ul}]}],pl={},vl={};function gl(e,t,n){var r=n,o=function(n){je("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(aa.prototype[t])return o(t);aa.prototype[t]=n}else if("collection"===e){if(Ei.prototype[t])return o(t);Ei.prototype[t]=n}else if("layout"===e){for(var i=function(e){this.options=e,n.call(this,e),D(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=i.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var u=s[l];a[u]=a[u]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var c=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return c?c.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},f={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};K(a,{createEmitter:function(){return this._private.emitter=new Vo(f,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),sr.eventAliasesOn(a),r=i}else if("renderer"===e&&"null"!==t&&"base"!==t){var h=yl("renderer","base"),p=h.prototype,v=n,g=n.prototype,y=function(){h.apply(this,arguments),v.apply(this,arguments)},m=y.prototype;for(var b in p){var x=p[b];if(null!=g[b])return o(b);m[b]=x}for(var w in g)m[w]=g[w];p.clientFunctions.forEach((function(e){m[e]=m[e]||function(){Se("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}else if("__proto__"===e||"constructor"===e||"prototype"===e)return Se(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return J({map:pl,keys:[e,t],value:r})}function yl(e,t){return ee({map:pl,keys:[e,t]})}function ml(e,t,n,r,o){return J({map:vl,keys:[e,t,n,r],value:o})}function bl(e,t,n,r){return ee({map:vl,keys:[e,t,n,r]})}var xl=function(){return 2===arguments.length?yl.apply(null,arguments):3===arguments.length?gl.apply(null,arguments):4===arguments.length?bl.apply(null,arguments):5===arguments.length?ml.apply(null,arguments):void Se("Invalid extension access syntax")};aa.prototype.extension=xl,hl.forEach((function(e){e.extensions.forEach((function(t){gl(e.type,t.name,t.impl)}))}));var wl=function e(){if(!(this instanceof e))return new e;this.length=0},_l=wl.prototype;_l.instanceString=function(){return"stylesheet"},_l.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},_l.css=function(e,t){var n=this.length-1;if(C(e))this[n].properties.push({name:e,value:t});else if(D(e))for(var r=e,o=Object.keys(r),i=0;i<o.length;i++){var a=o[i],s=r[a];if(null!=s){var l=ta.properties[a]||ta.properties[W(a)];if(null!=l){var u=l.name,c=s;this[n].properties.push({name:u,value:c})}}}return this},_l.style=_l.css,_l.generateStyle=function(e){var t=new ta(e);return this.appendToStyle(t)},_l.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,o=n.properties;e.selector(r);for(var i=0;i<o.length;i++){var a=o[i];e.css(a.name,a.value)}}return e};var El=function(e){return void 0===e&&(e={}),D(e)?new aa(e):C(e)?xl.apply(xl,arguments):void 0};El.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(El),e.apply(null,t),this},El.warnings=function(e){return Pe(e)},El.version="3.23.0",El.stylesheet=El.Stylesheet=wl,e.exports=El},46506:(e,t,n)=>{e.exports={graphlib:n(71310),layout:n(42529),debug:n(5512),util:{time:n(8783).time,notime:n(8783).notime},version:n(57589)}},85247:(e,t,n)=>{"use strict";var r=n(43294),o=n(38757);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?o(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},o={};function i(a){r.has(o,a)||(o[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):i(e.w)})),delete n[a])}return r.forEach(e.nodes(),i),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},49654:(e,t,n)=>{var r=n(43294),o=n(8783);function i(e,t,n,r,i,a){var s={width:0,height:0,rank:a,borderType:t},l=i[t][a-1],u=o.addDummyNode(e,"border",s,n);i[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var o=e.children(n),a=e.node(n);if(o.length&&r.forEach(o,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s<l;++s)i(e,"borderLeft","_bl",n,a,s),i(e,"borderRight","_br",n,a,s)}}))}},25128:(e,t,n)=>{"use strict";var r=n(43294);function o(e){r.forEach(e.nodes(),(function(t){i(e.node(t))})),r.forEach(e.edges(),(function(t){i(e.edge(t))}))}function i(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||o(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e);"lr"!==t&&"rl"!==t||(!function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),o(e))}}},65199:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},5512:(e,t,n)=>{var r=n(43294),o=n(8783),i=n(71310).Graph;e.exports={debugOrdering:function(e){var t=o.buildLayerMatrix(e),n=new i({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var o="layer"+t;n.setNode(o,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},71310:(e,t,n)=>{var r;try{r=n(87377)}catch(o){}r||(r=window.graphlib),e.exports=r},38757:(e,t,n)=>{var r=n(43294),o=n(71310).Graph,i=n(65199);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new o,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,o=t(e),i=r+o;n.setEdge(e.v,e.w,i),s=Math.max(s,n.node(e.v).out+=o),a=Math.max(a,n.node(e.w).in+=o)}));var u=r.range(s+a+3).map((function(){return new i})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){var r,o=[],i=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=i.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){o=o.concat(s(e,t,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,o,i){var a=i?[]:void 0;return r.forEach(e.inEdges(o.v),(function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,l(t,n,s)})),r.forEach(e.outEdges(o.v),(function(r){var o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,l(t,n,a)})),e.removeNode(o.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},42529:(e,t,n)=>{"use strict";var r=n(43294),o=n(85247),i=n(20450),a=n(64618),s=n(8783).normalizeRanks,l=n(77908),u=n(8783).removeEmptyRanks,c=n(96820),d=n(49654),f=n(25128),h=n(73641),p=n(65784),v=n(8783),g=n(71310).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n("  buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=P(e.graph());return t.setGraph(r.merge({},m,S(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var o=P(e.node(n));t.setNode(n,r.defaults(S(o,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var o=P(e.edge(n));t.setEdge(n,r.merge({},E,S(o,_),r.pick(o,k)))})),t}(e)}));n("  runLayout",(function(){!function(e,t){t("    makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t("    removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t("    acyclic",(function(){o.run(e)})),t("    nestingGraph.run",(function(){c.run(e)})),t("    rank",(function(){a(v.asNonCompoundGraph(e))})),t("    injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",o,"_ep")}}))}(e)})),t("    removeEmptyRanks",(function(){u(e)})),t("    nestingGraph.cleanup",(function(){c.cleanup(e)})),t("    normalizeRanks",(function(){s(e)})),t("    assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=r.max(t,o.maxRank))})),e.graph().maxRank=t}(e)})),t("    removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t("    normalize.run",(function(){i.run(e)})),t("    parentDummyChains",(function(){l(e)})),t("    addBorderSegments",(function(){d(e)})),t("    order",(function(){h(e)})),t("    insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,o){var i=e.node(t);i.order=o+n,r.forEach(i.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:o+ ++n,e:t.e,label:t.label},"_se")})),delete i.selfEdges}))}))}(e)})),t("    adjustCoordinateSystem",(function(){f.adjust(e)})),t("    position",(function(){p(e)})),t("    positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t("    removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),o=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t("    normalize.undo",(function(){i.undo(e)})),t("    fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t("    undoCoordinateSystem",(function(){f.undo(e)})),t("    translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),o=Math.min(o,a-l/2),i=Math.max(i,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,o-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=o})),r.forEach(e.edges(),(function(n){var i=e.edge(n);r.forEach(i.points,(function(e){e.x-=t,e.y-=o})),r.has(i,"x")&&(i.x-=t),r.has(i,"y")&&(i.y-=o)})),a.width=n-t+s,a.height=i-o+l}(e)})),t("    assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(v.intersectRect(i,n)),o.points.push(v.intersectRect(a,r))}))}(e)})),t("    reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t("    acyclic.undo",(function(){o.undo(e)}))}(t,n)})),n("  updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),o=t.node(n);r&&(r.x=o.x,r.y=o.y,t.children(n).length&&(r.width=o.width,r.height=o.height))})),r.forEach(e.edges(),(function(n){var o=e.edge(n),i=t.edge(n);o.points=i.points,r.has(i,"x")&&(o.x=i.x,o.y=i.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function S(e,t){return r.mapValues(r.pick(e,t),Number)}function P(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},43294:(e,t,n)=>{var r;try{r={cloneDeep:n(9850),constant:n(86874),defaults:n(84573),each:n(79421),filter:n(90882),find:n(55281),flatten:n(35676),forEach:n(59756),forIn:n(20792),has:n(93352),isUndefined:n(84336),last:n(56974),map:n(16760),mapValues:n(34519),max:n(71644),merge:n(98537),min:n(65680),minBy:n(10937),now:n(61100),pick:n(13888),range:n(2689),reduce:n(58215),sortBy:n(829),uniqueId:n(74930),values:n(98346),zipObject:n(46150)}}catch(o){}r||(r=window._),e.exports=r},96820:(e,t,n)=>{var r=n(43294),o=n(8783);function i(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=o.addBorderNode(e,"_bt"),f=o.addBorderNode(e,"_bb"),h=e.node(u);e.setParent(d,u),h.borderTop=d,e.setParent(f,u),h.borderBottom=f,r.forEach(c,(function(r){i(e,t,n,a,s,l,r);var o=e.node(r),c=o.borderTop?o.borderTop:r,h=o.borderBottom?o.borderBottom:r,p=o.borderTop?a:2*a,v=c!==h?1:s-l[u]+1;e.setEdge(d,c,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(h,f,{weight:p,minlen:v,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=o.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(o,i){var a=e.children(o);a&&a.length&&r.forEach(a,(function(e){n(e,i+1)})),t[o]=i}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){i(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},20450:(e,t,n)=>{"use strict";var r=n(43294),o=n(8783);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,i,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),f=d.labelRank;if(u===s+1)return;for(e.removeEdge(t),i=0,++s;s<u;++i,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=o.addDummyNode(e,"edge",r,"_d"),s===f&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},c),0===i&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,l,{weight:d.weight},c)}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=n,r=e.node(t)}))}}},47897:(e,t,n)=>{var r=n(43294);e.exports=function(e,t,n){var o,i={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=i[r],i[r]=s):(a=o,o=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},29533:(e,t,n)=>{var r=n(43294);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var o=r.reduce(n,(function(t,n){var r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}}))}},64622:(e,t,n)=>{var r=n(43294),o=n(71310).Graph;e.exports=function(e,t,n){var i=function(e){var t;for(;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new o({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(o){var s=e.node(o),l=e.parent(o);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(o),a.setParent(o,l||i),r.forEach(e[n](o),(function(t){var n=t.v===o?t.w:t.v,i=a.edge(n,o),s=r.isUndefined(i)?0:i.weight;a.setEdge(n,o,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(o,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6254:(e,t,n)=>{"use strict";var r=n(43294);function o(e,t,n){for(var o=r.zipObject(n,r.map(n,(function(e,t){return t}))),i=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:o[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var l=r.map(new Array(s),(function(){return 0})),u=0;return r.forEach(i.forEach((function(e){var t=e.pos+a;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=o(e,t[r-1],t[r]);return n}},73641:(e,t,n)=>{"use strict";var r=n(43294),o=n(65036),i=n(6254),a=n(83956),s=n(64622),l=n(47897),u=n(71310).Graph,c=n(8783);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function f(e,t){var n=new u;r.forEach(e,(function(e){var o=e.graph().root,i=a(e,o,n,t);r.forEach(i.vs,(function(t,n){e.node(t).order=n})),l(e,n,i.vs)}))}function h(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=o(e);h(e,s);for(var l,u=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){f(p%2?n:a,p%4>=2),s=c.buildLayerMatrix(e);var g=i(e,s);g<u&&(v=0,l=r.cloneDeep(s),u=g)}h(e,l)}},65036:(e,t,n)=>{"use strict";var r=n(43294);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),o=r.max(r.map(n,(function(t){return e.node(t).rank}))),i=r.map(r.range(o+1),(function(){return[]}));var a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(o){if(r.has(t,o))return;t[o]=!0;var a=e.node(o);i[a.rank].push(o),r.forEach(e.successors(o),n)})),i}},39953:(e,t,n)=>{"use strict";var r=n(43294);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var o=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(o.barycenter=e.barycenter,o.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],o=n[e.w];r.isUndefined(t)||r.isUndefined(o)||(o.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function o(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),r.forEach(i.in.reverse(),n(i)),r.forEach(i.out,o(i))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},83956:(e,t,n)=>{var r=n(43294),o=n(29533),i=n(39953),a=n(11957);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,f=c?c.borderRight:void 0,h={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==f})));var p=o(t,u);r.forEach(p,(function(n){if(t.children(n.v).length){var o=e(t,n.v,s,l);h[n.v]=o,r.has(o,"barycenter")&&(i=n,a=o,r.isUndefined(i.barycenter)?(i.barycenter=a.barycenter,i.weight=a.weight):(i.barycenter=(i.barycenter*i.weight+a.barycenter*a.weight)/(i.weight+a.weight),i.weight+=a.weight))}var i,a}));var v=i(p,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,h);var g=a(v,l);if(d&&(g.vs=r.flatten([d,g.vs,f],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(f)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g}},11957:(e,t,n)=>{var r=n(43294),o=n(8783);function i(e,t,n){for(var o;t.length&&(o=r.last(t)).i<=n;)t.pop(),e.push(o.vs),n++;return n}e.exports=function(e,t){var n=o.partition(e,(function(e){return r.has(e,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(e){return-e.i})),l=[],u=0,c=0,d=0;a.sort((f=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:f?t.i-e.i:e.i-t.i})),d=i(l,s,d),r.forEach(a,(function(e){d+=e.vs.length,l.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,d=i(l,s,d)}));var f;var h={vs:r.flatten(l,!0)};c&&(h.barycenter=u/c,h.weight=c);return h}},77908:(e,t,n)=>{var r=n(43294);e.exports=function(e){var t=function(e){var t={},n=0;function o(i){var a=n;r.forEach(e.children(i),o),t[i]={low:a,lim:n++}}return r.forEach(e.children(),o),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),o=r.edgeObj,i=function(e,t,n,r){var o,i,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);o=n;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>l||u>t[o].lim));i=o,o=r;for(;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(e,t,o.v,o.w),a=i.path,s=i.lca,l=0,u=a[l],c=!0;n!==o.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank<r.rank;)l++;u===s&&(c=!1)}if(!c){for(;l<a.length-1&&e.node(u=a[l+1]).minRank<=r.rank;)l++;u=a[l]}e.setParent(n,u),n=e.successors(n)[0]}}))}},91753:(e,t,n)=>{"use strict";var r=n(43294),o=n(71310).Graph,i=n(8783);function a(e,t){var n={};return r.reduce(t,(function(t,o){var i=0,a=0,s=t.length,u=r.last(o);return r.forEach(o,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),f=d?e.node(d).order:s;(d||t===u)&&(r.forEach(o.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var o=e.node(r),a=o.order;!(a<i||f<a)||o.dummy&&e.node(t).dummy||l(n,r,t)}))})),a=c+1,i=f)})),o})),n}function s(e,t){var n={};function o(t,o,i,a,s){var u;r.forEach(r.range(o,i),(function(o){u=t[o],e.node(u).dummy&&r.forEach(e.predecessors(u),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var i,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(i=e.node(u[0]).order,o(n,s,l,a,i),s=l,a=i)}o(n,s,n.length,i,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var o=e[t];o||(e[t]=o={}),o[n]=!0}function u(e,t,n){if(t>n){var o=t;t=n,n=o}return r.has(e[t],n)}function c(e,t,n,o){var i={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){i[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=o(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),f=Math.ceil(c);d<=f;++d){var h=l[d];a[e]===e&&t<s[h]&&!u(n,e,h)&&(a[h]=e,a[e]=i[e]=i[h],t=s[h])}}}))})),{root:i,align:a}}function d(e,t,n,i,a){var s={},l=function(e,t,n,i){var a=new o,s=e.graph(),l=function(e,t,n){return function(o,i,a){var s,l=o.node(i),u=o.node(a),c=0;if(c+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(c+=n?s:-s),s=0,c+=(l.dummy?t:e)/2,c+=(u.dummy?t:e)/2,c+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2}return s&&(c+=n?s:-s),s=0,c}}(s.nodesep,s.edgesep,i);return r.forEach(t,(function(t){var o;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),o){var i=n[o],s=a.edge(i,r);a.setEdge(i,r,Math.max(l(e,t,o),s||0))}o=t}))})),a}(e,t,n,a),u=a?"borderLeft":"borderRight";function c(e,t){for(var n=l.nodes(),r=n.pop(),o={};r;)o[r]?e(r):(o[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return c((function(e){s[e]=l.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+l.edge(t))}),0)}),l.predecessors.bind(l)),c((function(t){var n=l.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-l.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(s[t]=Math.max(s[t],n))}),l.successors.bind(l)),r.forEach(i,(function(e){s[e]=s[n[e]]})),s}function f(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var i=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+i,n),o=Math.min(t-i,o)})),n-o}))}function h(e,t){var n=r.values(t),o=r.min(n),i=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,l=n+a,u=e[l];if(u!==t){var c=r.values(u);(s="l"===a?o-r.min(c):i-r.max(c))&&(e[l]=r.mapValues(u,(function(e){return e+s})))}}))}))}function p(e,t){return r.mapValues(e.ul,(function(n,o){if(t)return e[t.toLowerCase()][o];var i=r.sortBy(r.map(e,o));return(i[1]+i[2])/2}))}e.exports={positionX:function(e){var t,n=i.buildLayerMatrix(e),o=r.merge(a(e,n),s(e,n)),l={};r.forEach(["u","d"],(function(i){t="u"===i?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e),s=c(e,t,o,a),u=d(e,t,s.root,s.align,"r"===n);"r"===n&&(u=r.mapValues(u,(function(e){return-e}))),l[i+n]=u}))}));var u=f(e,l);return h(l,u),p(l,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:l,hasConflict:u,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:h,findSmallestWidthAlignment:f,balance:p}},65784:(e,t,n)=>{"use strict";var r=n(43294),o=n(8783),i=n(91753).positionX;e.exports=function(e){(function(e){var t=o.buildLayerMatrix(e),n=e.graph().ranksep,i=0;r.forEach(t,(function(t){var o=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=i+o/2})),i+=o+n}))})(e=o.asNonCompoundGraph(e)),r.forEach(i(e),(function(t,n){e.node(n).x=t}))}},49154:(e,t,n)=>{"use strict";var r=n(43294),o=n(71310).Graph,i=n(85986).slack;function a(e,t){return r.forEach(e.nodes(),(function n(o){r.forEach(t.nodeEdges(o),(function(r){var a=r.v,s=o===a?r.w:a;e.hasNode(s)||i(t,r)||(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return i(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new o({directed:!1}),u=e.nodes()[0],c=e.nodeCount();r.setNode(u,{});for(;a(r,e)<c;)t=s(r,e),n=r.hasNode(t.v)?i(e,t):-i(e,t),l(r,e,n);return r}},64618:(e,t,n)=>{"use strict";var r=n(85986).longestPath,o=n(49154),i=n(57310);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":!function(e){r(e),o(e)}(e);break;case"longest-path":a(e)}};var a=r;function s(e){i(e)}},57310:(e,t,n)=>{"use strict";var r=n(43294),o=n(49154),i=n(85986).slack,a=n(85986).longestPath,s=n(71310).alg.preorder,l=n(71310).alg.postorder,u=n(8783).simplify;function c(e){e=u(e),a(e);var t,n=o(e);for(h(n),d(n,e);t=v(n);)y(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=f(e,t,n)}(e,t,n)}))}function f(e,t,n){var o=e.node(n).parent,i=!0,a=t.edge(n,o),s=0;return a||(i=!1,a=t.edge(o,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==o){var d=u===i,f=t.edge(r).weight;if(s+=d?f:-f,a=n,l=c,e.hasEdge(a,l)){var h=e.edge(n,c).cutvalue;s+=d?-h:h}}})),s}function h(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,o,i){var a=n,s=e.node(o);return t[o]=!0,r.forEach(e.neighbors(o),(function(i){r.has(t,i)||(n=p(e,t,n,i,o))})),s.low=a,s.lim=n++,i?s.parent=i:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var o=n.v,a=n.w;t.hasEdge(o,a)||(o=n.w,a=n.v);var s=e.node(o),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(e,e.node(t.v),u)&&c!==m(e,e.node(t.w),u)}));return r.minBy(d,(function(e){return i(t,e)}))}function y(e,t,n,o){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(o.v,o.w,{}),h(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),o=s(e,n);o=o.slice(1),r.forEach(o,(function(n){var r=e.node(n).parent,o=t.edge(n,r),i=!1;o||(o=t.edge(r,n),i=!0),t.node(n).rank=t.node(r).rank+(i?o.minlen:-o.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=h,c.initCutValues=d,c.calcCutValue=f,c.leaveEdge=v,c.enterEdge=g,c.exchangeEdges=y},85986:(e,t,n)=>{"use strict";var r=n(43294);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(o){var i=e.node(o);if(r.has(t,o))return i.rank;t[o]=!0;var a=r.min(r.map(e.outEdges(o),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),i.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},8783:(e,t,n)=>{"use strict";var r=n(43294),o=n(71310).Graph;function i(e,t,n,o){var i;do{i=r.uniqueId(o)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:i,simplify:function(e){var t=(new o).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),t},asNonCompoundGraph:function(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,o=e.x,i=e.y,a=t.x-o,s=t.y-i,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a);return{x:o+n,y:i+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var o=e.node(n),i=o.rank;r.isUndefined(i)||(t[i][o.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var o=e.node(n);r.has(o,"rank")&&(o.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)}));var o=0,i=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%i!=0?--o:o&&r.forEach(t,(function(t){e.node(t).rank+=o}))}))},addBorderNode:function(e,t,n,r){var o={width:0,height:0};arguments.length>=4&&(o.rank=n,o.order=r);return i(e,"border",o,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},57589:e=>{e.exports="0.8.5"},77847:e=>{e.exports=a,a.default=a,a.stable=c,a.stableStringify=c;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),l(e,"",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,f(t),n)}catch(c){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function l(e,r,o,i,a,u,c){var d;if(u+=1,"object"==typeof e&&null!==e){for(d=0;d<i.length;d++)if(i[d]===e)return void s(n,e,r,a);if(void 0!==c.depthLimit&&u>c.depthLimit)return void s(t,e,r,a);if(void 0!==c.edgesLimit&&o+1>c.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,i,e,u,c);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var h=f[d];l(e[h],h,d,i,e,u,c)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function c(e,t,n,a){void 0===a&&(a=i());var s,l=d(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(l,t,n):JSON.stringify(l,f(t),n)}catch(c){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function d(e,o,i,a,l,c,f){var h;if(c+=1,"object"==typeof e&&null!==e){for(h=0;h<a.length;h++)if(a[h]===e)return void s(n,e,o,l);try{if("function"==typeof e.toJSON)return}catch(y){return}if(void 0!==f.depthLimit&&c>f.depthLimit)return void s(t,e,o,l);if(void 0!==f.edgesLimit&&i+1>f.edgesLimit)return void s(t,e,o,l);if(a.push(e),Array.isArray(e))for(h=0;h<e.length;h++)d(e[h],h,h,a,e,c,f);else{var p={},v=Object.keys(e).sort(u);for(h=0;h<v.length;h++){var g=v[h];d(e[g],g,h,a,e,c,f),p[g]=e[g]}if(void 0===l)return p;r.push([l,o,e]),l[o]=p}a.pop()}}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},87377:(e,t,n)=>{var r=n(89);e.exports={Graph:r.Graph,json:n(80109),alg:n(577),version:r.version}},70229:(e,t,n)=>{var r=n(60274);e.exports=function(e){var t,n={},o=[];function i(o){r.has(n,o)||(n[o]=!0,t.push(o),r.each(e.successors(o),i),r.each(e.predecessors(o),i))}return r.each(e.nodes(),(function(e){t=[],i(e),t.length&&o.push(t)})),o}},70223:(e,t,n)=>{var r=n(60274);function o(e,t,n,i,a,s){r.has(i,t)||(i[t]=!0,n||s.push(t),r.each(a(t),(function(t){o(e,t,n,i,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);o(e,t,"post"===n,s,i,a)})),a}},19487:(e,t,n)=>{var r=n(16493),o=n(60274);e.exports=function(e,t,n){return o.transform(e.nodes(),(function(o,i){o[i]=r(e,i,t,n)}),{})}},16493:(e,t,n)=>{var r=n(60274),o=n(70905);e.exports=function(e,t,n,r){return function(e,t,n,r){var i,a,s={},l=new o,u=function(e){var t=e.v!==i?e.v:e.w,r=s[t],o=n(e),u=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);u<r.distance&&(r.distance=u,r.predecessor=i,l.decrease(t,u))};e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)}));for(;l.size()>0&&(i=l.removeMin(),(a=s[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);return s}(e,String(t),n||i,r||function(t){return e.outEdges(t)})};var i=r.constant(1)},24395:(e,t,n)=>{var r=n(60274),o=n(99289);e.exports=function(e){return r.filter(o(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},92077:(e,t,n)=>{var r=n(60274);e.exports=function(e,t,n){return function(e,t,n){var r={},o=e.nodes();return o.forEach((function(e){r[e]={},r[e][e]={distance:0},o.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var o=n.v===e?n.w:n.v,i=t(n);r[e][o]={distance:i,predecessor:e}}))})),o.forEach((function(e){var t=r[e];o.forEach((function(n){var i=r[n];o.forEach((function(n){var r=i[e],o=t[n],a=i[n],s=r.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)}))}))})),r}(e,t||o,n||function(t){return e.outEdges(t)})};var o=r.constant(1)},577:(e,t,n)=>{e.exports={components:n(70229),dijkstra:n(16493),dijkstraAll:n(19487),findCycles:n(24395),floydWarshall:n(92077),isAcyclic:n(67141),postorder:n(34825),preorder:n(78852),prim:n(78492),tarjan:n(99289),topsort:n(69176)}},67141:(e,t,n)=>{var r=n(69176);e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},34825:(e,t,n)=>{var r=n(70223);e.exports=function(e,t){return r(e,t,"post")}},78852:(e,t,n)=>{var r=n(70223);e.exports=function(e,t){return r(e,t,"pre")}},78492:(e,t,n)=>{var r=n(60274),o=n(53099),i=n(70905);e.exports=function(e,t){var n,a=new o,s={},l=new i;function u(e){var r=e.v===n?e.w:e.v,o=l.priority(r);if(void 0!==o){var i=t(e);i<o&&(s[r]=n,l.decrease(r,i))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){l.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),l.decrease(e.nodes()[0],0);var c=!1;for(;l.size()>0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},99289:(e,t,n)=>{var r=n(60274);e.exports=function(e){var t=0,n=[],o={},i=[];function a(s){var l=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(o,e)?o[e].onStack&&(l.lowlink=Math.min(l.lowlink,o[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,o[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),o[u].onStack=!1,c.push(u)}while(s!==u);i.push(c)}}return e.nodes().forEach((function(e){r.has(o,e)||a(e)})),i}},69176:(e,t,n)=>{var r=n(60274);function o(e){var t={},n={},o=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new i;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],o.push(s))})),r.size(t)!==e.nodeCount())throw new i;return o}function i(){}e.exports=o,o.CycleException=i,i.prototype=new Error},70905:(e,t,n)=>{var r=n(60274);function o(){this._arr=[],this._keyIndices={}}e.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},o.prototype.has=function(e){return r.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var o=this._arr,i=o.length;return n[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))},o.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},o.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}},53099:(e,t,n)=>{"use strict";var r=n(60274);e.exports=i;var o="\0";function i(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,o){var i=""+t,a=""+n;if(!e&&i>a){var s=i;i=a,a=s}return i+"\x01"+a+"\x01"+(r.isUndefined(o)?"\0":o)}function u(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}function c(e,t){return l(e,t.v,t.w,t.name)}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(e){return this._label=e,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},i.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},i.prototype.setNodes=function(e,t){var n=arguments,o=this;return r.each(e,(function(e){n.length>1?o.setNode(e,t):o.setNode(e)})),this},i.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},i.prototype.node=function(e){return this._nodes[e]},i.prototype.hasNode=function(e){return r.has(this._nodes,e)},i.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},i.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},i.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},i.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},i.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},i.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},i.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},i.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},i.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},i.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var o={};function i(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(o[e]=r,r):r in o?o[r]:i(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,i(e))})),t},i.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(e,t){var n=this,o=arguments;return r.reduce(e,(function(e,r){return o.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},i.prototype.setEdge=function(){var e,t,n,o,i=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(o=arguments[1],i=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],i=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return i&&(this._edgeLabels[c]=o),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=i?o:this._defaultEdgeLabelFn(e,t,n);var d=u(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[c]=d,a(this._preds[t],e),a(this._sucs[e],t),this._in[t][c]=d,this._out[e][c]=d,this._edgeCount++,this},i.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},i.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},i.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),o=this._edgeObjs[r];return o&&(e=o.v,t=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},i.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=r.values(n);return t?r.filter(o,(function(e){return e.v===t})):o}},i.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=r.values(n);return t?r.filter(o,(function(e){return e.w===t})):o}},i.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},89:(e,t,n)=>{e.exports={Graph:n(53099),version:n(90702)}},80109:(e,t,n)=>{var r=n(60274),o=n(53099);function i(e){return r.map(e.nodes(),(function(t){var n=e.node(t),o=e.parent(t),i={v:t};return r.isUndefined(n)||(i.value=n),r.isUndefined(o)||(i.parent=o),i}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),o={v:t.v,w:t.w};return r.isUndefined(t.name)||(o.name=t.name),r.isUndefined(n)||(o.value=n),o}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:i(e),edges:a(e)};r.isUndefined(e.graph())||(t.value=r.clone(e.graph()));return t},read:function(e){var t=new o(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},60274:(e,t,n)=>{var r;try{r={clone:n(54004),constant:n(86874),each:n(79421),filter:n(90882),has:n(93352),isArray:n(86152),isEmpty:n(45455),isFunction:n(61049),isUndefined:n(84336),keys:n(90249),map:n(16760),reduce:n(58215),size:n(36402),transform:n(89466),union:n(26139),values:n(98346)}}catch(o){}r||(r=window._),e.exports=r},90702:e=>{e.exports="2.1.8"},71254:(e,t,n)=>{e.exports=n(38397)},38397:function(e,t){var n,r,o;(function(){var i,a,s,l,u,c,d,f,h,p,v,g,y,m,b;s=Math.floor,p=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},h=function(e,t,n,r,o){var i;if(null==n&&(n=0),null==o&&(o=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)o(t,e[i=s((n+r)/2)])<0?r=i:n=i+1;return[].splice.apply(e,[n,n-n].concat(t)),t},c=function(e,t,n){return null==n&&(n=a),e.push(t),m(e,0,e.length-1,n)},u=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},f=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},l=function(e,t){var n,r,o,i,l,u;for(null==t&&(t=a),i=(function(){u=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}).apply(this).reverse(),l=[],r=0,o=i.length;r<o;r++)n=i[r],l.push(b(e,n,t));return l},y=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return m(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,o,i,s,u;if(null==n&&(n=a),!(o=e.slice(0,t)).length)return o;for(l(o,n),i=0,s=(u=e.slice(t)).length;i<s;i++)r=u[i],d(o,r,n);return o.sort(n).reverse()},g=function(e,t,n){var r,o,i,s,c,d,f,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(i=e.slice(0,t).sort(n)).length)return i;for(o=i[i.length-1],s=0,d=(f=e.slice(t)).length;s<d;s++)n(r=f[s],o)<0&&(h(i,r,0,null,n),i.pop(),o=i[i.length-1]);return i}for(l(e,n),g=[],c=0,v=p(t,e.length);0<=v?c<v:c>v;0<=v?++c:--c)g.push(u(e,n));return g},m=function(e,t,n,r){var o,i,s;for(null==r&&(r=a),o=e[n];n>t&&r(o,i=e[s=n-1>>1])<0;)e[n]=i,n=s;return e[n]=o},b=function(e,t,n){var r,o,i,s,l;for(null==n&&(n=a),o=e.length,l=t,i=e[t],r=2*t+1;r<o;)(s=r+1)<o&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=i,m(e,l,t,n)},i=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=c,e.pop=u,e.replace=f,e.pushpop=d,e.heapify=l,e.updateItem=y,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return c(this.nodes,e,this.cmp)},e.prototype.pop=function(){return u(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return f(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return l(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),r=[],void 0===(o="function"==typeof(n=function(){return i})?n.apply(t,r):n)||(e.exports=o)}).call(this)},50340:(e,t)=>{function n(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(e){return!!e&&!!e[K]}function o(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Q}(e)||Array.isArray(e)||!!e[$]||!!(null===(t=e.constructor)||void 0===t?void 0:t[$])||d(e)||f(e))}function i(e,t,n){void 0===n&&(n=!1),0===a(e)?(n?Object.keys:J)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function a(e){var t=e[K];return t?t.t>3?t.t-4:t.t:Array.isArray(e)?1:d(e)?2:f(e)?3:0}function s(e,t){return 2===a(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){return 2===a(e)?e.get(t):e[t]}function u(e,t,n){var r=a(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return W&&e instanceof Map}function f(e){return Y&&e instanceof Set}function h(e){return e.i||e.o}function p(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ee(e);delete t[K];for(var n=J(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function v(e,t){return void 0===t&&(t=!1),y(e)||r(e)||!o(e)||(a(e)>1&&(e.set=e.add=e.clear=e.delete=g),Object.freeze(e),t&&i(e,(function(e,t){return v(t,!0)}),!0)),e}function g(){n(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function m(e){var t=te[e];return t||n(18,e),t}function b(e,t){te[e]||(te[e]=t)}function x(){return G}function w(e,t){t&&(m("Patches"),e.u=[],e.v=[],e.s=t)}function _(e){E(e),e.p.forEach(S),e.p=null}function E(e){e===G&&(G=e.l)}function k(e){return G={p:[],l:G,h:e,_:!0,m:0}}function S(e){var t=e[K];0===t.t||1===t.t?t.j():t.O=!0}function P(e,t){t.m=t.p.length;var r=t.p[0],i=void 0!==e&&e!==r;return t.h.S||m("ES5").P(t,e,i),i?(r[K].M&&(_(t),n(4)),o(e)&&(e=j(t,e),t.l||T(t,e)),t.u&&m("Patches").g(r[K].o,e,t.u,t.v)):e=j(t,r,[]),_(t),t.u&&t.s(t.u,t.v),e!==X?e:void 0}function j(e,t,n){if(y(t))return t;var r=t[K];if(!r)return i(t,(function(o,i){return C(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.M)return T(e,r.o,!0),r.o;if(!r.R){r.R=!0,r.A.m--;var o=4===r.t||5===r.t?r.i=p(r.k):r.i;i(3===r.t?new Set(o):o,(function(t,i){return C(e,r,o,t,i,n)})),T(e,o,!1),n&&e.u&&m("Patches").F(r,n,e.u,e.v)}return r.i}function C(e,t,n,i,a,l){if(r(a)){var c=j(e,a,l&&t&&3!==t.t&&!s(t.D,i)?l.concat(i):void 0);if(u(n,i,c),!r(c))return;e._=!1}if(o(a)&&!y(a)){if(!e.h.K&&e.m<1)return;j(e,a),t&&t.A.l||T(e,a)}}function T(e,t,n){void 0===n&&(n=!1),e.h.K&&e._&&v(t,n)}function O(e,t){var n=e[K];return(n?h(n):e)[t]}function D(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function N(e){e.M||(e.M=!0,e.l&&N(e.l))}function A(e){e.i||(e.i=p(e.o))}function R(e,t,n){var r=d(t)?m("MapSet").$(t,n):f(t)?m("MapSet").C(t,n):e.S?function(e,t){var n=Array.isArray(e),r={t:n?1:0,A:t?t.A:x(),M:!1,R:!1,D:{},l:t,o:e,k:null,i:null,j:null,I:!1},o=r,i=ne;n&&(o=[r],i=re);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):m("ES5").J(t,n);return(n?n.A:x()).p.push(r),r}function M(e){return r(e)||n(22,e),function e(t){if(!o(t))return t;var n,r=t[K],s=a(t);if(r){if(!r.M&&(r.t<4||!m("ES5").N(r)))return r.o;r.R=!0,n=I(t,s),r.R=!1}else n=I(t,s);return i(n,(function(t,o){r&&l(r.o,t)===o||u(n,t,e(o))})),3===s?new Set(n):n}(e)}function I(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return p(e)}function L(){function e(e,t){var n=a[e];return n?n.enumerable=t:a[e]=n={configurable:!0,enumerable:t,get:function(){return ne.get(this[K],e)},set:function(t){ne.set(this[K],e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var r=e[t][K];if(!r.M)switch(r.t){case 5:o(r)&&N(r);break;case 4:n(r)&&N(r)}}}function n(e){for(var t=e.o,n=e.k,r=J(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==K){var a=t[i];if(void 0===a&&!s(t,i))return!0;var l=n[i],u=l&&l[K];if(u?u.o!==a:!c(l,a))return!0}}var d=!!t[K];return r.length!==J(t).length+(d?0:1)}function o(e){var t=e.k;if(t.length!==e.o.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var a={};b("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=ee(n);delete i[K];for(var a=J(i),s=0;s<a.length;s++){var l=a[s];i[l]=e(l,t||!!i[l].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={t:r?5:4,A:n?n.A:x(),M:!1,R:!1,D:{},l:n,o:t,k:o,i:null,O:!1,I:!1};return Object.defineProperty(o,K,{value:i,writable:!0}),o},P:function(e,n,a){a?r(n)&&n[K].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[K];if(n){var r=n.o,a=n.k,l=n.D,u=n.t;if(4===u)i(a,(function(t){t!==K&&(void 0!==r[t]||s(r,t)?l[t]||e(a[t]):(l[t]=!0,N(n)))})),i(r,(function(e){void 0!==a[e]||s(a,e)||(l[e]=!1,N(n))}));else if(5===u){if(o(n)&&(N(n),l.length=!0),a.length<r.length)for(var c=a.length;c<r.length;c++)l[c]=!1;else for(var d=r.length;d<a.length;d++)l[d]=!0;for(var f=Math.min(a.length,r.length),h=0;h<f;h++)a.hasOwnProperty(h)||(l[h]=!0),void 0===l[h]&&e(a[h])}}}}(e.p[0]),t(e.p))},N:function(e){return 4===e.t?n(e):o(e)}})}function B(){function e(t){if(!o(t))return t;if(Array.isArray(t))return t.map(e);if(d(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(f(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return s(t,$)&&(n[$]=t[$]),n}function t(t){return r(t)?e(t):t}var u="add";b("Patches",{W:function(t,r){return r.forEach((function(r){for(var o=r.path,i=r.op,s=t,c=0;c<o.length-1;c++){var d=a(s),f=""+o[c];0!==d&&1!==d||"__proto__"!==f&&"constructor"!==f||n(24),"function"==typeof s&&"prototype"===f&&n(24),"object"!=typeof(s=l(s,f))&&n(15,o.join("/"))}var h=a(s),p=e(r.value),v=o[o.length-1];switch(i){case"replace":switch(h){case 2:return s.set(v,p);case 3:n(16);default:return s[v]=p}case u:switch(h){case 1:return"-"===v?s.push(p):s.splice(v,0,p);case 2:return s.set(v,p);case 3:return s.add(p);default:return s[v]=p}case"remove":switch(h){case 1:return s.splice(v,1);case 2:return s.delete(v);case 3:return s.delete(r.value);default:return delete s[v]}default:n(17,i)}})),t},F:function(e,n,r,o){switch(e.t){case 0:case 4:case 2:return function(e,n,r,o){var a=e.o,c=e.i;i(e.D,(function(e,i){var d=l(a,e),f=l(c,e),h=i?s(a,e)?"replace":u:"remove";if(d!==f||"replace"!==h){var p=n.concat(e);r.push("remove"===h?{op:h,path:p}:{op:h,path:p,value:f}),o.push(h===u?{op:"remove",path:p}:"remove"===h?{op:u,path:p,value:t(d)}:{op:"replace",path:p,value:t(d)})}}))}(e,n,r,o);case 5:case 1:return function(e,n,r,o){var i=e.o,a=e.D,s=e.i;if(s.length<i.length){var l=[s,i];i=l[0],s=l[1];var c=[o,r];r=c[0],o=c[1]}for(var d=0;d<i.length;d++)if(a[d]&&s[d]!==i[d]){var f=n.concat([d]);r.push({op:"replace",path:f,value:t(s[d])}),o.push({op:"replace",path:f,value:t(i[d])})}for(var h=i.length;h<s.length;h++){var p=n.concat([h]);r.push({op:u,path:p,value:t(s[h])})}i.length<s.length&&o.push({op:"replace",path:n.concat(["length"]),value:i.length})}(e,n,r,o);case 3:return function(e,t,n,r){var o=e.o,i=e.i,a=0;o.forEach((function(e){if(!i.has(e)){var o=t.concat([a]);n.push({op:"remove",path:o,value:e}),r.unshift({op:u,path:o,value:e})}a++})),a=0,i.forEach((function(e){if(!o.has(e)){var i=t.concat([a]);n.push({op:u,path:i,value:e}),r.unshift({op:"remove",path:i,value:e})}a++}))}(e,n,r,o)}},g:function(e,t,n,r){n.push({op:"replace",path:[],value:t===X?void 0:t}),r.push({op:"replace",path:[],value:e})}})}function F(){function e(e,t){function n(){this.constructor=e}s(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.i||(e.D=new Map,e.i=new Map(e.o))}function r(e){e.i||(e.i=new Set,e.o.forEach((function(t){if(o(t)){var n=R(e.A.h,t,e);e.p.set(t,n),e.i.add(n)}else e.i.add(t)})))}function a(e){e.O&&n(3,JSON.stringify(h(e)))}var s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},l=function(){function n(e,t){return this[K]={t:2,l:t,A:t?t.A:x(),M:!1,R:!1,i:void 0,D:void 0,o:e,k:this,I:!1,O:!1},this}e(n,Map);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return h(this[K]).size}}),r.has=function(e){return h(this[K]).has(e)},r.set=function(e,n){var r=this[K];return a(r),h(r).has(e)&&h(r).get(e)===n||(t(r),N(r),r.D.set(e,!0),r.i.set(e,n),r.D.set(e,!0)),this},r.delete=function(e){if(!this.has(e))return!1;var n=this[K];return a(n),t(n),N(n),n.o.has(e)?n.D.set(e,!1):n.D.delete(e),n.i.delete(e),!0},r.clear=function(){var e=this[K];a(e),h(e).size&&(t(e),N(e),e.D=new Map,i(e.o,(function(t){e.D.set(t,!1)})),e.i.clear())},r.forEach=function(e,t){var n=this;h(this[K]).forEach((function(r,o){e.call(t,n.get(o),o,n)}))},r.get=function(e){var n=this[K];a(n);var r=h(n).get(e);if(n.R||!o(r))return r;if(r!==n.o.get(e))return r;var i=R(n.A.h,r,n);return t(n),n.i.set(e,i),i},r.keys=function(){return h(this[K]).keys()},r.values=function(){var e,t=this,n=this.keys();return(e={})[Z]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},r.entries=function(){var e,t=this,n=this.keys();return(e={})[Z]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},r[Z]=function(){return this.entries()},n}(),u=function(){function t(e,t){return this[K]={t:3,l:t,A:t?t.A:x(),M:!1,R:!1,i:void 0,o:e,k:this,p:new Map,O:!1,I:!1},this}e(t,Set);var n=t.prototype;return Object.defineProperty(n,"size",{get:function(){return h(this[K]).size}}),n.has=function(e){var t=this[K];return a(t),t.i?!!t.i.has(e)||!(!t.p.has(e)||!t.i.has(t.p.get(e))):t.o.has(e)},n.add=function(e){var t=this[K];return a(t),this.has(e)||(r(t),N(t),t.i.add(e)),this},n.delete=function(e){if(!this.has(e))return!1;var t=this[K];return a(t),r(t),N(t),t.i.delete(e)||!!t.p.has(e)&&t.i.delete(t.p.get(e))},n.clear=function(){var e=this[K];a(e),h(e).size&&(r(e),N(e),e.i.clear())},n.values=function(){var e=this[K];return a(e),r(e),e.i.values()},n.entries=function(){var e=this[K];return a(e),r(e),e.i.entries()},n.keys=function(){return this.values()},n[Z]=function(){return this.values()},n.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();b("MapSet",{$:function(e,t){return new l(e,t)},C:function(e,t){return new u(e,t)}})}var V;Object.defineProperty(t,"__esModule",{value:!0});var G,H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),W="undefined"!=typeof Map,Y="undefined"!=typeof Set,q="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,X=H?Symbol.for("immer-nothing"):((V={})["immer-nothing"]=!0,V),$=H?Symbol.for("immer-draftable"):"__$immer_draftable",K=H?Symbol.for("immer-state"):"__$immer_state",Z="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Q=""+Object.prototype.constructor,J="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ee=Object.getOwnPropertyDescriptors||function(e){var t={};return J(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},te={},ne={get:function(e,t){if(t===K)return e;var n=h(e);if(!s(n,t))return function(e,t,n){var r,o=D(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.R||!o(r)?r:r===O(e.o,t)?(A(e),e.i[t]=R(e.A.h,r,e)):r},has:function(e,t){return t in h(e)},ownKeys:function(e){return Reflect.ownKeys(h(e))},set:function(e,t,n){var r=D(h(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.M){var o=O(h(e),t),i=null==o?void 0:o[K];if(i&&i.o===n)return e.i[t]=n,e.D[t]=!1,!0;if(c(n,o)&&(void 0!==n||s(e.o,t)))return!0;A(e),N(e)}return e.i[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.i)||(e.i[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==O(e.o,t)||t in e.o?(e.D[t]=!1,A(e),N(e)):delete e.D[t],e.i&&delete e.i[t],!0},getOwnPropertyDescriptor:function(e,t){var n=h(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.t||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){n(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.o)},setPrototypeOf:function(){n(12)}},re={};i(ne,(function(e,t){re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),re.deleteProperty=function(e,t){return re.set.call(this,e,t,void 0)},re.set=function(e,t,n){return ne.set.call(this,e[0],t,n,e[0])};var oe=function(){function e(e){var t=this;this.S=q,this.K=!0,this.produce=function(e,r,i){if("function"==typeof e&&"function"!=typeof r){var a=r;r=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return s.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(o))}))}}var l;if("function"!=typeof r&&n(6),void 0!==i&&"function"!=typeof i&&n(7),o(e)){var u=k(t),c=R(t,e,void 0),d=!0;try{l=r(c),d=!1}finally{d?_(u):E(u)}return"undefined"!=typeof Promise&&l instanceof Promise?l.then((function(e){return w(u,i),P(e,u)}),(function(e){throw _(u),e})):(w(u,i),P(l,u))}if(!e||"object"!=typeof e){if(void 0===(l=r(e))&&(l=e),l===X&&(l=void 0),t.K&&v(l,!0),i){var f=[],h=[];m("Patches").g(e,l,f,h),i(f,h)}return l}n(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){o(e)||n(8),r(e)&&(e=M(e));var t=k(this),i=R(this,e,void 0);return i[K].I=!0,E(t),i},t.finishDraft=function(e,t){var n=(e&&e[K]).A;return w(n,t),P(void 0,n)},t.setAutoFreeze=function(e){this.K=e},t.setUseProxies=function(e){e&&!q&&n(20),this.S=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));var i=m("Patches").W;return r(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),ie=new oe,ae=ie.produce,se=ie.produceWithPatches.bind(ie),le=ie.setAutoFreeze.bind(ie),ue=ie.setUseProxies.bind(ie),ce=ie.applyPatches.bind(ie),de=ie.createDraft.bind(ie),fe=ie.finishDraft.bind(ie);t.Immer=oe,t.applyPatches=ce,t.castDraft=function(e){return e},t.castImmutable=function(e){return e},t.createDraft=de,t.current=M,t.default=ae,t.enableAllPlugins=function(){L(),F(),B()},t.enableES5=L,t.enableMapSet=F,t.enablePatches=B,t.finishDraft=fe,t.freeze=v,t.immerable=$,t.isDraft=r,t.isDraftable=o,t.nothing=X,t.original=function(e){return r(e)||n(23,e),e[K].o},t.produce=ae,t.produceWithPatches=se,t.setAutoFreeze=le,t.setUseProxies=ue},30412:(e,t,n)=>{"use strict";e.exports=n(50340)},39515:(e,t,n)=>{var r=n(38761)(n(37772),"DataView");e.exports=r},89612:(e,t,n)=>{var r=n(52118),o=n(96909),i=n(98138),a=n(4174),s=n(7942);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},80235:(e,t,n)=>{var r=n(3945),o=n(21846),i=n(88028),a=n(72344),s=n(94769);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},10326:(e,t,n)=>{var r=n(38761)(n(37772),"Map");e.exports=r},96738:(e,t,n)=>{var r=n(92411),o=n(36417),i=n(86928),a=n(79493),s=n(24150);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},52760:(e,t,n)=>{var r=n(38761)(n(37772),"Promise");e.exports=r},2143:(e,t,n)=>{var r=n(38761)(n(37772),"Set");e.exports=r},45386:(e,t,n)=>{var r=n(96738),o=n(52842),i=n(52482);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},86571:(e,t,n)=>{var r=n(80235),o=n(15243),i=n(72858),a=n(4417),s=n(8605),l=n(71418);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},50857:(e,t,n)=>{var r=n(37772).Symbol;e.exports=r},79162:(e,t,n)=>{var r=n(37772).Uint8Array;e.exports=r},93215:(e,t,n)=>{var r=n(38761)(n(37772),"WeakMap");e.exports=r},49432:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},72517:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},67552:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},38333:(e,t,n)=>{var r=n(77832);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},34893:e=>{e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},1634:(e,t,n)=>{var r=n(36473),o=n(79631),i=n(86152),a=n(73226),s=n(39045),l=n(77598),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),c=!n&&o(e),d=!n&&!c&&a(e),f=!n&&!c&&!d&&l(e),h=n||c||d||f,p=h?r(e.length,String):[],v=p.length;for(var g in e)!t&&!u.call(e,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},50343:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},65067:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},81207:e=>{e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},87064:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},8589:(e,t,n)=>{var r=n(20256)("length");e.exports=r},28582:(e,t,n)=>{var r=n(13940),o=n(41225);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},60091:(e,t,n)=>{var r=n(13940),o=n(41225),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},22218:(e,t,n)=>{var r=n(41225);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},67993:(e,t,n)=>{var r=n(752),o=n(90249);e.exports=function(e,t){return e&&r(t,o(t),e)}},55906:(e,t,n)=>{var r=n(752),o=n(18582);e.exports=function(e,t){return e&&r(t,o(t),e)}},13940:(e,t,n)=>{var r=n(83043);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},18874:(e,t,n)=>{var r=n(86571),o=n(72517),i=n(60091),a=n(67993),s=n(55906),l=n(92175),u=n(51522),c=n(7680),d=n(19987),f=n(13483),h=n(76939),p=n(70940),v=n(99917),g=n(8222),y=n(78725),m=n(86152),b=n(73226),x=n(4714),w=n(29259),_=n(43679),E=n(90249),k=n(18582),S="[object Arguments]",P="[object Function]",j="[object Object]",C={};C[S]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[j]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[P]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,T,O,D,N){var A,R=1&n,M=2&n,I=4&n;if(T&&(A=D?T(t,O,D,N):T(t)),void 0!==A)return A;if(!w(t))return t;var L=m(t);if(L){if(A=v(t),!R)return u(t,A)}else{var B=p(t),F=B==P||"[object GeneratorFunction]"==B;if(b(t))return l(t,R);if(B==j||B==S||F&&!D){if(A=M||F?{}:y(t),!R)return M?d(t,s(A,t)):c(t,a(A,t))}else{if(!C[B])return D?t:{};A=g(t,B,R)}}N||(N=new r);var V=N.get(t);if(V)return V;N.set(t,A),_(t)?t.forEach((function(r){A.add(e(r,n,T,r,t,N))})):x(t)&&t.forEach((function(r,o){A.set(o,e(r,n,T,o,t,N))}));var G=L?void 0:(I?M?h:f:M?k:E)(t);return o(G||t,(function(r,o){G&&(r=t[o=r]),i(A,o,e(r,n,T,o,t,N))})),A}},39413:(e,t,n)=>{var r=n(29259),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},24303:(e,t,n)=>{var r=n(26548),o=n(92019)(r);e.exports=o},2229:(e,t,n)=>{var r=n(4795);e.exports=function(e,t,n){for(var o=-1,i=e.length;++o<i;){var a=e[o],s=t(a);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,u=a}return u}},98043:(e,t,n)=>{var r=n(24303);e.exports=function(e,t){var n=[];return r(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}},21359:e=>{e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},62034:(e,t,n)=>{var r=n(65067),o=n(95882);e.exports=function e(t,n,i,a,s){var l=-1,u=t.length;for(i||(i=o),s||(s=[]);++l<u;){var c=t[l];n>0&&i(c)?n>1?e(c,n-1,i,a,s):r(s,c):a||(s[s.length]=c)}return s}},15308:(e,t,n)=>{var r=n(55463)();e.exports=r},26548:(e,t,n)=>{var r=n(15308),o=n(90249);e.exports=function(e,t){return e&&r(e,t,o)}},13324:(e,t,n)=>{var r=n(17297),o=n(33812);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},1897:(e,t,n)=>{var r=n(65067),o=n(86152);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},53366:(e,t,n)=>{var r=n(50857),o=n(62107),i=n(37157),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},84134:e=>{e.exports=function(e,t){return e>t}},32726:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},20187:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},77832:(e,t,n)=>{var r=n(21359),o=n(22195),i=n(66024);e.exports=function(e,t,n){return t==t?i(e,t,n):r(e,o,n)}},15183:(e,t,n)=>{var r=n(53366),o=n(15125);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},88746:(e,t,n)=>{var r=n(51952),o=n(15125);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},51952:(e,t,n)=>{var r=n(86571),o=n(74871),i=n(11491),a=n(17416),s=n(70940),l=n(86152),u=n(73226),c=n(77598),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,y){var m=l(e),b=l(t),x=m?f:s(e),w=b?f:s(t),_=(x=x==d?h:x)==h,E=(w=w==d?h:w)==h,k=x==w;if(k&&u(e)){if(!u(t))return!1;m=!0,_=!1}if(k&&!_)return y||(y=new r),m||c(e)?o(e,t,n,v,g,y):i(e,t,x,n,v,g,y);if(!(1&n)){var S=_&&p.call(e,"__wrapped__"),P=E&&p.call(t,"__wrapped__");if(S||P){var j=S?e.value():e,C=P?t.value():t;return y||(y=new r),g(j,C,n,v,y)}}return!!k&&(y||(y=new r),a(e,t,n,v,g,y))}},74511:(e,t,n)=>{var r=n(70940),o=n(15125);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},37036:(e,t,n)=>{var r=n(86571),o=n(88746);e.exports=function(e,t,n,i){var a=n.length,s=a,l=!i;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<s;){var c=(u=n[a])[0],d=e[c],f=u[1];if(l&&u[2]){if(void 0===d&&!(c in e))return!1}else{var h=new r;if(i)var p=i(d,f,c,e,t,h);if(!(void 0===p?o(f,d,3,i,h):p))return!1}}return!0}},22195:e=>{e.exports=function(e){return e!=e}},6840:(e,t,n)=>{var r=n(61049),o=n(47394),i=n(29259),a=n(87035),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},8109:(e,t,n)=>{var r=n(70940),o=n(15125);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},35522:(e,t,n)=>{var r=n(53366),o=n(61158),i=n(15125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},68286:(e,t,n)=>{var r=n(26423),o=n(74716),i=n(23059),a=n(86152),s=n(65798);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},86411:(e,t,n)=>{var r=n(16001),o=n(54248),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},18390:(e,t,n)=>{var r=n(29259),o=n(16001),i=n(62966),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},17606:e=>{e.exports=function(e,t){return e<t}},93401:(e,t,n)=>{var r=n(24303),o=n(67878);e.exports=function(e,t){var n=-1,i=o(e)?Array(e.length):[];return r(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}},26423:(e,t,n)=>{var r=n(37036),o=n(49882),i=n(73477);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},74716:(e,t,n)=>{var r=n(88746),o=n(72579),i=n(95041),a=n(21401),s=n(28792),l=n(73477),u=n(33812);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,3)}}},84565:(e,t,n)=>{var r=n(86571),o=n(28582),i=n(15308),a=n(25561),s=n(29259),l=n(18582),u=n(52434);e.exports=function e(t,n,c,d,f){t!==n&&i(n,(function(i,l){if(f||(f=new r),s(i))a(t,n,l,c,e,d,f);else{var h=d?d(u(t,l),i,l+"",t,n,f):void 0;void 0===h&&(h=i),o(t,l,h)}}),l)}},25561:(e,t,n)=>{var r=n(28582),o=n(92175),i=n(6190),a=n(51522),s=n(78725),l=n(79631),u=n(86152),c=n(93746),d=n(73226),f=n(61049),h=n(29259),p=n(97030),v=n(77598),g=n(52434),y=n(63329);e.exports=function(e,t,n,m,b,x,w){var _=g(e,n),E=g(t,n),k=w.get(E);if(k)r(e,n,k);else{var S=x?x(_,E,n+"",e,t,w):void 0,P=void 0===S;if(P){var j=u(E),C=!j&&d(E),T=!j&&!C&&v(E);S=E,j||C||T?u(_)?S=_:c(_)?S=a(_):C?(P=!1,S=o(E,!0)):T?(P=!1,S=i(E,!0)):S=[]:p(E)||l(E)?(S=_,l(_)?S=y(_):h(_)&&!f(_)||(S=s(E))):P=!1}P&&(w.set(E,S),b(S,E,m,x,w),w.delete(E)),r(e,n,S)}}},23813:(e,t,n)=>{var r=n(50343),o=n(13324),i=n(68286),a=n(93401),s=n(27095),l=n(47826),u=n(18477),c=n(23059),d=n(86152);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e})):[c];var f=-1;t=r(t,l(i));var h=a(e,(function(e,n,o){return{criteria:r(t,(function(t){return t(e)})),index:++f,value:e}}));return s(h,(function(e,t){return u(e,t,n)}))}},92602:(e,t,n)=>{var r=n(93759),o=n(95041);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},93759:(e,t,n)=>{var r=n(13324),o=n(82857),i=n(17297);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a<s;){var u=t[a],c=r(e,u);n(c,u)&&o(l,i(u,e),c)}return l}},20256:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},82952:(e,t,n)=>{var r=n(13324);e.exports=function(e){return function(t){return r(t,e)}}},93228:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,i){for(var a=-1,s=n(t((r-e)/(o||1)),0),l=Array(s);s--;)l[i?s:++a]=e,e+=o;return l}},5877:e=>{e.exports=function(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}},36060:(e,t,n)=>{var r=n(23059),o=n(43114),i=n(75251);e.exports=function(e,t){return i(o(e,t,r),e+"")}},82857:(e,t,n)=>{var r=n(60091),o=n(17297),i=n(39045),a=n(29259),s=n(33812);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=o(t,e)).length,d=c-1,f=e;null!=f&&++u<c;){var h=s(t[u]),p=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=d){var v=f[h];void 0===(p=l?l(v,h,f):void 0)&&(p=a(v)?v:i(t[u+1])?[]:{})}r(f,h,p),f=f[h]}return e}},86532:(e,t,n)=>{var r=n(86874),o=n(83043),i=n(23059),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},27095:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},36473:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1054:(e,t,n)=>{var r=n(50857),o=n(50343),i=n(86152),a=n(4795),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},51704:(e,t,n)=>{var r=n(52153),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},47826:e=>{e.exports=function(e){return function(t){return e(t)}}},67326:(e,t,n)=>{var r=n(45386),o=n(38333),i=n(34893),a=n(59950),s=n(78803),l=n(16909);e.exports=function(e,t,n){var u=-1,c=o,d=e.length,f=!0,h=[],p=h;if(n)f=!1,c=i;else if(d>=200){var v=t?null:s(e);if(v)return l(v);f=!1,c=a,p=new r}else p=t?[]:h;e:for(;++u<d;){var g=e[u],y=t?t(g):g;if(g=n||0!==g?g:0,f&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue e;t&&p.push(y),h.push(g)}else c(p,y,n)||(p!==h&&p.push(y),h.push(g))}return h}},50753:(e,t,n)=>{var r=n(50343);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},40509:e=>{e.exports=function(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;){var s=r<i?t[r]:void 0;n(a,e[r],s)}return a}},59950:e=>{e.exports=function(e,t){return e.has(t)}},89419:(e,t,n)=>{var r=n(23059);e.exports=function(e){return"function"==typeof e?e:r}},17297:(e,t,n)=>{var r=n(86152),o=n(21401),i=n(54452),a=n(66188);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},79882:(e,t,n)=>{var r=n(79162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},92175:(e,t,n)=>{e=n.nmd(e);var r=n(37772),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},34727:(e,t,n)=>{var r=n(79882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},96058:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},70169:(e,t,n)=>{var r=n(50857),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6190:(e,t,n)=>{var r=n(79882);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},27520:(e,t,n)=>{var r=n(4795);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,i=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||o&&s&&u||!n&&u||!i)return 1;if(!o&&!a&&!c&&e<t||c&&n&&i&&!o&&!a||l&&n&&i||!s&&i||!u)return-1}return 0}},18477:(e,t,n)=>{var r=n(27520);e.exports=function(e,t,n){for(var o=-1,i=e.criteria,a=t.criteria,s=i.length,l=n.length;++o<s;){var u=r(i[o],a[o]);if(u)return o>=l?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},51522:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},752:(e,t,n)=>{var r=n(60091),o=n(13940);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=i?i(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),a?o(n,u,c):r(n,u,c)}return n}},7680:(e,t,n)=>{var r=n(752),o=n(80633);e.exports=function(e,t){return r(e,o(e),t)}},19987:(e,t,n)=>{var r=n(752),o=n(12680);e.exports=function(e,t){return r(e,o(e),t)}},24019:(e,t,n)=>{var r=n(37772)["__core-js_shared__"];e.exports=r},97263:(e,t,n)=>{var r=n(36060),o=n(82406);e.exports=function(e){return r((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var l=n[r];l&&e(t,l,r,a)}return t}))}},92019:(e,t,n)=>{var r=n(67878);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&!1!==o(s[a],a,s););return n}}},55463:e=>{e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===n(i[l],l,i))break}return t}}},98776:(e,t,n)=>{var r=n(68286),o=n(67878),i=n(90249);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!o(t)){var l=r(n,3);t=i(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},82941:(e,t,n)=>{var r=n(93228),o=n(82406),i=n(5707);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&o(t,n,a)&&(n=a=void 0),t=i(t),void 0===n?(n=t,t=0):n=i(n),a=void 0===a?t<n?1:-1:i(a),r(t,n,a,e)}}},78803:(e,t,n)=>{var r=n(2143),o=n(34291),i=n(16909),a=r&&1/i(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=a},83043:(e,t,n)=>{var r=n(38761),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=o},74871:(e,t,n)=>{var r=n(45386),o=n(87064),i=n(59950);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<c;){var y=e[p],m=t[p];if(a)var b=u?a(m,y,p,t,e,l):a(y,m,p,e,t,l);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!o(t,(function(e,t){if(!i(g,t)&&(y===e||s(y,e,n,a,l)))return g.push(t)}))){v=!1;break}}else if(y!==m&&!s(y,m,n,a,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},11491:(e,t,n)=>{var r=n(50857),o=n(79162),i=n(41225),a=n(74871),s=n(75179),l=n(16909),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&r;if(h||(h=l),e.size!=t.size&&!p)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var g=a(h(e),h(t),r,u,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},17416:(e,t,n)=>{var r=n(13483),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var f=u[d];if(!(l?f in t:o.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<c;){var y=e[f=u[d]],m=t[f];if(i)var b=l?i(m,y,f,t,e,s):i(y,m,f,e,t,s);if(!(void 0===b?y===m||a(y,m,n,i,s):b)){v=!1;break}g||(g="constructor"==f)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},29097:(e,t,n)=>{var r=n(35676),o=n(43114),i=n(75251);e.exports=function(e){return i(o(e,void 0,r),e+"")}},51242:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},13483:(e,t,n)=>{var r=n(1897),o=n(80633),i=n(90249);e.exports=function(e){return r(e,i,o)}},76939:(e,t,n)=>{var r=n(1897),o=n(12680),i=n(18582);e.exports=function(e){return r(e,i,o)}},27937:(e,t,n)=>{var r=n(98304);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},49882:(e,t,n)=>{var r=n(28792),o=n(90249);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},38761:(e,t,n)=>{var r=n(6840),o=n(98109);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},47353:(e,t,n)=>{var r=n(60241)(Object.getPrototypeOf,Object);e.exports=r},62107:(e,t,n)=>{var r=n(50857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(l){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},80633:(e,t,n)=>{var r=n(67552),o=n(30981),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},12680:(e,t,n)=>{var r=n(65067),o=n(47353),i=n(80633),a=n(30981),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},70940:(e,t,n)=>{var r=n(39515),o=n(10326),i=n(52760),a=n(2143),s=n(93215),l=n(53366),u=n(87035),c="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=u(r),g=u(o),y=u(i),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=p||o&&x(new o)!=c||i&&x(i.resolve())!=d||a&&x(new a)!=f||s&&x(new s)!=h)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case v:return p;case g:return c;case y:return d;case m:return f;case b:return h}return t}),e.exports=x},98109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1369:(e,t,n)=>{var r=n(17297),o=n(79631),i=n(86152),a=n(39045),s=n(61158),l=n(33812);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u<c;){var f=l(t[u]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++u!=c?d:!!(c=null==e?0:e.length)&&s(c)&&a(f,c)&&(i(e)||o(e))}},33880:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},52118:(e,t,n)=>{var r=n(99191);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},96909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},98138:(e,t,n)=>{var r=n(99191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},4174:(e,t,n)=>{var r=n(99191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},7942:(e,t,n)=>{var r=n(99191);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},99917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},8222:(e,t,n)=>{var r=n(79882),o=n(34727),i=n(96058),a=n(70169),s=n(6190);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},78725:(e,t,n)=>{var r=n(39413),o=n(47353),i=n(16001);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},95882:(e,t,n)=>{var r=n(50857),o=n(79631),i=n(86152),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},39045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=n??9007199254740991)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},82406:(e,t,n)=>{var r=n(41225),o=n(67878),i=n(39045),a=n(29259);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&i(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},21401:(e,t,n)=>{var r=n(86152),o=n(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},98304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},47394:(e,t,n)=>{var r,o=n(24019),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},16001:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},28792:(e,t,n)=>{var r=n(29259);e.exports=function(e){return e==e&&!r(e)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},21846:(e,t,n)=>{var r=n(22218),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},88028:(e,t,n)=>{var r=n(22218);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},72344:(e,t,n)=>{var r=n(22218);e.exports=function(e){return r(this.__data__,e)>-1}},94769:(e,t,n)=>{var r=n(22218);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},92411:(e,t,n)=>{var r=n(89612),o=n(80235),i=n(10326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},36417:(e,t,n)=>{var r=n(27937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},86928:(e,t,n)=>{var r=n(27937);e.exports=function(e){return r(this,e).get(e)}},79493:(e,t,n)=>{var r=n(27937);e.exports=function(e){return r(this,e).has(e)}},24150:(e,t,n)=>{var r=n(27937);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},75179:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},73477:e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},77777:(e,t,n)=>{var r=n(30733);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},99191:(e,t,n)=>{var r=n(38761)(Object,"create");e.exports=r},54248:(e,t,n)=>{var r=n(60241)(Object.keys,Object);e.exports=r},62966:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},4146:(e,t,n)=>{e=n.nmd(e);var r=n(51242),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},37157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60241:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},43114:(e,t,n)=>{var r=n(49432),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),l=Array(s);++a<s;)l[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(l),r(e,this,u)}}},37772:(e,t,n)=>{var r=n(51242),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},52434:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},52842:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},52482:e=>{e.exports=function(e){return this.__data__.has(e)}},16909:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},75251:(e,t,n)=>{var r=n(86532),o=n(97787)(r);e.exports=o},97787:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},15243:(e,t,n)=>{var r=n(80235);e.exports=function(){this.__data__=new r,this.size=0}},72858:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:e=>{e.exports=function(e){return this.__data__.get(e)}},8605:e=>{e.exports=function(e){return this.__data__.has(e)}},71418:(e,t,n)=>{var r=n(80235),o=n(10326),i=n(96738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},66024:e=>{e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},82302:(e,t,n)=>{var r=n(8589),o=n(33880),i=n(35555);e.exports=function(e){return o(e)?i(e):r(e)}},54452:(e,t,n)=>{var r=n(77777),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},33812:(e,t,n)=>{var r=n(4795);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},87035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},52153:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},35555:e=>{var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")"+"?",l="[\\ufe0e\\ufe0f]?",u=l+s+("(?:\\u200d(?:"+[o,i,a].join("|")+")"+l+s+")*"),c="(?:"+[o+n+"?",n,i,a,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+c+u,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},54004:(e,t,n)=>{var r=n(18874);e.exports=function(e){return r(e,4)}},9850:(e,t,n)=>{var r=n(18874);e.exports=function(e){return r(e,5)}},86874:e=>{e.exports=function(e){return function(){return e}}},54073:(e,t,n)=>{var r=n(29259),o=n(61100),i=n(7642),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,f,h,p=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=l,r=u;return l=u=void 0,p=t,d=e.apply(r,n)}function b(e){return p=e,f=setTimeout(w,t),v?m(e):d}function x(e){var n=e-h;return void 0===h||n>=t||n<0||g&&e-p>=c}function w(){var e=o();if(x(e))return _(e);f=setTimeout(w,function(e){var n=t-(e-h);return g?s(n,c-(e-p)):n}(e))}function _(e){return f=void 0,y&&l?m(e):(l=u=void 0,d)}function E(){var e=o(),n=x(e);if(l=arguments,u=this,h=e,n){if(void 0===f)return b(h);if(g)return clearTimeout(f),f=setTimeout(w,t),m(h)}return void 0===f&&(f=setTimeout(w,t)),d}return t=i(t)||0,r(n)&&(v=!!n.leading,c=(g="maxWait"in n)?a(i(n.maxWait)||0,t):c,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=h=u=f=void 0},E.flush=function(){return void 0===f?d:_(o())},E}},84573:(e,t,n)=>{var r=n(36060),o=n(41225),i=n(82406),a=n(18582),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n<r;)for(var c=t[n],d=a(c),f=-1,h=d.length;++f<h;){var p=d[f],v=e[p];(void 0===v||o(v,s[p])&&!l.call(e,p))&&(e[p]=c[p])}return e}));e.exports=u},79421:(e,t,n)=>{e.exports=n(59756)},41225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},90882:(e,t,n)=>{var r=n(67552),o=n(98043),i=n(68286),a=n(86152);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},55281:(e,t,n)=>{var r=n(98776)(n(12982));e.exports=r},12982:(e,t,n)=>{var r=n(21359),o=n(68286),i=n(38101),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:i(n);return l<0&&(l=a(s+l,0)),r(e,o(t,3),l)}},35676:(e,t,n)=>{var r=n(62034);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},59756:(e,t,n)=>{var r=n(72517),o=n(24303),i=n(89419),a=n(86152);e.exports=function(e,t){return(a(e)?r:o)(e,i(t))}},20792:(e,t,n)=>{var r=n(15308),o=n(89419),i=n(18582);e.exports=function(e,t){return null==e?e:r(e,o(t),i)}},72579:(e,t,n)=>{var r=n(13324);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},93352:(e,t,n)=>{var r=n(32726),o=n(1369);e.exports=function(e,t){return null!=e&&o(e,t,r)}},95041:(e,t,n)=>{var r=n(20187),o=n(1369);e.exports=function(e,t){return null!=e&&o(e,t,r)}},23059:e=>{e.exports=function(e){return e}},79631:(e,t,n)=>{var r=n(15183),o=n(15125),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},86152:e=>{var t=Array.isArray;e.exports=t},67878:(e,t,n)=>{var r=n(61049),o=n(61158);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},93746:(e,t,n)=>{var r=n(67878),o=n(15125);e.exports=function(e){return o(e)&&r(e)}},73226:(e,t,n)=>{e=n.nmd(e);var r=n(37772),o=n(36330),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},45455:(e,t,n)=>{var r=n(86411),o=n(70940),i=n(79631),a=n(86152),s=n(67878),l=n(73226),u=n(16001),c=n(77598),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},61049:(e,t,n)=>{var r=n(53366),o=n(29259);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4714:(e,t,n)=>{var r=n(74511),o=n(47826),i=n(4146),a=i&&i.isMap,s=a?o(a):r;e.exports=s},29259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},15125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},97030:(e,t,n)=>{var r=n(53366),o=n(47353),i=n(15125),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},43679:(e,t,n)=>{var r=n(8109),o=n(47826),i=n(4146),a=i&&i.isSet,s=a?o(a):r;e.exports=s},85505:(e,t,n)=>{var r=n(53366),o=n(86152),i=n(15125);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},4795:(e,t,n)=>{var r=n(53366),o=n(15125);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},77598:(e,t,n)=>{var r=n(35522),o=n(47826),i=n(4146),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},84336:e=>{e.exports=function(e){return void 0===e}},90249:(e,t,n)=>{var r=n(1634),o=n(86411),i=n(67878);e.exports=function(e){return i(e)?r(e):o(e)}},18582:(e,t,n)=>{var r=n(1634),o=n(18390),i=n(67878);e.exports=function(e){return i(e)?r(e,!0):o(e)}},56974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},16760:(e,t,n)=>{var r=n(50343),o=n(68286),i=n(93401),a=n(86152);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},34519:(e,t,n)=>{var r=n(13940),o=n(26548),i=n(68286);e.exports=function(e,t){var n={};return t=i(t,3),o(e,(function(e,o,i){r(n,o,t(e,o,i))})),n}},71644:(e,t,n)=>{var r=n(2229),o=n(84134),i=n(23059);e.exports=function(e){return e&&e.length?r(e,i,o):void 0}},30733:(e,t,n)=>{var r=n(96738);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},98537:(e,t,n)=>{var r=n(84565),o=n(97263)((function(e,t,n){r(e,t,n)}));e.exports=o},65680:(e,t,n)=>{var r=n(2229),o=n(17606),i=n(23059);e.exports=function(e){return e&&e.length?r(e,i,o):void 0}},10937:(e,t,n)=>{var r=n(2229),o=n(68286),i=n(17606);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},34291:e=>{e.exports=function(){}},61100:(e,t,n)=>{var r=n(37772);e.exports=function(){return r.Date.now()}},13888:(e,t,n)=>{var r=n(92602),o=n(29097)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},65798:(e,t,n)=>{var r=n(20256),o=n(82952),i=n(21401),a=n(33812);e.exports=function(e){return i(e)?r(a(e)):o(e)}},2689:(e,t,n)=>{var r=n(82941)();e.exports=r},58215:(e,t,n)=>{var r=n(81207),o=n(24303),i=n(68286),a=n(5877),s=n(86152);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,i(t,4),n,u,o)}},16765:(e,t,n)=>{var r=n(82857);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},36402:(e,t,n)=>{var r=n(86411),o=n(70940),i=n(67878),a=n(85505),s=n(82302);e.exports=function(e){if(null==e)return 0;if(i(e))return a(e)?s(e):e.length;var t=o(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},829:(e,t,n)=>{var r=n(62034),o=n(23813),i=n(36060),a=n(82406),s=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=s},30981:e=>{e.exports=function(){return[]}},36330:e=>{e.exports=function(){return!1}},5707:(e,t,n)=>{var r=n(7642),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},38101:(e,t,n)=>{var r=n(5707);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},7642:(e,t,n)=>{var r=n(51704),o=n(29259),i=n(4795),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},25497:(e,t,n)=>{var r=n(50343),o=n(51522),i=n(86152),a=n(4795),s=n(54452),l=n(33812),u=n(66188);e.exports=function(e){return i(e)?r(e,l):a(e)?[e]:o(s(u(e)))}},63329:(e,t,n)=>{var r=n(752),o=n(18582);e.exports=function(e){return r(e,o(e))}},66188:(e,t,n)=>{var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},89466:(e,t,n)=>{var r=n(72517),o=n(39413),i=n(26548),a=n(68286),s=n(47353),l=n(86152),u=n(73226),c=n(61049),d=n(29259),f=n(77598);e.exports=function(e,t,n){var h=l(e),p=h||u(e)||f(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=p?h?new v:[]:d(e)&&c(v)?o(s(e)):{}}return(p?r:i)(e,(function(e,r,o){return t(n,e,r,o)})),n}},26139:(e,t,n)=>{var r=n(62034),o=n(36060),i=n(67326),a=n(93746),s=o((function(e){return i(r(e,1,a,!0))}));e.exports=s},74930:(e,t,n)=>{var r=n(66188),o=0;e.exports=function(e){var t=++o;return r(e)+t}},98346:(e,t,n)=>{var r=n(50753),o=n(90249);e.exports=function(e){return null==e?[]:r(e,o(e))}},46150:(e,t,n)=>{var r=n(60091),o=n(40509);e.exports=function(e,t){return o(e||[],t||[],r)}},12139:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>V,Component:()=>a.wA,Fragment:()=>a.HY,PureComponent:()=>R,StrictMode:()=>_e,Suspense:()=>W,SuspenseList:()=>X,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>he,cloneElement:()=>ye,createContext:()=>a.kr,createElement:()=>a.az,createFactory:()=>ve,createPortal:()=>Q,createRef:()=>a.Vf,default:()=>Ee,findDOMNode:()=>be,flushSync:()=>we,forwardRef:()=>B,hydrate:()=>oe,isValidElement:()=>ge,lazy:()=>q,memo:()=>M,render:()=>re,unmountComponentAtNode:()=>me,unstable_batchedUpdates:()=>xe,useCallback:()=>_,useContext:()=>E,useDebugValue:()=>k,useEffect:()=>y,useErrorBoundary:()=>S,useImperativeHandle:()=>x,useLayoutEffect:()=>m,useMemo:()=>w,useReducer:()=>g,useRef:()=>b,useState:()=>v,version:()=>pe});var r,o,i,a=n(33847),s=0,l=[],u=a.YM.__b,c=a.YM.__r,d=a.YM.diffed,f=a.YM.__c,h=a.YM.unmount;function p(e,t){a.YM.__h&&a.YM.__h(o,e,s||t),s=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return s=1,g(D,e)}function g(e,t,n){var i=p(r++,2);return i.t=e,i.__c||(i.__=[n?n(t):D(void 0,t),function(e){var t=i.t(i.__[0],e);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}))}],i.__c=o),i.__}function y(e,t){var n=p(r++,3);!a.YM.__s&&O(n.__H,t)&&(n.__=e,n.__H=t,o.__H.__h.push(n))}function m(e,t){var n=p(r++,4);!a.YM.__s&&O(n.__H,t)&&(n.__=e,n.__H=t,o.__h.push(n))}function b(e){return s=5,w((function(){return{current:e}}),[])}function x(e,t,n){s=6,m((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function w(e,t){var n=p(r++,7);return O(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function _(e,t){return s=8,w((function(){return e}),t)}function E(e){var t=o.context[e.__c],n=p(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function k(e,t){a.YM.useDebugValue&&a.YM.useDebugValue(t?t(e):e)}function S(e){var t=p(r++,10),n=v();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function P(){var e;for(l.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=l.pop();)if(e.__P)try{e.__H.__h.forEach(C),e.__H.__h.forEach(T),e.__H.__h=[]}catch(o){e.__H.__h=[],a.YM.__e(o,e.__v)}}a.YM.__b=function(e){o=null,u&&u(e)},a.YM.__r=function(e){c&&c(e),r=0;var t=(o=e.__c).__H;t&&(t.__h.forEach(C),t.__h.forEach(T),t.__h=[])},a.YM.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&i===a.YM.requestAnimationFrame||((i=a.YM.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),j&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);j&&(t=requestAnimationFrame(n))})(P)),o=null},a.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||T(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.YM.__e(i,e.__v)}})),f&&f(e,t)},a.YM.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),t&&a.YM.__e(t,n.__v))};var j="function"==typeof requestAnimationFrame;function C(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function T(e){var t=o;e.__c=e.__(),o=t}function O(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function D(e,t){return"function"==typeof t?t(e):t}function N(e,t){for(var n in t)e[n]=t[n];return e}function A(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function R(e){this.props=e}function M(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:A(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,a.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(R.prototype=new a.wA).isPureReactComponent=!0,R.prototype.shouldComponentUpdate=function(e,t){return A(this.props,e)||A(this.state,t)};var I=a.YM.__b;a.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),I&&I(e)};var L="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t,n){var r=N({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=L,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var F=function(e,t){return null==e?null:(0,a.bR)((0,a.bR)(e).map(t))},V={map:F,forEach:F,count:function(e){return e?(0,a.bR)(e).length:0},only:function(e){var t=(0,a.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:a.bR},G=a.YM.__e;a.YM.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);G(e,t,n)};var H=a.YM.unmount;function W(){this.__u=0,this.t=null,this.__b=null}function Y(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function q(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,a.az)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function X(){this.u=null,this.o=null}a.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),H&&H(e)},(W.prototype=new a.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Y(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=N({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&(0,a.az)(a.HY,null,e.fallback);return o&&(o.__h=null),[(0,a.az)(a.HY,null,t.__e?null:e.children),o]};var $=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function K(e){return this.getChildContext=function(){return e.context},e.children}function Z(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,a.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,a.sY)((0,a.az)(K,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Q(e,t){return(0,a.az)(Z,{__v:e,i:t})}(X.prototype=new a.wA).__e=function(e){var t=this,n=Y(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),$(t,e,r)):o()};n?n(i):i()}},X.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,a.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},X.prototype.componentDidUpdate=X.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){$(e,n,t)}))};var J="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ee=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,te="undefined"!=typeof document,ne=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function re(e,t,n){return null==t.__k&&(t.textContent=""),(0,a.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function oe(e,t,n){return(0,a.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}a.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(a.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var ie=a.YM.event;function ae(){}function se(){return this.cancelBubble}function le(){return this.defaultPrevented}a.YM.event=function(e){return ie&&(e=ie(e)),e.persist=ae,e.isPropagationStopped=se,e.isDefaultPrevented=le,e.nativeEvent=e};var ue,ce={configurable:!0,get:function(){return this.class}},de=a.YM.vnode;a.YM.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in r={},n){var s=n[i];te&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in n&&null==s||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===s?s="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!ne(n.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():o&&ee.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[i]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(ce.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",ce))}e.$$typeof=J,de&&de(e)};var fe=a.YM.__r;a.YM.__r=function(e){fe&&fe(e),ue=e.__c};var he={ReactCurrentDispatcher:{current:{readContext:function(e){return ue.__n[e.__c].props.value}}}},pe="17.0.2";function ve(e){return a.az.bind(null,e)}function ge(e){return!!e&&e.$$typeof===J}function ye(e){return ge(e)?a.Tm.apply(null,arguments):e}function me(e){return!!e.__k&&((0,a.sY)(null,e),!0)}function be(e){return e&&(e.base||1===e.nodeType&&e)||null}var xe=function(e,t){return e(t)},we=function(e,t){return e(t)},_e=a.HY;const Ee={useState:v,useReducer:g,useEffect:y,useLayoutEffect:m,useRef:b,useImperativeHandle:x,useMemo:w,useCallback:_,useContext:E,useDebugValue:k,version:"17.0.2",Children:V,render:re,hydrate:oe,unmountComponentAtNode:me,createPortal:Q,createElement:a.az,createContext:a.kr,createFactory:ve,cloneElement:ye,createRef:a.Vf,Fragment:a.HY,isValidElement:ge,findDOMNode:be,Component:a.wA,PureComponent:R,memo:M,forwardRef:B,flushSync:we,unstable_batchedUpdates:xe,StrictMode:a.HY,Suspense:W,SuspenseList:X,lazy:q,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:he}},33847:(e,t,n)=>{"use strict";n.d(t,{HY:()=>m,Tm:()=>V,Vf:()=>y,YM:()=>o,ZB:()=>F,az:()=>v,bR:()=>P,kr:()=>G,sY:()=>B,wA:()=>b});var r,o,i,a,s,l,u,c={},d=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return g(e,s,o,i,null)}function g(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:a??++i};return null==a&&null!=o.vnode&&o.vnode(s),s}function y(){return{current:null}}function m(e){return e.children}function b(e,t){this.props=e,this.context=t}function x(e,t){if(null==t)return e.__?x(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?x(e):null}function w(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return w(e)}}function _(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!E.__r++||l!==o.debounceRendering)&&((l=o.debounceRendering)||s)(E)}function E(){for(var e;E.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=h({},o)).__v=o.__v+1,N(a,o,r,t.__n,void 0!==a.ownerSVGElement,null!=o.__h?[i]:null,n,i??x(o),o.__h),A(n,o),o.__e!=i&&w(o)))}))}function k(e,t,n,r,o,i,a,s,l,u){var f,h,p,v,y,b,w,_=r&&r.__k||d,E=_.length;for(n.__k=[],f=0;f<t.length;f++)if(null!=(v=n.__k[f]=null==(v=t[f])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?g(null,v,null,null,v):Array.isArray(v)?g(m,{children:v},null,null,null):v.__b>0?g(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(p=_[f])||p&&v.key==p.key&&v.type===p.type)_[f]=void 0;else for(h=0;h<E;h++){if((p=_[h])&&v.key==p.key&&v.type===p.type){_[h]=void 0;break}p=null}N(e,v,p=p||c,o,i,a,s,l,u),y=v.__e,(h=v.ref)&&p.ref!=h&&(w||(w=[]),p.ref&&w.push(p.ref,null,v),w.push(h,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===p.__k?v.__d=l=S(v,l,e):l=j(e,v,p,_,y,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=x(p))}for(n.__e=b,f=E;f--;)null!=_[f]&&("function"==typeof n.type&&null!=_[f].__e&&_[f].__e==n.__d&&(n.__d=x(r,f+1)),I(_[f],_[f]));if(w)for(f=0;f<w.length;f++)M(w[f],w[++f],w[++f])}function S(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?S(r,t,n):j(n,r,r,o,r.__e,t));return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){P(e,t)})):t.push(e)),t}function j(e,t,n,r,o,i){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),a=null;else{for(s=i,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==o)break e;e.insertBefore(o,i),a=i}return void 0!==a?a:o.nextSibling}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||f.test(t)?n:n+"px"}function T(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||C(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?D:O,i):e.removeEventListener(t,i?D:O,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=n??"";break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function O(e){this.l[e.type+!1](o.event?o.event(e):e)}function D(e){this.l[e.type+!0](o.event?o.event(e):e)}function N(e,t,n,r,i,a,s,l,u){var c,d,f,p,v,g,y,x,w,_,E,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,l=t.__e=n.__e,t.__h=null,a=[l]),(c=o.__b)&&c(t);try{e:if("function"==typeof S){if(x=t.props,w=(c=S.contextType)&&r[c.__c],_=c?w?w.props.value:c.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(x,_):(t.__c=d=new b(x,_),d.constructor=S,d.render=L),w&&w.sub(d),d.props=x,d.state||(d.state={}),d.context=_,d.__n=r,f=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,S.getDerivedStateFromProps(x,d.__s))),p=d.props,v=d.state,f)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&x!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(x,_),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(x,d.__s,_)||t.__v===n.__v){d.props=x,d.state=d.__s,t.__v!==n.__v&&(d.__d=!1),d.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(x,d.__s,_),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}d.context=_,d.props=x,d.state=d.__s,(c=o.__r)&&c(t),d.__d=!1,d.__v=t,d.__P=e,c=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(r=h(h({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),E=null!=c&&c.type===m&&null==c.key?c.props.children:c,k(e,Array.isArray(E)?E:[E],t,n,r,i,a,s,l,u),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),y&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=R(n.__e,t,n,r,i,a,s,u);(c=o.diffed)&&c(t)}catch(e){t.__v=null,(u||null!=a)&&(t.__e=l,t.__h=!!u,a[a.indexOf(l)]=null),o.__e(e,t,n)}}function A(e,t){o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function R(e,t,n,o,i,a,s,l){var u,d,f,h=n.props,v=t.props,g=t.type,y=0;if("svg"===g&&(i=!0),null!=a)for(;y<a.length;y++)if((u=a[y])&&"setAttribute"in u==!!g&&(g?u.localName===g:3===u.nodeType)){e=u,a[y]=null;break}if(null==e){if(null===g)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),a=null,l=!1}if(null===g)h===v||l&&e.data===v||(e.data=v);else{if(a=a&&r.call(e.childNodes),d=(h=n.props||c).dangerouslySetInnerHTML,f=v.dangerouslySetInnerHTML,!l){if(null!=a)for(h={},y=0;y<e.attributes.length;y++)h[e.attributes[y].name]=e.attributes[y].value;(f||d)&&(f&&(d&&f.__html==d.__html||f.__html===e.innerHTML)||(e.innerHTML=f&&f.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||T(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||T(e,i,t[i],n[i],r)}(e,v,h,i,l),f)t.__k=[];else if(y=t.props.children,k(e,Array.isArray(y)?y:[y],t,n,o,i&&"foreignObject"!==g,a,s,a?a[0]:n.__k&&x(n,0),l),null!=a)for(y=a.length;y--;)null!=a[y]&&p(a[y]);l||("value"in v&&void 0!==(y=v.value)&&(y!==h.value||y!==e.value||"progress"===g&&!y)&&T(e,"value",y,h.value,!1),"checked"in v&&void 0!==(y=v.checked)&&y!==e.checked&&T(e,"checked",y,h.checked,!1))}return e}function M(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function I(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||M(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&I(r[i],t,"function"!=typeof e.type);n||null==e.__e||p(e.__e),e.__e=e.__d=void 0}function L(e,t,n){return this.constructor(e,n)}function B(e,t,n){var i,a,s;o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],N(t,e=(!i&&n||t).__k=v(m,null,[e]),a||c,c,void 0!==t.ownerSVGElement,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i),A(s,e)}function F(e,t){B(e,t,F)}function V(e,t,n){var o,i,a,s=h({},e.props);for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];return arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),g(e.type,s,o||e.key,i||e.ref,null)}function G(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(_)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,o={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},i=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},n),this.props)),e&&h(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),_(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},b.prototype.render=m,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,E.__r=0,u=0},32175:function(e,t,n){!function(e,t,n,r){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=o(t);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}const l="get",u="application/x-www-form-urlencoded";function c(e){return null!=e&&"string"==typeof e.tagName}function d(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}function f(e,t,n){let r,o,i,a;if(c(s=e)&&"form"===s.tagName.toLowerCase()){let s=n.submissionTrigger;r=n.method||e.getAttribute("method")||l,o=n.action||e.getAttribute("action")||t,i=n.encType||e.getAttribute("enctype")||u,a=new FormData(e),s&&s.name&&a.append(s.name,s.value)}else if(function(e){return c(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return c(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');r=n.method||e.getAttribute("formmethod")||s.getAttribute("method")||l,o=n.action||e.getAttribute("formaction")||s.getAttribute("action")||t,i=n.encType||e.getAttribute("formenctype")||s.getAttribute("enctype")||u,a=new FormData(s),e.name&&a.append(e.name,e.value)}else{if(c(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(r=n.method||l,o=n.action||t,i=n.encType||u,e instanceof FormData)a=e;else if(a=new FormData,e instanceof URLSearchParams)for(let[t,n]of e)a.append(t,n);else if(null!=e)for(let t of Object.keys(e))a.append(t,e[t])}var s;let{protocol:d,host:f}=window.location;return{url:new URL(o,d+"//"+f),method:r,encType:i,formData:a}}const h=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],p=["aria-current","caseSensitive","className","end","style","to","children"],v=["reloadDocument","replace","method","action","onSubmit","fetcherKey","routeId","relative"],g=i.forwardRef((function(e,t){let{onClick:r,relative:o,reloadDocument:l,replace:u,state:c,target:d,to:f,preventScrollReset:p}=e,v=s(e,h),g=n.useHref(f,{relative:o}),y=k(f,{replace:u,state:c,target:d,preventScrollReset:p,relative:o});return i.createElement("a",a({},v,{href:g,onClick:l?r:function(e){r&&r(e),e.defaultPrevented||y(e)},ref:t,target:d}))})),y=i.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:o=!1,className:l="",end:u=!1,style:c,to:d,children:f}=e,h=s(e,p),v=n.useResolvedPath(d,{relative:h.relative}),y=n.useLocation(),m=i.useContext(n.UNSAFE_DataRouterStateContext),b=v.pathname,x=y.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(x=x.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase());let _,E=x===b||!u&&x.startsWith(b)&&"/"===x.charAt(b.length),k=null!=w&&(w===b||!u&&w.startsWith(b)&&"/"===w.charAt(b.length)),S=E?r:void 0;_="function"==typeof l?l({isActive:E,isPending:k}):[l,E?"active":null,k?"pending":null].filter(Boolean).join(" ");let P="function"==typeof c?c({isActive:E,isPending:k}):c;return i.createElement(g,a({},h,{"aria-current":S,className:_,ref:t,style:P,to:d}),"function"==typeof f?f({isActive:E,isPending:k}):f)})),m=i.forwardRef(((e,t)=>i.createElement(b,a({},e,{ref:t})))),b=i.forwardRef(((e,t)=>{let{reloadDocument:n,replace:r,method:o=l,action:u,onSubmit:c,fetcherKey:d,routeId:f,relative:h}=e,p=s(e,v),g=S(d,f),y="get"===o.toLowerCase()?"get":"post",m=P(u,{relative:h});return i.createElement("form",a({ref:t,method:y,action:m,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter;g(t||e.currentTarget,{method:o,replace:r,relative:h})}},p))}));var x,w;function _(e){let t=i.useContext(n.UNSAFE_DataRouterContext);return t||r.invariant(!1),t}function E(e){let t=i.useContext(n.UNSAFE_DataRouterStateContext);return t||r.invariant(!1),t}function k(e,t){let{target:r,replace:o,state:a,preventScrollReset:s,relative:l}=void 0===t?{}:t,u=n.useNavigate(),c=n.useLocation(),d=n.useResolvedPath(e,{relative:l});return i.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==o?o:n.createPath(c)===n.createPath(d);u(e,{replace:r,state:a,preventScrollReset:s,relative:l})}}),[c,u,d,o,a,r,e,s,l])}function S(e,t){let{router:n}=_(x.UseSubmitImpl),o=P();return i.useCallback((function(i,a){if(void 0===a&&(a={}),"undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{method:s,encType:l,formData:u,url:c}=f(i,o,a),d=c.pathname+c.search,h={replace:a.replace,formData:u,formMethod:s,formEncType:l};e?(null==t&&r.invariant(!1),n.fetch(e,t,d,h)):n.navigate(d,h)}),[o,n,e,t])}function P(e,t){let{relative:o}=void 0===t?{}:t,{basename:s}=i.useContext(n.UNSAFE_NavigationContext),l=i.useContext(n.UNSAFE_RouteContext);l||r.invariant(!1);let[u]=l.matches.slice(-1),c=null!=e?e:".",d=a({},n.useResolvedPath(c,{relative:o})),f=n.useLocation();if(null==e&&(d.search=f.search,d.hash=f.hash,u.route.index)){let e=new URLSearchParams(d.search);e.delete("index"),d.search=e.toString()?"?"+e.toString():""}return e&&"."!==e||!u.route.index||(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),"/"!==s&&(d.pathname="/"===d.pathname?s:r.joinPaths([s,d.pathname])),n.createPath(d)}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"}(x||(x={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(w||(w={}));let j=0;const C="react-router-scroll-positions";let T={};Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return n.AbortedDeferredError}}),Object.defineProperty(e,"Await",{enumerable:!0,get:function(){return n.Await}}),Object.defineProperty(e,"MemoryRouter",{enumerable:!0,get:function(){return n.MemoryRouter}}),Object.defineProperty(e,"Navigate",{enumerable:!0,get:function(){return n.Navigate}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return n.NavigationType}}),Object.defineProperty(e,"Outlet",{enumerable:!0,get:function(){return n.Outlet}}),Object.defineProperty(e,"Route",{enumerable:!0,get:function(){return n.Route}}),Object.defineProperty(e,"Router",{enumerable:!0,get:function(){return n.Router}}),Object.defineProperty(e,"RouterProvider",{enumerable:!0,get:function(){return n.RouterProvider}}),Object.defineProperty(e,"Routes",{enumerable:!0,get:function(){return n.Routes}}),Object.defineProperty(e,"UNSAFE_DataRouterContext",{enumerable:!0,get:function(){return n.UNSAFE_DataRouterContext}}),Object.defineProperty(e,"UNSAFE_DataRouterStateContext",{enumerable:!0,get:function(){return n.UNSAFE_DataRouterStateContext}}),Object.defineProperty(e,"UNSAFE_DataStaticRouterContext",{enumerable:!0,get:function(){return n.UNSAFE_DataStaticRouterContext}}),Object.defineProperty(e,"UNSAFE_LocationContext",{enumerable:!0,get:function(){return n.UNSAFE_LocationContext}}),Object.defineProperty(e,"UNSAFE_NavigationContext",{enumerable:!0,get:function(){return n.UNSAFE_NavigationContext}}),Object.defineProperty(e,"UNSAFE_RouteContext",{enumerable:!0,get:function(){return n.UNSAFE_RouteContext}}),Object.defineProperty(e,"UNSAFE_enhanceManualRouteObjects",{enumerable:!0,get:function(){return n.UNSAFE_enhanceManualRouteObjects}}),Object.defineProperty(e,"createMemoryRouter",{enumerable:!0,get:function(){return n.createMemoryRouter}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return n.createPath}}),Object.defineProperty(e,"createRoutesFromChildren",{enumerable:!0,get:function(){return n.createRoutesFromChildren}}),Object.defineProperty(e,"createRoutesFromElements",{enumerable:!0,get:function(){return n.createRoutesFromElements}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return n.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return n.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return n.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return n.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return n.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return n.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return n.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return n.redirect}}),Object.defineProperty(e,"renderMatches",{enumerable:!0,get:function(){return n.renderMatches}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return n.resolvePath}}),Object.defineProperty(e,"useActionData",{enumerable:!0,get:function(){return n.useActionData}}),Object.defineProperty(e,"useAsyncError",{enumerable:!0,get:function(){return n.useAsyncError}}),Object.defineProperty(e,"useAsyncValue",{enumerable:!0,get:function(){return n.useAsyncValue}}),Object.defineProperty(e,"useHref",{enumerable:!0,get:function(){return n.useHref}}),Object.defineProperty(e,"useInRouterContext",{enumerable:!0,get:function(){return n.useInRouterContext}}),Object.defineProperty(e,"useLoaderData",{enumerable:!0,get:function(){return n.useLoaderData}}),Object.defineProperty(e,"useLocation",{enumerable:!0,get:function(){return n.useLocation}}),Object.defineProperty(e,"useMatch",{enumerable:!0,get:function(){return n.useMatch}}),Object.defineProperty(e,"useMatches",{enumerable:!0,get:function(){return n.useMatches}}),Object.defineProperty(e,"useNavigate",{enumerable:!0,get:function(){return n.useNavigate}}),Object.defineProperty(e,"useNavigation",{enumerable:!0,get:function(){return n.useNavigation}}),Object.defineProperty(e,"useNavigationType",{enumerable:!0,get:function(){return n.useNavigationType}}),Object.defineProperty(e,"useOutlet",{enumerable:!0,get:function(){return n.useOutlet}}),Object.defineProperty(e,"useOutletContext",{enumerable:!0,get:function(){return n.useOutletContext}}),Object.defineProperty(e,"useParams",{enumerable:!0,get:function(){return n.useParams}}),Object.defineProperty(e,"useResolvedPath",{enumerable:!0,get:function(){return n.useResolvedPath}}),Object.defineProperty(e,"useRevalidator",{enumerable:!0,get:function(){return n.useRevalidator}}),Object.defineProperty(e,"useRouteError",{enumerable:!0,get:function(){return n.useRouteError}}),Object.defineProperty(e,"useRouteLoaderData",{enumerable:!0,get:function(){return n.useRouteLoaderData}}),Object.defineProperty(e,"useRoutes",{enumerable:!0,get:function(){return n.useRoutes}}),e.BrowserRouter=function(e){let{basename:t,children:o,window:a}=e,s=i.useRef();null==s.current&&(s.current=r.createBrowserHistory({window:a,v5Compat:!0}));let l=s.current,[u,c]=i.useState({action:l.action,location:l.location});return i.useLayoutEffect((()=>l.listen(c)),[l]),i.createElement(n.Router,{basename:t,children:o,location:u.location,navigationType:u.action,navigator:l})},e.Form=m,e.HashRouter=function(e){let{basename:t,children:o,window:a}=e,s=i.useRef();null==s.current&&(s.current=r.createHashHistory({window:a,v5Compat:!0}));let l=s.current,[u,c]=i.useState({action:l.action,location:l.location});return i.useLayoutEffect((()=>l.listen(c)),[l]),i.createElement(n.Router,{basename:t,children:o,location:u.location,navigationType:u.action,navigator:l})},e.Link=g,e.NavLink=y,e.ScrollRestoration=function(e){let{getKey:t,storageKey:r}=e;return function(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:o}=_(x.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:s}=E(w.UseScrollRestoration),l=n.useLocation(),u=n.useMatches(),c=n.useNavigation();var d;i.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),d=i.useCallback((()=>{if("idle"===c.state){let e=(t?t(l,u):null)||l.key;T[e]=window.scrollY}sessionStorage.setItem(r||C,JSON.stringify(T)),window.history.scrollRestoration="auto"}),[r,t,c.state,l,u]),i.useEffect((()=>(window.addEventListener("beforeunload",d),()=>{window.removeEventListener("beforeunload",d)})),[d]),i.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||C);e&&(T=JSON.parse(e))}catch(e){}}),[r]),i.useLayoutEffect((()=>{let e=null==o?void 0:o.enableScrollRestoration(T,(()=>window.scrollY),t);return()=>e&&e()}),[o,t]),i.useLayoutEffect((()=>{if(!1!==a)if("number"!=typeof a){if(l.hash){let e=document.getElementById(l.hash.slice(1));if(e)return void e.scrollIntoView()}!0!==s&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[l,a,s])}({getKey:t,storageKey:r}),null},e.createBrowserRouter=function(e,t){var o;return r.createRouter({basename:null==t?void 0:t.basename,history:r.createBrowserHistory({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||(null==(o=window)?void 0:o.__staticRouterHydrationData),routes:n.UNSAFE_enhanceManualRouteObjects(e)}).initialize()},e.createHashRouter=function(e,t){var o;return r.createRouter({basename:null==t?void 0:t.basename,history:r.createHashHistory({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||(null==(o=window)?void 0:o.__staticRouterHydrationData),routes:n.UNSAFE_enhanceManualRouteObjects(e)}).initialize()},e.createSearchParams=d,e.unstable_HistoryRouter=function(e){let{basename:t,children:r,history:o}=e;const[a,s]=i.useState({action:o.action,location:o.location});return i.useLayoutEffect((()=>o.listen(s)),[o]),i.createElement(n.Router,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:o})},e.useFetcher=function(){var e;let{router:t}=_(x.UseFetcher),o=i.useContext(n.UNSAFE_RouteContext);o||r.invariant(!1);let s=null==(e=o.matches[o.matches.length-1])?void 0:e.route.id;null==s&&r.invariant(!1);let[l]=i.useState((()=>String(++j))),[u]=i.useState((()=>(s||r.invariant(!1),function(e,t){return i.forwardRef(((n,r)=>i.createElement(b,a({},n,{ref:r,fetcherKey:e,routeId:t}))))}(l,s)))),[c]=i.useState((()=>e=>{t||r.invariant(!1),s||r.invariant(!1),t.fetch(l,s,e)})),d=S(l,s),f=t.getFetcher(l),h=i.useMemo((()=>a({Form:u,submit:d,load:c},f)),[f,u,d,c]);return i.useEffect((()=>()=>{t?t.deleteFetcher(l):console.warn("No fetcher available to clean up from useFetcher()")}),[t,l]),h},e.useFetchers=function(){return[...E(w.UseFetchers).fetchers.values()]},e.useFormAction=P,e.useLinkClickHandler=k,e.useSearchParams=function(e){let t=i.useRef(d(e)),r=n.useLocation(),o=i.useMemo((()=>function(e,t){let n=d(e);for(let r of t.keys())n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}));return n}(r.search,t.current)),[r.search]),a=n.useNavigate(),s=i.useCallback(((e,t)=>{const n=d("function"==typeof e?e(o):e);a("?"+n,t)}),[a,o]);return[o,s]},e.useSubmit=function(){return S()},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(12139),n(3771),n(44928))},3771:(e,t,n)=>{"use strict";e.exports=n(34153)},34153:function(e,t,n){!function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=r(n);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}const a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:s,useEffect:l,useLayoutEffect:u,useDebugValue:c}=o;function d(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!a(n,e)}catch(e){return!0}}const f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t,n){return t()}:function(e,t,n){const r=t(),[{inst:o},i]=s({inst:{value:r,getSnapshot:t}});return u((()=>{o.value=r,o.getSnapshot=t,d(o)&&i({inst:o})}),[e,r,t]),l((()=>(d(o)&&i({inst:o}),e((()=>{d(o)&&i({inst:o})})))),[e]),c(r),r},h="useSyncExternalStore"in o?(e=>e.useSyncExternalStore)(o):f,p=o.createContext(null),v=o.createContext(null),g=o.createContext(null),y=o.createContext(null),m=o.createContext(null),b=o.createContext(null),x=o.createContext({outlet:null,matches:[]}),w=o.createContext(null);function _(){return null!=o.useContext(b)}function E(){return _()||t.invariant(!1),o.useContext(b).location}function k(){_()||t.invariant(!1);let{basename:e,navigator:n}=o.useContext(m),{matches:r}=o.useContext(x),{pathname:i}=E(),a=JSON.stringify(t.UNSAFE_getPathContributingMatches(r).map((e=>e.pathnameBase))),s=o.useRef(!1);return o.useEffect((()=>{s.current=!0})),o.useCallback((function(r,o){if(void 0===o&&(o={}),!s.current)return;if("number"==typeof r)return void n.go(r);let l=t.resolveTo(r,JSON.parse(a),i,"path"===o.relative);"/"!==e&&(l.pathname="/"===l.pathname?e:t.joinPaths([e,l.pathname])),(o.replace?n.replace:n.push)(l,o.state,o)}),[e,n,a,i])}const S=o.createContext(null);function P(e){let t=o.useContext(x).outlet;return t?o.createElement(S.Provider,{value:e},t):t}function j(e,n){let{relative:r}=void 0===n?{}:n,{matches:i}=o.useContext(x),{pathname:a}=E(),s=JSON.stringify(t.UNSAFE_getPathContributingMatches(i).map((e=>e.pathnameBase)));return o.useMemo((()=>t.resolveTo(e,JSON.parse(s),a,"path"===r)),[e,s,a,r])}function C(e,n){_()||t.invariant(!1);let r=o.useContext(g),{matches:a}=o.useContext(x),s=a[a.length-1],l=s?s.params:{};!s||s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let c,d=E();if(n){var f;let e="string"==typeof n?t.parsePath(n):n;"/"===u||(null==(f=e.pathname)?void 0:f.startsWith(u))||t.invariant(!1),c=e}else c=d;let h=c.pathname||"/",p="/"===u?h:h.slice(u.length)||"/",v=t.matchRoutes(e,{pathname:p}),y=D(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:t.joinPaths([u,e.pathname]),pathnameBase:"/"===e.pathnameBase?u:t.joinPaths([u,e.pathnameBase])}))),a,r||void 0);return n&&y?o.createElement(b.Provider,{value:{location:i({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:t.Action.Pop}},y):y}function T(){let e=I(),n=t.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i};return o.createElement(o.Fragment,null,o.createElement("h2",null,"Unhandled Thrown Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},n),r?o.createElement("pre",{style:a},r):null,o.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),o.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own\xa0",o.createElement("code",{style:s},"errorElement")," props on\xa0",o.createElement("code",{style:s},"<Route>")))}class U extends o.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?o.createElement(w.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function O(e){let{routeContext:t,match:n,children:r}=e,i=o.useContext(p);return i&&n.route.errorElement&&(i._deepestRenderedBoundaryId=n.route.id),o.createElement(x.Provider,{value:t},r)}function D(e,n,r){if(void 0===n&&(n=[]),null==e){if(null==r||!r.errors)return null;e=r.matches}let i=e,a=null==r?void 0:r.errors;if(null!=a){let e=i.findIndex((e=>e.route.id&&(null==a?void 0:a[e.route.id])));e>=0||t.invariant(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((e,t,s)=>{let l=t.route.id?null==a?void 0:a[t.route.id]:null,u=r?t.route.errorElement||o.createElement(T,null):null,c=()=>o.createElement(O,{match:t,routeContext:{outlet:e,matches:n.concat(i.slice(0,s+1))}},l?u:void 0!==t.route.element?t.route.element:e);return r&&(t.route.errorElement||0===s)?o.createElement(U,{location:r.location,component:u,error:l,children:c()}):c()}),null)}var N,A,R;function M(e){let n=o.useContext(g);return n||t.invariant(!1),n}function I(){var e;let n=o.useContext(w),r=M(A.UseRouteError),i=o.useContext(x),a=i.matches[i.matches.length-1];return n||(i||t.invariant(!1),a.route.id||t.invariant(!1),null==(e=r.errors)?void 0:e[a.route.id])}function L(){let e=o.useContext(y);return null==e?void 0:e._data}function B(e){t.invariant(!1)}function F(e){let{basename:n="/",children:r=null,location:i,navigationType:a=t.Action.Pop,navigator:s,static:l=!1}=e;_()&&t.invariant(!1);let u=n.replace(/^\/*/,"/"),c=o.useMemo((()=>({basename:u,navigator:s,static:l})),[u,s,l]);"string"==typeof i&&(i=t.parsePath(i));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:v="default"}=i,g=o.useMemo((()=>{let e=t.stripBasename(d,u);return null==e?null:{pathname:e,search:f,hash:h,state:p,key:v}}),[u,d,f,h,p,v]);return null==g?null:o.createElement(m.Provider,{value:c},o.createElement(b.Provider,{children:r,value:{location:g,navigationType:a}}))}function V(e){let{children:t,location:n}=e,r=o.useContext(v);return C(r&&!t?r.router.routes:W(t),n)}!function(e){e.UseRevalidator="useRevalidator"}(N||(N={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(A||(A={})),function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(R||(R={}));const G=new Promise((()=>{}));class z extends o.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:n,resolve:r}=this.props,i=null,a=R.pending;if(r instanceof Promise)if(this.state.error){a=R.error;let e=this.state.error;i=Promise.reject().catch((()=>{})),Object.defineProperty(i,"_tracked",{get:()=>!0}),Object.defineProperty(i,"_error",{get:()=>e})}else r._tracked?(i=r,a=void 0!==i._error?R.error:void 0!==i._data?R.success:R.pending):(a=R.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),i=r.then((e=>Object.defineProperty(r,"_data",{get:()=>e})),(e=>Object.defineProperty(r,"_error",{get:()=>e}))));else a=R.success,i=Promise.resolve(),Object.defineProperty(i,"_tracked",{get:()=>!0}),Object.defineProperty(i,"_data",{get:()=>r});if(a===R.error&&i._error instanceof t.AbortedDeferredError)throw G;if(a===R.error&&!n)throw i._error;if(a===R.error)return o.createElement(y.Provider,{value:i,children:n});if(a===R.success)return o.createElement(y.Provider,{value:i,children:e});throw i}}function H(e){let{children:t}=e,n=L();return"function"==typeof t?t(n):o.createElement(o.Fragment,null,t)}function W(e,n){void 0===n&&(n=[]);let r=[];return o.Children.forEach(e,((e,i)=>{if(!o.isValidElement(e))return;if(e.type===o.Fragment)return void r.push.apply(r,W(e.props.children,n));e.type!==B&&t.invariant(!1),e.props.index&&e.props.children&&t.invariant(!1);let a=[...n,i],s={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(s.children=W(e.props.children,a)),r.push(s)})),r}function Y(e){return e.map((e=>{let t=i({},e);return null==t.hasErrorBoundary&&(t.hasErrorBoundary=null!=t.errorElement),t.children&&(t.children=Y(t.children)),t}))}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return t.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return t.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return t.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return t.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return t.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return t.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return t.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return t.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return t.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return t.redirect}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return t.resolvePath}}),e.Await=function(e){let{children:t,errorElement:n,resolve:r}=e;return o.createElement(z,{resolve:r,errorElement:n},o.createElement(H,null,t))},e.MemoryRouter=function(e){let{basename:n,children:r,initialEntries:i,initialIndex:a}=e,s=o.useRef();null==s.current&&(s.current=t.createMemoryHistory({initialEntries:i,initialIndex:a,v5Compat:!0}));let l=s.current,[u,c]=o.useState({action:l.action,location:l.location});return o.useLayoutEffect((()=>l.listen(c)),[l]),o.createElement(F,{basename:n,children:r,location:u.location,navigationType:u.action,navigator:l})},e.Navigate=function(e){let{to:n,replace:r,state:i,relative:a}=e;_()||t.invariant(!1);let s=o.useContext(g),l=k();return o.useEffect((()=>{s&&"idle"!==s.navigation.state||l(n,{replace:r,state:i,relative:a})})),null},e.Outlet=function(e){return P(e.context)},e.Route=B,e.Router=F,e.RouterProvider=function(e){let{fallbackElement:t,router:n}=e,r=h(n.subscribe,(()=>n.state),(()=>n.state)),i=o.useMemo((()=>({createHref:n.createHref,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),a=n.basename||"/";return o.createElement(v.Provider,{value:{router:n,navigator:i,static:!1,basename:a}},o.createElement(g.Provider,{value:r},o.createElement(F,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:i},n.state.initialized?o.createElement(V,null):t)))},e.Routes=V,e.UNSAFE_DataRouterContext=v,e.UNSAFE_DataRouterStateContext=g,e.UNSAFE_DataStaticRouterContext=p,e.UNSAFE_LocationContext=b,e.UNSAFE_NavigationContext=m,e.UNSAFE_RouteContext=x,e.UNSAFE_enhanceManualRouteObjects=Y,e.createMemoryRouter=function(e,n){return t.createRouter({basename:null==n?void 0:n.basename,history:t.createMemoryHistory({initialEntries:null==n?void 0:n.initialEntries,initialIndex:null==n?void 0:n.initialIndex}),hydrationData:null==n?void 0:n.hydrationData,routes:Y(e)}).initialize()},e.createRoutesFromChildren=W,e.createRoutesFromElements=W,e.renderMatches=function(e){return D(e)},e.useActionData=function(){let e=M(A.UseActionData);return o.useContext(x)||t.invariant(!1),Object.values((null==e?void 0:e.actionData)||{})[0]},e.useAsyncError=function(){let e=o.useContext(y);return null==e?void 0:e._error},e.useAsyncValue=L,e.useHref=function(e,n){let{relative:r}=void 0===n?{}:n;_()||t.invariant(!1);let{basename:i,navigator:a}=o.useContext(m),{hash:s,pathname:l,search:u}=j(e,{relative:r}),c=l;return"/"!==i&&(c="/"===l?i:t.joinPaths([i,l])),a.createHref({pathname:c,search:u,hash:s})},e.useInRouterContext=_,e.useLoaderData=function(){let e=M(A.UseLoaderData),n=o.useContext(x);n||t.invariant(!1);let r=n.matches[n.matches.length-1];return r.route.id||t.invariant(!1),e.loaderData[r.route.id]},e.useLocation=E,e.useMatch=function(e){_()||t.invariant(!1);let{pathname:n}=E();return o.useMemo((()=>t.matchPath(e,n)),[n,e])},e.useMatches=function(){let{matches:e,loaderData:t}=M(A.UseMatches);return o.useMemo((()=>e.map((e=>{let{pathname:n,params:r}=e;return{id:e.route.id,pathname:n,params:r,data:t[e.route.id],handle:e.route.handle}}))),[e,t])},e.useNavigate=k,e.useNavigation=function(){return M(A.UseNavigation).navigation},e.useNavigationType=function(){return o.useContext(b).navigationType},e.useOutlet=P,e.useOutletContext=function(){return o.useContext(S)},e.useParams=function(){let{matches:e}=o.useContext(x),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=j,e.useRevalidator=function(){let e=function(e){let n=o.useContext(v);return n||t.invariant(!1),n}(N.UseRevalidator),n=M(A.UseRevalidator);return{revalidate:e.router.revalidate,state:n.revalidation}},e.useRouteError=I,e.useRouteLoaderData=function(e){return M(A.UseRouteLoaderData).loaderData[e]},e.useRoutes=C,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(44928),n(12139))},17767:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12139).useLayoutEffect;t.default=r},20452:(e,t,n)=>{"use strict";var r=n(12139);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(r){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,c=r[1];return s((function(){o.value=n,o.getSnapshot=t,u(o)&&c({inst:o})}),[e,n,t]),a((function(){return u(o)&&c({inst:o}),e((function(){u(o)&&c({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},80402:(e,t,n)=>{"use strict";var r=n(12139),o=n(43100);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=u((function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(a=e,s=n)}var a,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,o]);var h=a(e,d[0],d[1]);return l((function(){f.hasValue=!0,f.value=h}),[h]),c(h),h}},43100:(e,t,n)=>{"use strict";e.exports=n(20452)},41110:(e,t,n)=>{"use strict";e.exports=n(80402)},10557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(60035),i=n(84743);function a(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[o.symbolObservable]=function(){return this},t}function s(e,t,n){var r=a(t);if(r.deferred=!0,o.isMachine(e)){var s=r.state=i.provide(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return s}}return r}function l(e){try{return"function"==typeof e.send}catch(t){return!1}}t.createDeferredActor=s,t.createInvocableActor=function(e,t,n,r){var i,l=o.toInvokeSource(e.src),u=null===(i=null==t?void 0:t.options.services)||void 0===i?void 0:i[l.type],c=e.data?o.mapContext(e.data,n,r):void 0,d=u?s(u,e.id,c):a(e.id);return d.meta=e,d},t.createNullActor=a,t.isActor=l,t.isSpawnedActor=function(e){return l(e)&&"id"in e},t.toActorRef=function(e){var t;return r.__assign(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[o.symbolObservable]=function(){return this},t),e)}},409:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(88916),o=n(78664),i=!1;t.Machine=function(e,t,n){return void 0===n&&(n=e.context),new r.StateNode(e,t,n)},t.createMachine=function(e,t){return o.IS_PRODUCTION||e.predictableActionArguments||i||(i=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new r.StateNode(e,t)}},14255:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(3442),i=n(60035),a=n(9108),s=n(25612),l=n(78664);function u(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}var c=u;var d=function(){function e(e){var t,n=this;this.actions=[],this.activities=o.EMPTY_ACTIVITY_MAP,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||o.EMPTY_ACTIVITY_MAP,this.meta=a.getMeta(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return a.nextEvents(n.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:s.initEvent,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=s.initEvent;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),i.isString(e))return[e];var o=Object.keys(e);return o.concat.apply(o,r.__spreadArray([],r.__read(o.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=r.__rest(e,["configuration","transitions","tags","machine"]);return r.__assign(r.__assign({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return i.matchesState(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;l.IS_PRODUCTION&&i.warn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}();t.State=d,t.bindActionToState=function(e,t){var n=e.exec;return r.__assign(r.__assign({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})},t.isState=c,t.isStateConfig=u,t.stateValuesEqual=function e(t,n){if(t===n)return!0;if(void 0===t||void 0===n)return!1;if(i.isString(t)||i.isString(n))return t===n;var r=Object.keys(t),o=Object.keys(n);return r.length===o.length&&r.every((function(r){return e(t[r],n[r])}))}},88916:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(60035),i=n(94309),a=n(14255),s=n(83521),l=n(25612),u=n(78664),c=n(3442),d=n(9108),f=n(10557),h=n(8974),p="",v="*",g={},y=function(e){return"#"===e[0]},m=function(){function e(t,n,i,a){void 0===i&&(i="context"in t?t.context:void 0);var s,f=this;this.config=t,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==a?void 0:a.parent,this.key=this.config.key||(null==a?void 0:a.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:c.STATE_DELIMITER),this.id=this.config.id||r.__spreadArray([this.machine.key],r.__read(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(s=this.config.schema)&&void 0!==s?s:{},this.description=this.config.description,u.IS_PRODUCTION||o.warn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?o.mapValues(this.config.states,(function(t,n){var o,i=new e(t,{},void 0,{parent:f,key:n});return Object.assign(f.idMap,r.__assign(((o={})[i.id]=i,o),i.idMap)),i})):g;var v=0;!function e(t){var n,o;t.order=v++;try{for(var i=r.__values(d.getAllChildren(t)),a=i.next();!a.done;a=i.next()){e(a.value)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===p})):p in this.config.on),this.strict=!!this.config.strict,this.onEntry=o.toArray(this.config.entry||this.config.onEntry).map((function(e){return l.toActionObject(e)})),this.onExit=o.toArray(this.config.exit||this.config.onExit).map((function(e){return l.toActionObject(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=o.toArray(this.config.invoke).map((function(e,t){var n,i;if(o.isMachine(e)){var a=o.createInvokeId(f.id,t);return f.machine.options.services=r.__assign(((n={})[a]=e,n),f.machine.options.services),h.toInvokeDefinition({src:a,id:a})}if(o.isString(e.src)){a=e.id||o.createInvokeId(f.id,t);return h.toInvokeDefinition(r.__assign(r.__assign({},e),{id:a,src:e.src}))}if(o.isMachine(e.src)||o.isFunction(e.src)){a=e.id||o.createInvokeId(f.id,t);return f.machine.options.services=r.__assign(((i={})[a]=e.src,i),f.machine.options.services),h.toInvokeDefinition(r.__assign(r.__assign({id:a},e),{src:a}))}var s=e.src;return h.toInvokeDefinition(r.__assign(r.__assign({id:o.createInvokeId(f.id,t)},e),{src:s}))})),this.activities=o.toArray(this.config.activities).concat(this.invoke).map((function(e){return l.toActivityDefinition(e)})),this.transition=this.transition.bind(this),this.tags=o.toArray(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||d.getAllStateNodes(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var o=this.options,i=o.actions,a=o.activities,s=o.guards,l=o.services,u=o.delays;return new e(this.config,{actions:r.__assign(r.__assign({},i),t.actions),activities:r.__assign(r.__assign({},a),t.activities),guards:r.__assign(r.__assign({},s),t.guards),services:r.__assign(r.__assign({},l),t.services),delays:r.__assign(r.__assign({},u),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return o.isFunction(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:o.mapValues(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===p,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===v}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=o.isFunction(t)?"".concat(e.id,":delay[").concat(n,"]"):t,i=l.after(r,e.id);return e.onEntry.push(l.send(i,{delay:t})),e.onExit.push(l.cancel(i)),i};return(o.isArray(t)?t.map((function(e,t){var o=n(e.delay,t);return r.__assign(r.__assign({},e),{event:o})})):o.flatten(Object.keys(t).map((function(e,i){var a=t[e],s=o.isString(a)?{target:a}:a,l=isNaN(+e)?e:+e,u=n(l,i);return o.toArray(s).map((function(e){return r.__assign(r.__assign({},e),{event:u,delay:l})}))})))).map((function(t){var n=t.delay;return r.__assign(r.__assign({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var i=e instanceof a.State?e.value:o.toStateValue(e,this.delimiter);if(o.isString(i)){var s=this.getStateNode(i).initial;return void 0!==s?this.getStateNodes(((t={})[i]=s,t)):[this,this.states[i]]}var l=Object.keys(i),u=[this];return u.push.apply(u,r.__spreadArray([],r.__read(o.flatten(l.map((function(e){return n.getStateNode(e).getStateNodes(i[e])})))),!1)),u},e.prototype.handles=function(e){var t=o.getEventType(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof a.State?e:a.State.create(e),n=Array.from(d.getConfiguration([],this.getStateNodes(t.value)));return new a.State(r.__assign(r.__assign({},t),{value:this.resolve(t.value),configuration:n,done:d.isInFinalState(n,this),tags:d.getTagsFromConfiguration(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),o=this.getStateNode(r[0])._transition(e[r[0]],t,n);return o&&o.transitions.length?o:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var i,a,s={};try{for(var l=r.__values(Object.keys(e)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e[c];if(d){var f=this.getStateNode(c)._transition(d,t,n);f&&(s[c]=f)}}}catch(y){i={error:y}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var h=Object.keys(s).map((function(e){return s[e]})),p=o.flatten(h.map((function(e){return e.transitions})));if(!h.some((function(e){return e.transitions.length>0})))return this.next(t,n);var v=o.flatten(h.map((function(e){return e.entrySet}))),g=o.flatten(Object.keys(s).map((function(e){return s[e].configuration})));return{transitions:p,entrySet:v,exitSet:o.flatten(h.map((function(e){return e.exitSet}))),configuration:g,source:t,actions:o.flatten(Object.keys(s).map((function(e){return s[e].actions})))}},e.prototype._transition=function(e,t,n){return o.isString(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,o.toSCXMLEvent(t))},e.prototype.next=function(e,t){var n,i,a,s=this,l=t.name,u=[],c=[];try{for(var d=r.__values(this.getCandidates(l)),f=d.next();!f.done;f=d.next()){var h=f.value,p=h.cond,v=h.in,g=e.context,m=!v||(o.isString(v)&&y(v)?e.matches(o.toStateValue(this.getStateNodeById(v).path,this.delimiter)):o.matchesState(o.toStateValue(v,this.delimiter),o.path(this.path.slice(0,-2))(e.value))),b=!1;try{b=!p||o.evaluateGuard(this.machine,p,g,t,e)}catch(E){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(l,"' in state node '").concat(this.id,"':\n").concat(E.message))}if(b&&m){void 0!==h.target&&(c=h.target),u.push.apply(u,r.__spreadArray([],r.__read(h.actions),!1)),a=h;break}}}catch(k){n={error:k}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}if(a){if(!c.length)return{transitions:[a],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:u};var x=o.flatten(c.map((function(t){return s.getRelativeStateNodes(t,e.historyValue)}))),w=!!a.internal,_=[];return w||c.forEach((function(e){_.push.apply(_,r.__spreadArray([],r.__read(s.getExternalReentryNodes(e)),!1))})),{transitions:[a],entrySet:_,exitSet:w?[]:[this],configuration:x,source:e,actions:u}}},e.prototype.getExternalReentryNodes=function(e){for(var t=[],n=r.__read(e.order>this.order?[e,this]:[this,e],2),o=n[0],i=n[1];o&&o!==i;)t.push(o),o=o.parent;return o!==i?[]:(t.push(i),t)},e.prototype.getActions=function(e,t,n,a,u,c,f){var h,p,v,g,y=this,m=d.getConfiguration([],c?this.getStateNodes(c.value):[this]);try{for(var b=r.__values(e),x=b.next();!x.done;x=b.next()){var w=x.value;(!d.has(m,w)||d.has(n.entrySet,w.parent)&&!d.has(n.entrySet,w))&&n.entrySet.push(w)}}catch(O){h={error:O}}finally{try{x&&!x.done&&(p=b.return)&&p.call(b)}finally{if(h)throw h.error}}try{for(var _=r.__values(m),E=_.next();!E.done;E=_.next()){w=E.value;d.has(e,w)&&!d.has(n.exitSet,w.parent)||n.exitSet.push(w)}}catch(D){v={error:D}}finally{try{E&&!E.done&&(g=_.return)&&g.call(_)}finally{if(v)throw v.error}}var k=o.flatten(n.entrySet.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push(l.done(e.id,e.doneData),l.done(r.id,e.doneData?o.mapContext(e.doneData,a,u):void 0));var i=r.parent;return"parallel"===i.type&&d.getChildren(i).every((function(e){return d.isInFinalState(n.configuration,e)}))&&t.push(l.done(i.id)),t})));n.exitSet.sort((function(e,t){return t.order-e.order})),n.entrySet.sort((function(e,t){return e.order-t.order}));var S=new Set(n.entrySet),P=new Set(n.exitSet),j=Array.from(S).map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return l.start(e)}));return l.toActionObjects(f?r.__spreadArray(r.__spreadArray([],r.__read(t),!1),r.__read(n),!1):r.__spreadArray(r.__spreadArray([],r.__read(n),!1),r.__read(t),!1),y.machine.options.actions)})).concat([k.map(l.raise)]),C=Array.from(P).map((function(e){return l.toActionObjects(r.__spreadArray(r.__spreadArray([],r.__read(e.onExit),!1),r.__read(e.activities.map((function(e){return l.stop(e)}))),!1),y.machine.options.actions)})).concat([l.toActionObjects(n.actions,this.machine.options.actions)]).concat(j);if(t){var T=l.toActionObjects(o.flatten(r.__spreadArray([],r.__read(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return e.type!==s.raise&&(e.type!==s.send||!!e.to&&e.to!==i.SpecialTargets.Internal)}));return C.concat([T])}return C},e.prototype.transition=function(e,t,n,i){void 0===e&&(e=this.initialState);var s,l=o.toSCXMLEvent(t);if(e instanceof a.State)s=void 0===n?e:this.resolveState(a.State.from(e,n));else{var c=o.isString(e)?this.resolve(o.pathToStateValue(this.getResolvedPath(e))):this.resolve(e),f=null!=n?n:this.machine.context;s=this.resolveState(a.State.from(c,f))}if(!u.IS_PRODUCTION&&l.name===v)throw new Error("An event cannot have the wildcard type ('".concat(v,"')"));if(this.strict&&!this.events.includes(l.name)&&!o.isBuiltInEvent(l.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(l.name,"'"));var h=this._transition(s.value,s,l)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:s,actions:[]},p=d.getConfiguration([],this.getStateNodes(s.value)),g=h.configuration.length?d.getConfiguration(p,h.configuration):p;return h.configuration=r.__spreadArray([],r.__read(g),!1),this.resolveTransition(h,s,s.context,i,l)},e.prototype.resolveRaisedTransition=function(e,t,n,o){var i,a=e.actions;return(e=this.transition(e,t,void 0,o))._event=n,e.event=n.data,(i=e.actions).unshift.apply(i,r.__spreadArray([],r.__read(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,u,c){var h,v,g,y,m=this;void 0===c&&(c=l.initEvent);var b=e.configuration,x=!t||e.transitions.length>0,w=x?e.configuration:t?t.configuration:[],_=d.isInFinalState(w,this),E=x?d.getValue(this.machine,b):void 0,k=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,S=this.getActions(new Set(w),_,e,n,c,t,u),P=t?r.__assign({},t.activities):{};try{for(var j=r.__values(S),C=j.next();!C.done;C=j.next()){var T=C.value;try{for(var O=(g=void 0,r.__values(T)),D=O.next();!D.done;D=O.next()){var N=D.value;N.type===s.start?P[N.activity.id||N.activity.type]=N:N.type===s.stop&&(P[N.activity.id||N.activity.type]=!1)}}catch(K){g={error:K}}finally{try{D&&!D.done&&(y=O.return)&&y.call(O)}finally{if(g)throw g.error}}}}catch(Z){h={error:Z}}finally{try{C&&!C.done&&(v=j.return)&&v.call(j)}finally{if(h)throw h.error}}var A=r.__read(l.resolveActions(this,t,n,c,S,u,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),R=A[0],M=A[1],I=r.__read(o.partition(R,(function(e){return e.type===s.raise||e.type===s.send&&e.to===i.SpecialTargets.Internal})),2),L=I[0],B=I[1],F=R.filter((function(e){var t;return e.type===s.start&&(null===(t=e.activity)||void 0===t?void 0:t.type)===s.invoke})),V=F.reduce((function(e,t){return e[t.activity.id]=f.createInvocableActor(t.activity,m.machine,M,c),e}),t?r.__assign({},t.children):{}),G=new a.State({value:E||t.value,context:M,_event:c,_sessionid:t?t._sessionid:null,historyValue:E?k?o.updateHistoryValue(k,E):void 0:t?t.historyValue:void 0,history:!E||e.source?t:void 0,actions:E?B:[],activities:E?P:t?t.activities:{},events:[],configuration:w,transitions:e.transitions,children:V,done:_,tags:d.getTagsFromConfiguration(w),machine:this}),H=n!==M;G.changed=c.name===s.update||H;var W=G.history;W&&delete W.history;var Y=!_&&(this._transient||b.some((function(e){return e._transient})));if(!(x||Y&&c.name!==p))return G;var q=G;if(!_)for(Y&&(q=this.resolveRaisedTransition(q,{type:s.nullEvent},c,u));L.length;){var X=L.shift();q=this.resolveRaisedTransition(q,X._event,c,u)}var $=q.changed||(W?!!q.actions.length||H||typeof W.value!=typeof q.value||!a.stateValuesEqual(q.value,W.value):void 0);return q.changed=$,q.history=W,q},e.prototype.getStateNode=function(e){if(y(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=y(e)?e.slice("#".length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&y(e))try{return this.getStateNodeById(e.slice(1))}catch(i){}for(var t=o.toStatePath(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||g;switch(this.type){case"parallel":return o.mapValues(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):g}));case"compound":if(o.isString(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?o.mapValues(e,(function(e,t){return e?n.getStateNode(t).resolve(e):g})):this.initialStateValue||{};default:return e||g}},e.prototype.getResolvedPath=function(e){if(y(e)){var t=this.machine.idMap[e.slice("#".length)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return o.toStatePath(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=o.mapFilterValues(this.states,(function(e){return e.initialStateValue||g}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=d.isLeafNode(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=o.isString(t.target)&&y(t.target)?o.pathToStateValue(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;if(d.isLeafNode(this))return[this];if("compound"===this.type&&!this.initial)return u.IS_PRODUCTION||o.warn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=o.toStatePaths(this.initialStateValue);return o.flatten(t.map((function(t){return e.getFromRelativePath(t)})))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=r.__read(e),n=t[0],o=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var i=this.getStateNode(n);if("history"===i.type)return i.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(o)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:o.mapFilterValues(this.states,(function(t,n){if(!e)return t.historyValue();var r=o.isString(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?o.flatten(o.toStatePaths(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var i=o.nestedPath(n.path,"states")(e).current;return o.isString(i)?[n.getStateNode(i)]:o.flatten(o.toStatePaths(i).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=o.flatten(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,o;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var s=r.__values(Object.keys(i)),l=s.next();!l.done;l=s.next()){var u=i[l.value];if(u.states)try{for(var c=(n=void 0,r.__values(u.events)),d=c.next();!d.done;d=c.next()){var f=d.value;a.add("".concat(f))}}catch(h){n={error:h}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}}}catch(p){e={error:p}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!o.isString(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(i){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(i.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=o.normalizeTarget(e.target),i="internal"in e?e.internal:!n||n.some((function(e){return o.isString(e)&&e[0]===t.delimiter})),a=this.machine.options.guards,s=this.resolveTarget(n),u=r.__assign(r.__assign({},e),{actions:l.toActionObjects(o.toArray(e.actions)),cond:o.toGuard(e.cond,a),target:s,source:this,internal:i,eventType:e.event,toJSON:function(){return r.__assign(r.__assign({},u),{target:u.target?u.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return u},e.prototype.formatTransitions=function(){var e,t,n,i=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var a=this.config.on,s=v,c=a[s],d=void 0===c?[]:c,f=r.__rest(a,["*"]);n=o.flatten(Object.keys(f).map((function(e){u.IS_PRODUCTION||e!==p||o.warn(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(i.id,'".'));var t=o.toTransitionConfigArray(e,f[e]);return u.IS_PRODUCTION||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(o.isString(e.target)||o.isMachine(e.target))})),i=t===p?"the transient event":"event '".concat(t,"'");o.warn(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(i,e,t),t})).concat(o.toTransitionConfigArray(v,d)))}else n=[];var h=this.config.always?o.toTransitionConfigArray("",this.config.always):[],g=this.config.onDone?o.toTransitionConfigArray(String(l.done(this.id)),this.config.onDone):[];u.IS_PRODUCTION||o.warn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var y=o.flatten(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,r.__spreadArray([],r.__read(o.toTransitionConfigArray(String(l.doneInvoke(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,r.__spreadArray([],r.__read(o.toTransitionConfigArray(String(l.error(e.id)),e.onError)),!1)),t}))),m=this.after,b=o.flatten(r.__spreadArray(r.__spreadArray(r.__spreadArray(r.__spreadArray([],r.__read(g),!1),r.__read(y),!1),r.__read(n),!1),r.__read(h),!1).map((function(e){return o.toArray(e).map((function(e){return i.formatTransition(e)}))})));try{for(var x=r.__values(m),w=x.next();!w.done;w=x.next()){var _=w.value;b.push(_)}}catch(E){e={error:E}}finally{try{w&&!w.done&&(t=x.return)&&t.call(x)}finally{if(e)throw e.error}}return b},e}();t.StateNode=m},57649:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.__assign.apply(this,arguments)},t.__read=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},t.__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},t.__spreadArray=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},t.__values=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}},83521:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(94309),o=r.ActionTypes.Start,i=r.ActionTypes.Stop,a=r.ActionTypes.Raise,s=r.ActionTypes.Send,l=r.ActionTypes.Cancel,u=r.ActionTypes.NullEvent,c=r.ActionTypes.Assign,d=r.ActionTypes.After,f=r.ActionTypes.DoneState,h=r.ActionTypes.Log,p=r.ActionTypes.Init,v=r.ActionTypes.Invoke,g=r.ActionTypes.ErrorExecution,y=r.ActionTypes.ErrorPlatform,m=r.ActionTypes.ErrorCustom,b=r.ActionTypes.Update,x=r.ActionTypes.Choose,w=r.ActionTypes.Pure;t.after=d,t.assign=c,t.cancel=l,t.choose=x,t.doneState=f,t.error=m,t.errorExecution=g,t.errorPlatform=y,t.init=p,t.invoke=v,t.log=h,t.nullEvent=u,t.pure=w,t.raise=a,t.send=s,t.start=o,t.stop=i,t.update=b},25612:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(94309),i=n(83521),a=n(60035),s=n(78664),l=a.toSCXMLEvent({type:i.init});function u(e,t){return t&&t[e]||void 0}function c(e,t){var n;if(a.isString(e)||"number"==typeof e){var o=u(e,t);n=a.isFunction(o)?{type:e,exec:o}:o||{type:e,exec:void 0}}else if(a.isFunction(e))n={type:e.name||e.toString(),exec:e};else{o=u(e.type,t);if(a.isFunction(o))n=r.__assign(r.__assign({},e),{exec:o});else if(o){var i=o.type||e.type;n=r.__assign(r.__assign(r.__assign({},o),e),{type:i})}else n=e}return n}var d=function(e,t){return e?(a.isArray(e)?e:[e]).map((function(e){return c(e,t)})):[]};function f(e){var t=c(e);return r.__assign(r.__assign({id:a.isString(e)?e:t.id},t),{type:t.type})}function h(e){return{type:i.raise,_event:a.toSCXMLEvent(e.event)}}function p(e,t){return{to:t?t.to:void 0,type:i.send,event:a.isFunction(e)?e:a.toEventObject(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:a.isFunction(e)?e.name:a.getEventType(e)}}function v(e,t,n,o){var i,s={_event:n},l=a.toSCXMLEvent(a.isFunction(e.event)?e.event(t,n.data,s):e.event);if(a.isString(e.delay)){var u=o&&o[e.delay];i=a.isFunction(u)?u(t,n.data,s):u}else i=a.isFunction(e.delay)?e.delay(t,n.data,s):e.delay;var c=a.isFunction(e.to)?e.to(t,n.data,s):e.to;return r.__assign(r.__assign({},e),{to:c,_event:l,event:l.data,delay:i})}function g(e,t){return p(e,r.__assign(r.__assign({},t),{to:o.SpecialTargets.Parent}))}var y=function(e,t){return{context:e,event:t}};var m=function(e,t,n){return r.__assign(r.__assign({},e),{value:a.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})};function b(e,t,n){var r=a.isFunction(e.activity)?e.activity(t,n.data):e.activity,i="string"==typeof r?{id:r}:r;return{type:o.ActionTypes.Stop,activity:i}}t.actionTypes=i,t.after=function(e,t){var n=t?"#".concat(t):"";return"".concat(o.ActionTypes.After,"(").concat(e,")").concat(n)},t.assign=function(e){return{type:i.assign,assignment:e}},t.cancel=function(e){return{type:i.cancel,sendId:e}},t.choose=function(e){return{type:o.ActionTypes.Choose,conds:e}},t.done=function(e,t){var n="".concat(o.ActionTypes.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r},t.doneInvoke=function(e,t){var n="".concat(o.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r},t.error=function(e,t){var n="".concat(o.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r},t.escalate=function(e,t){return g((function(t,n,r){return{type:i.error,data:a.isFunction(e)?e(t,n,r):e}}),r.__assign(r.__assign({},t),{to:o.SpecialTargets.Parent}))},t.forwardTo=function(e,t){if(!(s.IS_PRODUCTION||e&&"function"!=typeof e)){var n=e;e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o="function"==typeof n?n.apply(void 0,r.__spreadArray([],r.__read(e),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return p((function(e,t){return t}),r.__assign(r.__assign({},t),{to:e}))},t.getActionFunction=u,t.initEvent=l,t.isActionObject=function(e){return"object"==typeof e&&"type"in e},t.log=function(e,t){return void 0===e&&(e=y),{type:i.log,label:t,expr:e}},t.pure=function(e){return{type:o.ActionTypes.Pure,get:e}},t.raise=function(e){return a.isString(e)?{type:i.raise,event:e}:p(e,{to:o.SpecialTargets.Internal})},t.resolveActions=function e(t,n,l,u,f,p,g){void 0===g&&(g=!1);var y=g?[]:function(e){var t,n,o=[];try{for(var a=r.__values(e),s=a.next();!s.done;s=a.next())for(var l=s.value,u=0;u<l.length;)l[u].type!==i.assign?u++:(o.push(l[u]),l.splice(u,1))}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o}(f),x=y.length?a.updateContext(l,u,y,n):l,w=g?[l]:void 0,_=[];function E(f){var y;switch(f.type){case i.raise:return h(f);case i.send:var E=v(f,x,u,t.options.delays);return s.IS_PRODUCTION||a.warn(!a.isString(f.delay)||"number"==typeof E.delay,"No delay reference for delay expression '".concat(f.delay,"' was found on machine '").concat(t.id,"'")),p&&E.to!==o.SpecialTargets.Internal&&_.push(E),E;case i.log:var k=m(f,x,u);return null==p||p(k,x,u),k;case i.choose:if(!(C=null===(y=f.conds.find((function(e){var r=a.toGuard(e.cond,t.options.guards);return!r||a.evaluateGuard(t,r,x,u,p?void 0:n)})))||void 0===y?void 0:y.actions))return[];var S=r.__read(e(t,n,x,u,[d(a.toArray(C),t.options.actions)],p,g),2),P=S[0],j=S[1];return x=j,null==w||w.push(x),P;case i.pure:var C;if(!(C=f.get(x,u.data)))return[];var T=r.__read(e(t,n,x,u,[d(a.toArray(C),t.options.actions)],p,g),2),O=T[0],D=T[1];return x=D,null==w||w.push(x),O;case i.stop:k=b(f,x,u);return null==p||p(k,l,u),k;case i.assign:x=a.updateContext(x,u,[f],p?void 0:n),null==w||w.push(x);break;default:var N=c(f,t.options.actions),A=N.exec;if(p)p(N,x,u);else if(A&&w){var R=w.length-1;N=r.__assign(r.__assign({},N),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];A.apply(void 0,r.__spreadArray([w[R]],r.__read(t),!1))}})}return N}}return[a.flatten(f.map((function(e){var t,n,o=[];try{for(var i=r.__values(e),a=i.next();!a.done;a=i.next()){var s=E(a.value);s&&(o=o.concat(s))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return _.forEach((function(e){p(e,x,u)})),_.length=0,o}))),x]},t.resolveLog=m,t.resolveRaise=h,t.resolveSend=v,t.resolveStop=b,t.respond=function(e,t){return p(e,r.__assign(r.__assign({},t),{to:function(e,t,n){return n._event.origin}}))},t.send=p,t.sendParent=g,t.sendTo=function(e,t,n){return p(t,r.__assign(r.__assign({},n),{to:e}))},t.sendUpdate=function(){return g(i.update)},t.start=function(e){var t=f(e);return{type:o.ActionTypes.Start,activity:t,exec:void 0}},t.stop=function(e){var t=a.isFunction(e)?e:f(e);return{type:o.ActionTypes.Stop,activity:t,exec:void 0}},t.toActionObject=c,t.toActionObjects=d,t.toActivityDefinition=f},26067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25612),o=n(10557),i=n(60035);t.fromPromise=function(e){var t={error:void 0,data:void 0,status:"pending"};return{transition:function(e,t,n){var o=n.parent,i=n.id,a=n.observers;switch(t.type){case"fulfill":return null==o||o.send(r.doneInvoke(i,t.data)),{error:void 0,data:t.data,status:"fulfilled"};case"reject":return null==o||o.send(r.error(i,t.error)),a.forEach((function(e){e.error(t.error)})),{error:t.error,data:void 0,status:"rejected"};default:return e}},initialState:t,start:function(n){var r=n.self;return e().then((function(e){r.send({type:"fulfill",data:e})}),(function(e){r.send({type:"reject",error:e})})),t}}},t.fromReducer=function(e,t){return{transition:e,initialState:t}},t.spawnBehavior=function(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,a=[],s=!1,l=o.toActorRef({id:t.id,send:function(t){a.push(t),function(){if(!s){for(s=!0;a.length>0;){var t=a.shift();n=e.transition(n,t,u),r.forEach((function(e){return e.next(n)}))}s=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,o){var a=i.toObserver(e,t,o);return r.add(a),a.next(n),{unsubscribe:function(){r.delete(a)}}}}),u={parent:t.parent,self:l,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,l}},3442:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DEFAULT_GUARD_TYPE="xstate.guard",t.EMPTY_ACTIVITY_MAP={},t.STATE_DELIMITER=".",t.TARGETLESS_KEY=""},24545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78664);function o(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(r.IS_PRODUCTION||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}t.getGlobal=o,t.registerService=function(e){if(o()){var t=function(){var e=o();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}},78664:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IS_PRODUCTION=!0},96524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25612),o=n(10557),i=n(13627),a=n(409),s=n(39230),l=n(75591),u=n(80038),c=n(14255),d=n(88916),f=n(26067),h=n(94309),p=n(60035),v=r.assign,g=r.send,y=r.sendTo,m=r.sendParent,b=r.sendUpdate,x=r.forwardTo,w=r.doneInvoke,_=r.raise;t.actions=r,t.toActorRef=o.toActorRef,t.Interpreter=i.Interpreter,Object.defineProperty(t,"InterpreterStatus",{enumerable:!0,get:function(){return i.InterpreterStatus}}),t.interpret=i.interpret,t.spawn=i.spawn,t.Machine=a.Machine,t.createMachine=a.createMachine,t.mapState=s.mapState,t.matchState=l.matchState,t.createSchema=u.createSchema,t.t=u.t,t.State=c.State,t.StateNode=d.StateNode,t.spawnBehavior=f.spawnBehavior,Object.defineProperty(t,"ActionTypes",{enumerable:!0,get:function(){return h.ActionTypes}}),Object.defineProperty(t,"SpecialTargets",{enumerable:!0,get:function(){return h.SpecialTargets}}),t.matchesState=p.matchesState,t.toEventObject=p.toEventObject,t.toObserver=p.toObserver,t.toSCXMLEvent=p.toSCXMLEvent,t.assign=v,t.doneInvoke=w,t.forwardTo=x,t.raise=_,t.send=g,t.sendParent=m,t.sendTo=y,t.sendUpdate=b},13627:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(57649),i=n(94309),a=n(14255),s=n(83521),l=n(25612),u=n(78664),c=n(60035),d=n(78095),f=n(10557),h=n(70937),p=n(24545),v=n(84743),g=n(26067),y={sync:!1,autoForward:!1};t.InterpreterStatus=void 0,(r=t.InterpreterStatus||(t.InterpreterStatus={}))[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped";var m=function(){function e(n,r){void 0===r&&(r=e.defaultOptions);var a=this;this.machine=n,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=t.InterpreterStatus.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,n){if(c.isArray(e))return a.batch(e),a.state;var r=c.toSCXMLEvent(c.toEventObject(e,n));if(a.status===t.InterpreterStatus.Stopped)return u.IS_PRODUCTION||c.warn(!1,'Event "'.concat(r.name,'" was sent to stopped service "').concat(a.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(r.data))),a.state;if(a.status!==t.InterpreterStatus.Running&&!a.options.deferEvents)throw new Error('Event "'.concat(r.name,'" was sent to uninitialized service "').concat(a.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(r.data)));return a.scheduler.schedule((function(){a.forward(r);var e=a._nextState(r);a.update(e,r)})),a._state},this.sendTo=function(e,n,r){var d=a.parent&&(n===i.SpecialTargets.Parent||a.parent.id===n),f=d?a.parent:c.isString(n)?a.children.get(n)||h.registry.get(n):c.isActor(n)?n:void 0;if(f)if("machine"in f){if(a.status!==t.InterpreterStatus.Stopped||a.parent!==f||a.state.done){var p=o.__assign(o.__assign({},e),{name:e.name===s.error?"".concat(l.error(a.id)):e.name,origin:a.sessionId});!r&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([f,p]):f.send(p)}}else!r&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([f,e.data]):f.send(e.data);else{if(!d)throw new Error("Unable to send event to child '".concat(n,"' from service '").concat(a.id,"'."));u.IS_PRODUCTION||c.warn(!1,"Service '".concat(a.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,n,r,o){void 0===o&&(o=a.machine.options.actions);var d=e.exec||l.getActionFunction(e.type,o),f=c.isFunction(d)?d:d?d.exec:e.exec;if(f)try{return f(n,r.data,a.machine.config.predictableActionArguments?{action:e,_event:r}:{action:e,state:a.state,_event:r})}catch(S){throw a.parent&&a.parent.send({type:"xstate.error",data:S}),S}switch(e.type){case s.send:var h=e;if("number"==typeof h.delay)return void a.defer(h);h.to?a.sendTo(h._event,h.to,r===l.initEvent):a.send(h._event);break;case s.cancel:a.cancel(e.sendId);break;case s.start:if(a.status!==t.InterpreterStatus.Running)return;var p=e.activity;if(!a.machine.config.predictableActionArguments&&!a.state.activities[p.id||p.type])break;if(p.type===i.ActionTypes.Invoke){var v=c.toInvokeSource(p.src),g=a.machine.options.services?a.machine.options.services[v.type]:void 0,y=p.id,m=p.data;u.IS_PRODUCTION||c.warn(!("forward"in p),"`forward` property is deprecated (found in invocation of '".concat(p.src,"' in in machine '").concat(a.machine.id,"'). ")+"Please use `autoForward` instead.");var b="autoForward"in p?p.autoForward:!!p.forward;if(!g)return void(u.IS_PRODUCTION||c.warn(!1,"No service found for invocation '".concat(p.src,"' in machine '").concat(a.machine.id,"'.")));var x=m?c.mapContext(m,n,r):void 0;if("string"==typeof g)return;var w=c.isFunction(g)?g(n,r.data,{data:x,src:v,meta:p.meta}):g;if(!w)return;var _=void 0;c.isMachine(w)&&(w=x?w.withContext(x):w,_={autoForward:b}),a.spawn(w,y,_)}else a.spawnActivity(p);break;case s.stop:a.stopChild(e.activity.id);break;case s.log:var E=e.label,k=e.value;E?a.logger(E,k):a.logger(k);break;default:u.IS_PRODUCTION||c.warn(!1,"No implementation found for action type '".concat(e.type,"'"))}};var f=o.__assign(o.__assign({},e.defaultOptions),r),p=f.clock,v=f.logger,g=f.parent,y=f.id,m=void 0!==y?y:n.id;this.id=m,this.logger=v,this.clock=p,this.parent=g,this.options=f,this.scheduler=new d.Scheduler({deferEvents:this.options.deferEvents}),this.sessionId=h.registry.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:v.provide(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return u.IS_PRODUCTION||c.warn(this.status!==t.InterpreterStatus.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var i=o.__values(e.actions),a=i.next();!a.done;a=i.next()){var s=a.value;this.exec(s,e,t)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,i,a,s,u,d,f,h=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==l.initEvent||!this.options.execute)for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);else this.execute(this.state);if(this.children.forEach((function(e){h.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var v=o.__values(this.eventListeners),g=v.next();!g.done;g=v.next()){(0,g.value)(e.event)}}catch(S){n={error:S}}finally{try{g&&!g.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}try{for(var y=o.__values(this.listeners),m=y.next();!m.done;m=y.next()){(0,m.value)(e,e.event)}}catch(P){i={error:P}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}try{for(var b=o.__values(this.contextListeners),x=b.next();!x.done;x=b.next()){(0,x.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(j){s={error:j}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(s)throw s.error}}if(this.state.done){var w=e.configuration.find((function(e){return"final"===e.type&&e.parent===h.machine})),_=w&&w.doneData?c.mapContext(w.doneData,e.context,t):void 0;try{for(var E=o.__values(this.doneListeners),k=E.next();!k.done;k=E.next()){(0,k.value)(l.doneInvoke(this.id,_))}}catch(C){d={error:C}}finally{try{k&&!k.done&&(f=E.return)&&f.call(E)}finally{if(d)throw d.error}}this._stop(),this._stopChildren()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===t.InterpreterStatus.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,n,r){var o=this,i=c.toObserver(e,n,r);this.listeners.add(i.next),this.status!==t.InterpreterStatus.NotStarted&&i.next(this.state);var a=function(){o.doneListeners.delete(a),o.stopListeners.delete(a),i.complete()};return this.status===t.InterpreterStatus.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){o.listeners.delete(i.next),o.doneListeners.delete(a),o.stopListeners.delete(a)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var n=this;if(this.status===t.InterpreterStatus.Running)return this;this.machine._init(),h.registry.register(this.sessionId,this),this.initialized=!0,this.status=t.InterpreterStatus.Running;var r=void 0===e?this.initialState:v.provide(this,(function(){return a.isStateConfig(e)?n.machine.resolveState(e):n.machine.resolveState(a.State.from(e,n.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){n.update(r,l.initEvent)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){c.isFunction(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,n,r,i,a,s,l,u,c,f;try{for(var h=o.__values(this.listeners),p=h.next();!p.done;p=h.next()){var v=p.value;this.listeners.delete(v)}}catch(S){e={error:S}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}try{for(var g=o.__values(this.stopListeners),y=g.next();!y.done;y=g.next()){(v=y.value)(),this.stopListeners.delete(v)}}catch(P){r={error:P}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}try{for(var m=o.__values(this.contextListeners),b=m.next();!b.done;b=m.next()){v=b.value;this.contextListeners.delete(v)}}catch(j){a={error:j}}finally{try{b&&!b.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}try{for(var x=o.__values(this.doneListeners),w=x.next();!w.done;w=x.next()){v=w.value;this.doneListeners.delete(v)}}catch(C){l={error:C}}finally{try{w&&!w.done&&(u=x.return)&&u.call(x)}finally{if(l)throw l.error}}if(!this.initialized)return this;this.initialized=!1,this.status=t.InterpreterStatus.Stopped,this._initialState=void 0;try{for(var _=o.__values(Object.keys(this.delayedEventsMap)),E=_.next();!E.done;E=_.next()){var k=E.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(T){c={error:T}}finally{try{E&&!E.done&&(f=_.return)&&f.call(_)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new d.Scheduler({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t=c.toSCXMLEvent({type:"xstate.stop"}),n=v.provide(e,(function(){var n=c.flatten(o.__spreadArray([],o.__read(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return l.toActionObjects(t.onExit,e.machine.options.actions)}))),r=o.__read(l.resolveActions(e.machine,e.state,e.state.context,t,[n],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),u=r[0],d=r[1],f=new a.State({value:e.state.value,context:d,_event:t,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:u.filter((function(e){return e.type!==s.raise&&(e.type!==s.send||!!e.to&&e.to!==i.SpecialTargets.Internal)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return f.changed=!0,f}));e.update(n,t),e._stopChildren(),h.registry.free(e.sessionId)})),this},e.prototype.batch=function(e){var n=this;if(this.status===t.InterpreterStatus.NotStarted&&this.options.deferEvents)u.IS_PRODUCTION||c.warn(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==t.InterpreterStatus.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var t,i,s=n.state,l=!1,u=[],d=function(e){var t=c.toSCXMLEvent(e);n.forward(t),s=v.provide(n,(function(){return n.machine.transition(s,t,void 0,r||void 0)})),u.push.apply(u,o.__spreadArray([],o.__read(n.machine.config.predictableActionArguments?s.actions:s.actions.map((function(e){return a.bindActionToState(e,s)}))),!1)),l=l||!!s.changed};try{for(var f=o.__values(e),h=f.next();!h.done;h=f.next()){d(h.value)}}catch(p){t={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}s.changed=l,s.actions=u,n.update(s,c.toSCXMLEvent(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=c.toSCXMLEvent(e);if(0===r.name.indexOf(s.errorPlatform)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(s.errorPlatform)})))throw r.data.data;return v.provide(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=o.__values(this.forwardTo),i=r.next();!i.done;i=r.next()){var a=i.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(e)}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this;this.delayedEventsMap[e.id]=this.clock.setTimeout((function(){e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),c.isFunction(t.stop)&&t.stop())},e.prototype.spawn=function(e,n,r){if(this.status!==t.InterpreterStatus.Running)return f.createDeferredActor(e,n);if(c.isPromiseLike(e))return this.spawnPromise(Promise.resolve(e),n);if(c.isFunction(e))return this.spawnCallback(e,n);if(f.isSpawnedActor(e))return this.spawnActor(e,n);if(c.isObservable(e))return this.spawnObservable(e,n);if(c.isMachine(e))return this.spawnMachine(e,o.__assign(o.__assign({},r),{id:n}));if(c.isBehavior(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var i=new e(t,o.__assign(o.__assign({},this.options),{parent:this,id:n.id||t.id})),a=o.__assign(o.__assign({},y),n);a.sync&&i.onTransition((function(e){r.send(s.update,{state:e,id:i.id})}));var l=i;return this.children.set(i.id,l),a.autoForward&&this.forwardTo.add(i.id),i.onDone((function(e){r.removeChild(i.id),r.send(c.toSCXMLEvent(e,{origin:i.id}))})).start(),l},e.prototype.spawnBehavior=function(e,t){var n=g.spawnBehavior(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,o=this,i=!1;e.then((function(e){i||(r=e,o.removeChild(t),o.send(c.toSCXMLEvent(l.doneInvoke(t,e),{origin:t})))}),(function(e){if(!i){o.removeChild(t);var n=l.error(t,e);try{o.send(c.toSCXMLEvent(n,{origin:t}))}catch(r){c.reportUnhandledExceptionOnInvocation(e,r,t),o.devTools&&o.devTools.send(n,o.state),o.machine.strict&&o.stop()}}}));var a=((n={id:t,send:function(){},subscribe:function(t,n,r){var o=c.toObserver(t,n,r),i=!1;return e.then((function(e){i||(o.next(e),i||o.complete())}),(function(e){i||o.error(e)})),{unsubscribe:function(){return i=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[c.symbolObservable]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnCallback=function(e,t){var n,r,o,i=this,a=!1,s=new Set,u=new Set;try{o=e((function(e){r=e,u.forEach((function(t){return t(e)})),a||i.send(c.toSCXMLEvent(e,{origin:t}))}),(function(e){s.add(e)}))}catch(f){this.send(l.error(t,f))}if(c.isPromiseLike(o))return this.spawnPromise(o,t);var d=((n={id:t,send:function(e){return s.forEach((function(t){return t(e)}))},subscribe:function(e){var t=c.toObserver(e);return u.add(t.next),{unsubscribe:function(){u.delete(t.next)}}},stop:function(){a=!0,c.isFunction(o)&&o()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[c.symbolObservable]=function(){return this},n);return this.children.set(t,d),d},e.prototype.spawnObservable=function(e,t){var n,r,o=this,i=e.subscribe((function(e){r=e,o.send(c.toSCXMLEvent(e,{origin:t}))}),(function(e){o.removeChild(t),o.send(c.toSCXMLEvent(l.error(t,e),{origin:t}))}),(function(){o.removeChild(t),o.send(c.toSCXMLEvent(l.doneInvoke(t),{origin:t}))})),a=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[c.symbolObservable]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else u.IS_PRODUCTION||c.warn(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[c.symbolObservable]=function(){return this},n))},e.prototype.attachDev=function(){var e=p.getGlobal();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(o.__assign(o.__assign({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:o.__assign({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}p.registerService(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[c.symbolObservable]=function(){return this},e.prototype.getSnapshot=function(){return this.status===t.InterpreterStatus.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=b,e}();function b(e,t){return new m(e,t)}t.Interpreter=m,t.interpret=b,t.spawn=function(e,t){var n=function(e){return c.isString(e)?o.__assign(o.__assign({},y),{name:e}):o.__assign(o.__assign(o.__assign({},y),{name:c.uniqueId()}),e)}(t);return v.consume((function(t){if(!u.IS_PRODUCTION){var r=c.isMachine(e)||c.isFunction(e);c.warn(!!t||r,'Attempted to spawn an Actor (ID: "'.concat(c.isMachine(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return t?t.spawn(e,n.name,n):f.createDeferredActor(e,n.name)}))}},8974:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649);n(94309);var o=n(83521);function i(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}n(60035),n(78664),t.toInvokeDefinition=function(e){return r.__assign(r.__assign({type:o.invoke},e),{toJSON:function(){e.onDone,e.onError;var t=r.__rest(e,["onDone","onError"]);return r.__assign(r.__assign({},t),{type:o.invoke,src:i(e.src)})}})},t.toInvokeSource=i},39230:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(60035);t.mapState=function(e,t){var n,i,a;try{for(var s=r.__values(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value;o.matchesState(u,t)&&(!a||t.length>a.length)&&(a=u)}}catch(c){n={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return e[a]}},75591:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(14255);t.matchState=function(e,t,n){var i,a,s=o.State.from(e,e instanceof o.State?e.context:void 0);try{for(var l=r.__values(t),u=l.next();!u.done;u=l.next()){var c=r.__read(u.value,2),d=c[0],f=c[1];if(s.matches(d))return f(s)}}catch(h){i={error:h}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return n(s)}},70937:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new Map,r=0,o={bookId:function(){return"x:".concat(r++)},register:function(e,t){return n.set(e,t),e},get:function(e){return n.get(e)},free:function(e){n.delete(e)}};t.registry=o},78095:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o={deferEvents:!1},i=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=r.__assign(r.__assign({},o),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},e}();t.Scheduler=i},80038:(e,t)=>{"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0});var r=n;t.createSchema=n,t.t=r},84743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=[];t.consume=function(e){return e(n[n.length-1])},t.provide=function(e,t){n.push(e);var r=t(e);return n.pop(),r}},9108:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(57649),o=n(60035),i=function(e){return"atomic"===e.type||"final"===e.type};function a(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function s(e){return a(e).filter((function(e){return"history"!==e.type}))}function l(e,t){var n,o,i,a,l,u,d,f,h=c(new Set(e)),p=new Set(t);try{for(var v=r.__values(p),g=v.next();!g.done;g=v.next())for(var y=(P=g.value).parent;y&&!p.has(y);)p.add(y),y=y.parent}catch(j){n={error:j}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}var m=c(p);try{for(var b=r.__values(p),x=b.next();!x.done;x=b.next()){if("compound"!==(P=x.value).type||m.get(P)&&m.get(P).length){if("parallel"===P.type)try{for(var w=(l=void 0,r.__values(s(P))),_=w.next();!_.done;_=w.next()){var E=_.value;p.has(E)||(p.add(E),h.get(E)?h.get(E).forEach((function(e){return p.add(e)})):E.initialStateNodes.forEach((function(e){return p.add(e)})))}}catch(C){l={error:C}}finally{try{_&&!_.done&&(u=w.return)&&u.call(w)}finally{if(l)throw l.error}}}else h.get(P)?h.get(P).forEach((function(e){return p.add(e)})):P.initialStateNodes.forEach((function(e){return p.add(e)}))}}catch(T){i={error:T}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}try{for(var k=r.__values(p),S=k.next();!S.done;S=k.next()){var P;for(y=(P=S.value).parent;y&&!p.has(y);)p.add(y),y=y.parent}}catch(O){d={error:O}}finally{try{S&&!S.done&&(f=k.return)&&f.call(k)}finally{if(d)throw d.error}}return p}function u(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(i(r))return r.key}var o={};return n.forEach((function(e){o[e.key]=u(e,t)})),o}function c(e){var t,n,o=new Map;try{for(var i=r.__values(e),a=i.next();!a.done;a=i.next()){var s=a.value;o.has(s)||o.set(s,[]),s.parent&&(o.has(s.parent)||o.set(s.parent,[]),o.get(s.parent).push(s))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}function d(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}t.getAdjList=c,t.getAllChildren=a,t.getAllStateNodes=function e(t){var n=[t];return i(t)?n:n.concat(o.flatten(s(t).map(e)))},t.getChildren=s,t.getConfiguration=l,t.getMeta=function(e){return void 0===e&&(e=[]),e.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})},t.getTagsFromConfiguration=function(e){return new Set(o.flatten(e.map((function(e){return e.tags}))))},t.getValue=function(e,t){return u(e,c(l([e],t)))},t.has=d,t.isInFinalState=function e(t,n){return"compound"===n.type?s(n).some((function(e){return"final"===e.type&&d(t,e)})):"parallel"===n.type&&s(n).every((function(n){return e(t,n)}))},t.isLeafNode=i,t.nextEvents=function(e){return r.__spreadArray([],r.__read(new Set(o.flatten(r.__spreadArray([],r.__read(e.map((function(e){return e.ownEvents}))),!1)))),!1)}},94309:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionTypes=void 0,(n=t.ActionTypes||(t.ActionTypes={})).Start="xstate.start",n.Stop="xstate.stop",n.Raise="xstate.raise",n.Send="xstate.send",n.Cancel="xstate.cancel",n.NullEvent="",n.Assign="xstate.assign",n.After="xstate.after",n.DoneState="done.state",n.DoneInvoke="done.invoke",n.Log="xstate.log",n.Init="xstate.init",n.Invoke="xstate.invoke",n.ErrorExecution="error.execution",n.ErrorCommunication="error.communication",n.ErrorPlatform="error.platform",n.ErrorCustom="xstate.error",n.Update="xstate.update",n.Pure="xstate.pure",n.Choose="xstate.choose",t.SpecialTargets=void 0,(r=t.SpecialTargets||(t.SpecialTargets={})).Parent="#_parent",r.Internal="#_internal"},60035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(57649),i=n(3442),a=n(78664);function s(e,t){try{return g(e)?e:e.toString().split(t)}catch(n){throw new Error("'".concat(e,"' is not a valid state path."))}}function l(e){return"object"==typeof e&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function u(e,t){return l(e)?e.value:g(e)?c(e):"string"!=typeof e?e:c(s(e,t))}function c(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function d(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var i=r[o];n[i]=t(e[i],i,e,o)}return n}function f(e){var t;return(t=[]).concat.apply(t,o.__spreadArray([],o.__read(e),!1))}function h(e){return g(e)?e:[e]}function p(e){return void 0===e?[]:h(e)}function v(e,t){return d(e.states,(function(e,n){if(e){var r=(m(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:v(e,r)}}}))}function g(e){return Array.isArray(e)}function y(e){return"function"==typeof e}function m(e){return"string"==typeof e}t.warn=function(){},a.IS_PRODUCTION||(t.warn=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var b=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}(),x=((r={})[b]=function(){return this},r[Symbol.observable]=function(){return this},r);function w(e){return!!e&&"__xstatenode"in e}var _=function(){var e=0;return function(){return(++e).toString(16)}}();function E(e,t){return m(e)||"number"==typeof e?o.__assign({type:e},t):e}t.createInvokeId=function(e,t){return"".concat(e,":invocation[").concat(t,"]")},t.evaluateGuard=function(e,t,n,r,o){var a=e.options.guards,s={state:o,cond:t,_event:r};if(t.type===i.DEFAULT_GUARD_TYPE)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,s);var l=null==a?void 0:a[t.type];if(!l)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return l(n,r.data,s)},t.flatten=f,t.getActionType=function(e){try{return m(e)||"number"==typeof e?"".concat(e):y(e)?e.name:e.type}catch(t){throw new Error("Actions must be strings or objects with a string action.type property.")}},t.getEventType=function(e){try{return m(e)||"number"==typeof e?"".concat(e):e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}},t.interopSymbols=x,t.isActor=function(e){return!!e&&"function"==typeof e.send},t.isArray=g,t.isBehavior=function(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition},t.isBuiltInEvent=function(e){return/^(done|error)\./.test(e)},t.isFunction=y,t.isMachine=w,t.isObservable=function(e){try{return"subscribe"in e&&y(e.subscribe)}catch(t){return!1}},t.isPromiseLike=function(e){return e instanceof Promise||!(null===e||!y(e)&&"object"!=typeof e||!y(e.then))},t.isStateLike=l,t.isString=m,t.keys=function(e){return Object.keys(e)},t.mapContext=function(e,t,n){var r,i;if(y(e))return e(t,n.data);var a={};try{for(var s=o.__values(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];y(c)?a[u]=c(t,n.data):a[u]=c}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a},t.mapFilterValues=function(e,t,n){var r,i,a={};try{for(var s=o.__values(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];n(c)&&(a[u]=t(c,u,e))}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a},t.mapValues=d,t.matchesState=function e(t,n,r){void 0===r&&(r=i.STATE_DELIMITER);var o=u(t,r),a=u(n,r);return m(a)?!!m(o)&&a===o:m(o)?o in a:Object.keys(o).every((function(t){return t in a&&e(o[t],a[t])}))},t.nestedPath=function(e,t){return function(n){var r,i,a=n;try{for(var s=o.__values(e),l=s.next();!l.done;l=s.next()){var u=l.value;a=a[t][u]}}catch(c){r={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}},t.normalizeTarget=function(e){if(void 0!==e&&e!==i.TARGETLESS_KEY)return p(e)},t.partition=function(e,t){var n,r,i=o.__read([[],[]],2),a=i[0],s=i[1];try{for(var l=o.__values(e),u=l.next();!u.done;u=l.next()){var c=u.value;t(c)?a.push(c):s.push(c)}}catch(d){n={error:d}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[a,s]},t.path=function(e){return function(t){var n,r,i=t;try{for(var a=o.__values(e),s=a.next();!s.done;s=a.next()){i=i[s.value]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}},t.pathToStateValue=c,t.pathsToStateValue=function(e){var t,n,r={};if(e&&1===e.length&&1===e[0].length)return e[0][0];try{for(var i=o.__values(e),a=i.next();!a.done;a=i.next())for(var s=a.value,l=r,u=0;u<s.length;u++){var c=s[u];if(u===s.length-2){l[c]=s[u+1];break}l[c]=l[c]||{},l=l[c]}}catch(d){t={error:d}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},t.reportUnhandledExceptionOnInvocation=function(e,t,n){if(!a.IS_PRODUCTION){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var o=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(o))}}},t.symbolObservable=b,t.toArray=p,t.toArrayStrict=h,t.toEventObject=E,t.toGuard=function(e,t){if(e)return m(e)?{type:i.DEFAULT_GUARD_TYPE,name:e,predicate:t?t[e]:void 0}:y(e)?{type:i.DEFAULT_GUARD_TYPE,name:e.name,predicate:e}:e},t.toInvokeSource=function(e){return"string"==typeof e?{type:e}:e},t.toObserver=function(e,t,n){var r=function(){},o="object"==typeof e,i=o?e:null;return{next:((o?e.next:e)||r).bind(i),error:((o?e.error:t)||r).bind(i),complete:((o?e.complete:n)||r).bind(i)}},t.toSCXMLEvent=function(e,t){if(!m(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=E(e);return o.__assign({name:n.type,data:n,$$type:"scxml",type:"external"},t)},t.toStatePath=s,t.toStatePaths=function e(t){return t?m(t)?[[t]]:f(Object.keys(t).map((function(n){var r=t[n];return"string"==typeof r||r&&Object.keys(r).length?e(t[n]).map((function(e){return[n].concat(e)})):[[n]]}))):[[]]},t.toStateValue=u,t.toTransitionConfigArray=function(e,t){return h(t).map((function(t){return void 0===t||"string"==typeof t||w(t)?{target:t,event:e}:o.__assign(o.__assign({},t),{event:e})}))},t.uniqueId=_,t.updateContext=function(e,n,r,i){a.IS_PRODUCTION||t.warn(!!e,"Attempting to update undefined context");var s=e?r.reduce((function(e,t){var r,a,s=t.assignment,l={state:i,action:t,_event:n},u={};if(y(s))u=s(e,n.data,l);else try{for(var c=o.__values(Object.keys(s)),d=c.next();!d.done;d=c.next()){var f=d.value,h=s[f];u[f]=y(h)?h(e,n.data,l):h}}catch(p){r={error:p}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return Object.assign({},e,u)}),e):e;return s},t.updateHistoryStates=v,t.updateHistoryValue=function(e,t){return{current:t,states:v(e,t)}}}},e=>{var t;t=94365,e(e.s=t)}]);

Выполнить команду


Для локальной разработки. Не используйте в интернете!