@aloudata/ink-flow 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -13,7 +13,7 @@ v=g,function(){var n={}.hasOwnProperty;function e(){for(var n="",e=0;e<arguments
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/b.exports=function(){if(x)return _;x=1;var e=n,t=k(),r="function"==typeof Object.is?Object.is:function(n,e){return n===e&&(0!==n||1/n==1/e)||n!=n&&e!=e},o=t.useSyncExternalStore,i=e.useRef,u=e.useEffect,a=e.useMemo,c=e.useDebugValue;return _.useSyncExternalStoreWithSelector=function(n,e,t,l,s){var f=i(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=a((function(){function n(n){if(!u){if(u=!0,o=n,n=l(n),void 0!==s&&d.hasValue){var e=d.value;if(s(e,n))return i=e}return i=n}if(e=i,r(o,n))return e;var t=l(n);return void 0!==s&&s(e,t)?e:(o=n,i=t)}var o,i,u=!1,a=void 0===t?null:t;return[function(){return n(e())},null===a?void 0:function(){return n(a())}]}),[e,t,l,s]);var h=o(n,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),c(h),h},_}();var C=s(b.exports);const M=n=>{let e;const t=new Set,r=(n,r)=>{const o="function"==typeof n?n(e):n;if(!Object.is(o,e)){const n=e;e=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},e,o),t.forEach((t=>t(e,n)))}},o=()=>e,i={setState:r,getState:o,getInitialState:()=>u,subscribe:n=>(t.add(n),()=>t.delete(n)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=e=n(r,o,i);return i},{useDebugValue:N}=n,{useSyncExternalStoreWithSelector:O}=C,P=n=>n;function j(n,e=P,t){const r=O(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return N(r),r}const I=(n,e)=>{const t=(n=>n?M(n):M)(n),r=(n,r=e)=>j(t,n,r);return Object.assign(r,t),r};var A=n.createContext(null),z=A.Provider,L=function(){return L=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},L.apply(this,arguments)};function T(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function R(n,e,t){if(2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var D,V,H,Y,Z,X,U,F,W,$,G,q,K,Q,J,nn,en,tn,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,xn,wn,bn,_n,En,Sn,kn,Cn,Mn,Nn,On,Pn,jn,In,An,zn,Ln,Tn,Bn,Rn,Dn,Vn,Hn,Yn,Zn,Xn,Un,Fn,Wn,$n,Gn,qn,Kn,Qn,Jn,ne,ee,te,re,oe,ie,ue,ae,ce,le,se,fe,de,he,ve,pe,ge,ye,me,xe,we,be,_e,Ee,Se,ke,Ce,Me,Ne,Oe,Pe,je,Ie,Ae,ze,Le,Te,Be,Re,De,Ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function He(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ye(){return Y?H:(Y=1,H=function(n,e){return n===e||n!=n&&e!=e})}function Ze(){if(X)return Z;X=1;var n=Ye();return Z=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1},Z}function Xe(){if(nn)return J;nn=1;var n=V?D:(V=1,D=function(){this.__data__=[],this.size=0}),e=function(){if(F)return U;F=1;var n=Ze(),e=Array.prototype.splice;return U=function(t){var r=this.__data__,o=n(r,t);return!(o<0||(o==r.length-1?r.pop():e.call(r,o,1),--this.size,0))}}(),t=function(){if($)return W;$=1;var n=Ze();return W=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}}(),r=function(){if(q)return G;q=1;var n=Ze();return G=function(e){return n(this.__data__,e)>-1}}(),o=function(){if(Q)return K;Q=1;var n=Ze();return K=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,J=i}function Ue(){if(fn)return sn;fn=1;var n="object"==typeof Ve&&Ve&&Ve.Object===Object&&Ve;return sn=n}function Fe(){if(hn)return dn;hn=1;var n=Ue(),e="object"==typeof self&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return dn=t}function We(){if(pn)return vn;pn=1;var n=Fe().Symbol;return vn=n}function $e(){if(bn)return wn;bn=1;var n=We(),e=function(){if(yn)return gn;yn=1;var n=We(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;return gn=function(n){var e=t.call(n,o),i=n[o];try{n[o]=void 0;var u=!0}catch(n){}var a=r.call(n);return u&&(e?n[o]=i:delete n[o]),a}}(),t=function(){if(xn)return mn;xn=1;var n=Object.prototype.toString;return mn=function(e){return n.call(e)}}(),r=n?n.toStringTag:void 0;return wn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?e(n):t(n)}}function Ge(){return En?_n:(En=1,_n=function(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)})}function qe(){if(kn)return Sn;kn=1;var n=$e(),e=Ge();return Sn=function(t){if(!e(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function Ke(){if(jn)return Pn;jn=1;var n=Function.prototype.toString;return Pn=function(e){if(null!=e){try{return n.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function Qe(){if(Bn)return Tn;Bn=1;var n=function(){if(An)return In;An=1;var n=qe(),e=function(){if(On)return Nn;On=1;var n,e=function(){if(Mn)return Cn;Mn=1;var n=Fe()["__core-js_shared__"];return Cn=n}(),t=(n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Nn=function(n){return!!t&&t in n}}(),t=Ge(),r=Ke(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,c=u.hasOwnProperty,l=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return In=function(i){return!(!t(i)||e(i))&&(n(i)?l:o).test(r(i))}}(),e=Ln?zn:(Ln=1,zn=function(n,e){return null==n?void 0:n[e]});return Tn=function(t,r){var o=e(t,r);return n(o)?o:void 0}}function Je(){if(Dn)return Rn;Dn=1;var n=Qe()(Fe(),"Map");return Rn=n}function nt(){if(Hn)return Vn;Hn=1;var n=Qe()(Object,"create");return Vn=n}function et(){if(ie)return oe;ie=1;var n=re?te:(re=1,te=function(n){var e=typeof n;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n});return oe=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}}function tt(){if(pe)return ve;pe=1;var n=function(){if(ee)return ne;ee=1;var n=function(){if(Jn)return Qn;Jn=1;var n=function(){if(Zn)return Yn;Zn=1;var n=nt();return Yn=function(){this.__data__=n?n(null):{},this.size=0}}(),e=Un?Xn:(Un=1,Xn=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}),t=function(){if(Wn)return Fn;Wn=1;var n=nt(),e=Object.prototype.hasOwnProperty;return Fn=function(t){var r=this.__data__;if(n){var o=r[t];return"__lodash_hash_undefined__"===o?void 0:o}return e.call(r,t)?r[t]:void 0}}(),r=function(){if(Gn)return $n;Gn=1;var n=nt(),e=Object.prototype.hasOwnProperty;return $n=function(t){var r=this.__data__;return n?void 0!==r[t]:e.call(r,t)}}(),o=function(){if(Kn)return qn;Kn=1;var n=nt();return qn=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,Qn=i}(),e=Xe(),t=Je();return ne=function(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}}(),e=function(){if(ae)return ue;ae=1;var n=et();return ue=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}}(),t=function(){if(le)return ce;le=1;var n=et();return ce=function(e){return n(this,e).get(e)}}(),r=function(){if(fe)return se;fe=1;var n=et();return se=function(e){return n(this,e).has(e)}}(),o=function(){if(he)return de;he=1;var n=et();return de=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,ve=i}function rt(){if(xe)return me;xe=1;var n=Xe(),e=function(){if(tn)return en;tn=1;var n=Xe();return en=function(){this.__data__=new n,this.size=0}}(),t=on?rn:(on=1,rn=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}),r=an?un:(an=1,un=function(n){return this.__data__.get(n)}),o=ln?cn:(ln=1,cn=function(n){return this.__data__.has(n)}),i=function(){if(ye)return ge;ye=1;var n=Xe(),e=Je(),t=tt();return ge=function(r,o){var i=this.__data__;if(i instanceof n){var u=i.__data__;if(!e||u.length<199)return u.push([r,o]),this.size=++i.size,this;i=this.__data__=new t(u)}return i.set(r,o),this.size=i.size,this}}();function u(e){var t=this.__data__=new n(e);this.size=t.size}return u.prototype.clear=e,u.prototype.delete=t,u.prototype.get=r,u.prototype.has=o,u.prototype.set=i,me=u}function ot(){return be||(be=1,we=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}),we}function it(){if(Ee)return _e;Ee=1;var n=Qe(),e=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return _e=e}function ut(){if(ke)return Se;ke=1;var n=it();return Se=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}}function at(){if(Me)return Ce;Me=1;var n=ut(),e=Ye(),t=Object.prototype.hasOwnProperty;return Ce=function(r,o,i){var u=r[o];t.call(r,o)&&e(u,i)&&(void 0!==i||o in r)||n(r,o,i)}}function ct(){if(Oe)return Ne;Oe=1;var n=at(),e=ut();return Ne=function(t,r,o,i){var u=!o;o||(o={});for(var a=-1,c=r.length;++a<c;){var l=r[a],s=i?i(o[l],t[l],l,o,t):void 0;void 0===s&&(s=t[l]),u?e(o,l,s):n(o,l,s)}return o}}function lt(){return Ae?Ie:(Ae=1,Ie=function(n){return null!=n&&"object"==typeof n})}function st(){if(Be)return Te;Be=1;var n=function(){if(Le)return ze;Le=1;var n=$e(),e=lt();return ze=function(t){return e(t)&&"[object Arguments]"==n(t)}}(),e=lt(),t=Object.prototype,r=t.hasOwnProperty,o=t.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return e(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return Te=i}function ft(){if(De)return Re;De=1;var n=Array.isArray;return Re=n}var dt,ht,vt,pt,gt,yt,mt,xt,wt,bt,_t,Et={exports:{}};function St(){return vt||(vt=1,function(n,e){var t=Fe(),r=ht?dt:(ht=1,dt=function(){return!1}),o=e&&!e.nodeType&&e,i=o&&n&&!n.nodeType&&n,u=i&&i.exports===o?t.Buffer:void 0,a=(u?u.isBuffer:void 0)||r;n.exports=a}(Et,Et.exports)),Et.exports}function kt(){if(gt)return pt;gt=1;var n=/^(?:0|[1-9]\d*)$/;return pt=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}}function Ct(){return mt?yt:(mt=1,yt=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Mt(){return _t?bt:(_t=1,bt=function(n){return function(e){return n(e)}})}var Nt,Ot,Pt,jt,It,At,zt,Lt,Tt,Bt,Rt,Dt,Vt,Ht,Yt,Zt,Xt,Ut,Ft,Wt,$t,Gt,qt,Kt,Qt,Jt,nr,er={exports:{}};function tr(){return Nt||(Nt=1,n=er,e=er.exports,t=Ue(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r&&t.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(n){}}(),n.exports=u),er.exports;var n,e,t,r,o,i,u}function rr(){if(Pt)return Ot;Pt=1;var n=function(){if(wt)return xt;wt=1;var n=$e(),e=Ct(),t=lt(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,xt=function(o){return t(o)&&e(o.length)&&!!r[n(o)]}}(),e=Mt(),t=tr(),r=t&&t.isTypedArray,o=r?e(r):n;return Ot=o}function or(){if(It)return jt;It=1;var n=je?Pe:(je=1,Pe=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}),e=st(),t=ft(),r=St(),o=kt(),i=rr(),u=Object.prototype.hasOwnProperty;return jt=function(a,c){var l=t(a),s=!l&&e(a),f=!l&&!s&&r(a),d=!l&&!s&&!f&&i(a),h=l||s||f||d,v=h?n(a.length,String):[],p=v.length;for(var g in a)!c&&!u.call(a,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,p))||v.push(g);return v}}function ir(){if(zt)return At;zt=1;var n=Object.prototype;return At=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}}function ur(){return Tt||(Tt=1,Lt=function(n,e){return function(t){return n(e(t))}}),Lt}function ar(){if(Vt)return Dt;Vt=1;var n=ir(),e=function(){if(Rt)return Bt;Rt=1;var n=ur()(Object.keys,Object);return Bt=n}(),t=Object.prototype.hasOwnProperty;return Dt=function(r){if(!n(r))return e(r);var o=[];for(var i in Object(r))t.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function cr(){if(Yt)return Ht;Yt=1;var n=qe(),e=Ct();return Ht=function(t){return null!=t&&e(t.length)&&!n(t)}}function lr(){if(Xt)return Zt;Xt=1;var n=or(),e=ar(),t=cr();return Zt=function(r){return t(r)?n(r):e(r)}}function sr(){if(Qt)return Kt;Qt=1;var n=or(),e=function(){if(qt)return Gt;qt=1;var n=Ge(),e=ir(),t=$t?Wt:($t=1,Wt=function(n){var e=[];if(null!=n)for(var t in Object(n))e.push(t);return e}),r=Object.prototype.hasOwnProperty;return Gt=function(o){if(!n(o))return t(o);var i=e(o),u=[];for(var a in o)("constructor"!=a||!i&&r.call(o,a))&&u.push(a);return u}}(),t=cr();return Kt=function(r){return t(r)?n(r,!0):e(r)}}var fr,dr,hr,vr,pr,gr,yr,mr,xr,wr,br,_r,Er,Sr,kr,Cr,Mr,Nr,Or,Pr,jr,Ir,Ar,zr,Lr,Tr,Br,Rr,Dr,Vr,Hr,Yr,Zr,Xr,Ur,Fr,Wr,$r,Gr,qr,Kr,Qr,Jr,no,eo,to,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,xo,wo,bo,_o,Eo,So,ko,Co,Mo,No,Oo,Po,jo,Io,Ao,zo,Lo,To,Bo,Ro,Do,Vo,Ho,Yo,Zo,Xo,Uo,Fo,Wo,$o,Go,qo,Ko,Qo,Jo,ni,ei,ti,ri,oi,ii,ui,ai,ci,li,si,fi,di,hi,vi,pi,gi,yi,mi,xi,wi,bi,_i,Ei,Si,ki,Ci,Mi,Ni,Oi,Pi,ji,Ii,Ai,zi,Li,Ti,Bi,Ri,Di,Vi,Hi,Yi,Zi,Xi,Ui,Fi,Wi,$i,Gi,qi,Ki,Qi,Ji,nu,eu,tu,ru,ou,iu,uu,au,cu,lu,su,fu,du,hu,vu,pu,gu,yu,mu,xu,wu,bu,_u,Eu,Su,ku,Cu,Mu,Nu,Ou,Pu,ju,Iu,Au,zu,Lu,Tu,Bu,Ru,Du,Vu,Hu,Yu,Zu,Xu,Uu,Fu,Wu,$u,Gu,qu,Ku,Qu,Ju,na,ea,ta,ra,oa,ia,ua,aa,ca,la,sa,fa,da,ha,va,pa,ga,ya,ma,xa,wa,ba,_a,Ea,Sa,ka,Ca,Ma,Na,Oa,Pa,ja,Ia,Aa,za,La,Ta,Ba,Ra,Da,Va,Ha,Ya,Za,Xa,Ua,Fa,Wa,$a,Ga,qa,Ka,Qa,Ja,nc,ec,tc,rc,oc,ic,uc,ac,cc,lc,sc,fc,dc,hc,vc,pc,gc,yc,mc,xc,wc,bc,_c={exports:{}};function Ec(){return fr||(fr=1,function(n,e){var t=Fe(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?t.Buffer:void 0,u=i?i.allocUnsafe:void 0;n.exports=function(n,e){if(e)return n.slice();var t=n.length,r=u?u(t):new n.constructor(t);return n.copy(r),r}}(_c,_c.exports)),_c.exports}function Sc(){return hr||(hr=1,dr=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}),dr}function kc(){return pr||(pr=1,vr=function(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var u=n[t];e(u,t,n)&&(i[o++]=u)}return i}),vr}function Cc(){return yr?gr:(yr=1,gr=function(){return[]})}function Mc(){if(xr)return mr;xr=1;var n=kc(),e=Cc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return mr=r?function(e){return null==e?[]:(e=Object(e),n(r(e),(function(n){return t.call(e,n)})))}:e}function Nc(){return Er||(Er=1,_r=function(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}),_r}function Oc(){if(kr)return Sr;kr=1;var n=ur()(Object.getPrototypeOf,Object);return Sr=n}function Pc(){if(Mr)return Cr;Mr=1;var n=Nc(),e=Oc(),t=Mc(),r=Cc(),o=Object.getOwnPropertySymbols;return Cr=o?function(r){for(var o=[];r;)n(o,t(r)),r=e(r);return o}:r}function jc(){if(jr)return Pr;jr=1;var n=Nc(),e=ft();return Pr=function(t,r,o){var i=r(t);return e(t)?i:n(i,o(t))}}function Ic(){if(Ar)return Ir;Ar=1;var n=jc(),e=Mc(),t=lr();return Ir=function(r){return n(r,t,e)}}function Ac(){if(Hr)return Vr;Hr=1;var n=Qe()(Fe(),"Set");return Vr=n}function zc(){if(Ur)return Xr;Ur=1;var n=function(){if(Br)return Tr;Br=1;var n=Qe()(Fe(),"DataView");return Tr=n}(),e=Je(),t=function(){if(Dr)return Rr;Dr=1;var n=Qe()(Fe(),"Promise");return Rr=n}(),r=Ac(),o=function(){if(Zr)return Yr;Zr=1;var n=Qe()(Fe(),"WeakMap");return Yr=n}(),i=$e(),u=Ke(),a="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",d=u(n),h=u(e),v=u(t),p=u(r),g=u(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=f||e&&y(new e)!=a||t&&y(t.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var e=i(n),t="[object Object]"==e?n.constructor:void 0,r=t?u(t):"";if(r)switch(r){case d:return f;case h:return a;case v:return c;case p:return l;case g:return s}return e}),Xr=y}function Lc(){if(Gr)return $r;Gr=1;var n=Fe().Uint8Array;return $r=n}function Tc(){if(Kr)return qr;Kr=1;var n=Lc();return qr=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}}function Bc(){if(io)return oo;io=1;var n=Tc();return oo=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}}function Rc(){if(lo)return co;lo=1;var n=Ge(),e=Object.create,t=function(){function t(){}return function(r){if(!n(r))return{};if(e)return e(r);t.prototype=r;var o=new t;return t.prototype=void 0,o}}();return co=t}function Dc(){if(fo)return so;fo=1;var n=Rc(),e=Oc(),t=ir();return so=function(r){return"function"!=typeof r.constructor||t(r)?{}:n(e(r))}}function Vc(){if(_o)return bo;_o=1;var n=rt(),e=ot(),t=at(),r=function(){if(Ft)return Ut;Ft=1;var n=ct(),e=lr();return Ut=function(t,r){return t&&n(r,e(r),t)}}(),o=function(){if(nr)return Jt;nr=1;var n=ct(),e=sr();return Jt=function(t,r){return t&&n(r,e(r),t)}}(),i=Ec(),u=Sc(),a=function(){if(br)return wr;br=1;var n=ct(),e=Mc();return wr=function(t,r){return n(t,e(t),r)}}(),c=function(){if(Or)return Nr;Or=1;var n=ct(),e=Pc();return Nr=function(t,r){return n(t,e(t),r)}}(),l=Ic(),s=function(){if(Lr)return zr;Lr=1;var n=jc(),e=Pc(),t=sr();return zr=function(r){return n(r,t,e)}}(),f=zc(),d=function(){if(Wr)return Fr;Wr=1;var n=Object.prototype.hasOwnProperty;return Fr=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r},Fr}(),h=function(){if(ao)return uo;ao=1;var n=Tc(),e=function(){if(Jr)return Qr;Jr=1;var n=Tc();return Qr=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}}(),t=function(){if(eo)return no;eo=1;var n=/\w*$/;return no=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}(),r=function(){if(ro)return to;ro=1;var n=We(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;return to=function(n){return t?Object(t.call(n)):{}}}(),o=Bc();return uo=function(i,u,a){var c=i.constructor;switch(u){case"[object ArrayBuffer]":return n(i);case"[object Boolean]":case"[object Date]":return new c(+i);case"[object DataView]":return e(i,a);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 o(i,a);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(i);case"[object RegExp]":return t(i);case"[object Symbol]":return r(i)}}}(),v=Dc(),p=ft(),g=St(),y=function(){if(go)return po;go=1;var n=function(){if(vo)return ho;vo=1;var n=zc(),e=lt();return ho=function(t){return e(t)&&"[object Map]"==n(t)}}(),e=Mt(),t=tr(),r=t&&t.isMap,o=r?e(r):n;return po=o}(),m=Ge(),x=function(){if(wo)return xo;wo=1;var n=function(){if(mo)return yo;mo=1;var n=zc(),e=lt();return yo=function(t){return e(t)&&"[object Set]"==n(t)}}(),e=Mt(),t=tr(),r=t&&t.isSet,o=r?e(r):n;return xo=o}(),w=lr(),b=sr(),_="[object Arguments]",E="[object Function]",S="[object Object]",k={};return k[_]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[S]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[E]=k["[object WeakMap]"]=!1,bo=function C(M,N,O,P,j,I){var A,z=1&N,L=2&N,T=4&N;if(O&&(A=j?O(M,P,j,I):O(M)),void 0!==A)return A;if(!m(M))return M;var B=p(M);if(B){if(A=d(M),!z)return u(M,A)}else{var R=f(M),D=R==E||"[object GeneratorFunction]"==R;if(g(M))return i(M,z);if(R==S||R==_||D&&!j){if(A=L||D?{}:v(M),!z)return L?c(M,o(A,M)):a(M,r(A,M))}else{if(!k[R])return j?M:{};A=h(M,R,z)}}I||(I=new n);var V=I.get(M);if(V)return V;I.set(M,A),x(M)?M.forEach((function(n){A.add(C(n,N,O,n,M,I))})):y(M)&&M.forEach((function(n,e){A.set(e,C(n,N,O,e,M,I))}));var H=B?void 0:(T?L?s:l:L?b:w)(M);return e(H||M,(function(n,e){H&&(n=M[e=n]),t(A,e,C(n,N,O,e,M,I))})),A},bo}function Hc(){if(So)return Eo;So=1;var n=Vc();return Eo=function(e){return n(e,4)}}function Yc(){return Co?ko:(Co=1,ko=function(n){return function(){return n}})}function Zc(){if(Po)return Oo;Po=1;var n=(No?Mo:(No=1,Mo=function(n){return function(e,t,r){for(var o=-1,i=Object(e),u=r(e),a=u.length;a--;){var c=u[n?a:++o];if(!1===t(i[c],c,i))break}return e}}))();return Oo=n}function Xc(){if(Io)return jo;Io=1;var n=Zc(),e=lr();return jo=function(t,r){return t&&n(t,r,e)}}function Uc(){if(To)return Lo;To=1;var n=Xc(),e=function(){if(zo)return Ao;zo=1;var n=cr();return Ao=function(e,t){return function(r,o){if(null==r)return r;if(!n(r))return e(r,o);for(var i=r.length,u=t?i:-1,a=Object(r);(t?u--:++u<i)&&!1!==o(a[u],u,a););return r}}}()(n);return Lo=e}function Fc(){return Ro?Bo:(Ro=1,Bo=function(n){return n})}function Wc(){if(Vo)return Do;Vo=1;var n=Fc();return Do=function(e){return"function"==typeof e?e:n}}function $c(){if(Yo)return Ho;Yo=1;var n=ot(),e=Uc(),t=Wc(),r=ft();return Ho=function(o,i){return(r(o)?n:e)(o,t(i))}}function Gc(){return Xo?Zo:(Xo=1,Zo=$c())}function qc(){if(Qo)return Ko;Qo=1;var n=tt(),e=$o?Wo:($o=1,Wo=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=qo?Go:(qo=1,Go=function(n){return this.__data__.has(n)});function r(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,Ko=r}function Kc(){return ti?ei:(ti=1,ei=function(n,e){return n.has(e)})}function Qc(){if(oi)return ri;oi=1;var n=qc(),e=(ni||(ni=1,Jo=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}),Jo),t=Kc();return ri=function(r,o,i,u,a,c){var l=1&i,s=r.length,f=o.length;if(s!=f&&!(l&&f>s))return!1;var d=c.get(r),h=c.get(o);if(d&&h)return d==o&&h==r;var v=-1,p=!0,g=2&i?new n:void 0;for(c.set(r,o),c.set(o,r);++v<s;){var y=r[v],m=o[v];if(u)var x=l?u(m,y,v,o,r,c):u(y,m,v,r,o,c);if(void 0!==x){if(x)continue;p=!1;break}if(g){if(!e(o,(function(n,e){if(!t(g,e)&&(y===n||a(y,n,i,u,c)))return g.push(e)}))){p=!1;break}}else if(y!==m&&!a(y,m,i,u,c)){p=!1;break}}return c.delete(r),c.delete(o),p},ri}function Jc(){return ci||(ci=1,ai=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}),ai}function nl(){if(vi)return hi;vi=1;var n=rt(),e=Qc(),t=function(){if(si)return li;si=1;var n=We(),e=Lc(),t=Ye(),r=Qc(),o=ui?ii:(ui=1,ii=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}),i=Jc(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return li=function(n,u,c,l,s,f,d){switch(c){case"[object DataView]":if(n.byteLength!=u.byteLength||n.byteOffset!=u.byteOffset)return!1;n=n.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=u.byteLength||!f(new e(n),new e(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+n,+u);case"[object Error]":return n.name==u.name&&n.message==u.message;case"[object RegExp]":case"[object String]":return n==u+"";case"[object Map]":var h=o;case"[object Set]":var v=1&l;if(h||(h=i),n.size!=u.size&&!v)return!1;var p=d.get(n);if(p)return p==u;l|=2,d.set(n,u);var g=r(h(n),h(u),l,s,f,d);return d.delete(n),g;case"[object Symbol]":if(a)return a.call(n)==a.call(u)}return!1}}(),r=function(){if(di)return fi;di=1;var n=Ic(),e=Object.prototype.hasOwnProperty;return fi=function(t,r,o,i,u,a){var c=1&o,l=n(t),s=l.length;if(s!=n(r).length&&!c)return!1;for(var f=s;f--;){var d=l[f];if(!(c?d in r:e.call(r,d)))return!1}var h=a.get(t),v=a.get(r);if(h&&v)return h==r&&v==t;var p=!0;a.set(t,r),a.set(r,t);for(var g=c;++f<s;){var y=t[d=l[f]],m=r[d];if(i)var x=c?i(m,y,d,r,t,a):i(y,m,d,t,r,a);if(!(void 0===x?y===m||u(y,m,o,i,a):x)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var w=t.constructor,b=r.constructor;w==b||!("constructor"in t)||!("constructor"in r)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(t),a.delete(r),p}}(),o=zc(),i=ft(),u=St(),a=rr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return hi=function(d,h,v,p,g,y){var m=i(d),x=i(h),w=m?l:o(d),b=x?l:o(h),_=(w=w==c?s:w)==s,E=(b=b==c?s:b)==s,S=w==b;if(S&&u(d)){if(!u(h))return!1;m=!0,_=!1}if(S&&!_)return y||(y=new n),m||a(d)?e(d,h,v,p,g,y):t(d,h,w,v,p,g,y);if(!(1&v)){var k=_&&f.call(d,"__wrapped__"),C=E&&f.call(h,"__wrapped__");if(k||C){var M=k?d.value():d,N=C?h.value():h;return y||(y=new n),g(M,N,v,p,y)}}return!!S&&(y||(y=new n),r(d,h,v,p,g,y))}}function el(){if(gi)return pi;gi=1;var n=nl(),e=lt();return pi=function t(r,o,i,u,a){return r===o||(null==r||null==o||!e(r)&&!e(o)?r!=r&&o!=o:n(r,o,i,u,t,a))},pi}function tl(){if(wi)return xi;wi=1;var n=Ge();return xi=function(e){return e==e&&!n(e)}}function rl(){return Si?Ei:(Si=1,Ei=function(n,e){return function(t){return null!=t&&t[n]===e&&(void 0!==e||n in Object(t))}})}function ol(){if(Ni)return Mi;Ni=1;var n=$e(),e=lt();return Mi=function(t){return"symbol"==typeof t||e(t)&&"[object Symbol]"==n(t)}}function il(){if(Pi)return Oi;Pi=1;var n=ft(),e=ol(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Oi=function(o,i){if(n(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!e(o))||r.test(o)||!t.test(o)||null!=i&&o in Object(i)}}function ul(){return Ri||(Ri=1,Bi=function(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}),Bi}function al(){if(Yi)return Hi;Yi=1;var n=function(){if(Vi)return Di;Vi=1;var n=We(),e=ul(),t=ft(),r=ol(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return Di=function n(o){if("string"==typeof o)return o;if(t(o))return e(o,n)+"";if(r(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},Di}();return Hi=function(e){return null==e?"":n(e)}}function cl(){if(Xi)return Zi;Xi=1;var n=ft(),e=il(),t=function(){if(Ti)return Li;Ti=1;var n=function(){if(zi)return Ai;zi=1;var n=function(){if(Ii)return ji;Ii=1;var n=tt();function e(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,e=r?r.apply(this,n):n[0],i=o.cache;if(i.has(e))return i.get(e);var u=t.apply(this,n);return o.cache=i.set(e,u)||i,u};return o.cache=new(e.Cache||n),o}return e.Cache=n,ji=e}();return Ai=function(e){var t=n(e,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}}(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(e,(function(n,e,o,i){r.push(o?i.replace(t,"$1"):e||n)})),r}));return Li=r}(),r=al();return Zi=function(o,i){return n(o)?o:e(o,i)?[o]:t(r(o))}}function ll(){if(Fi)return Ui;Fi=1;var n=ol();return Ui=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}}function sl(){if($i)return Wi;$i=1;var n=cl(),e=ll();return Wi=function(t,r){for(var o=0,i=(r=n(r,t)).length;null!=t&&o<i;)t=t[e(r[o++])];return o&&o==i?t:void 0}}function fl(){if(nu)return Ji;nu=1;var n=cl(),e=st(),t=ft(),r=kt(),o=Ct(),i=ll();return Ji=function(u,a,c){for(var l=-1,s=(a=n(a,u)).length,f=!1;++l<s;){var d=i(a[l]);if(!(f=null!=u&&c(u,d)))break;u=u[d]}return f||++l!=s?f:!!(s=null==u?0:u.length)&&o(s)&&r(d,s)&&(t(u)||e(u))}}function dl(){if(tu)return eu;tu=1;var n=Qi?Ki:(Qi=1,Ki=function(n,e){return null!=n&&e in Object(n)}),e=fl();return eu=function(t,r){return null!=t&&e(t,r,n)}}function hl(){return uu?iu:(uu=1,iu=function(n){return function(e){return null==e?void 0:e[n]}})}function vl(){if(du)return fu;du=1;var n=function(){if(Ci)return ki;Ci=1;var n=function(){if(mi)return yi;mi=1;var n=rt(),e=el();return yi=function(t,r,o,i){var u=o.length,a=u,c=!i;if(null==t)return!a;for(t=Object(t);u--;){var l=o[u];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++u<a;){var s=(l=o[u])[0],f=t[s],d=l[1];if(c&&l[2]){if(void 0===f&&!(s in t))return!1}else{var h=new n;if(i)var v=i(f,d,s,t,r,h);if(!(void 0===v?e(d,f,3,i,h):v))return!1}}return!0}}(),e=function(){if(_i)return bi;_i=1;var n=tl(),e=lr();return bi=function(t){for(var r=e(t),o=r.length;o--;){var i=r[o],u=t[i];r[o]=[i,u,n(u)]}return r}}(),t=rl();return ki=function(r){var o=e(r);return 1==o.length&&o[0][2]?t(o[0][0],o[0][1]):function(e){return e===r||n(e,r,o)}}}(),e=function(){if(ou)return ru;ou=1;var n=el(),e=function(){if(qi)return Gi;qi=1;var n=sl();return Gi=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}}(),t=dl(),r=il(),o=tl(),i=rl(),u=ll();return ru=function(a,c){return r(a)&&o(c)?i(u(a),c):function(r){var o=e(r,a);return void 0===o&&o===c?t(r,a):n(c,o,3)}}}(),t=Fc(),r=ft(),o=function(){if(su)return lu;su=1;var n=hl(),e=function(){if(cu)return au;cu=1;var n=sl();return au=function(e){return function(t){return n(t,e)}}}(),t=il(),r=ll();return lu=function(o){return t(o)?n(r(o)):e(o)}}();return fu=function(i){return"function"==typeof i?i:null==i?t:"object"==typeof i?r(i)?e(i[0],i[1]):n(i):o(i)}}function pl(){if(vu)return hu;vu=1;var n=kc(),e=function(){if(Fo)return Uo;Fo=1;var n=Uc();return Uo=function(e,t){var r=[];return n(e,(function(n,e,o){t(n,e,o)&&r.push(n)})),r}}(),t=vl(),r=ft();return hu=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function gl(){if(mu)return yu;mu=1;var n=function(){if(gu)return pu;gu=1;var n=Object.prototype.hasOwnProperty;return pu=function(e,t){return null!=e&&n.call(e,t)}}(),e=fl();return yu=function(t,r){return null!=t&&e(t,r,n)}}function yl(){if(wu)return xu;wu=1;var n=ar(),e=zc(),t=st(),r=ft(),o=cr(),i=St(),u=ir(),a=rr(),c=Object.prototype.hasOwnProperty;return xu=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||a(l)||t(l)))return!l.length;var s=e(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(u(l))return!n(l).length;for(var f in l)if(c.call(l,f))return!1;return!0}}function ml(){return _u?bu:(_u=1,bu=function(n){return void 0===n})}function xl(){if(Su)return Eu;Su=1;var n=Uc(),e=cr();return Eu=function(t,r){var o=-1,i=e(t)?Array(t.length):[];return n(t,(function(n,e,t){i[++o]=r(n,e,t)})),i}}function wl(){if(Cu)return ku;Cu=1;var n=ul(),e=vl(),t=xl(),r=ft();return ku=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function bl(){if(Iu)return ju;Iu=1;var n=(Nu||(Nu=1,Mu=function(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}),Mu),e=Uc(),t=vl(),r=Pu?Ou:(Pu=1,Ou=function(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}),o=ft();return ju=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,t(u,4),a,l,e)},ju}function _l(){if(Xu)return Zu;Xu=1;var n=ar(),e=zc(),t=cr(),r=function(){if(zu)return Au;zu=1;var n=$e(),e=ft(),t=lt();return Au=function(r){return"string"==typeof r||!e(r)&&t(r)&&"[object String]"==n(r)}}(),o=function(){if(Yu)return Hu;Yu=1;var n=function(){if(Tu)return Lu;Tu=1;var n=hl()("length");return Lu=n}(),e=function(){if(Ru)return Bu;Ru=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Bu=function(e){return n.test(e)}}(),t=function(){if(Vu)return Du;Vu=1;var n="\\ud800-\\udfff",e="["+n+"]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+t+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+c+a+")*",s="(?:"+[o+t+"?",t,i,u,e].join("|")+")",f=RegExp(r+"(?="+r+")|"+s+l,"g");return Du=function(n){for(var e=f.lastIndex=0;f.test(n);)++e;return e}}();return Hu=function(r){return e(r)?t(r):n(r)}}();return Zu=function(i){if(null==i)return 0;if(t(i))return r(i)?o(i):i.length;var u=e(i);return"[object Map]"==u||"[object Set]"==u?i.size:n(i).length}}function El(){if(Fu)return Uu;Fu=1;var n=ot(),e=Rc(),t=Xc(),r=vl(),o=Oc(),i=ft(),u=St(),a=qe(),c=Ge(),l=rr();return Uu=function(s,f,d){var h=i(s),v=h||u(s)||l(s);if(f=r(f,4),null==d){var p=s&&s.constructor;d=v?h?new p:[]:c(s)&&a(p)?e(o(s)):{}}return(v?n:t)(s,(function(n,e,t){return f(d,n,e,t)})),d}}function Sl(){if(qu)return Gu;qu=1;var n=Nc(),e=function(){if($u)return Wu;$u=1;var n=We(),e=st(),t=ft(),r=n?n.isConcatSpreadable:void 0;return Wu=function(n){return t(n)||e(n)||!!(r&&n&&n[r])}}();return Gu=function t(r,o,i,u,a){var c=-1,l=r.length;for(i||(i=e),a||(a=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?t(s,o-1,i,u,a):n(a,s):u||(a[a.length]=s)}return a},Gu}function kl(){if(na)return Ju;na=1;var n=Qu?Ku:(Qu=1,Ku=function(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}),e=Math.max;return Ju=function(t,r,o){return r=e(void 0===r?t.length-1:r,0),function(){for(var i=arguments,u=-1,a=e(i.length-r,0),c=Array(a);++u<a;)c[u]=i[r+u];u=-1;for(var l=Array(r+1);++u<r;)l[u]=i[u];return l[r]=o(c),n(t,this,l)}},Ju}function Cl(){if(ua)return ia;ua=1;var n=function(){if(ta)return ea;ta=1;var n=Yc(),e=it(),t=Fc();return ea=e?function(t,r){return e(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:t}(),e=function(){if(oa)return ra;oa=1;var n=Date.now;return ra=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},ra}(),t=e(n);return ia=t}function Ml(){if(ca)return aa;ca=1;var n=Fc(),e=kl(),t=Cl();return aa=function(r,o){return t(e(r,o,n),r+"")},aa}function Nl(){return sa||(sa=1,la=function(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}),la}function Ol(){if(Ca)return ka;Ca=1;var n=qc(),e=function(){if(ma)return ya;ma=1;var n=function(){if(ga)return pa;ga=1;var n=Nl(),e=da?fa:(da=1,fa=function(n){return n!=n}),t=(va||(va=1,ha=function(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}),ha);return pa=function(r,o,i){return o==o?t(r,o,i):n(r,e,i)},pa}();return ya=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1},ya}(),t=(wa||(wa=1,xa=function(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}),xa),r=Kc(),o=function(){if(Sa)return Ea;Sa=1;var n=Ac(),e=_a?ba:(_a=1,ba=function(){}),t=Jc(),r=n&&1/t(new n([,-0]))[1]==1/0?function(e){return new n(e)}:e;return Ea=r}(),i=Jc();return ka=function(u,a,c){var l=-1,s=e,f=u.length,d=!0,h=[],v=h;if(c)d=!1,s=t;else if(f>=200){var p=a?null:o(u);if(p)return i(p);d=!1,s=r,v=new n}else v=a?[]:h;n:for(;++l<f;){var g=u[l],y=a?a(g):g;if(g=c||0!==g?g:0,d&&y==y){for(var m=v.length;m--;)if(v[m]===y)continue n;a&&v.push(y),h.push(g)}else s(v,y,c)||(v!==h&&v.push(y),h.push(g))}return h},ka}function Pl(){if(Na)return Ma;Na=1;var n=cr(),e=lt();return Ma=function(t){return e(t)&&n(t)}}function jl(){if(Pa)return Oa;Pa=1;var n=Sl(),e=Ml(),t=Ol(),r=Pl(),o=e((function(e){return t(n(e,1,r,!0))}));return Oa=o}function Il(){if(za)return Aa;za=1;var n=function(){if(Ia)return ja;Ia=1;var n=ul();return ja=function(e,t){return n(t,(function(n){return e[n]}))}}(),e=lr();return Aa=function(t){return null==t?[]:n(t,e(t))}}function Al(){if(Ta)return La;var n;Ta=1;try{n={clone:Hc(),constant:Yc(),each:Gc(),filter:pl(),has:gl(),isArray:ft(),isEmpty:yl(),isFunction:qe(),isUndefined:ml(),keys:lr(),map:wl(),reduce:bl(),size:_l(),transform:El(),union:jl(),values:Il()}}catch(n){}return n||(n=window._),La=n}function zl(){if(Ra)return Ba;Ra=1;var n=Al();Ba=t;var e="\0";function t(t){this._isDirected=!n.has(t,"directed")||t.directed,this._isMultigraph=!!n.has(t,"multigraph")&&t.multigraph,this._isCompound=!!n.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[e]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(n,e){n[e]?n[e]++:n[e]=1}function o(n,e){--n[e]||delete n[e]}function i(e,t,r,o){var i=""+t,u=""+r;if(!e&&i>u){var a=i;i=u,u=a}return i+""+u+""+(n.isUndefined(o)?"\0":o)}function u(n,e){return i(n,e.v,e.w,e.name)}return t.prototype._nodeCount=0,t.prototype._edgeCount=0,t.prototype.isDirected=function(){return this._isDirected},t.prototype.isMultigraph=function(){return this._isMultigraph},t.prototype.isCompound=function(){return this._isCompound},t.prototype.setGraph=function(n){return this._label=n,this},t.prototype.graph=function(){return this._label},t.prototype.setDefaultNodeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultNodeLabelFn=e,this},t.prototype.nodeCount=function(){return this._nodeCount},t.prototype.nodes=function(){return n.keys(this._nodes)},t.prototype.sources=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._in[t])}))},t.prototype.sinks=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._out[t])}))},t.prototype.setNodes=function(e,t){var r=arguments,o=this;return n.each(e,(function(n){r.length>1?o.setNode(n,t):o.setNode(n)})),this},t.prototype.setNode=function(t,r){return n.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=e,this._children[t]={},this._children[e][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},t.prototype.node=function(n){return this._nodes[n]},t.prototype.hasNode=function(e){return n.has(this._nodes,e)},t.prototype.removeNode=function(e){var t=this;if(n.has(this._nodes,e)){var r=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],n.each(this.children(e),(function(n){t.setParent(n)})),delete this._children[e]),n.each(n.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],n.each(n.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},t.prototype.setParent=function(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(r))r=e;else{for(var o=r+="";!n.isUndefined(o);o=this.parent(o))if(o===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this},t.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},t.prototype.parent=function(n){if(this._isCompound){var t=this._parent[n];if(t!==e)return t}},t.prototype.children=function(t){if(n.isUndefined(t)&&(t=e),this._isCompound){var r=this._children[t];if(r)return n.keys(r)}else{if(t===e)return this.nodes();if(this.hasNode(t))return[]}},t.prototype.predecessors=function(e){var t=this._preds[e];if(t)return n.keys(t)},t.prototype.successors=function(e){var t=this._sucs[e];if(t)return n.keys(t)},t.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return n.union(t,this.successors(e))},t.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},t.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),n.each(this._edgeObjs,(function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,r.edge(n))}));var o={};function i(n){var e=r.parent(n);return void 0===e||t.hasNode(e)?(o[n]=e,e):e in o?o[e]:i(e)}return this._isCompound&&n.each(t.nodes(),(function(n){t.setParent(n,i(n))})),t},t.prototype.setDefaultEdgeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultEdgeLabelFn=e,this},t.prototype.edgeCount=function(){return this._edgeCount},t.prototype.edges=function(){return n.values(this._edgeObjs)},t.prototype.setPath=function(e,t){var r=this,o=arguments;return n.reduce(e,(function(n,e){return o.length>1?r.setEdge(n,e,t):r.setEdge(n,e),e})),this},t.prototype.setEdge=function(){var e,t,o,u,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(e=c.v,t=c.w,o=c.name,2===arguments.length&&(u=arguments[1],a=!0)):(e=c,t=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),e=""+e,t=""+t,n.isUndefined(o)||(o=""+o);var l=i(this._isDirected,e,t,o);if(n.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=u),this;if(!n.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?u:this._defaultEdgeLabelFn(e,t,o);var s=function(n,e,t,r){var o=""+e,i=""+t;if(!n&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};return r&&(a.name=r),a}(this._isDirected,e,t,o);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[l]=s,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=s,this._out[e][l]=s,this._edgeCount++,this},t.prototype.edge=function(n,e,t){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,e,t);return this._edgeLabels[r]},t.prototype.hasEdge=function(e,t,r){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return n.has(this._edgeLabels,o)},t.prototype.removeEdge=function(n,e,t){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,e,t),a=this._edgeObjs[r];return a&&(n=a.v,e=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[e],n),o(this._sucs[n],e),delete this._in[e][r],delete this._out[n][r],this._edgeCount--),this},t.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.v===t})):o}},t.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.w===t})):o}},t.prototype.nodeEdges=function(n,e){var t=this.inEdges(n,e);if(t)return t.concat(this.outEdges(n,e))},Ba}function Ll(){if(Xa)return Za;Xa=1;var n=Al(),e=zl();function t(e){return n.map(e.nodes(),(function(t){var r=e.node(t),o=e.parent(t),i={v:t};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(e){return n.map(e.edges(),(function(t){var r=e.edge(t),o={v:t.v,w:t.w};return n.isUndefined(t.name)||(o.name=t.name),n.isUndefined(r)||(o.value=r),o}))}return Za={write:function(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t(e),edges:r(e)};return n.isUndefined(e.graph())||(o.value=n.clone(e.graph())),o},read:function(t){var r=new e(t.options).setGraph(t.value);return n.each(t.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(t.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Tl(){if(Fa)return Ua;Fa=1;var n=Al();return Ua=function(e){var t,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,t.push(o),n.each(e.successors(o),i),n.each(e.predecessors(o),i))}return n.each(e.nodes(),(function(n){t=[],i(n),t.length&&o.push(t)})),o},Ua}function Bl(){if($a)return Wa;$a=1;var n=Al();function e(){this._arr=[],this._keyIndices={}}return Wa=e,e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},e.prototype.has=function(e){return n.has(this._keyIndices,e)},e.prototype.priority=function(n){var e=this._keyIndices[n];if(void 0!==e)return this._arr[e].priority},e.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!n.has(r,e)){var o=this._arr,i=o.length;return r[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,e){var t=this._keyIndices[n];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)},e.prototype._heapify=function(n){var e=this._arr,t=2*n,r=t+1,o=n;t<e.length&&(o=e[t].priority<e[o].priority?t:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},e.prototype._decrease=function(n){for(var e,t=this._arr,r=t[n].priority;0!==n&&!(t[e=n>>1].priority<r);)this._swap(n,e),n=e},e.prototype._swap=function(n,e){var t=this._arr,r=this._keyIndices,o=t[n],i=t[e];t[n]=i,t[e]=o,r[i.key]=n,r[o.key]=e},Wa}function Rl(){if(qa)return Ga;qa=1;var n=Al(),e=Bl();Ga=function(n,r,o,i){return function(n,t,r,o){var i,u,a={},c=new e,l=function(n){var e=n.v!==i?n.v:n.w,t=a[e],o=r(n),l=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+n+" Weight: "+o);l<t.distance&&(t.distance=l,t.predecessor=i,c.decrease(e,l))};for(n.nodes().forEach((function(n){var e=n===t?0:Number.POSITIVE_INFINITY;a[n]={distance:e},c.add(n,e)}));c.size()>0&&(i=c.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return a}(n,String(r),o||t,i||function(e){return n.outEdges(e)})};var t=n.constant(1);return Ga}function Dl(){if(Qa)return Ka;Qa=1;var n=Rl(),e=Al();return Ka=function(t,r,o){return e.transform(t.nodes(),(function(e,i){e[i]=n(t,i,r,o)}),{})}}function Vl(){if(nc)return Ja;nc=1;var n=Al();return Ja=function(e){var t=0,r=[],o={},i=[];function u(a){var c=o[a]={onStack:!0,lowlink:t,index:t++};if(r.push(a),e.successors(a).forEach((function(e){n.has(o,e)?o[e].onStack&&(c.lowlink=Math.min(c.lowlink,o[e].index)):(u(e),c.lowlink=Math.min(c.lowlink,o[e].lowlink))})),c.lowlink===c.index){var l,s=[];do{l=r.pop(),o[l].onStack=!1,s.push(l)}while(a!==l);i.push(s)}}return e.nodes().forEach((function(e){n.has(o,e)||u(e)})),i},Ja}function Hl(){if(tc)return ec;tc=1;var n=Al(),e=Vl();return ec=function(t){return n.filter(e(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function Yl(){if(oc)return rc;oc=1;var n=Al();rc=function(n,t,r){return function(n,e,t){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(e){n!==e&&(r[n][e]={distance:Number.POSITIVE_INFINITY})})),t(n).forEach((function(t){var o=t.v===n?t.w:t.v,i=e(t);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var e=r[n];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[n],o=e[t],u=i[t],a=r.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)}))}))})),r}(n,t||e,r||function(e){return n.outEdges(e)})};var e=n.constant(1);return rc}function Zl(){if(uc)return ic;uc=1;var n=Al();function e(e){var r={},o={},i=[];if(n.each(e.sinks(),(function u(a){if(n.has(o,a))throw new t;n.has(r,a)||(o[a]=!0,r[a]=!0,n.each(e.predecessors(a),u),delete o[a],i.push(a))})),n.size(r)!==e.nodeCount())throw new t;return i}function t(){}return ic=e,e.CycleException=t,t.prototype=new Error,ic}function Xl(){if(cc)return ac;cc=1;var n=Zl();return ac=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}function Ul(){if(sc)return lc;sc=1;var n=Al();function e(t,r,o,i,u,a){n.has(i,r)||(i[r]=!0,o||a.push(r),n.each(u(r),(function(n){e(t,n,o,i,u,a)})),o&&a.push(r))}return lc=function(t,r,o){n.isArray(r)||(r=[r]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),u=[],a={};return n.each(r,(function(n){if(!t.hasNode(n))throw new Error("Graph does not have node: "+n);e(t,n,"post"===o,a,i,u)})),u},lc}function Fl(){if(dc)return fc;dc=1;var n=Ul();return fc=function(e,t){return n(e,t,"post")}}function Wl(){if(vc)return hc;vc=1;var n=Ul();return hc=function(e,t){return n(e,t,"pre")}}function $l(){if(gc)return pc;gc=1;var n=Al(),e=zl(),t=Bl();return pc=function(r,o){var i,u=new e,a={},c=new t;function l(n){var e=n.v===i?n.w:n.v,t=c.priority(e);if(void 0!==t){var r=o(n);r<t&&(a[e]=i,c.decrease(e,r))}}if(0===r.nodeCount())return u;n.each(r.nodes(),(function(n){c.add(n,Number.POSITIVE_INFINITY),u.setNode(n)})),c.decrease(r.nodes()[0],0);for(var s=!1;c.size()>0;){if(i=c.removeMin(),n.has(a,i))u.setEdge(i,a[i]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(i).forEach(l)}return u},pc}try{bc=function(){if(wc)return xc;wc=1;var n=Ya?Ha:(Ya=1,Ha={Graph:zl(),version:Va?Da:(Va=1,Da="2.1.8")});return xc={Graph:n.Graph,json:Ll(),alg:mc?yc:(mc=1,yc={components:Tl(),dijkstra:Rl(),dijkstraAll:Dl(),findCycles:Hl(),floydWarshall:Yl(),isAcyclic:Xl(),postorder:Fl(),preorder:Wl(),prim:$l(),tarjan:Vl(),topsort:Zl()}),version:n.version}}()}catch(L){}bc||(bc=window.graphlib);var Gl,ql,Kl,Ql,Jl,ns,es,ts,rs,os,is,us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,xs,ws,bs,_s,Es,Ss,ks,Cs,Ms,Ns,Os,Ps,js,Is,As,zs,Ls,Ts,Bs,Rs,Ds,Vs,Hs,Ys,Zs,Xs,Us,Fs,Ws,$s,Gs,qs,Ks,Qs,Js,nf,ef,tf,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,xf,wf,bf,_f,Ef,Sf,kf,Cf,Mf,Nf,Of,Pf,jf,If,Af,zf,Lf=bc;function Tf(){if(Ql)return Kl;Ql=1;var n=Ye(),e=cr(),t=kt(),r=Ge();return Kl=function(o,i,u){if(!r(u))return!1;var a=typeof i;return!!("number"==a?e(u)&&t(i,u.length):"string"==a&&i in u)&&n(u[i],o)}}function Bf(){if(ss)return ls;ss=1;var n=function(){if(cs)return as;cs=1;var n=function(){if(us)return is;us=1;var n=function(){if(os)return rs;os=1;var n=/\s/;return rs=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}}(),e=/^\s+/;return is=function(t){return t?t.slice(0,n(t)+1).replace(e,""):t}}(),e=Ge(),t=ol(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return as=function(a){if("number"==typeof a)return a;if(t(a))return NaN;if(e(a)){var c="function"==typeof a.valueOf?a.valueOf():a;a=e(c)?c+"":c}if("string"!=typeof a)return 0===a?a:+a;a=n(a);var l=o.test(a);return l||i.test(a)?u(a.slice(2),l?2:8):r.test(a)?NaN:+a}}(),e=1/0;return ls=function(t){return t?(t=n(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}}function Rf(){if(ms)return ys;ms=1;var n=Sl();return ys=function(e){return null!=e&&e.length?n(e,1):[]}}function Df(){if(Cs)return ks;Cs=1;var n=ol();return ks=function(e,t,r){for(var o=-1,i=e.length;++o<i;){var u=e[o],a=t(u);if(null!=a&&(void 0===c?a==a&&!n(a):r(a,c)))var c=a,l=u}return l},ks}function Vf(){if(Is)return js;Is=1;var n=ut(),e=Ye();return js=function(t,r,o){(void 0!==o&&!e(t[r],o)||void 0===o&&!(r in t))&&n(t,r,o)}}function Hf(){return Ts?Ls:(Ts=1,Ls=function(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]})}function Yf(){return $s?Ws:($s=1,Ws=function(n,e){return n<e})}function Zf(){if(kf)return Sf;kf=1;var n=ul(),e=sl(),t=vl(),r=xl(),o=(xf||(xf=1,mf=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}),mf),i=Mt(),u=function(){if(Ef)return _f;Ef=1;var n=function(){if(bf)return wf;bf=1;var n=ol();return wf=function(e,t){if(e!==t){var r=void 0!==e,o=null===e,i=e==e,u=n(e),a=void 0!==t,c=null===t,l=t==t,s=n(t);if(!c&&!s&&!u&&e>t||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&e<t||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}}();return _f=function(e,t,r){for(var o=-1,i=e.criteria,u=t.criteria,a=i.length,c=r.length;++o<a;){var l=n(i[o],u[o]);if(l)return o>=c?l:l*("desc"==r[o]?-1:1)}return e.index-t.index}}(),a=Fc(),c=ft();return Sf=function(l,s,f){s=s.length?n(s,(function(n){return c(n)?function(t){return e(t,1===n.length?n[0]:n)}:n})):[a];var d=-1;s=n(s,i(t));var h=r(l,(function(e,t,r){return{criteria:n(s,(function(n){return n(e)})),index:++d,value:e}}));return o(h,(function(n,e){return u(n,e,f)}))}}try{zf={cloneDeep:function(){if(ql)return Gl;ql=1;var n=Vc();return Gl=function(e){return n(e,5)}}(),constant:Yc(),defaults:function(){if(ns)return Jl;ns=1;var n=Ml(),e=Ye(),t=Tf(),r=sr(),o=Object.prototype,i=o.hasOwnProperty,u=n((function(n,u){n=Object(n);var a=-1,c=u.length,l=c>2?u[2]:void 0;for(l&&t(u[0],u[1],l)&&(c=1);++a<c;)for(var s=u[a],f=r(s),d=-1,h=f.length;++d<h;){var v=f[d],p=n[v];(void 0===p||e(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return Jl=u}(),each:Gc(),filter:pl(),find:function(){if(gs)return ps;gs=1;var n=function(){if(ts)return es;ts=1;var n=vl(),e=cr(),t=lr();return es=function(r){return function(o,i,u){var a=Object(o);if(!e(o)){var c=n(i,3);o=t(o),i=function(n){return c(a[n],n,a)}}var l=r(o,i,u);return l>-1?a[c?o[l]:l]:void 0}}}()(function(){if(vs)return hs;vs=1;var n=Nl(),e=vl(),t=function(){if(ds)return fs;ds=1;var n=Bf();return fs=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return hs=function(o,i,u){var a=null==o?0:o.length;if(!a)return-1;var c=null==u?0:t(u);return c<0&&(c=r(a+c,0)),n(o,e(i,3),c)},hs}());return ps=n}(),flatten:Rf(),forEach:$c(),forIn:function(){if(ws)return xs;ws=1;var n=Zc(),e=Wc(),t=sr();return xs=function(r,o){return null==r?r:n(r,e(o),t)}}(),has:gl(),isUndefined:ml(),last:(_s||(_s=1,bs=function(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}),bs),map:wl(),mapValues:function(){if(Ss)return Es;Ss=1;var n=ut(),e=Xc(),t=vl();return Es=function(r,o){var i={};return o=t(o,3),e(r,(function(e,t,r){n(i,t,o(e,t,r))})),i}}(),max:function(){if(Ps)return Os;Ps=1;var n=Df(),e=Ns?Ms:(Ns=1,Ms=function(n,e){return n>e}),t=Fc();return Os=function(r){return r&&r.length?n(r,t,e):void 0},Os}(),merge:function(){if(Fs)return Us;Fs=1;var n=function(){if(Ys)return Hs;Ys=1;var n=rt(),e=Vf(),t=Zc(),r=function(){if(Vs)return Ds;Vs=1;var n=Vf(),e=Ec(),t=Bc(),r=Sc(),o=Dc(),i=st(),u=ft(),a=Pl(),c=St(),l=qe(),s=Ge(),f=function(){if(zs)return As;zs=1;var n=$e(),e=Oc(),t=lt(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return As=function(r){if(!t(r)||"[object Object]"!=n(r))return!1;var o=e(r);if(null===o)return!0;var c=u.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==a}}(),d=rr(),h=Hf(),v=function(){if(Rs)return Bs;Rs=1;var n=ct(),e=sr();return Bs=function(t){return n(t,e(t))}}();return Ds=function(p,g,y,m,x,w,b){var _=h(p,y),E=h(g,y),S=b.get(E);if(S)n(p,y,S);else{var k=w?w(_,E,y+"",p,g,b):void 0,C=void 0===k;if(C){var M=u(E),N=!M&&c(E),O=!M&&!N&&d(E);k=E,M||N||O?u(_)?k=_:a(_)?k=r(_):N?(C=!1,k=e(E,!0)):O?(C=!1,k=t(E,!0)):k=[]:f(E)||i(E)?(k=_,i(_)?k=v(_):s(_)&&!l(_)||(k=o(E))):C=!1}C&&(b.set(E,k),x(k,E,m,w,b),b.delete(E)),n(p,y,k)}}}(),o=Ge(),i=sr(),u=Hf();return Hs=function a(c,l,s,f,d){c!==l&&t(l,(function(t,i){if(d||(d=new n),o(t))r(c,l,i,s,a,f,d);else{var h=f?f(u(c,i),t,i+"",c,l,d):void 0;void 0===h&&(h=t),e(c,i,h)}}),i)},Hs}(),e=function(){if(Xs)return Zs;Xs=1;var n=Ml(),e=Tf();return Zs=function(t){return n((function(n,r){var o=-1,i=r.length,u=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,a&&e(r[0],r[1],a)&&(u=i<3?void 0:u,i=1),n=Object(n);++o<i;){var c=r[o];c&&t(n,c,o,u)}return n}))}}()((function(e,t,r){n(e,t,r)}));return Us=e}(),min:function(){if(qs)return Gs;qs=1;var n=Df(),e=Yf(),t=Fc();return Gs=function(r){return r&&r.length?n(r,t,e):void 0},Gs}(),minBy:function(){if(Qs)return Ks;Qs=1;var n=Df(),e=vl(),t=Yf();return Ks=function(r,o){return r&&r.length?n(r,e(o,2),t):void 0},Ks}(),now:function(){if(nf)return Js;nf=1;var n=Fe();return Js=function(){return n.Date.now()}}(),pick:function(){if(ff)return sf;ff=1;var n=function(){if(af)return uf;af=1;var n=function(){if(of)return rf;of=1;var n=sl(),e=function(){if(tf)return ef;tf=1;var n=at(),e=cl(),t=kt(),r=Ge(),o=ll();return ef=function(i,u,a,c){if(!r(i))return i;for(var l=-1,s=(u=e(u,i)).length,f=s-1,d=i;null!=d&&++l<s;){var h=o(u[l]),v=a;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(l!=f){var p=d[h];void 0===(v=c?c(p,h,d):void 0)&&(v=r(p)?p:t(u[l+1])?[]:{})}n(d,h,v),d=d[h]}return i}}(),t=cl();return rf=function(r,o,i){for(var u=-1,a=o.length,c={};++u<a;){var l=o[u],s=n(r,l);i(s,l)&&e(c,t(l,r),s)}return c}}(),e=dl();return uf=function(t,r){return n(t,r,(function(n,r){return e(t,r)}))}}(),e=function(){if(lf)return cf;lf=1;var n=Rf(),e=kl(),t=Cl();return cf=function(r){return t(e(r,void 0,n),r+"")}}()((function(e,t){return null==e?{}:n(e,t)}));return sf=e}(),range:function(){if(yf)return gf;yf=1;var n=function(){if(pf)return vf;pf=1;var n=function(){if(hf)return df;hf=1;var n=Math.ceil,e=Math.max;return df=function(t,r,o,i){for(var u=-1,a=e(n((r-t)/(o||1)),0),c=Array(a);a--;)c[i?a:++u]=t,t+=o;return c},df}(),e=Tf(),t=Bf();return vf=function(r){return function(o,i,u){return u&&"number"!=typeof u&&e(o,i,u)&&(i=u=void 0),o=t(o),void 0===i?(i=o,o=0):i=t(i),u=void 0===u?o<i?1:-1:t(u),n(o,i,u,r)}},vf}()();return gf=n}(),reduce:bl(),sortBy:function(){if(Mf)return Cf;Mf=1;var n=Sl(),e=Zf(),t=Ml(),r=Tf(),o=t((function(t,o){if(null==t)return[];var i=o.length;return i>1&&r(t,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(t,n(o,1),[])}));return Cf=o}(),uniqueId:function(){if(Of)return Nf;Of=1;var n=al(),e=0;return Nf=function(t){var r=++e;return n(t)+r},Nf}(),values:Il(),zipObject:function(){if(Af)return If;Af=1;var n=at(),e=jf?Pf:(jf=1,Pf=function(n,e,t){for(var r=-1,o=n.length,i=e.length,u={};++r<o;){var a=r<i?e[r]:void 0;t(u,n[r],a)}return u});return If=function(t,r){return e(t||[],r||[],n)}}()}}catch(L){}zf||(zf=window._);var Xf=zf,Uf=Ff;function Ff(){var n={};n._next=n._prev=n,this._sentinel=n}function Wf(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function $f(n,e){if("_next"!==n&&"_prev"!==n)return e}Ff.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return Wf(e),e},Ff.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&Wf(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},Ff.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,$f)),t=t._prev;return"["+n.join(", ")+"]"};var Gf=Xf,qf=Lf.Graph,Kf=Uf,Qf=Gf.constant(1);function Jf(n,e,t,r,o){var i=o?[]:void 0;return Gf.forEach(n.inEdges(r.v),(function(r){var u=n.edge(r),a=n.node(r.v);o&&i.push({v:r.v,w:r.w}),a.out-=u,nd(e,t,a)})),Gf.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,nd(e,t,u)})),n.removeNode(r.v),i}function nd(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var ed=Xf,td=function(n,e){if(n.nodeCount()<=1)return[];var t=function(n,e){var t=new qf,r=0,o=0;Gf.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),Gf.forEach(n.edges(),(function(n){var i=t.edge(n.v,n.w)||0,u=e(n),a=i+u;t.setEdge(n.v,n.w,a),o=Math.max(o,t.node(n.v).out+=u),r=Math.max(r,t.node(n.w).in+=u)}));var i=Gf.range(o+r+3).map((function(){return new Kf})),u=r+1;return Gf.forEach(t.nodes(),(function(n){nd(i,u,t.node(n))})),{graph:t,buckets:i,zeroIdx:u}}(n,e||Qf),r=function(n,e,t){for(var r,o=[],i=e[e.length-1],u=e[0];n.nodeCount();){for(;r=u.dequeue();)Jf(n,e,t,r);for(;r=i.dequeue();)Jf(n,e,t,r);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(r=e[a].dequeue()){o=o.concat(Jf(n,e,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return Gf.flatten(Gf.map(r,(function(e){return n.outEdges(e.v,e.w)})),!0)},rd={run:function(n){var e="greedy"===n.graph().acyclicer?td(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],t={},r={};return ed.forEach(n.nodes(),(function o(i){ed.has(r,i)||(r[i]=!0,t[i]=!0,ed.forEach(n.outEdges(i),(function(n){ed.has(t,n.w)?e.push(n):o(n.w)})),delete t[i])})),e}(n);ed.forEach(e,(function(e){var t=n.edge(e);n.removeEdge(e),t.forwardName=e.name,t.reversed=!0,n.setEdge(e.w,e.v,t,ed.uniqueId("rev"))}))},undo:function(n){ed.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}}))}},od=Xf,id=Lf.Graph,ud={addDummyNode:ad,simplify:function(n){var e=(new id).setGraph(n.graph());return od.forEach(n.nodes(),(function(t){e.setNode(t,n.node(t))})),od.forEach(n.edges(),(function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},o=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(n){var e=new id({multigraph:n.isMultigraph()}).setGraph(n.graph());return od.forEach(n.nodes(),(function(t){n.children(t).length||e.setNode(t,n.node(t))})),od.forEach(n.edges(),(function(t){e.setEdge(t,n.edge(t))})),e},successorWeights:function(n){var e=od.map(n.nodes(),(function(e){var t={};return od.forEach(n.outEdges(e),(function(e){t[e.w]=(t[e.w]||0)+n.edge(e).weight})),t}));return od.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=od.map(n.nodes(),(function(e){var t={};return od.forEach(n.inEdges(e),(function(e){t[e.v]=(t[e.v]||0)+n.edge(e).weight})),t}));return od.zipObject(n.nodes(),e)},intersectRect:function(n,e){var t,r,o=n.x,i=n.y,u=e.x-o,a=e.y-i,c=n.width/2,l=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*c>Math.abs(u)*l?(a<0&&(l=-l),t=l*u/a,r=l):(u<0&&(c=-c),t=c,r=c*a/u),{x:o+t,y:i+r}},buildLayerMatrix:function(n){var e=od.map(od.range(cd(n)+1),(function(){return[]}));return od.forEach(n.nodes(),(function(t){var r=n.node(t),o=r.rank;od.isUndefined(o)||(e[o][r.order]=t)})),e},normalizeRanks:function(n){var e=od.min(od.map(n.nodes(),(function(e){return n.node(e).rank})));od.forEach(n.nodes(),(function(t){var r=n.node(t);od.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(n){var e=od.min(od.map(n.nodes(),(function(e){return n.node(e).rank}))),t=[];od.forEach(n.nodes(),(function(r){var o=n.node(r).rank-e;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;od.forEach(t,(function(e,t){od.isUndefined(e)&&t%o!=0?--r:r&&od.forEach(e,(function(e){n.node(e).rank+=r}))}))},addBorderNode:function(n,e,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),ad(n,"border",o,e)},maxRank:cd,partition:function(n,e){var t={lhs:[],rhs:[]};return od.forEach(n,(function(n){e(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,e){var t=od.now();try{return e()}finally{console.log(n+" time: "+(od.now()-t)+"ms")}},notime:function(n,e){return e()}};function ad(n,e,t,r){var o;do{o=od.uniqueId(r)}while(n.hasNode(o));return t.dummy=e,n.setNode(o,t),o}function cd(n){return od.max(od.map(n.nodes(),(function(e){var t=n.node(e).rank;if(!od.isUndefined(t))return t})))}var ld=Xf,sd=ud,fd={run:function(n){n.graph().dummyChains=[],ld.forEach(n.edges(),(function(e){!function(n,e){var t,r,o,i=e.v,u=n.node(i).rank,a=e.w,c=n.node(a).rank,l=e.name,s=n.edge(e),f=s.labelRank;if(c!==u+1){for(n.removeEdge(e),o=0,++u;u<c;++o,++u)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:e,rank:u},t=sd.addDummyNode(n,"edge",r,"_d"),u===f&&(r.width=s.width,r.height=s.height,r.dummy="edge-label",r.labelpos=s.labelpos),n.setEdge(i,t,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(t),i=t;n.setEdge(i,a,{weight:s.weight},l)}}(n,e)}))},undo:function(n){ld.forEach(n.graph().dummyChains,(function(e){var t,r=n.node(e),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)t=n.successors(e)[0],n.removeNode(e),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),e=t,r=n.node(e)}))}},dd=Xf,hd=function(n){var e={};dd.forEach(n.sources(),(function t(r){var o=n.node(r);if(dd.has(e,r))return o.rank;e[r]=!0;var i=dd.min(dd.map(n.outEdges(r),(function(e){return t(e.w)-n.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},vd=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},pd=Xf,gd=Lf.Graph,yd=vd,md=function(n){var e,t,r=new gd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});xd(r,n)<i;)e=wd(r,n),t=r.hasNode(e.v)?yd(n,e):-yd(n,e),bd(r,n,t);return r};function xd(n,e){return pd.forEach(n.nodes(),(function t(r){pd.forEach(e.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||yd(e,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),t(u))}))})),n.nodeCount()}function wd(n,e){return pd.minBy(e.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return yd(e,t)}))}function bd(n,e,t){pd.forEach(n.nodes(),(function(n){e.node(n).rank+=t}))}var _d=Xf,Ed=md,Sd=vd,kd=hd,Cd=Lf.alg.preorder,Md=Lf.alg.postorder,Nd=ud.simplify,Od=Pd;function Pd(n){n=Nd(n),kd(n);var e,t=Ed(n);for(Ad(t),jd(t,n);e=Ld(t);)Bd(t,n,e,Td(t,n,e))}function jd(n,e){var t=Md(n,n.nodes());t=t.slice(0,t.length-1),_d.forEach(t,(function(t){!function(n,e,t){var r=n.node(t).parent;n.edge(t,r).cutvalue=Id(n,e,t)}(n,e,t)}))}function Id(n,e,t){var r=n.node(t).parent,o=!0,i=e.edge(t,r),u=0;return i||(o=!1,i=e.edge(r,t)),u=i.weight,_d.forEach(e.nodeEdges(t),(function(i){var a,c,l=i.v===t,s=l?i.w:i.v;if(s!==r){var f=l===o,d=e.edge(i).weight;if(u+=f?d:-d,a=t,c=s,n.hasEdge(a,c)){var h=n.edge(t,s).cutvalue;u+=f?-h:h}}})),u}function Ad(n,e){arguments.length<2&&(e=n.nodes()[0]),zd(n,{},1,e)}function zd(n,e,t,r,o){var i=t,u=n.node(r);return e[r]=!0,_d.forEach(n.neighbors(r),(function(o){_d.has(e,o)||(t=zd(n,e,t,o,r))})),u.low=i,u.lim=t++,o?u.parent=o:delete u.parent,t}function Ld(n){return _d.find(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function Td(n,e,t){var r=t.v,o=t.w;e.hasEdge(r,o)||(r=t.w,o=t.v);var i=n.node(r),u=n.node(o),a=i,c=!1;i.lim>u.lim&&(a=u,c=!0);var l=_d.filter(e.edges(),(function(e){return c===Rd(n,n.node(e.v),a)&&c!==Rd(n,n.node(e.w),a)}));return _d.minBy(l,(function(n){return Sd(e,n)}))}function Bd(n,e,t,r){var o=t.v,i=t.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Ad(n),jd(n,e),function(n,e){var t=_d.find(n.nodes(),(function(n){return!e.node(n).parent})),r=Cd(n,t);r=r.slice(1),_d.forEach(r,(function(t){var r=n.node(t).parent,o=e.edge(t,r),i=!1;o||(o=e.edge(r,t),i=!0),e.node(t).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,e)}function Rd(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}Pd.initLowLimValues=Ad,Pd.initCutValues=jd,Pd.calcCutValue=Id,Pd.leaveEdge=Ld,Pd.enterEdge=Td,Pd.exchangeEdges=Bd;var Dd=hd,Vd=md,Hd=Od,Yd=Dd;var Zd=Xf,Xd=Xf,Ud=ud,Fd={run:function(n){var e=Ud.addDummyNode(n,"root",{},"_root"),t=function(n){var e={};function t(r,o){var i=n.children(r);i&&i.length&&Xd.forEach(i,(function(n){t(n,o+1)})),e[r]=o}return Xd.forEach(n.children(),(function(n){t(n,1)})),e}(n),r=Xd.max(Xd.values(t))-1,o=2*r+1;n.graph().nestingRoot=e,Xd.forEach(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return Xd.reduce(n.edges(),(function(e,t){return e+n.edge(t).weight}),0)}(n)+1;Xd.forEach(n.children(),(function(u){Wd(n,e,o,i,r,t,u)})),n.graph().nodeRankFactor=o},cleanup:function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,Xd.forEach(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}};function Wd(n,e,t,r,o,i,u){var a=n.children(u);if(a.length){var c=Ud.addBorderNode(n,"_bt"),l=Ud.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(c,u),s.borderTop=c,n.setParent(l,u),s.borderBottom=l,Xd.forEach(a,(function(a){Wd(n,e,t,r,o,i,a);var s=n.node(a),f=s.borderTop?s.borderTop:a,d=s.borderBottom?s.borderBottom:a,h=s.borderTop?r:2*r,v=f!==d?1:o-i[u]+1;n.setEdge(c,f,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(d,l,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(u)||n.setEdge(e,c,{weight:0,minlen:o+i[u]})}else u!==e&&n.setEdge(e,u,{weight:0,minlen:t})}var $d=Xf,Gd=ud;function qd(n,e,t,r,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],c=Gd.addDummyNode(n,"border",u,t);o[e][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var Kd=Xf,Qd={adjust:function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Jd(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){Kd.forEach(n.nodes(),(function(e){eh(n.node(e))})),Kd.forEach(n.edges(),(function(e){var t=n.edge(e);Kd.forEach(t.points,eh),Kd.has(t,"y")&&eh(t)}))}(n),"lr"!==e&&"rl"!==e||(function(n){Kd.forEach(n.nodes(),(function(e){th(n.node(e))})),Kd.forEach(n.edges(),(function(e){var t=n.edge(e);Kd.forEach(t.points,th),Kd.has(t,"x")&&th(t)}))}(n),Jd(n))}};function Jd(n){Kd.forEach(n.nodes(),(function(e){nh(n.node(e))})),Kd.forEach(n.edges(),(function(e){nh(n.edge(e))}))}function nh(n){var e=n.width;n.width=n.height,n.height=e}function eh(n){n.y=-n.y}function th(n){var e=n.x;n.x=n.y,n.y=e}var rh=Xf,oh=Xf;function ih(n,e,t){for(var r=oh.zipObject(t,oh.map(t,(function(n,e){return e}))),o=oh.flatten(oh.map(e,(function(e){return oh.sortBy(oh.map(n.outEdges(e),(function(e){return{pos:r[e.w],weight:n.edge(e).weight}})),"pos")})),!0),i=1;i<t.length;)i<<=1;var u=2*i-1;i-=1;var a=oh.map(new Array(u),(function(){return 0})),c=0;return oh.forEach(o.forEach((function(n){var e=n.pos+i;a[e]+=n.weight;for(var t=0;e>0;)e%2&&(t+=a[e+1]),a[e=e-1>>1]+=n.weight;c+=n.weight*t}))),c}var uh=Xf,ah=Xf,ch=Xf,lh=ud;function sh(n,e,t){for(var r;e.length&&(r=ch.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var fh=Xf,dh=Xf,hh=Lf.Graph,vh=Xf,ph=Xf,gh=function(n){var e={},t=rh.filter(n.nodes(),(function(e){return!n.children(e).length})),r=rh.max(rh.map(t,(function(e){return n.node(e).rank}))),o=rh.map(rh.range(r+1),(function(){return[]}));var i=rh.sortBy(t,(function(e){return n.node(e).rank}));return rh.forEach(i,(function t(r){if(!rh.has(e,r)){e[r]=!0;var i=n.node(r);o[i.rank].push(r),rh.forEach(n.successors(r),t)}})),o},yh=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=ih(n,e[r-1],e[r]);return t},mh=function n(e,t,r,o){var i=e.children(t),u=e.node(t),a=u?u.borderLeft:void 0,c=u?u.borderRight:void 0,l={};a&&(i=fh.filter(i,(function(n){return n!==a&&n!==c})));var s=function(n,e){return uh.map(e,(function(e){var t=n.inEdges(e);if(t.length){var r=uh.reduce(t,(function(e,t){var r=n.edge(t),o=n.node(t.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);fh.forEach(s,(function(t){if(e.children(t.v).length){var i=n(e,t.v,r,o);l[t.v]=i,fh.has(i,"barycenter")&&(u=t,a=i,fh.isUndefined(u.barycenter)?(u.barycenter=a.barycenter,u.weight=a.weight):(u.barycenter=(u.barycenter*u.weight+a.barycenter*a.weight)/(u.weight+a.weight),u.weight+=a.weight))}var u,a}));var f=function(n,e){var t={};return ah.forEach(n,(function(n,e){var r=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};ah.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),ah.forEach(e.edges(),(function(n){var e=t[n.v],r=t[n.w];ah.isUndefined(e)||ah.isUndefined(r)||(r.indegree++,e.out.push(t[n.w]))})),function(n){var e=[];function t(n){return function(e){e.merged||(ah.isUndefined(e.barycenter)||ah.isUndefined(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function r(e){return function(t){t.in.push(e),0==--t.indegree&&n.push(t)}}for(;n.length;){var o=n.pop();e.push(o),ah.forEach(o.in.reverse(),t(o)),ah.forEach(o.out,r(o))}return ah.map(ah.filter(e,(function(n){return!n.merged})),(function(n){return ah.pick(n,["vs","i","barycenter","weight"])}))}(ah.filter(t,(function(n){return!n.indegree})))}(s,r);!function(n,e){fh.forEach(n,(function(n){n.vs=fh.flatten(n.vs.map((function(n){return e[n]?e[n].vs:n})),!0)}))}(f,l);var d=function(n,e){var t,r=lh.partition(n,(function(n){return ch.has(n,"barycenter")})),o=r.lhs,i=ch.sortBy(r.rhs,(function(n){return-n.i})),u=[],a=0,c=0,l=0;o.sort((t=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:t?e.i-n.i:n.i-e.i})),l=sh(u,i,l),ch.forEach(o,(function(n){l+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,c+=n.weight,l=sh(u,i,l)}));var s={vs:ch.flatten(u,!0)};return c&&(s.barycenter=a/c,s.weight=c),s}(f,o);if(a&&(d.vs=fh.flatten([a,d.vs,c],!0),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(c)[0]);fh.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+v.order)/(d.weight+2),d.weight+=2}return d},xh=function(n,e,t){var r=function(n){for(var e;n.hasNode(e=dh.uniqueId("_root")););return e}(n),o=new hh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return n.node(e)}));return dh.forEach(n.nodes(),(function(i){var u=n.node(i),a=n.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||r),dh.forEach(n[t](i),(function(e){var t=e.v===i?e.w:e.v,r=o.edge(t,i),u=dh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:n.edge(e).weight+u})})),dh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o},wh=Lf.Graph,bh=ud;function _h(n,e,t){return ph.map(e,(function(e){return xh(n,e,t)}))}function Eh(n,e){var t=new wh;ph.forEach(n,(function(n){var r=n.graph().root,o=mh(n,r,t,e);ph.forEach(o.vs,(function(e,t){n.node(e).order=t})),function(n,e,t){var r,o={};vh.forEach(t,(function(t){for(var i,u,a=n.parent(t);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=r,r=a),u&&u!==a)return void e.setEdge(u,a);a=i}}))}(n,t,o.vs)}))}function Sh(n,e){ph.forEach(e,(function(e){ph.forEach(e,(function(e,t){n.node(e).order=t}))}))}var kh=Xf,Ch=Lf.Graph,Mh=ud;function Nh(n,e,t){if(e>t){var r=e;e=t,t=r}var o=n[e];o||(n[e]=o={}),o[t]=!0}function Oh(n,e,t){if(e>t){var r=e;e=t,t=r}return kh.has(n[e],t)}var Ph=Xf,jh=ud,Ih=function(n){var e,t=Mh.buildLayerMatrix(n),r=kh.merge(function(n,e){var t={};return kh.reduce(e,(function(e,r){var o=0,i=0,u=e.length,a=kh.last(r);return kh.forEach(r,(function(e,c){var l=function(n,e){if(n.node(e).dummy)return kh.find(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),s=l?n.node(l).order:u;(l||e===a)&&(kh.forEach(r.slice(i,c+1),(function(e){kh.forEach(n.predecessors(e),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(e).dummy||Nh(t,r,e)}))})),i=c+1,o=s)})),r})),t}(n,t),function(n,e){var t={};function r(e,r,o,i,u){var a;kh.forEach(kh.range(r,o),(function(r){a=e[r],n.node(a).dummy&&kh.forEach(n.predecessors(a),(function(e){var r=n.node(e);r.dummy&&(r.order<i||r.order>u)&&Nh(t,e,a)}))}))}return kh.reduce(e,(function(e,t){var o,i=-1,u=0;return kh.forEach(t,(function(a,c){if("border"===n.node(a).dummy){var l=n.predecessors(a);l.length&&(o=n.node(l[0]).order,r(t,u,c,i,o),u=c,i=o)}r(t,u,t.length,o,e.length)})),t})),t}(n,t)),o={};kh.forEach(["u","d"],(function(i){e="u"===i?t:kh.values(t).reverse(),kh.forEach(["l","r"],(function(t){"r"===t&&(e=kh.map(e,(function(n){return kh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,t,r){var o={},i={},u={};return kh.forEach(e,(function(n){kh.forEach(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),kh.forEach(e,(function(n){var e=-1;kh.forEach(n,(function(n){var a=r(n);if(a.length){a=kh.sortBy(a,(function(n){return u[n]}));for(var c=(a.length-1)/2,l=Math.floor(c),s=Math.ceil(c);l<=s;++l){var f=a[l];i[n]===n&&e<u[f]&&!Oh(t,n,f)&&(i[f]=n,i[n]=o[n]=o[f],e=u[f])}}}))})),{root:o,align:i}}(0,e,r,u),c=function(n,e,t,r,o){var i={},u=function(n,e,t,r){var o=new Ch,i=n.graph(),u=function(n,e,t){return function(r,o,i){var u,a=r.node(o),c=r.node(i),l=0;if(l+=a.width/2,kh.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(l+=t?u:-u),u=0,l+=(a.dummy?e:n)/2,l+=(c.dummy?e:n)/2,l+=c.width/2,kh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(l+=t?u:-u),u=0,l}}(i.nodesep,i.edgesep,r);return kh.forEach(e,(function(e){var r;kh.forEach(e,(function(e){var i=t[e];if(o.setNode(i),r){var a=t[r],c=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,e,r),c||0))}r=e}))})),o}(n,e,t,o),a=o?"borderLeft":"borderRight";function c(n,e){for(var t=u.nodes(),r=t.pop(),o={};r;)o[r]?n(r):(o[r]=!0,t.push(r),t=t.concat(e(r))),r=t.pop()}return c((function(n){i[n]=u.inEdges(n).reduce((function(n,e){return Math.max(n,i[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var t=u.outEdges(e).reduce((function(n,e){return Math.min(n,i[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=n.node(e);t!==Number.POSITIVE_INFINITY&&r.borderType!==a&&(i[e]=Math.max(i[e],t))}),u.successors.bind(u)),kh.forEach(r,(function(n){i[n]=i[t[n]]})),i}(n,e,a.root,a.align,"r"===t);"r"===t&&(c=kh.mapValues(c,(function(n){return-n}))),o[i+t]=c}))}));var i=function(n,e){return kh.minBy(kh.values(e),(function(e){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return kh.forIn(e,(function(e,o){var i=function(n,e){return n.node(e).width}(n,o)/2;t=Math.max(e+i,t),r=Math.min(e-i,r)})),t-r}))}(n,o);return function(n,e){var t=kh.values(e),r=kh.min(t),o=kh.max(t);kh.forEach(["u","d"],(function(t){kh.forEach(["l","r"],(function(i){var u,a=t+i,c=n[a];if(c!==e){var l=kh.values(c);(u="l"===i?r-kh.min(l):o-kh.max(l))&&(n[a]=kh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return kh.mapValues(n.ul,(function(t,r){if(e)return n[e.toLowerCase()][r];var o=kh.sortBy(kh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Ah=Xf,zh=rd,Lh=fd,Th=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Hd(n)}(n);break;case"tight-tree":!function(n){Dd(n),Vd(n)}(n);break;case"longest-path":Yd(n)}},Bh=ud.normalizeRanks,Rh=function(n){var e=function(n){var e={},t=0;return Zd.forEach(n.children(),(function r(o){var i=t;Zd.forEach(n.children(o),r),e[o]={low:i,lim:t++}})),e}(n);Zd.forEach(n.graph().dummyChains,(function(t){for(var r=n.node(t),o=r.edgeObj,i=function(n,e,t,r){var o,i,u=[],a=[],c=Math.min(e[t].low,e[r].low),l=Math.max(e[t].lim,e[r].lim);o=t;do{o=n.parent(o),u.push(o)}while(o&&(e[o].low>c||l>e[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,c=0,l=u[c],s=!0;t!==o.w;){if(r=n.node(t),s){for(;(l=u[c])!==a&&n.node(l).maxRank<r.rank;)c++;l===a&&(s=!1)}if(!s){for(;c<u.length-1&&n.node(l=u[c+1]).minRank<=r.rank;)c++;l=u[c]}n.setParent(t,l),t=n.successors(t)[0]}}))},Dh=ud.removeEmptyRanks,Vh=Fd,Hh=function(n){$d.forEach(n.children(),(function e(t){var r=n.children(t),o=n.node(t);if(r.length&&$d.forEach(r,e),$d.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)qd(n,"borderLeft","_bl",t,o,i),qd(n,"borderRight","_br",t,o,i)}}))},Yh=Qd,Zh=function(n){var e=bh.maxRank(n),t=_h(n,ph.range(1,e+1),"inEdges"),r=_h(n,ph.range(e-1,-1,-1),"outEdges"),o=gh(n);Sh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Eh(a%2?t:r,a%4>=2),o=bh.buildLayerMatrix(n);var l=yh(n,o);l<u&&(c=0,i=ph.cloneDeep(o),u=l)}Sh(n,i)},Xh=function(n){(function(n){var e=jh.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Ph.forEach(e,(function(e){var o=Ph.max(Ph.map(e,(function(e){return n.node(e).height})));Ph.forEach(e,(function(e){n.node(e).y=r+o/2})),r+=o+t}))})(n=jh.asNonCompoundGraph(n)),Ph.forEach(Ih(n),(function(e,t){n.node(t).x=e}))},Uh=ud,Fh=Lf.Graph,Wh=["nodesep","edgesep","ranksep","marginx","marginy"],$h={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Gh=["acyclicer","ranker","rankdir","align"],qh=["width","height"],Kh={width:0,height:0},Qh=["minlen","weight","width","height","labeloffset"],Jh={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nv=["labelpos"];function ev(n,e){return Ah.mapValues(Ah.pick(n,e),Number)}function tv(n){var e={};return Ah.forEach(n,(function(n,t){e[t.toLowerCase()]=n})),e}var rv=Xf,ov=ud,iv=Lf.Graph,uv={debugOrdering:function(n){var e=ov.buildLayerMatrix(n),t=new iv({compound:!0,multigraph:!0}).setGraph({});return rv.forEach(n.nodes(),(function(e){t.setNode(e,{label:e}),t.setParent(e,"layer"+n.node(e).rank)})),rv.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),rv.forEach(e,(function(n,e){var r="layer"+e;t.setNode(r,{rank:"same"}),rv.reduce(n,(function(n,e){return t.setEdge(n,e,{style:"invis"}),e}))})),t}},av=He({graphlib:Lf,layout:function(n,e){var t=e&&e.debugTiming?Uh.time:Uh.notime;t("layout",(function(){var e=t(" buildLayoutGraph",(function(){return function(n){var e=new Fh({multigraph:!0,compound:!0}),t=tv(n.graph());return e.setGraph(Ah.merge({},$h,ev(t,Wh),Ah.pick(t,Gh))),Ah.forEach(n.nodes(),(function(t){var r=tv(n.node(t));e.setNode(t,Ah.defaults(ev(r,qh),Kh)),e.setParent(t,n.parent(t))})),Ah.forEach(n.edges(),(function(t){var r=tv(n.edge(t));e.setEdge(t,Ah.merge({},Jh,ev(r,Qh),Ah.pick(r,nv)))})),e}(n)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,Ah.forEach(n.edges(),(function(t){var r=n.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),e(" removeSelfEdges",(function(){!function(n){Ah.forEach(n.edges(),(function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}}))}(n)})),e(" acyclic",(function(){zh.run(n)})),e(" nestingGraph.run",(function(){Vh.run(n)})),e(" rank",(function(){Th(Uh.asNonCompoundGraph(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),o={rank:(n.node(e.w).rank-r.rank)/2+r.rank,e:e};Uh.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){Dh(n)})),e(" nestingGraph.cleanup",(function(){Vh.cleanup(n)})),e(" normalizeRanks",(function(){Bh(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;Ah.forEach(n.nodes(),(function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=Ah.max(e,r.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){Ah.forEach(n.nodes(),(function(e){var t=n.node(e);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))}))}(n)})),e(" normalize.run",(function(){Lh.run(n)})),e(" parentDummyChains",(function(){Rh(n)})),e(" addBorderSegments",(function(){Hh(n)})),e(" order",(function(){Zh(n)})),e(" insertSelfEdges",(function(){!function(n){var e=Uh.buildLayerMatrix(n);Ah.forEach(e,(function(e){var t=0;Ah.forEach(e,(function(e,r){var o=n.node(e);o.order=r+t,Ah.forEach(o.selfEdges,(function(e){Uh.addDummyNode(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++t,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(n)})),e(" adjustCoordinateSystem",(function(){Yh.adjust(n)})),e(" position",(function(){Xh(n)})),e(" positionSelfEdges",(function(){!function(n){Ah.forEach(n.nodes(),(function(e){var t=n.node(e);if("selfedge"===t.dummy){var r=n.node(t.e.v),o=r.x+r.width/2,i=r.y,u=t.x-o,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],t.label.x=t.x,t.label.y=t.y}}))}(n)})),e(" removeBorderNodes",(function(){!function(n){Ah.forEach(n.nodes(),(function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),o=n.node(t.borderBottom),i=n.node(Ah.last(t.borderLeft)),u=n.node(Ah.last(t.borderRight));t.width=Math.abs(u.x-i.x),t.height=Math.abs(o.y-r.y),t.x=i.x+t.width/2,t.y=r.y+t.height/2}})),Ah.forEach(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){Lh.undo(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t=n.edge(e);if(Ah.has(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}}))}(n)})),e(" undoCoordinateSystem",(function(){Yh.undo(n)})),e(" translateGraph",(function(){!function(n){var e=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function c(n){var i=n.x,u=n.y,a=n.width,c=n.height;e=Math.min(e,i-a/2),t=Math.max(t,i+a/2),r=Math.min(r,u-c/2),o=Math.max(o,u+c/2)}Ah.forEach(n.nodes(),(function(e){c(n.node(e))})),Ah.forEach(n.edges(),(function(e){var t=n.edge(e);Ah.has(t,"x")&&c(t)})),e-=u,r-=a,Ah.forEach(n.nodes(),(function(t){var o=n.node(t);o.x-=e,o.y-=r})),Ah.forEach(n.edges(),(function(t){var o=n.edge(t);Ah.forEach(o.points,(function(n){n.x-=e,n.y-=r})),Ah.has(o,"x")&&(o.x-=e),Ah.has(o,"y")&&(o.y-=r)})),i.width=t-e+u,i.height=o-r+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t,r,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=u,r=i),o.points.unshift(Uh.intersectRect(i,t)),o.points.push(Uh.intersectRect(u,r))}))}(n)})),e(" reversePoints",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t=n.edge(e);t.reversed&&t.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){zh.undo(n)}))}(e,t)})),t(" updateInputGraph",(function(){!function(n,e){Ah.forEach(n.nodes(),(function(t){var r=n.node(t),o=e.node(t);r&&(r.x=o.x,r.y=o.y,e.children(t).length&&(r.width=o.width,r.height=o.height))})),Ah.forEach(n.edges(),(function(t){var r=n.edge(t),o=e.edge(t);r.points=o.points,Ah.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(n,e)}))}))},debug:uv,util:{time:ud.time,notime:ud.notime},version:"0.8.5"}),cv=function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},lv=function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},sv=function(){return"The Ink Flow parent container needs a width and a height to render the graph."},fv=function(){return"Only child nodes can use a parent extent."},dv=function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},hv=function(n,e){var t=e.id,r=e.sourceHandle,o=e.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(t,".")},vv=function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},pv=function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},gv=function(n){return'Node with id "'.concat(n,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},yv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],mv=["Enter"," ","Escape"],xv=.5,wv=2,bv=[0,0],_v=function(n,e){void 0===e&&(e=[0,0]);var t=Rv(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||e,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},Ev=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=jv(t,e.nodeOrigin);return Ov(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pv(t)};function Sv(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?_v(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Bv(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,x=f+v*m[0],w=d+p*m[1];h=[[x,w],[x+g-v,w+y-p]]}}else null==a||a("005",fv());var b=Bv(h)?Cv(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}var kv=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Cv=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:kv(n.x,e[0][0],e[1][0]),y:kv(n.y,e[0][1],e[1][1])}},Mv=function(n,e,t){return n<e?kv(Math.abs(n-e),1,50)/50:n>t?-kv(Math.abs(n-t),1,50)/50:0},Nv=function(n,e){return[20*Mv(n.x,35,e.width-35),20*Mv(n.y,35,e.height-35)]},Ov=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},Pv=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},jv=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=_v(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}},Iv=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},Av=function(n,e,t,r){var o=n.x,i=n.y,u=B(e,3),a=u[0],c=u[1],l=u[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return t?Iv(s,r):s},zv=function(n,e){var t=n.x,r=n.y,o=B(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}},Lv=function(n,e,t,r,o,i){var u=e/(n.width*(1+i)),a=t/(n.height*(1+i)),c=Math.min(u,a),l=kv(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}},Tv=function(){var n;return"undefined"!=typeof navigator&&(null===(n=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===n?void 0:n.indexOf("Mac"))>=0};function Bv(n){return void 0!==n&&"parent"!==n}function Rv(n){var e,t,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var Dv={x:0,y:0};function Vv(n,e){var t=e.snapGrid,r=void 0===t?[0,0]:t,o=e.snapToGrid,i=void 0!==o&&o,u=e.transform,a=Hv(n),c=a.x,l=a.y,s=Av({x:c,y:l},u),f=i?Iv(s,r):s,d=f.x,h=f.y;return L({xSnapped:d,ySnapped:h},s)}exports.ConnectionMode=void 0,exports.PanOnScrollMode=void 0,exports.SelectionMode=void 0,exports.ConnectionLineType=void 0,exports.MarkerType=void 0,exports.Position=void 0;var Hv=function(n,e){var t,r,o,i,u=function(n){return"clientX"in n}(n),a=u?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}};function Yv(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-e),Math.abs(c-t)]}function Zv(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function Xv(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case exports.Position.Left:return[t-Zv(t-o,u),r];case exports.Position.Right:return[t+Zv(o-t,u),r];case exports.Position.Top:return[t,r-Zv(r-i,u)];case exports.Position.Bottom:return[t,r+Zv(i-r,u)]}}function Uv(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?exports.Position.Top:a,l=n.curvature,s=void 0===l?.25:l,f=B(Xv({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=B(Xv({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],y=B(Yv({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],x=y[1],w=y[2],b=y[3];return["M".concat(e,",").concat(t," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),m,x,w,b]}function Fv(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,u=r<e?r+i:r-i,a=Math.abs(o-t)/2;return[u,o<t?o+a:o-a,i,a]}!function(n){n.Strict="strict",n.Loose="loose"}(exports.ConnectionMode||(exports.ConnectionMode={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(exports.PanOnScrollMode||(exports.PanOnScrollMode={})),function(n){n.Partial="partial",n.Full="full"}(exports.SelectionMode||(exports.SelectionMode={})),function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(exports.ConnectionLineType||(exports.ConnectionLineType={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(exports.MarkerType||(exports.MarkerType={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(exports.Position||(exports.Position={}));var Wv,$v=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")};var Gv=((Wv={})[exports.Position.Left]={x:-1,y:0},Wv[exports.Position.Right]={x:1,y:0},Wv[exports.Position.Top]={x:0,y:-1},Wv[exports.Position.Bottom]={x:0,y:1},Wv),qv=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Kv(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?exports.Position.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?exports.Position.Top:l,f=n.center,d=n.offset,h=Gv[a],v=Gv[s],p={x:i.x+h.x*d,y:i.y+h.y*d},g={x:c.x+v.x*d,y:c.y+v.y*d},y=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?exports.Position.Bottom:t,o=n.target;return r===exports.Position.Left||r===exports.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),m=0!==y.x?"x":"y",x=y[m],w=[],b={x:0,y:0},_={x:0,y:0},E=B(Fv({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],C=E[2],M=E[3];if(h[m]*v[m]==-1){r=null!==(e=f.x)&&void 0!==e?e:S,o=null!==(t=f.y)&&void 0!==t?t:k;var N=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];w=h[m]===x?"x"===m?N:O:"x"===m?O:N}else{var P=[{x:p.x,y:g.y}],j=[{x:g.x,y:p.y}];if(w="x"===m?h.x===x?j:P:h.y===x?P:j,a===s){var I=Math.abs(i[m]-c[m]);if(I<=d){var A=Math.min(d-1,d-I);h[m]===x?b[m]=(p[m]>i[m]?-1:1)*A:_[m]=(g[m]>c[m]?-1:1)*A}}if(a!==s){var z="x"===m?"y":"x",L=h[m]===v[z],T=p[z]>g[z],D=p[z]<g[z];(1===h[m]&&(!L&&T||L&&D)||1!==h[m]&&(!L&&D||L&&T))&&(w="x"===m?P:j)}var V={x:p.x+b.x,y:p.y+b.y},H={x:g.x+_.x,y:g.y+_.y};Math.max(Math.abs(V.x-w[0].x),Math.abs(H.x-w[0].x))>=Math.max(Math.abs(V.y-w[0].y),Math.abs(H.y-w[0].y))?(r=(V.x+H.x)/2,o=w[0].y):(r=w[0].x,o=(V.y+H.y)/2)}return[R(R([i,{x:p.x+b.x,y:p.y+b.y}],B(w),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,C,M]}function Qv(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?exports.Position.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=B(Kv({source:{x:e,y:t},sourcePosition:o,target:{x:i,y:u},targetPosition:c,center:{x:f,y:d},offset:void 0===h?20:h}),5),p=v[0],g=v[1],y=v[2],m=v[3],x=v[4];return[p.reduce((function(n,e,t){return n+(t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(qv(n,e)/2,qv(e,t)/2,r),i=e.x,u=e.y;if(n.x===i&&i===t.x||n.y===u&&u===t.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<t.x?-1:1,c=n.y<t.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<t.x?1:-1,s=n.y<t.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[t-1],e,p[t+1],s):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y))}),""),g,y,m,x]}function Jv(n,e,t){var r=(null==t?void 0:t.rankdir)||"TB",o=new av.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(L({rankdir:r},t));var i=n.map((function(n){return L({},n)}));i.forEach((function(n){var e,t;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(e=n.data)||void 0===e?void 0:e.width)||200,i=(null===(t=n.data)||void 0===t?void 0:t.height)||56;o.setNode(n.id,{width:r,height:i})})),e.forEach((function(n){o.setEdge(n.source,n.target)})),av.layout(o),i.forEach((function(n){var e=o.node(n.id),t="bottom",i="top";switch(r){case"TB":default:t="bottom",i="top";break;case"BT":t="top",i="bottom";break;case"LR":t="right",i="left";break;case"RL":t="left",i="right"}n.targetPosition=i,n.sourcePosition=t,n.position={x:e.x-e.width/2,y:e.y-e.height/2}}));var u=function(n){var e=n.centerNodeId,t=n.containerHeight,r=void 0===t?0:t,o=n.containerWidth,i=void 0===o?0:o,u=n.centerByBBox,a=n.nodes,c=n.nodeOrigin,l=void 0===c?bv:c;if(!e&&!u||!r||!i)return Dv;if(null==e?void 0:e.trim()){var s=null==a?void 0:a.find((function(n){return n.id===(null==e?void 0:e.trim())}));if(s){var f=function(n,e){if(!n)return Dv;var t=Rv(n),r=t.width,o=t.height,i=r*e[0],u=o*e[1];return{x:n.position.x+r/2-i,y:n.position.y+o/2-u}}(s,l);return{x:i/2-f.x,y:r/2-f.y}}}return u?(f=function(n,e){if(!(null==n?void 0:n.length))return Dv;var t=Ev(n,{nodeOrigin:e}),r=t.x,o=t.y;return{x:r+t.width/2,y:o+t.height/2}}(a,l),{x:i/2-f.x,y:r/2-f.y}):Dv}({centerByBBox:null==t?void 0:t.centerByBBox,centerNodeId:null==t?void 0:t.centerNodeId,nodes:i,containerWidth:null==t?void 0:t.width,containerHeight:null==t?void 0:t.height,nodeOrigin:null==t?void 0:t.nodeOrigin}),a=u.x,c=void 0===a?0:a,l=u.y,s=void 0===l?0:l;i.forEach((function(n){n.position={x:n.position.x+c,y:n.position.y+s}}));var f={overflowBoundary:!1,transform:{x:0,y:0,zoom:1}};return(null==t?void 0:t.width)&&(null==t?void 0:t.height)&&t.fitViewOptions&&(f=function(n,e){var t=e||{},r=t.minZoom,o=void 0===r?xv:r,i=t.maxZoom,u=void 0===i?wv:i,a=t.padding,c=void 0===a?.1:a,l=t.nodeOrigin,s=void 0===l?bv:l,f=t.width,d=t.height,h=Ev(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:Lv(h,f,d,o,u,c),overflowBoundary:v}}(i,L({width:t.width,height:t.height,nodeOrigin:t.nodeOrigin},t.fitViewOptions))),{nodes:i,edges:e,transform:f.transform,overflowBoundary:f.overflowBoundary}}var np={assign:Object.assign,getHeight:function(n,e,t,r){return void 0===r&&(r="height"),"center"===t?(n[r]+e[r])/2:n.height}},ep=np,tp={getId:function(n){return n.id||n.name},getPreH:function(n){return n.preH||0},getPreV:function(n){return n.preV||0},getHGap:function(n){return n.hgap||18},getVGap:function(n){return n.vgap||18},getChildren:function(n){return n.children},getHeight:function(n){return n.height||36},getWidth:function(n){var e=n.label||" ";return n.width||18*e.split("").length}};function rp(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof rp)return n;t.data=n;var r=e.getHGap(n),o=e.getVGap(n);return t.preH=e.getPreH(n),t.preV=e.getPreV(n),t.width=e.getWidth(n),t.height=e.getHeight(n),t.width+=t.preH,t.height+=t.preV,t.id=e.getId(n),t.x=t.y=0,t.depth=0,t.children||(t.children=[]),t.addGap(r,o),t}ep.assign(rp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,e){var t=this;t.hgap+=n,t.vgap+=e,t.width+=2*n,t.height+=2*e},eachNode:function(n){for(var e,t=[this];e=t.shift();)n(e),t=e.children.concat(t)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var e,t=[this];e=t.shift();)n(e),t=t.concat(e.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){n.left=Math.min(n.left,e.x),n.top=Math.min(n.top,e.y),n.width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height)})),n},translate:function(n,e){void 0===n&&(n=0),void 0===e&&(e=0),this.eachNode((function(t){t.x+=n,t.y+=e,t.x+=t.preH,t.y+=t.preV}))},right2left:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-e.left)-n.width})),n.translate(e.width,0)},bottom2top:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-e.top)-n.height})),n.translate(0,e.height)}});var op=function(n,e,t){void 0===e&&(e={});var r,o=new rp(n,e=ep.assign({},tp,e)),i=[o];if(!t&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var u=e.getChildren(r.data),a=u?u.length:0;if(r.children=new Array(a),u&&a)for(var c=0;c<a;c++){var l=new rp(u[c],e);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},ip=op,up=function(){function n(n,e){void 0===e&&(e={}),this.options=e,this.rootNode=ip(n,e)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),ap=up;function cp(n,e,t,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=e||0,o.y=t||0,o.x=0,o.c=r||[],o.cs=r.length,o.prelim=0,o.mod=0,o.shift=0,o.change=0,o.tl=null,o.tr=null,o.el=null,o.er=null,o.msel=0,o.mser=0}function lp(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach((function(n){lp(n,e,t)}))}function sp(n,e){var t=e?n.y:n.x;return n.children.forEach((function(n){t=Math.min(sp(n,e),t)})),t}function fp(n,e){lp(n,-sp(n,e),e)}function dp(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach((function(n,r){dp(n,e.children[r],t)}))}function hp(n,e,t){void 0===t&&(t=0),e?(n.x=t,t+=n.width):(n.y=t,t+=n.height),n.children.forEach((function(n){hp(n,e,t)}))}cp.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach((function(n){t.push(cp.fromNode(n,e))})),e?new cp(n.height,n.width,n.x,t):new cp(n.width,n.height,n.y,t)};var vp=op,pp=function(n,e){for(var t=vp(n.data,e,!0),r=vp(n.data,e,!0),o=n.children.length,i=Math.round(o/2),u=e.getSide||function(n,e){return e<i?"right":"left"},a=0;a<o;a++){var c=n.children[a];"right"===u(c,a)?r.children.push(c):t.children.push(c)}return t.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:t,right:r}},gp=pp,yp=["LR","RL","TB","BT","H","V"],mp=["LR","RL","H"],xp=yp[0],wp=function(n,e,t){var r=e.direction||xp;if(e.isHorizontal=function(n){return mp.indexOf(n)>-1}(r),r&&-1===yp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===yp[0])t(n,e);else if(r===yp[1])t(n,e),n.right2left();else if(r===yp[2])t(n,e);else if(r===yp[3])t(n,e),n.bottom2top();else if(r===yp[4]||r===yp[5]){var o=gp(n,e),i=o.left,u=o.right;t(i,e),t(u,e),e.isHorizontal?i.right2left():i.bottom2top(),u.translate(i.x-u.x,i.y-u.y),n.x=i.x,n.y=u.y;var a=n.getBoundingBox();e.isHorizontal?a.top<0&&n.translate(0,-a.top):a.left<0&&n.translate(-a.left,0)}var c=e.fixedRoot;return void 0===c&&(c=!0),c&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),function(n,e){if(e.radial){var t=e.isHorizontal?["x","y"]:["y","x"],r=t[0],o=t[1],i={x:1/0,y:1/0},u={x:-1/0,y:-1/0},a=0;n.DFTraverse((function(n){a++;var e=n.x,t=n.y;i.x=Math.min(i.x,e),i.y=Math.min(i.y,t),u.x=Math.max(u.x,e),u.y=Math.max(u.y,t)}));var c=u[o]-i[o];if(0===c)return;var l=2*Math.PI/a;n.DFTraverse((function(e){var t=(e[o]-i[o])/c*(2*Math.PI-l)+l,u=e[r]-n[r];e.x=Math.cos(t)*u,e.y=Math.sin(t)*u}))}}(n,e),n};function bp(n,e){return bp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},bp(n,e)}var _p=function(n,e){void 0===e&&(e={});var t=e.isHorizontal;function r(n){0===n.cs?(n.el=n,n.er=n,n.msel=n.mser=0):(n.el=n.c[0].el,n.msel=n.c[0].msel,n.er=n.c[n.cs-1].er,n.mser=n.c[n.cs-1].mser)}function o(n,e,t){for(var r=n.c[e-1],o=r.mod,l=n.c[e],s=l.mod;null!==r&&null!==l;){c(r)>t.low&&(t=t.nxt);var f=o+r.prelim+r.w-(s+l.prelim);f>0&&(s+=f,i(n,e,t.index,f));var d=c(r),h=c(l);d<=h&&null!==(r=a(r))&&(o+=r.mod),d>=h&&null!==(l=u(l))&&(s+=l.mod)}!r&&l?function(n,e,t,r){var o=n.c[0].el;o.tl=t;var i=r-t.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[e].el,n.c[0].msel=n.c[e].msel}(n,e,l,s):r&&!l&&function(n,e,t,r){var o=n.c[e].er;o.tr=t;var i=r-t.mod-n.c[e].mser;o.mod+=i,o.prelim-=i,n.c[e].er=n.c[e-1].er,n.c[e].mser=n.c[e-1].mser}(n,e,r,o)}function i(n,e,t,r){n.c[e].mod+=r,n.c[e].msel+=r,n.c[e].mser+=r,function(n,e,t,r){if(t!==e-1){var o=e-t;n.c[t+1].shift+=r/o,n.c[e].shift-=r/o,n.c[e].change-=r-r/o}}(n,e,t,r)}function u(n){return 0===n.cs?n.tl:n.c[0]}function a(n){return 0===n.cs?n.tr:n.c[n.cs-1]}function c(n){return n.y+n.h}function l(n,e,t){for(;null!==t&&n>=t.low;)t=t.nxt;return{low:n,index:e,nxt:t}}hp(n,t);var s=cp.fromNode(n,t);return function n(e){if(0!==e.cs){n(e.c[0]);for(var t=l(c(e.c[0].el),0,null),i=1;i<e.cs;++i){n(e.c[i]);var u=c(e.c[i].er);o(e,i,t),t=l(u,i,t)}!function(n){n.prelim=(n.c[0].prelim+n.c[0].mod+n.c[n.cs-1].mod+n.c[n.cs-1].prelim+n.c[n.cs-1].w)/2-n.w/2}(e),r(e)}else r(e)}(s),function n(e,t){t+=e.mod,e.x=e.prelim+t,function(n){for(var e=0,t=0,r=0;r<n.cs;r++)t+=(e+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=t}(e);for(var r=0;r<e.cs;r++)n(e.c[r],t)}(s,0),dp(s,n,t),fp(n,t),n},Ep=wp,Sp=np,kp=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,bp(t,r),e.prototype.execute=function(){return Ep(this.rootNode,this.options,_p)},e}(ap),Cp={},Mp=np;function Np(n,e){void 0===e&&(e=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=e}var Op={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Pp(n,e,t){t?(e.x=n.x,e.y=n.y):(e.x=n.y,e.y=n.x),n.children.forEach((function(n,r){Pp(n,e.children[r],t)}))}function jp(n,e){return jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},jp(n,e)}var Ip=function(n,e){void 0===e&&(e={}),e=Mp.assign({},Op,e);var t,r=0,o=function n(e){if(!e)return null;e.width=0,e.depth&&e.depth>r&&(r=e.depth);var t=e.children,o=t.length,i=new Np(e.height,[]);return t.forEach((function(e,t){var r=n(e);i.children.push(r),0===t&&(i.leftChild=r),t===o-1&&(i.rightChild=r)})),i.originNode=e,i.isLeaf=e.isLeaf(),i}(n);return function n(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=r;else{var t=e.children.map((function(e){return n(e)})),o=Math.min.apply(null,t);e.drawingDepth=o-1}return e.drawingDepth}(o),function n(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,t&&(r.y=t.y+t.height+e.nodeSep,r.originNode.parent!==t.originNode.parent&&(r.y+=e.subTreeSep)),t=r):(r.children.forEach((function(e){n(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Pp(o,n,e.isHorizontal),n},Ap=wp,zp=np,Lp=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,jp(t,r),e.prototype.execute=function(){var n=this;return n.rootNode.width=0,Ap(n.rootNode,n.options,Ip)},e}(ap),Tp={},Bp=np;function Rp(n,e){return Rp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Rp(n,e)}var Dp=ap,Vp=function(n,e,t,r){var o=null;n.eachNode((function(n){!function(n,e,t,r,o){var i=("function"==typeof t?t(n):t)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=e?e.y:0)}catch(n){}if(n.x+=i,e){if(n.y=e.y+Bp.getHeight(e,n,o),e.parent&&n.parent.id!==e.parent.id){var u=e.parent,a=u.y+Bp.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,e,t,r),o=n}))},Hp=pp,Yp=np,Zp=["LR","RL","H"],Xp=Zp[0],Up=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,Rp(t,r),e.prototype.execute=function(){var n=this.options,e=this.rootNode;n.isHorizontal=!0;var t=n.indent,r=void 0===t?20:t,o=n.dropCap,i=void 0===o||o,u=n.direction,a=void 0===u?Xp:u,c=n.align;if(a&&-1===Zp.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===Zp[0])Vp(e,r,i,c);else if(a===Zp[1])Vp(e,r,i,c),e.right2left();else if(a===Zp[2]){var l=Hp(e,n),s=l.left,f=l.right;Vp(s,r,i,c),s.right2left(),Vp(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),e.x=f.x-e.width/2}return e},e}(Dp),Fp={},Wp=np;function $p(n,e){var t=0;return n.children.length?n.children.forEach((function(n){t+=$p(n,e)})):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function Gp(n){var e=n.children,t=e.length;if(t){e.forEach((function(n){Gp(n)}));var r=e[0],o=e[t-1],i=o.y-r.y+o.height,u=0;if(e.forEach((function(n){u+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==e.length||n.height>u){var a=n.y+(n.height-i)/2-r.y;e.forEach((function(n){n.translate(0,a)}))}else n.y=(r.y+r.height/2+o.y+o.height/2)/2-n.height/2}}var qp={getSubTreeSep:function(){return 0}};function Kp(n,e){return Kp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Kp(n,e)}var Qp=function(n,e){void 0===e&&(e={}),e=Wp.assign({},qp,e),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse((function(n){n.x=n.parent.x+n.parent.width})),n.parent=null,$p(n,e),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var e=n.children,t=e.length;if(t){var r=e[0];if(r.startY=n.startY+n._subTreeSep,1===t)r.y=n.y+n.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var o=1;o<t;o++){var i=e[o];i.startY=e[o-1].startY+e[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),Gp(n)},Jp=wp,ng=np,eg=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,Kp(t,r),e.prototype.execute=function(){return Jp(this.rootNode,this.options,Qp)},e}(ap),tg={};He({compactBox:function(n,e){return e=Sp.assign({},Cp,e),new kp(n,e).execute()},dendrogram:function(n,e){return e=zp.assign({},Tp,e),new Lp(n,e).execute()},indented:function(n,e){return e=Yp.assign({},Fp,e),new Up(n,e).execute()},mindmap:function(n,e){return e=ng.assign({},tg,e),new eg(n,e).execute()}});var rg={value:()=>{}};function og(){for(var n,e=0,t=arguments.length,r={};e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new ig(r)}function ig(n){this._=n}function ug(n,e){for(var t,r=0,o=n.length;r<o;++r)if((t=n[r]).name===e)return t.value}function ag(n,e,t){for(var r=0,o=n.length;r<o;++r)if(n[r].name===e){n[r]=rg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}ig.prototype=og.prototype={constructor:ig,on:function(n,e){var t,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");if(t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:e}}))),u=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<a;)if(t=(n=i[u]).type)o[t]=ag(o[t],n.name,e);else if(null==e)for(t in o)o[t]=ag(o[t],n.name,null);return this}for(;++u<a;)if((t=(n=i[u]).type)&&(t=ug(o[t],n.name)))return t},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new ig(n)},call:function(n,e){if((t=arguments.length-2)>0)for(var t,r,o=new Array(t),i=0;i<t;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,t=(r=this._[n]).length;i<t;++i)r[i].value.apply(e,o)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],o=0,i=r.length;o<i;++o)r[o].value.apply(e,t)}};var cg="http://www.w3.org/1999/xhtml",lg={svg:"http://www.w3.org/2000/svg",xhtml:cg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function sg(n){var e=n+="",t=e.indexOf(":");return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),lg.hasOwnProperty(e)?{space:lg[e],local:n}:n}function fg(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===cg&&e.documentElement.namespaceURI===cg?e.createElement(n):e.createElementNS(t,n)}}function dg(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function hg(n){var e=sg(n);return(e.local?dg:fg)(e)}function vg(){}function pg(n){return null==n?vg:function(){return this.querySelector(n)}}function gg(){return[]}function yg(n){return null==n?gg:function(){return this.querySelectorAll(n)}}function mg(n){return function(){return this.matches(n)}}function xg(n){return function(e){return e.matches(n)}}var wg=Array.prototype.find;function bg(){return this.firstElementChild}var _g=Array.prototype.filter;function Eg(){return Array.from(this.children)}function Sg(n){return new Array(n.length)}function kg(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}function Cg(n,e,t,r,o,i){for(var u,a=0,c=e.length,l=i.length;a<l;++a)(u=e[a])?(u.__data__=i[a],r[a]=u):t[a]=new kg(n,i[a]);for(;a<c;++a)(u=e[a])&&(o[a]=u)}function Mg(n,e,t,r,o,i,u){var a,c,l,s=new Map,f=e.length,d=i.length,h=new Array(f);for(a=0;a<f;++a)(c=e[a])&&(h[a]=l=u.call(c,c.__data__,a,e)+"",s.has(l)?o[a]=c:s.set(l,c));for(a=0;a<d;++a)l=u.call(n,i[a],a,i)+"",(c=s.get(l))?(r[a]=c,c.__data__=i[a],s.delete(l)):t[a]=new kg(n,i[a]);for(a=0;a<f;++a)(c=e[a])&&s.get(h[a])===c&&(o[a]=c)}function Ng(n){return n.__data__}function Og(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function Pg(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function jg(n){return function(){this.removeAttribute(n)}}function Ig(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Ag(n,e){return function(){this.setAttribute(n,e)}}function zg(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function Lg(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function Tg(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function Bg(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Rg(n){return function(){this.style.removeProperty(n)}}function Dg(n,e,t){return function(){this.style.setProperty(n,e,t)}}function Vg(n,e,t){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function Hg(n,e){return n.style.getPropertyValue(e)||Bg(n).getComputedStyle(n,null).getPropertyValue(e)}function Yg(n){return function(){delete this[n]}}function Zg(n,e){return function(){this[n]=e}}function Xg(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function Ug(n){return n.trim().split(/^|\s+/)}function Fg(n){return n.classList||new Wg(n)}function Wg(n){this._node=n,this._names=Ug(n.getAttribute("class")||"")}function $g(n,e){for(var t=Fg(n),r=-1,o=e.length;++r<o;)t.add(e[r])}function Gg(n,e){for(var t=Fg(n),r=-1,o=e.length;++r<o;)t.remove(e[r])}function qg(n){return function(){$g(this,n)}}function Kg(n){return function(){Gg(this,n)}}function Qg(n,e){return function(){(e.apply(this,arguments)?$g:Gg)(this,n)}}function Jg(){this.textContent=""}function ny(n){return function(){this.textContent=n}}function ey(n){return function(){var e=n.apply(this,arguments);this.textContent=null==e?"":e}}function ty(){this.innerHTML=""}function ry(n){return function(){this.innerHTML=n}}function oy(n){return function(){var e=n.apply(this,arguments);this.innerHTML=null==e?"":e}}function iy(){this.nextSibling&&this.parentNode.appendChild(this)}function uy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ay(){return null}function cy(){var n=this.parentNode;n&&n.removeChild(this)}function ly(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function sy(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function fy(n){return function(){var e=this.__on;if(e){for(var t,r=0,o=-1,i=e.length;r<i;++r)t=e[r],n.type&&t.type!==n.type||t.name!==n.name?e[++o]=t:this.removeEventListener(t.type,t.listener,t.options);++o?e.length=o:delete this.__on}}}function dy(n,e,t){return function(){var r,o=this.__on,i=function(n){return function(e){n.call(this,e,this.__data__)}}(e);if(o)for(var u=0,a=o.length;u<a;++u)if((r=o[u]).type===n.type&&r.name===n.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=t),void(r.value=e);this.addEventListener(n.type,i,t),r={type:n.type,name:n.name,value:e,listener:i,options:t},o?o.push(r):this.__on=[r]}}function hy(n,e,t){var r=Bg(n),o=r.CustomEvent;"function"==typeof o?o=new o(e,t):(o=r.document.createEvent("Event"),t?(o.initEvent(e,t.bubbles,t.cancelable),o.detail=t.detail):o.initEvent(e,!1,!1)),n.dispatchEvent(o)}function vy(n,e){return function(){return hy(this,n,e)}}function py(n,e){return function(){return hy(this,n,e.apply(this,arguments))}}kg.prototype={constructor:kg,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},Wg.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var gy=[null];function yy(n,e){this._groups=n,this._parents=e}function my(){return new yy([[document.documentElement]],gy)}function xy(n){return"string"==typeof n?new yy([[document.querySelector(n)]],[document.documentElement]):new yy([[n]],gy)}function wy(n,e){if(n=function(n){let e;for(;e=n.sourceEvent;)n=e;return n}(n),void 0===e&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[n.clientX-o.left-e.clientLeft,n.clientY-o.top-e.clientTop]}}return[n.pageX,n.pageY]}yy.prototype=my.prototype={constructor:yy,select:function(n){"function"!=typeof n&&(n=pg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u,a=e[o],c=a.length,l=r[o]=new Array(c),s=0;s<c;++s)(i=a[s])&&(u=n.call(i,i.__data__,s,a))&&("__data__"in i&&(u.__data__=i.__data__),l[s]=u);return new yy(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(e=n.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(n):yg(n);for(var e=this._groups,t=e.length,r=[],o=[],i=0;i<t;++i)for(var u,a=e[i],c=a.length,l=0;l<c;++l)(u=a[l])&&(r.push(n.call(u,u.__data__,l,a)),o.push(u));return new yy(r,o)},selectChild:function(n){return this.select(null==n?bg:function(n){return function(){return wg.call(this.children,n)}}("function"==typeof n?n:xg(n)))},selectChildren:function(n){return this.selectAll(null==n?Eg:function(n){return function(){return _g.call(this.children,n)}}("function"==typeof n?n:xg(n)))},filter:function(n){"function"!=typeof n&&(n=mg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u=e[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new yy(r,this._parents)},data:function(n,e){if(!arguments.length)return Array.from(this,Ng);var t,r=e?Mg:Cg,o=this._parents,i=this._groups;"function"!=typeof n&&(t=n,n=function(){return t});for(var u=i.length,a=new Array(u),c=new Array(u),l=new Array(u),s=0;s<u;++s){var f=o[s],d=i[s],h=d.length,v=Og(n.call(f,f&&f.__data__,s,o)),p=v.length,g=c[s]=new Array(p),y=a[s]=new Array(p);r(f,d,g,y,l[s]=new Array(h),v,e);for(var m,x,w=0,b=0;w<p;++w)if(m=g[w]){for(w>=b&&(b=w+1);!(x=y[b])&&++b<p;);m._next=x||null}}return(a=new yy(a,o))._enter=c,a._exit=l,a},enter:function(){return new yy(this._enter||this._groups.map(Sg),this._parents)},exit:function(){return new yy(this._exit||this._groups.map(Sg),this._parents)},join:function(n,e,t){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=e&&(o=e(o))&&(o=o.selection()),null==t?i.remove():t(i),r&&o?r.merge(o).order():o},merge:function(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,o=t.length,i=r.length,u=Math.min(o,i),a=new Array(o),c=0;c<u;++c)for(var l,s=t[c],f=r[c],d=s.length,h=a[c]=new Array(d),v=0;v<d;++v)(l=s[v]||f[v])&&(h[v]=l);for(;c<o;++c)a[c]=t[c];return new yy(a,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r,o=n[e],i=o.length-1,u=o[i];--i>=0;)(r=o[i])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(n){function e(e,t){return e&&t?n(e.__data__,t.__data__):!e-!t}n||(n=Pg);for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i){for(var u,a=t[i],c=a.length,l=o[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(l[s]=u);l.sort(e)}return new yy(o,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],o=0,i=r.length;o<i;++o){var u=r[o];if(u)return u}return null},size:function(){let n=0;for(const e of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o,i=e[t],u=0,a=i.length;u<a;++u)(o=i[u])&&n.call(o,o.__data__,u,i);return this},attr:function(n,e){var t=sg(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((null==e?t.local?Ig:jg:"function"==typeof e?t.local?Tg:Lg:t.local?zg:Ag)(t,e))},style:function(n,e,t){return arguments.length>1?this.each((null==e?Rg:"function"==typeof e?Vg:Dg)(n,e,null==t?"":t)):Hg(this.node(),n)},property:function(n,e){return arguments.length>1?this.each((null==e?Yg:"function"==typeof e?Xg:Zg)(n,e)):this.node()[n]},classed:function(n,e){var t=Ug(n+"");if(arguments.length<2){for(var r=Fg(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof e?Qg:e?qg:Kg)(t,e))},text:function(n){return arguments.length?this.each(null==n?Jg:("function"==typeof n?ey:ny)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?ty:("function"==typeof n?oy:ry)(n)):this.node().innerHTML},raise:function(){return this.each(iy)},lower:function(){return this.each(uy)},append:function(n){var e="function"==typeof n?n:hg(n);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(n,e){var t="function"==typeof n?n:hg(n),r=null==e?ay:"function"==typeof e?e:pg(e);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(cy)},clone:function(n){return this.select(n?sy:ly)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,e,t){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");return t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),{type:n,name:e}}))}(n+""),u=i.length;if(!(arguments.length<2)){for(a=e?dy:fy,r=0;r<u;++r)this.each(a(i[r],e,t));return this}var a=this.node().__on;if(a)for(var c,l=0,s=a.length;l<s;++l)for(r=0,c=a[l];r<u;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(n,e){return this.each(("function"==typeof e?py:vy)(n,e))},[Symbol.iterator]:function*(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r,o=n[e],i=0,u=o.length;i<u;++i)(r=o[i])&&(yield r)}};const by={passive:!1},_y={capture:!0,passive:!1};function Ey(n){n.stopImmediatePropagation()}function Sy(n){n.preventDefault(),n.stopImmediatePropagation()}function ky(n){var e=n.document.documentElement,t=xy(n).on("dragstart.drag",Sy,_y);"onselectstart"in e?t.on("selectstart.drag",Sy,_y):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Cy(n,e){var t=n.document.documentElement,r=xy(n).on("dragstart.drag",null);e&&(r.on("click.drag",Sy,_y),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in t?r.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}var My=n=>()=>n;function Ny(n,{sourceEvent:e,subject:t,target:r,identifier:o,active:i,x:u,y:a,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function Oy(n){return!n.ctrlKey&&!n.button}function Py(){return this.parentNode}function jy(n,e){return null==e?{x:n.x,y:n.y}:e}function Iy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ay(n,e){if(!n.parentId)return!1;var t=e.get(n.parentId);return!!t&&(!!t.selected||Ay(t,e))}function zy(n,e,t){var r=n;do{if(null==r?void 0:r.matches(e))return!0;if(r===t)return!1;r=r.parentElement}while(r);return!1}function Ly(n){var e,t,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=T(u),s=l.next();!s.done;s=l.next()){var f=B(s.value,2),d=f[0],h=f[1],v=null===(r=a.get(d))||void 0===r?void 0:r.internals.userNode;v&&c.push(L(L({},v),{position:h.position}))}}catch(n){e={error:n}}finally{try{s&&!s.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}if(!i)return[c[0],c];var p=a.get(i).internals.userNode;return[L(L({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function Ty(n){var e=n.onNodeMouseDown,t=n.getStoreItems,r=n.onDragStart,o=n.onDrag,i=n.onDragStop,u={x:null,y:null},a=0,c=new Map,l=!1,s={x:0,y:0},f=null,d=!1,h=null;return{update:function(n){var v=n.noDragClassName,p=n.handleSelector,g=n.domNode,y=n.isSelectable,m=n.nodeId;function x(n,e){var r,i,a=n.x,l=n.y,s=t(),f=s.nodeLookup,d=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,x=s.onError,w=s.updateNodePositions;u={x:a,y:l};var b=!1,_={x:0,y:0,x2:0,y2:0};if(c.size>1&&d){var E=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==e.filter||e.filter(n)){var r=jv(n,e.nodeOrigin);t=Ov(t,r)}})),Pv(t)}(c,{nodeOrigin:p});_=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}}(E)}try{for(var S=T(c),k=S.next();!k.done;k=S.next()){var C=B(k.value,2),M=C[0],N=C[1],O={x:a-N.distance.x,y:l-N.distance.y};v&&(O=Iv(O,h));var P=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!N.extent){var j=N.internals.positionAbsolute,I=j.x-_.x+d[0][0],A=j.x+N.measured.width-_.x2+d[1][0];P=[[I,j.y-_.y+d[0][1]],[A,j.y+N.measured.height-_.y2+d[1][1]]]}var z=Sv({nodeId:M,nextPosition:O,nodeLookup:f,nodeExtent:P,nodeOrigin:p,onError:x}),L=z.position,R=z.positionAbsolute;b=b||N.position.x!==L.x||N.position.y!==L.y,N.position=L,N.internals.positionAbsolute=R}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(b&&(w(c,!0),e&&(o||g||!m&&y))){var D=B(Ly({nodeId:m,dragItems:c,nodeLookup:f}),2),V=D[0],H=D[1];null==o||o(e,c,V,H),null==g||g(e,V,H),m||null==y||y(e,H)}}function w(){var n,e;if(f){var r=B(Nv(s,f),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=t(),l=c.transform,d=c.panBy;u.x=(null!==(n=u.x)&&void 0!==n?n:0)-o/l[2],u.y=(null!==(e=u.y)&&void 0!==e?e:0)-i/l[2],d({x:o,y:i})&&x(u,null)}a=requestAnimationFrame(w)}}function b(n){var o,i=t(),a=i.nodeLookup,l=i.multiSelectionActive,s=i.nodesDraggable,f=i.transform,h=i.snapGrid,v=i.snapToGrid,p=i.selectNodesOnDrag,g=i.onNodeDragStart,x=i.onSelectionDragStart,w=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||w(),y&&p&&m&&(null==e||e(m));var b=Vv(n.sourceEvent,{transform:f,snapGrid:h,snapToGrid:v});if(u=b,c=function(n,e,t,r){var o,i,u,a,c=new Map;try{for(var l=T(n),s=l.next();!s.done;s=l.next()){var f=B(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!Ay(h,n))&&(h.draggable||e&&void 0===h.draggable)){var v=n.get(d);v&&c.set(d,{id:d,position:v.position||{x:0,y:0},distance:{x:t.x-v.internals.positionAbsolute.x,y:t.y-v.internals.positionAbsolute.y},extent:v.extent,parentId:v.parentId,origin:v.origin,expandParent:v.expandParent,internals:{positionAbsolute:v.internals.positionAbsolute||{x:0,y:0}},measured:{width:null!==(u=v.measured.width)&&void 0!==u?u:0,height:null!==(a=v.measured.height)&&void 0!==a?a:0}})}}}catch(n){o={error:n}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return c}(a,s,b,m),c.size>0&&(r||g||!m&&x)){var _=B(Ly({nodeId:m,dragItems:c,nodeLookup:a}),2),E=_[0],S=_[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==x||x(n.sourceEvent,S)}}h=xy(g);var _=function(){var n,e,t,r,o=Oy,i=Py,u=jy,a=Iy,c={},l=og("start","drag","end"),s=0,f=0;function d(n){n.on("mousedown.drag",h).filter(a).on("touchstart.drag",g).on("touchmove.drag",y,by).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(u,a){if(!r&&o.call(this,u,a)){var c=x(this,i.call(this,u,a),u,a,"mouse");c&&(xy(u.view).on("mousemove.drag",v,_y).on("mouseup.drag",p,_y),ky(u.view),Ey(u),t=!1,n=u.clientX,e=u.clientY,c("start",u))}}function v(r){if(Sy(r),!t){var o=r.clientX-n,i=r.clientY-e;t=o*o+i*i>f}c.mouse("drag",r)}function p(n){xy(n.view).on("mousemove.drag mouseup.drag",null),Cy(n.view,t),Sy(n),c.mouse("end",n)}function g(n,e){if(o.call(this,n,e)){var t,r,u=n.changedTouches,a=i.call(this,n,e),c=u.length;for(t=0;t<c;++t)(r=x(this,a,n,e,u[t].identifier,u[t]))&&(Ey(n),r("start",n,u[t]))}}function y(n){var e,t,r=n.changedTouches,o=r.length;for(e=0;e<o;++e)(t=c[r[e].identifier])&&(Sy(n),t("drag",n,r[e]))}function m(n){var e,t,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<i;++e)(t=c[o[e].identifier])&&(Ey(n),t("end",n,o[e]))}function x(n,e,t,r,o,i){var a,f,h,v=l.copy(),p=wy(i||t,e);if(null!=(h=u.call(n,new Ny("beforestart",{sourceEvent:t,target:d,identifier:o,active:s,x:p[0],y:p[1],dx:0,dy:0,dispatch:v}),r)))return a=h.x-p[0]||0,f=h.y-p[1]||0,function t(i,u,l){var g,y=p;switch(i){case"start":c[o]=t,g=s++;break;case"end":delete c[o],--s;case"drag":p=wy(l||u,e),g=s}v.call(i,n,new Ny(i,{sourceEvent:u,subject:h,target:d,identifier:o,active:g,x:p[0]+a,y:p[1]+f,dx:p[0]-y[0],dy:p[1]-y[1],dispatch:v}),r)}}return d.filter=function(n){return arguments.length?(o="function"==typeof n?n:My(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:My(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:My(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:My(!!n),d):a},d.on=function(){var n=l.on.apply(l,arguments);return n===l?d:n},d.clickDistance=function(n){return arguments.length?(f=(n=+n)*n,d):Math.sqrt(f)},d}().on("start",(function(n){var e=t(),r=e.domNode,o=e.nodeDragThreshold,i=e.transform,a=e.snapGrid,c=e.snapToGrid;0===o&&b(n);var l=Vv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=Hv(n.sourceEvent,f)})).on("drag",(function(n){var e,r,o=t(),i=o.autoPanOnNodeDrag,a=o.transform,h=o.snapGrid,v=o.snapToGrid,p=o.nodeDragThreshold,g=Vv(n.sourceEvent,{transform:a,snapGrid:h,snapToGrid:v});if(!l&&i&&d&&(l=!0,w()),!d){var y=g.xSnapped-(null!==(e=u.x)&&void 0!==e?e:0),m=g.ySnapped-(null!==(r=u.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&b(n)}(u.x!==g.xSnapped||u.y!==g.ySnapped)&&c&&d&&(s=Hv(n.sourceEvent,f),x(g,n.sourceEvent))})).on("end",(function(n){if(d&&(l=!1,d=!1,cancelAnimationFrame(a),c.size>0)){var e=t(),r=e.nodeLookup,o=e.updateNodePositions,u=e.onNodeDragStop,s=e.onSelectionDragStop;if(o(c,!1),i||u||!m&&s){var f=B(Ly({nodeId:m,dragItems:c,nodeLookup:r}),2),h=f[0],v=f[1];null==i||i(n.sourceEvent,c,h,v),null==u||u(n.sourceEvent,h,v),m||null==s||s(n.sourceEvent,v)}}})).filter((function(n){var e=n.target;return!n.button&&(!v||!zy(e,".".concat(v),g))&&(!p||zy(e,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function By(n,e,t,r){return(e[t]||[]).reduce((function(e,o){return"".concat(n.id,"-").concat(o.id,"-").concat(t)!==r&&e.push({id:o.id||null,type:t,nodeId:n.id,x:n.internals.positionAbsolute.x+o.x+o.width/2,y:n.internals.positionAbsolute.y+o.y+o.height/2}),e}),[])}function Ry(n,e){return n||((null==e?void 0:e.classList.contains("target"))?"target":(null==e?void 0:e.classList.contains("source"))?"source":null)}Ny.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var Dy=function(){return!0},Vy=null;function Hy(n,e){var t=e.handle,r=e.connectionMode,o=e.fromNodeId,i=e.fromHandleId,u=e.fromType,a=e.doc,c=e.lib,l=e.flowId,s=e.isValidConnection,f=void 0===s?Dy:s,d="target"===u,h=t?a.querySelector(".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==t?void 0:t.nodeId,"-").concat(null==t?void 0:t.id,"-").concat(null==t?void 0:t.type,'"]')):null,v=Hv(n),p=v.x,g=v.y,y=a.elementFromPoint(p,g),m=(null==y?void 0:y.classList.contains("".concat(c,"-flow__handle")))?y:h,x={handleDomNode:m,isValid:!1,connection:null,endHandle:null};if(m){var w=Ry(void 0,m),b=m.getAttribute("data-nodeid"),_=m.getAttribute("data-handleid"),E=m.classList.contains("connectable"),S=m.classList.contains("connectableend");if(!b)return x;var k={source:d?b:o,sourceHandle:d?_:i,target:d?o:b,targetHandle:d?i:_};x.connection=k,E&&S&&(r===exports.ConnectionMode.Strict?d&&"source"===w||!d&&"target"===w:b!==o||_!==i)&&(x.endHandle={nodeId:b,handleId:_,type:w},x.isValid=f(k))}return x}var Yy={onPointerDown:function(n,e){var t,r=e.connectionMode,o=e.connectionRadius,i=e.handleId,u=e.nodeId,a=e.edgeUpdaterType,c=e.isTarget,l=e.domNode,s=e.nodeLookup,f=e.lib,d=e.autoPanOnConnect,h=e.flowId,v=e.panBy,p=e.cancelConnection,g=e.onConnectStart,y=e.onConnect,m=e.onConnectEnd,x=e.isValidConnection,w=void 0===x?Dy:x,b=e.onEdgeUpdateEnd,_=e.updateConnection,E=e.getTransform,S=e.getConnectionStartHandle,k=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),C=0,M=Hv(n),N=M.x,O=M.y,P=null==k?void 0:k.elementFromPoint(N,O),j=Ry(a,P),I=null==l?void 0:l.getBoundingClientRect();if(I&&j){var A=Hv(n,I),z=!1,L=null,D=!1,V=null,H=function(n){var e,t,r=n.nodeLookup,o=n.nodeId,i=n.handleId,u=n.handleType,a=[];try{for(var c=T(r),l=c.next();!l.done;l=c.next()){var s=B(l.value,2)[1];if(s.internals.handleBounds){var f="".concat(o,"-").concat(i,"-").concat(u),d=By(s,s.internals.handleBounds,"source",f),h=By(s,s.internals.handleBounds,"target",f);a.push.apply(a,R(R([],B(d),!1),B(h),!1))}}}catch(n){e={error:n}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}return a}({nodeLookup:s,nodeId:u,handleId:i,handleType:j});_({connectionPosition:A,connectionStatus:null,connectionStartHandle:Vy={nodeId:u,handleId:i,type:j},connectionEndHandle:null}),null==g||g(n,{nodeId:u,handleId:i,handleType:j}),k.addEventListener("mousemove",Z),k.addEventListener("mouseup",X),k.addEventListener("touchmove",Z),k.addEventListener("touchend",X)}function Y(){if(d&&I){var n=B(Nv(A,I),2),e=n[0],t=n[1];v({x:e,y:t}),C=requestAnimationFrame(Y)}}function Z(n){S()||X(n);var e=E();A=Hv(n,I),t=function(n,e,t){var r,o,i=[],u=1/0;try{for(var a=T(t),c=a.next();!c.done;c=a.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));s<=e&&(s<u?i=[l]:s===u&&i.push(l),u=s)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i.length?1===i.length?i[0]:i.find((function(n){return"target"===n.type}))||i[0]:null}(Av(A,e,!1,[1,1]),o,H),z||(Y(),z=!0);var a,l,s,d=Hy(n,{handle:t,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:w,doc:k,lib:f,flowId:h});V=d.handleDomNode,L=d.connection,D=d.isValid,_({connectionStartHandle:Vy,connectionPosition:t&&D?zv({x:t.x,y:t.y},e):A,connectionStatus:(a=!!t,l=D,s=null,l?s="valid":a&&!l&&(s="invalid"),s),connectionEndHandle:d.endHandle})}function X(n){(t||V)&&L&&D&&(null==y||y(L)),null==m||m(n),a&&(null==b||b(n)),p(),cancelAnimationFrame(C),z=!1,D=!1,L=null,V=null,Vy=null,k.removeEventListener("mousemove",Z),k.removeEventListener("mouseup",X),k.removeEventListener("touchmove",Z),k.removeEventListener("touchend",X)}},isValid:Hy};function Zy(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Xy(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Uy(){}var Fy=.7,Wy=1/Fy,$y="\\s*([+-]?\\d+)\\s*",Gy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ky=/^#([0-9a-f]{3,8})$/,Qy=new RegExp(`^rgb\\(${$y},${$y},${$y}\\)$`),Jy=new RegExp(`^rgb\\(${qy},${qy},${qy}\\)$`),nm=new RegExp(`^rgba\\(${$y},${$y},${$y},${Gy}\\)$`),em=new RegExp(`^rgba\\(${qy},${qy},${qy},${Gy}\\)$`),tm=new RegExp(`^hsl\\(${Gy},${qy},${qy}\\)$`),rm=new RegExp(`^hsla\\(${Gy},${qy},${qy},${Gy}\\)$`),om={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function im(){return this.rgb().formatHex()}function um(){return this.rgb().formatRgb()}function am(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Ky.exec(n))?(t=e[1].length,e=parseInt(e[1],16),6===t?cm(e):3===t?new fm(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===t?lm(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===t?lm(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Qy.exec(n))?new fm(e[1],e[2],e[3],1):(e=Jy.exec(n))?new fm(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nm.exec(n))?lm(e[1],e[2],e[3],e[4]):(e=em.exec(n))?lm(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=tm.exec(n))?ym(e[1],e[2]/100,e[3]/100,1):(e=rm.exec(n))?ym(e[1],e[2]/100,e[3]/100,e[4]):om.hasOwnProperty(n)?cm(om[n]):"transparent"===n?new fm(NaN,NaN,NaN,0):null}function cm(n){return new fm(n>>16&255,n>>8&255,255&n,1)}function lm(n,e,t,r){return r<=0&&(n=e=t=NaN),new fm(n,e,t,r)}function sm(n,e,t,r){return 1===arguments.length?((o=n)instanceof Uy||(o=am(o)),o?new fm((o=o.rgb()).r,o.g,o.b,o.opacity):new fm):new fm(n,e,t,null==r?1:r);var o}function fm(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}function dm(){return`#${gm(this.r)}${gm(this.g)}${gm(this.b)}`}function hm(){const n=vm(this.opacity);return`${1===n?"rgb(":"rgba("}${pm(this.r)}, ${pm(this.g)}, ${pm(this.b)}${1===n?")":`, ${n})`}`}function vm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function pm(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function gm(n){return((n=pm(n))<16?"0":"")+n.toString(16)}function ym(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new xm(n,e,t,r)}function mm(n){if(n instanceof xm)return new xm(n.h,n.s,n.l,n.opacity);if(n instanceof Uy||(n=am(n)),!n)return new xm;if(n instanceof xm)return n;var e=(n=n.rgb()).r/255,t=n.g/255,r=n.b/255,o=Math.min(e,t,r),i=Math.max(e,t,r),u=NaN,a=i-o,c=(i+o)/2;return a?(u=e===i?(t-r)/a+6*(t<r):t===i?(r-e)/a+2:(e-t)/a+4,a/=c<.5?i+o:2-i-o,u*=60):a=c>0&&c<1?0:u,new xm(u,a,c,n.opacity)}function xm(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}function wm(n){return(n=(n||0)%360)<0?n+360:n}function bm(n){return Math.max(0,Math.min(1,n||0))}function _m(n,e,t){return 255*(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)}Zy(Uy,am,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:im,formatHex:im,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mm(this).formatHsl()},formatRgb:um,toString:um}),Zy(fm,sm,Xy(Uy,{brighter(n){return n=null==n?Wy:Math.pow(Wy,n),new fm(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?Fy:Math.pow(Fy,n),new fm(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new fm(pm(this.r),pm(this.g),pm(this.b),vm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dm,formatHex:dm,formatHex8:function(){return`#${gm(this.r)}${gm(this.g)}${gm(this.b)}${gm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hm,toString:hm})),Zy(xm,(function(n,e,t,r){return 1===arguments.length?mm(n):new xm(n,e,t,null==r?1:r)}),Xy(Uy,{brighter(n){return n=null==n?Wy:Math.pow(Wy,n),new xm(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?Fy:Math.pow(Fy,n),new xm(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,o=2*t-r;return new fm(_m(n>=240?n-240:n+120,o,r),_m(n,o,r),_m(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new xm(wm(this.h),bm(this.s),bm(this.l),vm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=vm(this.opacity);return`${1===n?"hsl(":"hsla("}${wm(this.h)}, ${100*bm(this.s)}%, ${100*bm(this.l)}%${1===n?")":`, ${n})`}`}}));var Em=n=>()=>n;function Sm(n,e){var t=e-n;return t?function(n,e){return function(t){return n+t*e}}(n,t):Em(isNaN(n)?e:n)}var km=function n(e){var t=function(n){return 1==(n=+n)?Sm:function(e,t){return t-e?function(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}(e,t,n):Em(isNaN(e)?t:e)}}(e);function r(n,e){var r=t((n=sm(n)).r,(e=sm(e)).r),o=t(n.g,e.g),i=t(n.b,e.b),u=Sm(n.opacity,e.opacity);return function(e){return n.r=r(e),n.g=o(e),n.b=i(e),n.opacity=u(e),n+""}}return r.gamma=n,r}(1);function Cm(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var Mm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nm=new RegExp(Mm.source,"g");function Om(n,e){var t,r,o,i=Mm.lastIndex=Nm.lastIndex=0,u=-1,a=[],c=[];for(n+="",e+="";(t=Mm.exec(n))&&(r=Nm.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),a[u]?a[u]+=o:a[++u]=o),(t=t[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:Cm(t,r)})),i=Nm.lastIndex;return i<e.length&&(o=e.slice(i),a[u]?a[u]+=o:a[++u]=o),a.length<2?c[0]?function(n){return function(e){return n(e)+""}}(c[0].x):function(n){return function(){return n}}(e):(e=c.length,function(n){for(var t,r=0;r<e;++r)a[(t=c[r]).i]=t.x(n);return a.join("")})}var Pm,jm=180/Math.PI,Im={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Am(n,e,t,r,o,i){var u,a,c;return(u=Math.sqrt(n*n+e*e))&&(n/=u,e/=u),(c=n*t+e*r)&&(t-=n*c,r-=e*c),(a=Math.sqrt(t*t+r*r))&&(t/=a,r/=a,c/=a),n*r<e*t&&(n=-n,e=-e,c=-c,u=-u),{translateX:o,translateY:i,rotate:Math.atan2(e,n)*jm,skewX:Math.atan(c)*jm,scaleX:u,scaleY:a}}function zm(n,e,t,r){function o(n){return n.length?n.pop()+" ":""}return function(i,u){var a=[],c=[];return i=n(i),u=n(u),function(n,r,o,i,u,a){if(n!==o||r!==i){var c=u.push("translate(",null,e,null,t);a.push({i:c-4,x:Cm(n,o)},{i:c-2,x:Cm(r,i)})}else(o||i)&&u.push("translate("+o+e+i+t)}(i.translateX,i.translateY,u.translateX,u.translateY,a,c),function(n,e,t,i){n!==e?(n-e>180?e+=360:e-n>180&&(n+=360),i.push({i:t.push(o(t)+"rotate(",null,r)-2,x:Cm(n,e)})):e&&t.push(o(t)+"rotate("+e+r)}(i.rotate,u.rotate,a,c),function(n,e,t,i){n!==e?i.push({i:t.push(o(t)+"skewX(",null,r)-2,x:Cm(n,e)}):e&&t.push(o(t)+"skewX("+e+r)}(i.skewX,u.skewX,a,c),function(n,e,t,r,i,u){if(n!==t||e!==r){var a=i.push(o(i)+"scale(",null,",",null,")");u.push({i:a-4,x:Cm(n,t)},{i:a-2,x:Cm(e,r)})}else 1===t&&1===r||i.push(o(i)+"scale("+t+","+r+")")}(i.scaleX,i.scaleY,u.scaleX,u.scaleY,a,c),i=u=null,function(n){for(var e,t=-1,r=c.length;++t<r;)a[(e=c[t]).i]=e.x(n);return a.join("")}}}var Lm=zm((function(n){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?Im:Am(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Tm=zm((function(n){return null==n?Im:(Pm||(Pm=document.createElementNS("http://www.w3.org/2000/svg","g")),Pm.setAttribute("transform",n),(n=Pm.transform.baseVal.consolidate())?Am((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):Im)}),", ",")",")");function Bm(n){return((n=Math.exp(n))+1/n)/2}var Rm,Dm,Vm=function n(e,t,r){function o(n,o){var i,u,a=n[0],c=n[1],l=n[2],s=o[0],f=o[1],d=o[2],h=s-a,v=f-c,p=h*h+v*v;if(p<1e-12)u=Math.log(d/l)/e,i=function(n){return[a+n*h,c+n*v,l*Math.exp(e*n*u)]};else{var g=Math.sqrt(p),y=(d*d-l*l+r*p)/(2*l*t*g),m=(d*d-l*l-r*p)/(2*d*t*g),x=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(m*m+1)-m);u=(w-x)/e,i=function(n){var r,o=n*u,i=Bm(x),s=l/(t*g)*(i*(r=e*o+x,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(x));return[a+s*h,c+s*v,l*i/Bm(e*o+x)]}}return i.duration=1e3*u*e/Math.SQRT2,i}return o.rho=function(e){var t=Math.max(.001,+e),r=t*t;return n(t,r,r*r)},o}(Math.SQRT2,2,4),Hm=0,Ym=0,Zm=0,Xm=0,Um=0,Fm=0,Wm="object"==typeof performance&&performance.now?performance:Date,$m="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Gm(){return Um||($m(qm),Um=Wm.now()+Fm)}function qm(){Um=0}function Km(){this._call=this._time=this._next=null}function Qm(n,e,t){var r=new Km;return r.restart(n,e,t),r}function Jm(){Um=(Xm=Wm.now())+Fm,Hm=Ym=0;try{!function(){Gm(),++Hm;for(var n,e=Rm;e;)(n=Um-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Hm}()}finally{Hm=0,function(){for(var n,e,t=Rm,r=1/0;t;)t._call?(r>t._time&&(r=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:Rm=e);Dm=n,ex(r)}(),Um=0}}function nx(){var n=Wm.now(),e=n-Xm;e>1e3&&(Fm-=e,Xm=n)}function ex(n){Hm||(Ym&&(Ym=clearTimeout(Ym)),n-Um>24?(n<1/0&&(Ym=setTimeout(Jm,n-Wm.now()-Fm)),Zm&&(Zm=clearInterval(Zm))):(Zm||(Xm=Wm.now(),Zm=setInterval(nx,1e3)),Hm=1,$m(Jm)))}function tx(n,e,t){var r=new Km;return e=null==e?0:+e,r.restart((t=>{r.stop(),n(t+e)}),e,t),r}Km.prototype=Qm.prototype={constructor:Km,restart:function(n,e,t){if("function"!=typeof n)throw new TypeError("callback is not a function");t=(null==t?Gm():+t)+(null==e?0:+e),this._next||Dm===this||(Dm?Dm._next=this:Rm=this,Dm=this),this._call=n,this._time=t,ex()},stop:function(){this._call&&(this._call=null,this._time=1/0,ex())}};var rx=og("start","end","cancel","interrupt"),ox=[];function ix(n,e,t,r,o,i){var u=n.__transition;if(u){if(t in u)return}else n.__transition={};!function(n,e,t){var r,o=n.__transition;function i(c){var l,s,f,d;if(1!==t.state)return a();for(l in o)if((d=o[l]).name===t.name){if(3===d.state)return tx(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",n,n.__data__,d.index,d.group),delete o[l]):+l<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",n,n.__data__,d.index,d.group),delete o[l])}if(tx((function(){3===t.state&&(t.state=4,t.timer.restart(u,t.delay,t.time),u(c))})),t.state=2,t.on.call("start",n,n.__data__,t.index,t.group),2===t.state){for(t.state=3,r=new Array(f=t.tween.length),l=0,s=-1;l<f;++l)(d=t.tween[l].value.call(n,n.__data__,t.index,t.group))&&(r[++s]=d);r.length=s+1}}function u(e){for(var o=e<t.duration?t.ease.call(null,e/t.duration):(t.timer.restart(a),t.state=5,1),i=-1,u=r.length;++i<u;)r[i].call(n,o);5===t.state&&(t.on.call("end",n,n.__data__,t.index,t.group),a())}function a(){for(var r in t.state=6,t.timer.stop(),delete o[e],o)return;delete n.__transition}o[e]=t,t.timer=Qm((function(n){t.state=1,t.timer.restart(i,t.delay,t.time),t.delay<=n&&i(n-t.delay)}),0,t.time)}(n,t,{name:e,index:r,group:o,on:rx,tween:ox,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function ux(n,e){var t=cx(n,e);if(t.state>0)throw new Error("too late; already scheduled");return t}function ax(n,e){var t=cx(n,e);if(t.state>3)throw new Error("too late; already running");return t}function cx(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function lx(n,e){var t,r,o,i=n.__transition,u=!0;if(i){for(o in e=null==e?null:e+"",i)(t=i[o]).name===e?(r=t.state>2&&t.state<5,t.state=6,t.timer.stop(),t.on.call(r?"interrupt":"cancel",n,n.__data__,t.index,t.group),delete i[o]):u=!1;u&&delete n.__transition}}function sx(n,e){var t,r;return function(){var o=ax(this,n),i=o.tween;if(i!==t)for(var u=0,a=(r=t=i).length;u<a;++u)if(r[u].name===e){(r=r.slice()).splice(u,1);break}o.tween=r}}function fx(n,e,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=ax(this,n),u=i.tween;if(u!==r){o=(r=u).slice();for(var a={name:e,value:t},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function dx(n,e,t){var r=n._id;return n.each((function(){var n=ax(this,r);(n.value||(n.value={}))[e]=t.apply(this,arguments)})),function(n){return cx(n,r).value[e]}}function hx(n,e){var t;return("number"==typeof e?Cm:e instanceof am?km:(t=am(e))?(e=t,km):Om)(n,e)}function vx(n){return function(){this.removeAttribute(n)}}function px(n){return function(){this.removeAttributeNS(n.space,n.local)}}function gx(n,e,t){var r,o,i=t+"";return function(){var u=this.getAttribute(n);return u===i?null:u===r?o:o=e(r=u,t)}}function yx(n,e,t){var r,o,i=t+"";return function(){var u=this.getAttributeNS(n.space,n.local);return u===i?null:u===r?o:o=e(r=u,t)}}function mx(n,e,t){var r,o,i;return function(){var u,a,c=t(this);if(null!=c)return(u=this.getAttribute(n))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=e(r=u,c));this.removeAttribute(n)}}function xx(n,e,t){var r,o,i;return function(){var u,a,c=t(this);if(null!=c)return(u=this.getAttributeNS(n.space,n.local))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=e(r=u,c));this.removeAttributeNS(n.space,n.local)}}function wx(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}(n,o)),t}return o._value=e,o}function bx(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}(n,o)),t}return o._value=e,o}function _x(n,e){return function(){ux(this,n).delay=+e.apply(this,arguments)}}function Ex(n,e){return e=+e,function(){ux(this,n).delay=e}}function Sx(n,e){return function(){ax(this,n).duration=+e.apply(this,arguments)}}function kx(n,e){return e=+e,function(){ax(this,n).duration=e}}var Cx=my.prototype.constructor;function Mx(n){return function(){this.style.removeProperty(n)}}var Nx=0;function Ox(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function Px(){return++Nx}var jx=my.prototype;Ox.prototype={constructor:Ox,select:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=pg(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var a,c,l=r[u],s=l.length,f=i[u]=new Array(s),d=0;d<s;++d)(a=l[d])&&(c=n.call(a,a.__data__,d,l))&&("__data__"in a&&(c.__data__=a.__data__),f[d]=c,ix(f[d],e,t,d,f,cx(a,t)));return new Ox(i,this._parents,e,t)},selectAll:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=yg(n));for(var r=this._groups,o=r.length,i=[],u=[],a=0;a<o;++a)for(var c,l=r[a],s=l.length,f=0;f<s;++f)if(c=l[f]){for(var d,h=n.call(c,c.__data__,f,l),v=cx(c,t),p=0,g=h.length;p<g;++p)(d=h[p])&&ix(d,e,t,p,h,v);i.push(h),u.push(c)}return new Ox(i,u,e,t)},selectChild:jx.selectChild,selectChildren:jx.selectChildren,filter:function(n){"function"!=typeof n&&(n=mg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u=e[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new Ox(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,o=t.length,i=Math.min(r,o),u=new Array(r),a=0;a<i;++a)for(var c,l=e[a],s=t[a],f=l.length,d=u[a]=new Array(f),h=0;h<f;++h)(c=l[h]||s[h])&&(d[h]=c);for(;a<r;++a)u[a]=e[a];return new Ox(u,this._parents,this._name,this._id)},selection:function(){return new Cx(this._groups,this._parents)},transition:function(){for(var n=this._name,e=this._id,t=Px(),r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)if(u=a[l]){var s=cx(u,e);ix(u,n,t,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Ox(r,this._parents,n,t)},call:jx.call,nodes:jx.nodes,node:jx.node,size:jx.size,empty:jx.empty,each:jx.each,on:function(n,e){var t=this._id;return arguments.length<2?cx(this.node(),t).on.on(n):this.each(function(n,e,t){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||"start"===n}))}(e)?ux:ax;return function(){var u=i(this,n),a=u.on;a!==r&&(o=(r=a).copy()).on(e,t),u.on=o}}(t,n,e))},attr:function(n,e){var t=sg(n),r="transform"===t?Tm:hx;return this.attrTween(n,"function"==typeof e?(t.local?xx:mx)(t,r,dx(this,"attr."+n,e)):null==e?(t.local?px:vx)(t):(t.local?yx:gx)(t,r,e))},attrTween:function(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;var r=sg(n);return this.tween(t,(r.local?wx:bx)(r,e))},style:function(n,e,t){var r="transform"==(n+="")?Lm:hx;return null==e?this.styleTween(n,function(n,e){var t,r,o;return function(){var i=Hg(this,n),u=(this.style.removeProperty(n),Hg(this,n));return i===u?null:i===t&&u===r?o:o=e(t=i,r=u)}}(n,r)).on("end.style."+n,Mx(n)):"function"==typeof e?this.styleTween(n,function(n,e,t){var r,o,i;return function(){var u=Hg(this,n),a=t(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=Hg(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=e(r=u,a))}}(n,r,dx(this,"style."+n,e))).each(function(n,e){var t,r,o,i,u="style."+e,a="end."+u;return function(){var c=ax(this,n),l=c.on,s=null==c.value[u]?i||(i=Mx(e)):void 0;l===t&&o===s||(r=(t=l).copy()).on(a,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,e,t){var r,o,i=t+"";return function(){var u=Hg(this,n);return u===i?null:u===r?o:o=e(r=u,t)}}(n,r,e),t).on("end.style."+n,null)},styleTween:function(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(n,e,t){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}(n,i,t)),r}return i._value=e,i}(n,e,null==t?"":t))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var e=n(this);this.textContent=null==e?"":e}}(dx(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;return this.tween(e,function(n){var e,t;function r(){var r=n.apply(this,arguments);return r!==t&&(e=(t=r)&&function(n){return function(e){this.textContent=n.call(this,e)}}(r)),e}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}(this._id))},tween:function(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r,o=cx(this.node(),t).tween,i=0,u=o.length;i<u;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==e?sx:fx)(t,n,e))},delay:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?_x:Ex)(e,n)):cx(this.node(),e).delay},duration:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?Sx:kx)(e,n)):cx(this.node(),e).duration},ease:function(n){var e=this._id;return arguments.length?this.each(function(n,e){if("function"!=typeof e)throw new Error;return function(){ax(this,n).ease=e}}(e,n)):cx(this.node(),e).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,e){return function(){var t=e.apply(this,arguments);if("function"!=typeof t)throw new Error;ax(this,n).ease=t}}(this._id,n))},end:function(){var n,e,t=this,r=t._id,o=t.size();return new Promise((function(i,u){var a={value:u},c={value:function(){0==--o&&i()}};t.each((function(){var t=ax(this,r),o=t.on;o!==n&&((e=(n=o).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),t.on=e})),0===o&&i()}))},[Symbol.iterator]:jx[Symbol.iterator]};var Ix={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function Ax(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}my.prototype.interrupt=function(n){return this.each((function(){lx(this,n)}))},my.prototype.transition=function(n){var e,t;n instanceof Ox?(e=n._id,n=n._name):(e=Px(),(t=Ix).time=Gm(),n=null==n?null:n+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)(u=a[l])&&ix(u,n,e,l,a,t||Ax(u,e));return new Ox(r,this._parents,n,e)};var zx=n=>()=>n;function Lx(n,{sourceEvent:e,target:t,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Tx(n,e,t){this.k=n,this.x=e,this.y=t}Tx.prototype={constructor:Tx,scale:function(n){return 1===n?this:new Tx(this.k*n,this.x,this.y)},translate:function(n,e){return 0===n&0===e?this:new Tx(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Bx=new Tx(1,0,0);function Rx(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Bx;return n.__zoom}function Dx(n){n.stopImmediatePropagation()}function Vx(n){n.preventDefault(),n.stopImmediatePropagation()}function Hx(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function Yx(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n).hasAttribute("viewBox")?[[(n=n.viewBox.baseVal).x,n.y],[n.x+n.width,n.y+n.height]]:[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]:[[0,0],[n.clientWidth,n.clientHeight]]}function Zx(){return this.__zoom||Bx}function Xx(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Ux(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fx(n,e,t){var r=n.invertX(e[0][0])-t[0][0],o=n.invertX(e[1][0])-t[1][0],i=n.invertY(e[0][1])-t[0][1],u=n.invertY(e[1][1])-t[1][1];return n.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),u>i?(i+u)/2:Math.min(0,i)||Math.max(0,u))}Rx.prototype=Tx.prototype;var Wx,$x=function(n){return{x:n.x,y:n.y,zoom:n.k}},Gx=function(n){var e=n.x,t=n.y,r=n.zoom;return Bx.translate(e,t).scale(r)},qx=function(n,e){return n.target.closest(".".concat(e))},Kx=function(n,e){return 2===e&&Array.isArray(n)&&n.includes(2)},Qx=function(n,e){return void 0===e&&(e=0),"number"==typeof e&&e>0?n.transition().duration(e):n},Jx=function(n){var e=n.ctrlKey&&Tv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*e};function nw(n){var e=n.domNode,t=n.minZoom,r=n.maxZoom,o=n.translateExtent,i=n.viewport,u=n.onPanZoom,a=n.onPanZoomStart,c=n.onPanZoomEnd,l=n.onTransformChange,s=n.onDraggingChange,f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=function(){var n,e,t,r=Hx,o=Yx,i=Fx,u=Xx,a=Ux,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=Vm,d=og("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",Zx).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(n,e){return(e=Math.max(c[0],Math.min(c[1],e)))===n.k?n:new Tx(e,n.x,n.y)}function y(n,e,t){var r=e[0]-t[0]*n.k,o=e[1]-t[1]*n.k;return r===n.x&&o===n.y?n:new Tx(n.k,r,o)}function m(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function x(n,e,t,r){n.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=w(n,i).event(r),a=o.apply(n,i),c=null==t?m(a):"function"==typeof t?t.apply(n,i):t,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=n.__zoom,d="function"==typeof e?e.apply(n,i):e,h=f(s.invert(c).concat(l/s.k),d.invert(c).concat(l/d.k));return function(n){if(1===n)n=d;else{var e=h(n),t=l/e[2];n=new Tx(t,c[0]-e[0]*t,c[1]-e[1]*t)}u.zoom(null,n)}}))}function w(n,e,t){return!t&&n.__zooming||new b(n,e)}function b(n,e){this.that=n,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,e),this.taps=0}function _(n,...e){if(r.apply(this,arguments)){var t=w(this,e).event(n),o=this.__zoom,a=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,u.apply(this,arguments)))),s=wy(n);if(t.wheel)t.mouse[0][0]===s[0]&&t.mouse[0][1]===s[1]||(t.mouse[1]=o.invert(t.mouse[0]=s)),clearTimeout(t.wheel);else{if(o.k===a)return;t.mouse=[s,o.invert(s)],lx(this),t.start()}Vx(n),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),150),t.zoom("mouse",i(y(g(o,a),t.mouse[0],t.mouse[1]),t.extent,l))}}function E(n,...e){if(!t&&r.apply(this,arguments)){var o=n.currentTarget,u=w(this,e,!0).event(n),a=xy(n.view).on("mousemove.zoom",(function(n){if(Vx(n),!u.moved){var e=n.clientX-s,t=n.clientY-f;u.moved=e*e+t*t>h}u.event(n).zoom("mouse",i(y(u.that.__zoom,u.mouse[0]=wy(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),Cy(n.view,u.moved),Vx(n),u.event(n).end()}),!0),c=wy(n,o),s=n.clientX,f=n.clientY;ky(n.view),Dx(n),u.mouse=[c,this.__zoom.invert(c)],lx(this),u.start()}}function S(n,...e){if(r.apply(this,arguments)){var t=this.__zoom,u=wy(n.changedTouches?n.changedTouches[0]:n,this),a=t.invert(u),c=t.k*(n.shiftKey?.5:2),f=i(y(g(t,c),u,a),o.apply(this,e),l);Vx(n),s>0?xy(this).transition().duration(s).call(x,f,u,n):xy(this).call(p.transform,f,u,n)}}function k(t,...o){if(r.apply(this,arguments)){var i,u,a,c,l=t.touches,s=l.length,f=w(this,o,t.changedTouches.length===s).event(t);for(Dx(t),u=0;u<s;++u)c=[c=wy(a=l[u],this),this.__zoom.invert(c),a.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!n);n&&(n=clearTimeout(n)),i&&(f.taps<2&&(e=c[0],n=setTimeout((function(){n=null}),500)),lx(this),f.start())}}function C(n,...e){if(this.__zooming){var t,r,o,u,a=w(this,e).event(n),c=n.changedTouches,s=c.length;for(Vx(n),t=0;t<s;++t)o=wy(r=c[t],this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=o:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=o);if(r=a.that.__zoom,a.touch1){var f=a.touch0[0],d=a.touch0[1],h=a.touch1[0],v=a.touch1[1],p=(p=h[0]-f[0])*p+(p=h[1]-f[1])*p,m=(m=v[0]-d[0])*m+(m=v[1]-d[1])*m;r=g(r,Math.sqrt(p/m)),o=[(f[0]+h[0])/2,(f[1]+h[1])/2],u=[(d[0]+v[0])/2,(d[1]+v[1])/2]}else{if(!a.touch0)return;o=a.touch0[0],u=a.touch0[1]}a.zoom("touch",i(y(r,o,u),a.extent,l))}}function M(n,...r){if(this.__zooming){var o,i,u=w(this,r).event(n),a=n.changedTouches,c=a.length;for(Dx(n),t&&clearTimeout(t),t=setTimeout((function(){t=null}),500),o=0;o<c;++o)i=a[o],u.touch0&&u.touch0[2]===i.identifier?delete u.touch0:u.touch1&&u.touch1[2]===i.identifier&&delete u.touch1;if(u.touch1&&!u.touch0&&(u.touch0=u.touch1,delete u.touch1),u.touch0)u.touch0[1]=this.__zoom.invert(u.touch0[0]);else if(u.end(),2===u.taps&&(i=wy(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var l=xy(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return p.transform=function(n,e,t,r){var o=n.selection?n.selection():n;o.property("__zoom",Zx),n!==o?x(n,e,t,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(n,e,t,r){p.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),t,r)},p.scaleTo=function(n,e,t,r){p.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,u=null==t?m(n):"function"==typeof t?t.apply(this,arguments):t,a=r.invert(u),c="function"==typeof e?e.apply(this,arguments):e;return i(y(g(r,c),u,a),n,l)}),t,r)},p.translateBy=function(n,e,t,r){p.transform(n,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof t?t.apply(this,arguments):t),o.apply(this,arguments),l)}),null,r)},p.translateTo=function(n,e,t,r,u){p.transform(n,(function(){var n=o.apply(this,arguments),u=this.__zoom,a=null==r?m(n):"function"==typeof r?r.apply(this,arguments):r;return i(Bx.translate(a[0],a[1]).scale(u.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof t?-t.apply(this,arguments):-t),n,l)}),r,u)},b.prototype={event:function(n){return n&&(this.sourceEvent=n),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(n,e){return this.mouse&&"mouse"!==n&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var e=xy(this.that).datum();d.call(n,this.that,new Lx(n,{sourceEvent:this.sourceEvent,target:p,type:n,transform:this.that.__zoom,dispatch:d}),e)}},p.wheelDelta=function(n){return arguments.length?(u="function"==typeof n?n:zx(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:zx(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:zx(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:zx([[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]]),p):o},p.scaleExtent=function(n){return arguments.length?(c[0]=+n[0],c[1]=+n[1],p):[c[0],c[1]]},p.translateExtent=function(n){return arguments.length?(l[0][0]=+n[0][0],l[1][0]=+n[1][0],l[0][1]=+n[0][1],l[1][1]=+n[1][1],p):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},p.constrain=function(n){return arguments.length?(i=n,p):i},p.duration=function(n){return arguments.length?(s=+n,p):s},p.interpolate=function(n){return arguments.length?(f=n,p):f},p.on=function(){var n=d.on.apply(d,arguments);return n===d?p:n},p.clickDistance=function(n){return arguments.length?(h=(n=+n)*n,p):Math.sqrt(h)},p.tapDistance=function(n){return arguments.length?(v=+n,p):v},p}().scaleExtent([t,r]).translateExtent(o),v=xy(e).call(h);x({x:i.x,y:i.y,zoom:kv(i.zoom,t,r)},[[0,0],[d.width,d.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,e){v&&(null==h||h.transform(Qx(v,null==e?void 0:e.duration),n))}function m(){h.on("zoom",null)}function x(n,e,t){var r=Gx(n),o=null==h?void 0:h.constrain()(r,e,t);return o&&y(o),o}return h.wheelDelta(Jx),{update:function(n){var e=n.noWheelClassName,t=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,d=n.panOnDrag,y=n.panOnScrollMode,x=n.panOnScrollSpeed,w=n.preventScrolling,b=n.zoomOnPinch,_=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!f.isZoomingOrPanning&&m();var C=!i||S||o?function(n){var e=n.noWheelClassName,t=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!t&&"wheel"===n.type&&!n.ctrlKey||qx(n,e))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:e,preventScrolling:w,d3ZoomHandler:p}):function(n){var e=n.zoomPanValues,t=n.noWheelClassName,r=n.d3Selection,o=n.d3Zoom,i=n.panOnScrollMode,u=n.panOnScrollSpeed,a=n.zoomOnPinch,c=n.onPanZoomStart,l=n.onPanZoom,s=n.onPanZoomEnd;return function(n){if(qx(n,t))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=wy(n),h=Jx(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===exports.PanOnScrollMode.Vertical?0:n.deltaX*p,y=i===exports.PanOnScrollMode.Horizontal?0:n.deltaY*p;!Tv()&&n.shiftKey&&i!==exports.PanOnScrollMode.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=$x(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,null==c||c(n,m)),e.isPanScrolling&&(null==l||l(n,m),e.panScrollTimeout=setTimeout((function(){null==s||s(n,m),e.isPanScrolling=!1}),150))}}}({zoomPanValues:f,noWheelClassName:e,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:x,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var M=function(n){var e=n.zoomPanValues,t=n.onDraggingChange,r=n.onPanZoomStart;return function(n){var o,i,u;if(!(null===(o=n.sourceEvent)||void 0===o?void 0:o.internal)){var a=$x(n.transform);e.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,"mousedown"===(null===(u=n.sourceEvent)||void 0===u?void 0:u.type)&&t(!0),r&&(null==r||r(n.sourceEvent,a))}}}({zoomPanValues:f,onDraggingChange:s,onPanZoomStart:a});h.on("start",M);var N=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var u,a,c;e.usedRightMouseButton=!(!r||!Kx(t,null!==(u=e.mouseButton)&&void 0!==u?u:0)),(null===(a=n.sourceEvent)||void 0===a?void 0:a.sync)||o([n.transform.x,n.transform.y,n.transform.k]),i&&!(null===(c=n.sourceEvent)||void 0===c?void 0:c.internal)&&(null==i||i(n.sourceEvent,$x(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",N);var O=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.panOnScroll,o=n.onDraggingChange,i=n.onPanZoomEnd,u=n.onPaneContextMenu;return function(n){var a,c,l,s;if(!(null===(a=n.sourceEvent)||void 0===a?void 0:a.internal)&&(e.isZoomingOrPanning=!1,u&&Kx(t,null!==(c=e.mouseButton)&&void 0!==c?c:0)&&!e.usedRightMouseButton&&n.sourceEvent&&u(n.sourceEvent),e.usedRightMouseButton=!1,o(!1),i&&(l=e.prevViewport,s=n.transform,l.x!==s.x||l.y!==s.y||l.zoom!==s.k))){var f=$x(n.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout((function(){null==i||i(n.sourceEvent,f)}),r?150:0)}}}({zoomPanValues:f,panOnDrag:d,panOnScroll:i,onPaneContextMenu:r,onPanZoomEnd:c,onDraggingChange:s});h.on("end",O)}var P=function(n){var e=n.zoomActivationKeyPressed,t=n.zoomOnScroll,r=n.zoomOnPinch,o=n.panOnDrag,i=n.panOnScroll,u=n.zoomOnDoubleClick,a=n.userSelectionActive,c=n.noWheelClassName,l=n.noPanClassName,s=n.lib;return function(n){var f=e||t,d=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(qx(n,"".concat(s,"-flow__node"))||qx(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(qx(n,c)&&"wheel"===n.type)return!1;if(qx(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!e))return!1;if(!r&&n.ctrlKey&&"wheel"===n.type)return!1;if(!f&&!i&&!d&&"wheel"===n.type)return!1;if(!o&&("mousedown"===n.type||"touchstart"===n.type))return!1;if(Array.isArray(o)&&!o.includes(n.button)&&"mousedown"===n.type)return!1;var h=Array.isArray(o)&&o.includes(n.button)||!n.button||n.button<=1;return(!n.ctrlKey||"wheel"===n.type)&&h}}({zoomActivationKeyPressed:S,panOnDrag:d,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:b,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:k});h.filter(P),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,e){var t=Gx(n);return y(t,e),t},setViewportConstrained:x,getViewport:function(){var n=v?Rx(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,e){v&&(null==h||h.scaleTo(Qx(v,null==e?void 0:e.duration),n))},scaleBy:function(n,e){v&&(null==h||h.scaleBy(Qx(v,null==e?void 0:e.duration),n))},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var e=Gx(n),t=v.property("__zoom");t.k===n.zoom&&t.x===n.x&&t.y===n.y||null==h||h.transform(v,e,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(Wx||(Wx={}));L(L({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var ew=cv();function tw(e,t){var r=n.useContext(A);if(null===r)throw new Error(ew);return j(r,e,t)}function rw(){var e=n.useContext(A);if(null===e)throw new Error(ew);return n.useMemo((function(){return{getState:e.getState,setState:e.setState,subscribe:e.subscribe}}),[e])}function ow(n,e){var r,o,i;void 0===e&&(e={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var c=(null==e?void 0:e.elevateNodesOnSelect)?1e3:0;try{for(var l=u(n),s=l.next();!s.done;s=l.next()){var f=a(s.value,2)[1],d=f.parentId;if(d){if(!n.has(d))throw new Error("Parent node ".concat(d," not found"));var h=n.get(d),v=iw(f,n,t(t({},f.position),{z:(hw(f.zIndex)?f.zIndex:0)+(f.selected?c:0)}),null!==(i=null==h?void 0:h.origin)&&void 0!==i?i:e.nodeOrigin),p=v.x,g=v.y,y=v.z,m=f.internals.positionAbsolute,x=p!==m.x||g!==m.y;(x||y!==f.internals.z)&&(f.internals=t(t({},f.internals),{positionAbsolute:x?{x:p,y:g}:m,z:y}))}}}catch(n){r={error:n}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}}function iw(n,e,t,r){var o,i,u,a,c,l;if(void 0===r&&(r=[0,0]),!n.parentId)return t;var s=e.get(n.parentId),f=uw(s,r).position;return iw(s,e,{x:(null!==(o=t.x)&&void 0!==o?o:0)+f.x,y:(null!==(i=t.y)&&void 0!==i?i:0)+f.y,z:(null!==(u=s.internals.z)&&void 0!==u?u:0)>(null!==(a=t.z)&&void 0!==a?a:0)?null!==(c=s.internals.z)&&void 0!==c?c:0:null!==(l=t.z)&&void 0!==l?l:0},s.origin||r)}var uw=function(n,e){void 0===e&&(e=[0,0]);var t=dw(n),r=t.width,o=t.height,i=("internals"in n?n.internals.positionAbsolute:n.position)||{x:0,y:0},u=n.origin||e,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}};function aw(n,e,t){var r,o;n.clear(),e.clear();try{for(var i=u(t),a=i.next();!a.done;a=i.next()){var c=a.value,l=c.source,s=c.target,f=c.sourceHandle,d=void 0===f?null:f,h=c.targetHandle,v=void 0===h?null:h,p="".concat(l,"-source-").concat(d),g="".concat(s,"-target-").concat(v),y=n.get(p)||new Map,m=n.get(g)||new Map,x={edgeId:c.id,source:l,target:s,sourceHandle:d,targetHandle:v};e.set(c.id,c),n.set(p,y.set("".concat(s,"-").concat(v),x)),n.set(g,m.set("".concat(l,"-").concat(d),x))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}function cw(n,e,r,o){void 0===o&&(o={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var i=new Map(e);e.clear(),r.clear();var u=(null==o?void 0:o.elevateNodesOnSelect)?1e3:0;n.forEach((function(n){var a,c,l,s,f=i.get(n.id);if(o.checkEquality&&n===(null==f?void 0:f.internals.userNode)||(f=t(t(t({},o.defaults),n),{measured:{width:null!==(c=null===(a=n.measured)||void 0===a?void 0:a.width)&&void 0!==c?c:0,height:null!==(s=null===(l=n.measured)||void 0===l?void 0:l.height)&&void 0!==s?s:0},internals:{positionAbsolute:n.position||{x:0,y:0},handleBounds:null==f?void 0:f.internals.handleBounds,z:(hw(n.zIndex)?n.zIndex:0)+(n.selected?u:0),userNode:n}})),e.set(n.id,f),n.parentId){var d=r.get(n.parentId);d?d.push(f):r.set(n.parentId,[f])}})),r.size>0&&ow(e,o)}function lw(n,e,t,r){var o,i,a,c,l,s=[],f=new Map;try{for(var d=u(n),h=d.next();!h.done;h=d.next()){var v=h.value,p=e.get(v.parentId);if(p){var g=null!==(c=null===(a=f.get(v.parentId))||void 0===a?void 0:a.expandedRect)&&void 0!==c?c:gw(p,null!==(l=p.origin)&&void 0!==l?l:r),y=ww(g,v.rect);f.set(v.parentId,{expandedRect:y,parent:p})}}}catch(n){o={error:n}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}return f.size>0&&f.forEach((function(e,r){var o=e.expandedRect,i=e.parent,u=uw(i,i.origin).position,a=dw(i),c=o.x<u.x?Math.round(Math.abs(u.x-o.x)):0,l=o.y<u.y?Math.round(Math.abs(u.y-o.y)):0;if(c>0||l>0){s.push({id:r,type:"position",position:{x:u.x-c,y:u.y-l}});var f=t.get(r);null==f||f.forEach((function(e){n.some((function(n){return n.id===e.id}))||s.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+l}})}))}(a.width<o.width||a.height<o.height)&&s.push({id:r,type:"dimensions",setAttributes:!0,dimensions:{width:Math.max(a.width,Math.round(o.width)),height:Math.max(a.height,Math.round(o.height))}})})),s}var sw=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},fw=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:sw(n.x,e[0][0],e[1][0]),y:sw(n.y,e[0][1],e[1][1])}};function dw(n){var e,t,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var hw=function(n){return!isNaN(n)&&isFinite(n)},vw=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},pw=function(n,e,t,r){var o=n.x,i=n.y,u=a(e,3),c=u[0],l=u[1],s=u[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var f={x:(o-c)/s,y:(i-l)/s};return t?vw(f,r):f},gw=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=uw(n,e).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0,height:null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0}},yw=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},mw=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},xw=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},ww=function(n,e){return xw(yw(mw(n),mw(e)))};function bw(e){return n.forwardRef(e)}var _w=function(n,e){var t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),r=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*r)},Ew=function(n,e,t,r,o,i){var u=e/(n.width*(1+i)),a=t/(n.height*(1+i)),c=Math.min(u,a),l=sw(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}};function Sw(n){return void 0!==n&&"parent"!==n}var kw=function(n){return Cw(n)},Cw=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};var Mw=function(n){return hw(n.width)&&hw(n.height)&&hw(n.x)&&hw(n.y)},Nw=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},Ow=["INPUT","SELECT","TEXTAREA"];function Pw(n){var e,t,r=(null===(t=null===(e=n.composedPath)||void 0===e?void 0:e.call(n))||void 0===t?void 0:t[0])||n.target;return Ow.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var jw=function(n){return"clientX"in n},Iw=function(n,e){var t,r,o,i,u=jw(n),a=u?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}},Aw=function(n,e,r,o){void 0===o&&(o=[0,0]);var i=e.querySelectorAll(n);if(!i||!i.length)return null;var u=Array.from(i),a=e.getBoundingClientRect(),c=a.width*o[0],l=a.height*o[1];return u.map((function(n){var e=n.getBoundingClientRect();return t({id:n.getAttribute("data-handleid"),position:n.getAttribute("data-handlepos"),x:(e.left-a.left-c)/r,y:(e.top-a.top-l)/r},Nw(n))}))},zw="undefined"!=typeof document?document:null;function Lw(e,t){void 0===e&&(e=null),void 0===t&&(t={target:zw,actInsideInputWithModifier:!0});var r=a(n.useState(!1),2),o=r[0],i=r[1],u=n.useRef(!1),l=n.useRef(new Set([])),s=a(n.useMemo((function(){if(null!==e){var n=(Array.isArray(e)?e:[e]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),t=n.reduce((function(n,e){return n.concat.apply(n,c([],a(e),!1))}),[]);return[n,t]}return[[],[]]}),[e]),2),f=s[0],d=s[1];return n.useEffect((function(){var n=(null==t?void 0:t.target)||zw;if(null!==e){var r=function(n){if(u.current=n.ctrlKey||n.metaKey||n.shiftKey,(!u.current||u.current&&!t.actInsideInputWithModifier)&&Pw(n))return!1;var e=Bw(n.code,d);l.current.add(n[e]),Tw(f,l.current,!1)&&(n.preventDefault(),i(!0))},o=function(n){if((!u.current||u.current&&!t.actInsideInputWithModifier)&&Pw(n))return!1;var e=Bw(n.code,d);Tw(f,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(n[e]),"Meta"===n.key&&l.current.clear(),u.current=!1},a=function(){l.current.clear(),i(!1)};return null==n||n.addEventListener("keydown",r),null==n||n.addEventListener("keyup",o),window.addEventListener("blur",a),window.addEventListener("contextmenu",a),function(){null==n||n.removeEventListener("keydown",r),null==n||n.removeEventListener("keyup",o),window.removeEventListener("blur",a),window.removeEventListener("contextmenu",a)}}}),[e,i]),o}function Tw(n,e,t){return n.filter((function(n){return t||n.length===e.size})).some((function(n){return n.every((function(n){return e.has(n)}))}))}function Bw(n,e){return e.includes(n)?"code":"key"}function Rw(n,e){if(Object.is(n,e))return!0;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[t,r]of n)if(!Object.is(r,e.get(t)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}var Dw={position:"absolute",width:"100%",height:"100%",top:0,left:0};var Vw=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function Hw(e){var t=e.onPaneContextMenu,r=e.zoomOnScroll,o=void 0===r||r,i=e.zoomOnPinch,u=void 0===i||i,a=e.panOnScroll,c=void 0!==a&&a,l=e.panOnScrollSpeed,s=void 0===l?.5:l,f=e.panOnScrollMode,d=void 0===f?exports.PanOnScrollMode.Free:f,h=e.zoomOnDoubleClick,v=void 0===h||h,g=e.panOnDrag,y=void 0===g||g,m=e.defaultViewport,x=e.translateExtent,w=e.zoomActivationKeyCode,b=e.preventScrolling,_=void 0===b||b,E=e.children,S=e.noWheelClassName,k=e.noPanClassName,C=e.onViewportChange,M=e.isControlledViewport,N=rw(),O=n.useRef(null),P=tw(Vw,Rw),j=P.userSelectionActive,I=P.lib,A=Lw(w),z=n.useRef();return function(e){var t=rw();n.useEffect((function(){var n=function(){var n,r;if(!e.current)return!1;var o=Nw(e.current);0!==o.height&&0!==o.width||null===(r=(n=t.getState()).onError)||void 0===r||r.call(n,"004",sv()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);var r=new ResizeObserver((function(){return n()}));return r.observe(e.current),function(){window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}}),[])}(O),n.useEffect((function(){if(O.current){var n=N.getState();z.current=nw({domNode:O.current,minZoom:n.minZoom,maxZoom:n.maxZoom,translateExtent:x,viewport:m,onTransformChange:function(n){null==C||C({x:n[0],y:n[1],zoom:n[2]}),M||N.setState({transform:n})},onDraggingChange:function(n){return N.setState({paneDragging:n})},onPanZoomStart:function(n,e){var t=N.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(n,e),null==r||r(e)},onPanZoom:function(n,e){var t=N.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(n,e),null==r||r(e)},onPanZoomEnd:function(n,e){var t=N.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(n,e),null==r||r(e)}});var e=z.current.getViewport(),t=e.x,r=e.y,o=e.zoom;return N.setState({panZoom:z.current,transform:[t,r,o],domNode:O.current.closest(".ink-flow")}),function(){var n;null===(n=z.current)||void 0===n||n.destroy()}}}),[]),n.useEffect((function(){var n;null===(n=z.current)||void 0===n||n.update({onPaneContextMenu:t,zoomOnScroll:o,zoomOnPinch:u,panOnScroll:c,panOnScrollSpeed:s,panOnScrollMode:d,zoomOnDoubleClick:v,panOnDrag:y,zoomActivationKeyPressed:A,preventScrolling:_,noPanClassName:k,userSelectionActive:j,noWheelClassName:S,lib:I})}),[t,o,u,c,s,d,v,y,A,_,k,j,S,I]),p.jsx("div",{className:"ink-flow__renderer",ref:O,style:Dw,children:E})}var Yw={actInsideInputWithModifier:!1};function Zw(n,e){switch(n.type){case"select":e.selected=n.selected;break;case"position":void 0!==n.position&&(e.position=n.position),void 0!==n.dragging&&(e.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(e.measured={width:n.dimensions.width,height:n.dimensions.height},n.setAttributes&&(e.width=n.dimensions.width,e.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(e.resizing=n.resizing)}}function Xw(n,e){var r,o,i,a,c,l,s=[],f=new Map;try{for(var d=u(n),h=d.next();!h.done;h=d.next()){if("add"!==(_=h.value).type)if("remove"===_.type||"replace"===_.type)f.set(_.id,[_]);else{var v=f.get(_.id);v?v.push(_):f.set(_.id,[_])}else s.push(_.item)}}catch(n){r={error:n}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}try{for(var p=u(e),g=p.next();!g.done;g=p.next()){var y=g.value,m=f.get(y.id);if(m){if("remove"!==m[0].type)if("replace"!==m[0].type){var x=t({},y);try{for(var w=(c=void 0,u(m)),b=w.next();!b.done;b=w.next()){var _;Zw(_=b.value,x)}}catch(n){c={error:n}}finally{try{b&&!b.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}s.push(x)}else s.push(t({},m[0].item))}else s.push(y)}}catch(n){i={error:n}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return s}function Uw(n,e){return{id:n,type:"select",selected:e}}function Fw(n,e,t){var r,o;void 0===e&&(e=new Set),void 0===t&&(t=!1);var i=[];try{for(var c=u(n),l=c.next();!l.done;l=c.next()){var s=a(l.value,2),f=s[0],d=s[1],h=e.has(f);void 0===d.selected&&!h||d.selected===h||(t&&(d.selected=h),i.push(Uw(d.id,h)))}}catch(n){r={error:n}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}return i}function Ww(n){var e,t,r,o,i,c,l=n.items,s=void 0===l?[]:l,f=n.lookup,d=[],h=new Map(s.map((function(n){return[n.id,n]})));try{for(var v=u(s),p=v.next();!p.done;p=v.next()){var g=p.value,y=f.get(g.id),m=null!==(c=null===(i=null==y?void 0:y.internals)||void 0===i?void 0:i.userNode)&&void 0!==c?c:y;void 0!==m&&m!==g&&d.push({id:g.id,item:g,type:"replace"}),void 0===m&&d.push({item:g,type:"add"})}}catch(n){e={error:n}}finally{try{p&&!p.done&&(t=v.return)&&t.call(v)}finally{if(e)throw e.error}}try{for(var x=u(f),w=x.next();!w.done;w=x.next()){var b=a(w.value,1)[0];void 0===h.get(b)&&d.push({id:b,type:"remove"})}}catch(n){r={error:n}}finally{try{w&&!w.done&&(o=x.return)&&o.call(x)}finally{if(r)throw r.error}}return d}function $w(n){return{id:n.id,type:"remove"}}var Gw=function(n,e){void 0===e&&(e=[0,0]);var t=dw(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||e,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},qw=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=uw(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}}(t,e.nodeOrigin);return yw(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xw(t)},Kw=function(n,e,r,o,i,c){var l,s,f,d,h,v,p,g,y=a(void 0===r?[0,0,1]:r,3),m=y[0],x=y[1],w=y[2];void 0===o&&(o=!1),void 0===i&&(i=!1),void 0===c&&(c=[0,0]);var b=t(t({},pw(e,[m,x,w])),{width:e.width/w,height:e.height/w}),_=[];try{for(var E=u(n),S=E.next();!S.done;S=E.next()){var k=a(S.value,2)[1],C=k.measured,M=k.selectable,N=void 0===M||M,O=k.hidden,P=void 0!==O&&O,j=null!==(h=null!==(d=null!==(f=C.width)&&void 0!==f?f:k.width)&&void 0!==d?d:k.initialWidth)&&void 0!==h?h:null,I=null!==(g=null!==(p=null!==(v=C.height)&&void 0!==v?v:k.height)&&void 0!==p?p:k.initialHeight)&&void 0!==g?g:null;if(!(i&&!N||P)){var A=_w(b,gw(k,c));(null===j||null===I||o&&A>0||A>=(null!=j?j:0)*(null!=I?I:0)||k.dragging)&&_.push(k)}}}catch(n){l={error:n}}finally{try{S&&!S.done&&(s=E.return)&&s.call(E)}finally{if(l)throw l.error}}return _};function Qw(n,e){var t,r,o,i=n.nodeLookup,u=n.width,a=n.height,c=n.panZoom,l=n.minZoom,s=n.maxZoom,f=n.nodeOrigin,d=void 0===f?[0,0]:f,h=[],v=(null==e?void 0:e.nodes)?new Set(e.nodes.map((function(n){return n.id}))):null;if(i.forEach((function(n){!(n.measured.width&&n.measured.height&&((null==e?void 0:e.includeHiddenNodes)||!n.hidden))||v&&!v.has(n.id)||h.push(n)})),h.length>0){var p=qw(h,{nodeOrigin:d}),g=p.width>=u||p.height>=a;if("overflow"===(null==e?void 0:e.when)&&!g)return!0;var y=Ew(p,u,a,null!==(t=null==e?void 0:e.minZoom)&&void 0!==t?t:l,null!==(r=null==e?void 0:e.maxZoom)&&void 0!==r?r:s,null!==(o=null==e?void 0:e.padding)&&void 0!==o?o:.1);return c.setViewport(y,{duration:null==e?void 0:e.duration}),!0}return!1}function Jw(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?Gw(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Sw(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,x=f+v*m[0],w=d+p*m[1];h=[[x,w],[x+g-v,w+y-p]]}}else null==a||a("005",fv());var b=Sw(h)?fw(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}function nb(n){return o(this,arguments,void 0,(function(n){var e,t,r,o,a,c,l,s,f,d,h,v,p,g,y,m,x,w,b,_=n.nodesToRemove,E=void 0===_?[]:_,S=n.edgesToRemove,k=void 0===S?[]:S,C=n.nodes,M=n.edges,N=n.onBeforeDelete;return i(this,(function(n){switch(n.label){case 0:e=new Set(E.map((function(n){return n.id}))),t=[],r=function(n){if(!1===n.deletable)return"continue";var r=e.has(n.id),o=!r&&n.parentId&&t.find((function(e){return e.id===n.parentId}));(r||o)&&t.push(n)};try{for(o=u(C),a=o.next();!a.done;a=o.next())c=a.value,r(c)}catch(n){m={error:n}}finally{try{a&&!a.done&&(x=o.return)&&x.call(o)}finally{if(m)throw m.error}}l=new Set(k.map((function(n){return n.id}))),s=M.filter((function(n){return!1!==n.deletable})),f=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))}(t,s),d=f,h=function(n){l.has(n.id)&&!d.find((function(e){return e.id===n.id}))&&d.push(n)};try{for(v=u(s),p=v.next();!p.done;p=v.next())g=p.value,h(g)}catch(n){w={error:n}}finally{try{p&&!p.done&&(b=v.return)&&b.call(v)}finally{if(w)throw w.error}}return N?[4,N({nodes:t,edges:d})]:[2,{edges:d,nodes:t}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:d,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var eb=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function tb(){var n=tw(eb,Rw),e=n.userSelectionActive,t=n.userSelectionRect;return e&&t?p.jsx("div",{className:"ink-flow__selection ink-flow__container",style:{width:t.width,height:t.height,transform:"translate(".concat(t.x,"px, ").concat(t.y,"px)")}}):null}var rb=function(n,e){return function(t){t.target===e.current&&(null==n||n(t))}},ob=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function ib(e){var t=e.isSelecting;e.selectionMode;var r=e.panOnDrag,o=e.onSelectionStart,i=e.onSelectionEnd,c=e.onPaneClick,l=e.onPaneContextMenu,s=e.onPaneScroll,f=e.onPaneMouseEnter,d=e.onPaneMouseMove,h=e.onPaneMouseLeave,v=e.children,g=n.useRef(null),y=rw(),m=n.useRef(0),x=n.useRef(0),b=n.useRef(),_=n.useRef(new Map),E=tw(ob,Rw),S=E.userSelectionActive,k=E.elementsSelectable,C=E.dragging,M=function(){y.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,x.current=0},N=function(n){null==c||c(n),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},O=s?function(n){return s(n)}:void 0,P=k&&(t||S);return p.jsxs("div",{className:w(["ink-flow__pane",{draggable:r,dragging:C,selection:t}]),onClick:P?void 0:rb(N,g),onContextMenu:rb((function(n){Array.isArray(r)&&(null==r?void 0:r.includes(2))?n.preventDefault():null==l||l(n)}),g),onWheel:rb(O,g),onMouseEnter:P?void 0:f,onMouseDown:P?function(n){var e,r,i,c,l=y.getState(),s=l.resetSelectedElements,f=l.domNode,d=l.edgeLookup;if(b.current=null==f?void 0:f.getBoundingClientRect(),k&&t&&0===n.button&&n.target===g.current&&b.current){_.current=new Map;try{for(var h=u(d),v=h.next();!v.done;v=h.next()){var p=a(v.value,2),m=p[0],x=p[1];_.current.set(x.source,(null===(i=_.current.get(x.source))||void 0===i?void 0:i.add(m))||new Set([m])),_.current.set(x.target,(null===(c=_.current.get(x.target))||void 0===c?void 0:c.add(m))||new Set([m]))}}catch(n){e={error:n}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}var w=Iw(n.nativeEvent,b.current),E=w.x,S=w.y;s(),y.setState({userSelectionRect:{width:0,height:0,startX:E,startY:S,x:E,y:S}}),null==o||o(n)}}:void 0,onMouseMove:P?function(n){var e,r,o,i,a=y.getState(),c=a.userSelectionRect,l=a.edgeLookup,s=a.transform,f=a.nodeOrigin,d=a.nodeLookup,h=a.triggerNodeChanges,v=a.triggerEdgeChanges;if(t&&b.current&&c){var p=Iw(n.nativeEvent,b.current),g=p.x,w=p.y,E=c.startX,S=c.startY,k={startX:E,startY:S,x:g<E?g:E,y:w<S?w:S,width:Math.abs(g-E),height:Math.abs(w-S)},C=Kw(d,k,s,!1,!0,f),M=new Set,N=new Set;try{for(var O=u(C),P=O.next();!P.done;P=O.next()){var j=P.value;N.add(j.id);var I=_.current.get(j.id);if(I)try{for(var A=(o=void 0,u(I)),z=A.next();!z.done;z=A.next()){var L=z.value;M.add(L)}}catch(n){o={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(n){e={error:n}}finally{try{P&&!P.done&&(r=O.return)&&r.call(O)}finally{if(e)throw e.error}}if(m.current!==N.size)m.current=N.size,h(Fw(d,N,!0));if(x.current!==M.size)x.current=M.size,v(Fw(l,M));y.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:d,onMouseUp:P?function(n){if(0===n.button){var e=y.getState().userSelectionRect;!S&&e&&n.target===g.current&&(null==N||N(n)),y.setState({nodesSelectionActive:m.current>0}),M(),null==i||i(n)}}:void 0,onMouseLeave:P?function(n){S&&(y.setState({nodesSelectionActive:m.current>0}),null==i||i(n)),M()}:h,ref:g,style:Dw,children:[v,p.jsx(tb,{})]})}var ub=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function ab(e){var t=e.children,r=e.onPaneClick,o=e.onPaneMouseEnter,i=e.onPaneMouseMove,u=e.onPaneMouseLeave,a=e.onPaneContextMenu,c=e.onPaneScroll,l=e.deleteKeyCode,s=e.selectionKeyCode,f=e.selectionOnDrag,d=e.selectionMode,h=e.onSelectionStart,v=e.onSelectionEnd,g=e.multiSelectionKeyCode,y=e.panActivationKeyCode,m=e.zoomActivationKeyCode,x=e.elementsSelectable,w=e.zoomOnScroll,b=e.zoomOnPinch,_=e.panOnScroll,E=e.panOnScrollSpeed,S=e.panOnScrollMode,k=e.zoomOnDoubleClick,C=e.panOnDrag,M=e.defaultViewport,N=e.translateExtent,O=e.minZoom,P=e.maxZoom,j=e.preventScrolling;e.onSelectionContextMenu;var I=e.noWheelClassName,A=e.noPanClassName;e.disableKeyboardA11y;var z=e.onViewportChange,L=e.isControlledViewport,T=tw(ub);T.nodesSelectionActive;var B=T.userSelectionActive,R=Lw(s),D=Lw(y),V=D||C,H=D||_,Y=R||B||f&&!0!==V;return function(e){var t=e.deleteKeyCode,r=e.multiSelectionKeyCode,o=rw(),i=Lw(t,Yw),u=Lw(r);n.useEffect((function(){if(i){var n=o.getState();n.edges,n.nodes,o.setState({nodesSelectionActive:!1})}}),[i]),n.useEffect((function(){o.setState({multiSelectionActive:u})}),[u])}({deleteKeyCode:l,multiSelectionKeyCode:g}),p.jsx(Hw,{onPaneContextMenu:a,elementsSelectable:x,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:E,panOnScrollMode:S,zoomOnDoubleClick:k,panOnDrag:!R&&V,defaultViewport:M,translateExtent:N,minZoom:O,maxZoom:P,zoomActivationKeyCode:m,preventScrolling:j,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:L,children:p.jsx(ib,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:d,children:t})})}ab.displayName="FlowRenderer";var cb=n.memo(ab);var lb="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function sb(e){var t=a(n.useState(!1),2),r=t[0],o=t[1],i=a(n.useState((function(){return function(n){var e=[];return{get:function(){return e},reset:function(){e=[]},push:function(t){e.push(t),n()}}}((function(){return o(!0)}))})),1),u=i[0];return lb((function(){if(r){var n=u.get();n.length&&(e(n),u.reset()),o(!1)}else u.reset()}),[r]),u}var fb=n.createContext(null);function db(e){var t=e.children,r=rw(),o=n.useCallback((function(n){var e,t,o=r.getState(),i=o.nodes,a=void 0===i?[]:i,c=o.onNodesChange,l=o.nodeLookup,s=a;try{for(var f=u(n),d=f.next();!d.done;d=f.next()){var h=d.value;s="function"==typeof h?h(s):h}}catch(n){e={error:n}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}c&&c({changes:Ww({items:s,lookup:l}),userNodes:s})}),[]),i=sb(o),a=n.useCallback((function(n){var e,t,o=r.getState(),i=o.edges,a=void 0===i?[]:i,c=o.onEdgesChange,l=o.edgeLookup,s=a;try{for(var f=u(n),d=f.next();!d.done;d=f.next()){var h=d.value;s="function"==typeof h?h(s):h}}catch(n){e={error:n}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}c&&c({changes:Ww({items:s,lookup:l}),userEdges:s})}),[]),c=sb(a),l=n.useMemo((function(){return{nodeQueue:i,edgeQueue:c}}),[]);return p.jsx(fb.Provider,{value:l,children:t})}var hb=function(){var e=rw();return n.useMemo((function(){return{zoomIn:function(n){var t;return null===(t=e.getState().panZoom)||void 0===t?void 0:t.scaleBy(1.2,{duration:null==n?void 0:n.duration})},zoomOut:function(n){var t;return null===(t=e.getState().panZoom)||void 0===t?void 0:t.scaleBy(1/1.2,{duration:null==n?void 0:n.duration})},zoomTo:function(n,t){var r;return null===(r=e.getState().panZoom)||void 0===r?void 0:r.scaleTo(n,{duration:null==t?void 0:t.duration})},getZoom:function(){return e.getState().transform[2]},setViewport:function(n,t){var r,o,i,u=e.getState(),c=a(u.transform,3),l=c[0],s=c[1],f=c[2],d=u.panZoom;null==d||d.setViewport({x:null!==(r=n.x)&&void 0!==r?r:l,y:null!==(o=n.y)&&void 0!==o?o:s,zoom:null!==(i=n.zoom)&&void 0!==i?i:f},{duration:null==t?void 0:t.duration})},getViewport:function(){var n=a(e.getState().transform,3);return{x:n[0],y:n[1],zoom:n[2]}},fitView:function(n){var t=e.getState(),r=t.nodeLookup,o=t.width,i=t.height,u=t.nodeOrigin,a=t.minZoom,c=t.maxZoom,l=t.panZoom;return!!l&&Qw({nodeLookup:r,width:o,height:i,nodeOrigin:u,minZoom:a,maxZoom:c,panZoom:l},n)},setCenter:function(n,t,r){var o=e.getState(),i=o.width,u=o.height,a=o.panZoom,c=o.transform,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:c[2],s=i/2-n*l,f=u/2-t*l;null==a||a.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(n,t){var r,o=e.getState(),i=o.width,u=o.height,a=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Ew(n,i,u,a,c,null!==(r=null==t?void 0:t.padding)&&void 0!==r?r:.1);null==l||l.setViewport(s,{duration:null==t?void 0:t.duration})},screenToFlowPosition:function(n,t){void 0===t&&(t={snapToGrid:!0});var r=e.getState(),o=r.transform,i=r.snapGrid,u=r.domNode;if(!u)return n;var a=u.getBoundingClientRect(),c=a.x,l=a.y,s={x:n.x-c,y:n.y-l};return pw(s,o,t.snapToGrid,i)},flowToScreenPosition:function(n){var t=e.getState(),r=t.transform,o=t.domNode;if(!o)return n;var i=o.getBoundingClientRect(),u=i.x,c=i.y,l=function(n,e){var t=n.x,r=n.y,o=a(e,3),i=o[0],u=o[1],c=o[2];return{x:t*c+i,y:r*c+u}}(n,r);return{x:l.x+u,y:l.y+c}}}}),[])},vb=function(n){return!!n.panZoom};function pb(){var e=this,r=hb(),u=rw(),l=function(){var e=n.useContext(fb);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),s=tw(vb);console.log("yk store",u.getState());var f=n.useMemo((function(){var n=function(n){return u.getState().nodeLookup.get(n)},r=function(n){l.nodeQueue.push(n)},s=function(n){var e,r,o,i,a=u.getState(),c=a.nodeLookup,l=a.nodeOrigin,s=kw(n)?n:c.get(n.id),f=s.parentId?function(n,e,r,o){var i,u;void 0===o&&(o=[0,0]);for(var a=e,c=t({},n);a;){var l=r.get(e);if(a=null==l?void 0:l.parentId,l){var s=l.origin||o,f=(null!==(i=l.measured.width)&&void 0!==i?i:0)*s[0],d=(null!==(u=l.measured.height)&&void 0!==u?u:0)*s[1];c.x+=l.position.x-f,c.y+=l.position.y-d}}return c}(s.position,s.parentId,c,l):s.position,d={id:s.id,position:f,width:null!==(r=null===(e=s.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:s.width,height:null!==(i=null===(o=s.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:s.height,data:s.data};return gw(d)},f=function(n,e,o){void 0===o&&(o={replace:!1}),r((function(r){return r.map((function(r){if(r.id===n){var i="function"==typeof e?e(r):e;return o.replace&&kw(i)?i:t(t({},r),i)}return r}))}))};return{getNodes:function(){return u.getState().nodes.map((function(n){return t({},n)}))},getNode:function(e){var t;return null===(t=n(e))||void 0===t?void 0:t.internals.userNode},getInternalNode:n,getEdges:function(){var n=u.getState().edges;return(void 0===n?[]:n).map((function(n){return t({},n)}))},getEdge:function(n){return u.getState().edgeLookup.get(n)},setNodes:r,setEdges:function(n){l.edgeQueue.push(n)},addNodes:function(n){var e=Array.isArray(n)?n:[n];l.nodeQueue.push((function(n){return c(c([],a(n),!1),a(e),!1)}))},addEdges:function(n){var e=Array.isArray(n)?n:[n];l.edgeQueue.push((function(n){return c(c([],a(n),!1),a(e),!1)}))},toObject:function(){var n=u.getState(),e=n.nodes,r=void 0===e?[]:e,o=n.edges,i=void 0===o?[]:o,c=a(n.transform,3),l=c[0],s=c[1],f=c[2];return{nodes:r.map((function(n){return t({},n)})),edges:i.map((function(n){return t({},n)})),viewport:{x:l,y:s,zoom:f}}},deleteElements:function(n){return o(e,[n],void 0,(function(n){var e,t,r,o,a,c,l,s,f,d,h,v,p,g,y,m,x=n.nodes,w=void 0===x?[]:x,b=n.edges,_=void 0===b?[]:b;return i(this,(function(n){switch(n.label){case 0:return e=u.getState(),t=e.nodes,r=e.edges,o=e.onNodesDelete,a=e.onEdgesDelete,c=e.triggerNodeChanges,l=e.triggerEdgeChanges,s=e.onDelete,f=e.onBeforeDelete,[4,nb({nodesToRemove:w,edgesToRemove:_,nodes:t,edges:r,onBeforeDelete:f})];case 1:return d=n.sent(),h=d.nodes,v=d.edges,p=v.length>0,g=h.length>0,p&&(y=v.map($w),null==a||a(v),l(y)),g&&(m=h.map($w),null==o||o(h),c(m)),(g||p)&&(null==s||s({nodes:h,edges:v})),[2,{deletedNodes:h,deletedEdges:v}]}}))}))},getIntersectingNodes:function(n,e,t){void 0===e&&(e=!0);var r=Mw(n),o=r?n:s(n),i=void 0!==t;return o?(t||u.getState().nodes).filter((function(t){var a=u.getState().nodeLookup.get(t.id);if(a&&!r&&(t.id===n.id||!a.internals.positionAbsolute))return!1;var c=gw(i?t:a),l=_w(c,o);return e&&l>0||l>=o.width*o.height})):[]},isNodeIntersecting:function(n,e,t){void 0===t&&(t=!0);var r=Mw(n)?n:s(n);if(!r)return!1;var o=_w(r,e);return t&&o>0||o>=r.width*r.height},updateNode:f,updateNodeData:function(n,e,r){void 0===r&&(r={replace:!1}),f(n,(function(n){var o="function"==typeof e?e(n):e;return r.replace?t(t({},n),{data:o}):t(t({},n),{data:t(t({},n.data),o)})}),r)},setLayoutAnchorId:function(n){u.getState().setLayoutAnchorId(n)}}}),[]);return n.useMemo((function(){return t(t(t({},f),r),{viewportInitialized:s})}),[s])}var gb=function(n){return n.updateNodeInternals};function yb(e){var t=tw(n.useCallback(function(n){return function(e){return n?Kw(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map((function(n){return n.id})):Array.from(e.nodeLookup.keys())}}(e),[e]),Rw);return t}var mb=n.createContext(null),xb=mb.Provider;mb.Consumer;function wb(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-e),Math.abs(c-t)]}function bb(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function _b(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case exports.Position.Left:return[t-bb(t-o,u),r];case exports.Position.Right:return[t+bb(o-t,u),r];case exports.Position.Top:return[t,r-bb(r-i,u)];case exports.Position.Bottom:return[t,r+bb(i-r,u)]}}function Eb(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,u=r<e?r+i:r-i,a=Math.abs(o-t)/2;return[u,o<t?o+a:o-a,i,a]}var Sb,kb=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")};var Cb=((Sb={})[exports.Position.Left]={x:-1,y:0},Sb[exports.Position.Right]={x:1,y:0},Sb[exports.Position.Top]={x:0,y:-1},Sb[exports.Position.Bottom]={x:0,y:1},Sb),Mb=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Nb(n){var e,t,r,o,i=n.source,u=n.sourcePosition,l=void 0===u?exports.Position.Bottom:u,s=n.target,f=n.targetPosition,d=void 0===f?exports.Position.Top:f,h=n.center,v=n.offset,p=Cb[l],g=Cb[d],y={x:i.x+p.x*v,y:i.y+p.y*v},m={x:s.x+g.x*v,y:s.y+g.y*v},x=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?exports.Position.Bottom:t,o=n.target;return r===exports.Position.Left||r===exports.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:y,sourcePosition:l,target:m}),w=0!==x.x?"x":"y",b=x[w],_=[],E={x:0,y:0},S={x:0,y:0},k=a(Eb({sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}),4),C=k[0],M=k[1],N=k[2],O=k[3];if(p[w]*g[w]==-1){r=null!==(e=h.x)&&void 0!==e?e:C,o=null!==(t=h.y)&&void 0!==t?t:M;var P=[{x:r,y:y.y},{x:r,y:m.y}],j=[{x:y.x,y:o},{x:m.x,y:o}];_=p[w]===b?"x"===w?P:j:"x"===w?j:P}else{var I=[{x:y.x,y:m.y}],A=[{x:m.x,y:y.y}];if(_="x"===w?p.x===b?A:I:p.y===b?I:A,l===d){var z=Math.abs(i[w]-s[w]);if(z<=v){var L=Math.min(v-1,v-z);p[w]===b?E[w]=(y[w]>i[w]?-1:1)*L:S[w]=(m[w]>s[w]?-1:1)*L}}if(l!==d){var T="x"===w?"y":"x",B=p[w]===g[T],R=y[T]>m[T],D=y[T]<m[T];(1===p[w]&&(!B&&R||B&&D)||1!==p[w]&&(!B&&D||B&&R))&&(_="x"===w?I:A)}var V={x:y.x+E.x,y:y.y+E.y},H={x:m.x+S.x,y:m.y+S.y};Math.max(Math.abs(V.x-_[0].x),Math.abs(H.x-_[0].x))>=Math.max(Math.abs(V.y-_[0].y),Math.abs(H.y-_[0].y))?(r=(V.x+H.x)/2,o=_[0].y):(r=_[0].x,o=(V.y+H.y)/2)}return[c(c([i,{x:y.x+E.x,y:y.y+E.y}],a(_),!1),[{x:m.x+S.x,y:m.y+S.y},s],!1),r,o,N,O]}function Ob(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,c=n.targetPosition,l=void 0===c?exports.Position.Top:c,s=n.borderRadius,f=void 0===s?5:s,d=n.centerX,h=n.centerY,v=n.offset,p=a(Nb({source:{x:e,y:t},sourcePosition:o,target:{x:i,y:u},targetPosition:l,center:{x:d,y:h},offset:void 0===v?20:v}),5),g=p[0],y=p[1],m=p[2],x=p[3],w=p[4],b=g.reduce((function(n,e,t){var r="";return r=t>0&&t<g.length-1?function(n,e,t,r){var o=Math.min(Mb(n,e)/2,Mb(e,t)/2,r),i=e.x,u=e.y;if(n.x===i&&i===t.x||n.y===u&&u===t.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<t.x?-1:1,c=n.y<t.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<t.x?1:-1,s=n.y<t.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(g[t-1],e,g[t+1],f):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y),n+=r}),"");return[b,y,m,x,w]}var Pb=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var jb=n.memo(bw((function(e,o){var i,u,a=e.type,c=void 0===a?"source":a,l=e.position,s=void 0===l?exports.Position.Top:l,f=e.isValidConnection,d=e.isConnectable,h=void 0===d||d,v=e.isConnectableStart,g=void 0===v||v,y=e.isConnectableEnd,m=void 0===y||y,x=e.id,b=e.onConnect,_=e.children,E=e.className,S=e.onMouseDown,k=e.onTouchStart,C=r(e,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),M=x||null,N="target"===c,O=rw(),P=n.useContext(mb),j=tw(Pb,Rw),I=j.connectOnClick,A=j.noPanClassName,z=j.rfId,L=tw(function(n,e,t){return function(r){var o=r.connectionStartHandle,i=r.connectionEndHandle,u=r.connectionClickStartHandle,a=r.connectionMode,c=r.connectionStatus,l=(null==i?void 0:i.nodeId)===n&&(null==i?void 0:i.handleId)===e&&(null==i?void 0:i.type)===t;return{connectingFrom:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.handleId)===e&&(null==o?void 0:o.type)===t,connectingTo:l,clickConnecting:(null==u?void 0:u.nodeId)===n&&(null==u?void 0:u.handleId)===e&&(null==u?void 0:u.type)===t,isPossibleEndHandle:a===exports.ConnectionMode.Strict?(null==o?void 0:o.type)!==t:n!==(null==o?void 0:o.nodeId)||e!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(P,M,c),Rw),T=L.connectingFrom,B=L.connectingTo,R=L.clickConnecting,D=L.isPossibleEndHandle,V=L.connectionInProcess,H=L.valid;P||null===(u=(i=O.getState()).onError)||void 0===u||u.call(i,"010",vv());var Y=function(n){var e=O.getState(),r=e.defaultEdgeOptions,o=e.onConnect,i=e.hasDefaultEdges,u=t(t({},r),n);if(i){var a=O.getState(),c=a.edges;(0,a.setEdges)(function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(r="id"in(o=n)&&"source"in o&&"target"in o?t({},n):t(t({},n),{id:kb(n)}),e)?e:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,e.concat(r)):e;var r,o}(u,c))}null==o||o(u),null==b||b(u)},Z=function(n){if(P){var e=jw(n.nativeEvent);if(g&&(e&&0===n.button||!e)){var t=O.getState();Yy.onPointerDown(n.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:N,handleId:M,nodeId:P,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:Y,isValidConnection:f||t.isValidConnection,getTransform:function(){return O.getState().transform},getConnectionStartHandle:function(){return O.getState().connectionStartHandle}})}e?null==S||S(n):null==k||k(n)}};return p.jsx("div",t({"data-handleid":M,"data-nodeid":P,"data-handlepos":s,"data-id":"".concat(z,"-").concat(P,"-").concat(M,"-").concat(c),className:w(["ink-flow__handle","ink-flow__handle-".concat(s),"nodrag",A,E,{source:!N,target:N,connectable:h,connectablestart:g,connectableend:m,clickconnecting:R,connectingfrom:T,connectingto:B,valid:H,connectionindicator:h&&(!V||D)&&(V?m:g)}]),onMouseDown:Z,onTouchStart:Z,onClick:I?function(n){var e=O.getState(),t=e.onClickConnectStart,r=e.onClickConnectEnd,o=e.connectionClickStartHandle,i=e.connectionMode,u=e.isValidConnection,a=e.lib,l=e.rfId;if(P&&(o||g)){if(!o)return null==t||t(n.nativeEvent,{nodeId:P,handleId:M,handleType:c}),void O.setState({connectionClickStartHandle:{nodeId:P,type:c,handleId:M}});var s=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),d=f||u,h=Yy.isValid(n.nativeEvent,{handle:{nodeId:P,id:M,type:c},connectionMode:i,fromNodeId:o.nodeId,fromHandleId:o.handleId||null,fromType:o.type,isValidConnection:d,flowId:l,doc:s,lib:a}),v=h.connection;h.isValid&&v&&Y(v),null==r||r(n),O.setState({connectionClickStartHandle:null})}}:void 0,ref:o},C,{children:_}))})));var Ib={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ab={input:function(n){var e=n.data,t=n.isConnectable,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r;return p.jsxs(p.Fragment,{children:[null==e?void 0:e.label,p.jsx(jb,{type:"source",position:o,isConnectable:t})]})},default:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?exports.Position.Top:r,i=n.sourcePosition,u=void 0===i?exports.Position.Bottom:i;return p.jsxs(p.Fragment,{children:[p.jsx(jb,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label,p.jsx(jb,{type:"source",position:u,isConnectable:t})]})},output:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?exports.Position.Top:r;return p.jsxs(p.Fragment,{children:[p.jsx(jb,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};function zb(n){var e=n.id,t=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,u=t.getState(),a=u.addSelectedNodes,c=u.unselectNodesAndEdges,l=u.multiSelectionActive,s=u.nodeLookup,f=u.onError,d=s.get(e);d?(t.setState({nodesSelectionActive:!1}),d.selected?(o||d.selected&&l)&&(c({nodes:[d],edges:[]}),requestAnimationFrame((function(){var n;return null===(n=null==i?void 0:i.current)||void 0===n?void 0:n.blur()}))):a([e])):null==f||f("012",gv(e))}function Lb(e){var r,o=e.id,i=e.onClick,c=e.onMouseEnter,l=e.onMouseMove,s=e.onMouseLeave,f=e.onContextMenu,d=e.onDoubleClick,h=e.nodesDraggable,v=e.elementsSelectable,g=e.nodesConnectable,y=e.nodesFocusable,m=e.resizeObserver,x=e.noDragClassName,b=e.noPanClassName,_=e.disableKeyboardA11y,E=e.rfId,S=e.nodeTypes,k=e.nodeExtent,C=e.nodeOrigin,M=e.onError,N=tw((function(n){var e=n.nodeLookup.get(o),t=n.parentLookup.has(o);return{node:e,internals:e.internals,isParent:t}}),Rw),O=N.node,P=N.internals,j=N.isParent,I=O.type||"default",A=(null==S?void 0:S[I])||Ab[I];void 0===A&&(null==M||M("003",lv(I)),I="default",A=Ab.default);var z=!!(O.draggable||h&&void 0===O.draggable),L=!!(O.selectable||v&&void 0===O.selectable),T=!!(O.connectable||g&&void 0===O.connectable),B=!!(O.focusable||y&&void 0===O.focusable),R=rw(),D=function(n){var e,t,r,o,i,u;return void 0!==(null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==(null!==(u=null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:n.height)&&void 0!==u?u:n.initialHeight)}(O),V=function(e){var t=e.node,r=e.nodeType,o=e.hasDimensions,i=e.resizeObserver,u=rw(),a=n.useRef(null),c=n.useRef(null),l=n.useRef(t.sourcePosition),s=n.useRef(t.targetPosition),f=n.useRef(r),d=o&&!!t.internals.handleBounds&&!t.hidden;return n.useEffect((function(){!a.current||d&&c.current===a.current||(c.current&&(null==i||i.unobserve(c.current)),null==i||i.observe(a.current),c.current=a.current)}),[d]),n.useEffect((function(){return function(){c.current&&(null==i||i.unobserve(c.current),c.current=null)}}),[]),n.useEffect((function(){if(a.current){var n=f.current!==r,e=l.current!==t.sourcePosition,o=s.current!==t.targetPosition;(n||e||o)&&(f.current=r,l.current=t.sourcePosition,s.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:a.current,force:!0}]])))}}),[t.id,r,t.sourcePosition,t.targetPosition]),a}({node:O,nodeType:I,hasDimensions:D,resizeObserver:m}),H=function(e){var t=e.nodeRef,r=e.disabled,o=void 0!==r&&r,i=e.noDragClassName,u=e.handleSelector,c=e.nodeId,l=e.isSelectable,s=rw(),f=a(n.useState(!1),2),d=f[0],h=f[1],v=n.useRef();return n.useEffect((function(){v.current=Ty({getStoreItems:function(){return s.getState()},onNodeMouseDown:function(n){zb({id:n,store:s,nodeRef:t})},onDragStart:function(){h(!0)},onDragStop:function(){h(!1)}})}),[]),n.useEffect((function(){var n,e;if(o)null===(n=v.current)||void 0===n||n.destroy();else if(t.current)return null===(e=v.current)||void 0===e||e.update({noDragClassName:i,handleSelector:u,domNode:t.current,isSelectable:l,nodeId:c}),function(){var n;null===(n=v.current)||void 0===n||n.destroy()}}),[i,u,o,l,t,c]),d}({nodeRef:V,disabled:O.hidden||!z,noDragClassName:x,handleSelector:O.dragHandle,nodeId:o,isSelectable:L}),Y=function(){var e=rw(),t=n.useCallback((function(n){var t,r,o=e.getState(),i=o.nodeExtent,c=o.snapToGrid,l=o.snapGrid,s=o.nodesDraggable,f=o.onError,d=o.updateNodePositions,h=o.nodeLookup,v=o.nodeOrigin,p=new Map,g=function(n){return function(e){return e.selected&&(e.draggable||n&&void 0===e.draggable)}}(s),y=c?l[0]:5,m=c?l[1]:5,x=n.direction.x*y*n.factor,w=n.direction.y*m*n.factor;try{for(var b=u(h),_=b.next();!_.done;_=b.next()){var E=a(_.value,2)[1];if(g(E)){var S={x:E.internals.positionAbsolute.x+x,y:E.internals.positionAbsolute.y+w};c&&(S=vw(S,l));var k=Jw({nodeId:E.id,nextPosition:S,nodeLookup:h,nodeExtent:i,nodeOrigin:v,onError:f}),C=k.position,M=k.positionAbsolute;E.position=C,E.internals.positionAbsolute=M,p.set(E.id,E)}}}catch(n){t={error:n}}finally{try{_&&!_.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}d(p)}),[]);return t}();if(O.hidden)return null;var Z=dw(O),X=function(n){var e,t,r,o,i,u,a,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(t=null!==(e=n.width)&&void 0!==e?e:n.initialWidth)&&void 0!==t?t:null===(r=n.style)||void 0===r?void 0:r.width,height:null!==(i=null!==(o=n.height)&&void 0!==o?o:n.initialHeight)&&void 0!==i?i:null===(u=n.style)||void 0===u?void 0:u.height}:{width:null!==(a=n.width)&&void 0!==a?a:null===(c=n.style)||void 0===c?void 0:c.width,height:null!==(l=n.height)&&void 0!==l?l:null===(s=n.style)||void 0===s?void 0:s.height}}(O),U=(k?fw(P.positionAbsolute,k):P.positionAbsolute)||{x:0,y:0},F=function(n){var e=n.x,t=n.y,r=n.width,o=n.height,i=n.origin,u=void 0===i?[0,0]:i;return!r||!o||u[0]<0||u[1]<0||u[0]>1||u[1]>1?{x:e,y:t}:{x:e-r*u[0],y:t-o*u[1]}}(t(t(t({},U),Z),{origin:O.origin||C})),W=L||z||i||c||l||s,$=c?function(n){return c(n,t({},P.userNode))}:void 0,G=l?function(n){return l(n,t({},P.userNode))}:void 0,q=s?function(n){return s(n,t({},P.userNode))}:void 0,K=f?function(n){return f(n,t({},P.userNode))}:void 0,Q=d?function(n){return d(n,t({},P.userNode))}:void 0;return p.jsx("div",{className:w(["ink-flow__node","ink-flow__node-".concat(I),(r={},r[b]=z,r),O.className,{selected:O.selected,selectable:L,parent:j,draggable:z,dragging:H}]),ref:V,style:t(t({zIndex:P.z,transform:"translate(".concat(F.x,"px,").concat(F.y,"px)"),pointerEvents:W?"all":"none",visibility:D?"visible":"hidden"},O.style),X),"data-id":o,"data-testid":"rf__node-".concat(o),onMouseEnter:$,onMouseMove:G,onMouseLeave:q,onContextMenu:K,onClick:function(n){var e=R.getState(),r=e.selectNodesOnDrag,u=e.nodeDragThreshold;L&&(!r||!z||u>0)&&zb({id:o,store:R,nodeRef:V}),i&&i(n,t({},P.userNode))},onDoubleClick:Q,onKeyDown:B?function(n){if(!Pw(n.nativeEvent)&&!_)if(mv.includes(n.key)&&L){var e="Escape"===n.key;zb({id:o,store:R,unselect:e,nodeRef:V})}else z&&O.selected&&Object.prototype.hasOwnProperty.call(Ib,n.key)&&(R.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~U.x,", y: ").concat(~~U.y)}),Y({direction:Ib[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:B?0:void 0,role:B?"button":void 0,"aria-describedby":_?void 0:"".concat("ink-flow__node-desc","-").concat(E),"aria-label":O.ariaLabel,children:p.jsx(xb,{value:o,children:p.jsx(A,t({id:o,data:O.data,type:I,positionAbsoluteX:U.x,positionAbsoluteY:U.y,selected:O.selected,isConnectable:T,sourcePosition:O.sourcePosition,targetPosition:O.targetPosition,dragging:H,dragHandle:O.dragHandle,zIndex:P.z},Z))})})}var Tb=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function Bb(e){var t=tw(Tb,Rw),r=t.nodesDraggable,o=t.nodesConnectable,i=t.nodesFocusable,u=t.elementsSelectable,c=t.onError,l=yb(!1),s=function(){var e=tw(gb),t=a(n.useState((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(n){var t=new Map;n.forEach((function(n){var e=n.target.getAttribute("data-id");t.set(e,{id:e,nodeElement:n.target})})),e(t)}))})),1),r=t[0];return n.useEffect((function(){return function(){null==r||r.disconnect()}}),[r]),r}();return p.jsx("div",{className:"ink-flow__nodes",style:Dw,children:l.map((function(n){return p.jsx(Lb,{id:n,nodeTypes:e.nodeTypes,nodeOrigin:e.nodeOrigin,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:u,onError:c},n)}))})}Bb.displayName="NodeRenderer";var Rb,Db=n.memo(Bb),Vb=((Rb={})[exports.MarkerType.Arrow]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return p.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},Rb[exports.MarkerType.ArrowClosed]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return p.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Rb);function Hb(n,e){if(!n)return"";if("string"==typeof n)return n;var t=e?"".concat(e,"__"):"";return"".concat(t).concat(Object.keys(n).sort().map((function(e){return"".concat(e,"=").concat(n[e])})).join("&"))}var Yb=function(e){var t=e.id,r=e.type,o=e.color,i=e.width,u=void 0===i?12.5:i,a=e.height,c=void 0===a?12.5:a,l=e.markerUnits,s=void 0===l?"strokeWidth":l,f=e.strokeWidth,d=e.orient,h=void 0===d?"auto-start-reverse":d,v=function(e){var t=rw(),r=n.useMemo((function(){var n,r;return Object.prototype.hasOwnProperty.call(Vb,e)?Vb[e]:(null===(r=(n=t.getState()).onError)||void 0===r||r.call(n,"009",dv(e)),null)}),[e]);return r}(r);return v?p.jsx("marker",{className:"ink-flow__arrowhead",id:t,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:p.jsx(v,{color:o,strokeWidth:f})}):null},Zb=function(e){var r=e.defaultColor,o=e.rfId,i=tw((function(n){return n.edges})),u=tw((function(n){return n.defaultEdgeOptions})),a=n.useMemo((function(){var n=function(n,e){var r=e.id,o=e.defaultColor,i=e.defaultMarkerStart,u=e.defaultMarkerEnd,a=new Set;return n.reduce((function(n,e){return[e.markerStart||i,e.markerEnd||u].forEach((function(e){if(e&&"object"==typeof e){var i=Hb(e,r);a.has(i)||(n.push(t({id:i,color:e.color||o},e)),a.add(i))}})),n}),[]).sort((function(n,e){return n.id.localeCompare(e.id)}))}(i,{id:o,defaultColor:r,defaultMarkerStart:null==u?void 0:u.markerStart,defaultMarkerEnd:null==u?void 0:u.markerEnd});return n}),[i,u,o,r]);return a.length?p.jsx("svg",{className:"ink-flow__marker",children:p.jsx("defs",{children:a.map((function(n){return p.jsx(Yb,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id)}))})}):null};Zb.displayName="MarkerDefinitions";var Xb=n.memo(Zb);function Ub(e){var o=e.x,i=e.y,u=e.label,c=e.labelStyle,l=void 0===c?{}:c,s=e.labelShowBg,f=void 0===s||s,d=e.labelBgStyle,h=void 0===d?{}:d,v=e.labelBgPadding,g=void 0===v?[2,4]:v,y=e.labelBgBorderRadius,m=void 0===y?2:y,x=e.children,b=e.className,_=r(e,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),E=a(n.useState({x:1,y:0,width:0,height:0}),2),S=E[0],k=E[1],C=w(["ink-flow__edge-textwrapper",b]),M=n.useCallback((function(n){if(null!==n){var e=n.getBBox();k({x:e.x,y:e.y,width:e.width,height:e.height})}}),[]);return void 0!==u&&u?p.jsxs("g",t({transform:"translate(".concat(o-S.width/2," ").concat(i-S.height/2,")"),className:C,visibility:S.width?"visible":"hidden"},_,{children:[f&&p.jsx("rect",{width:S.width+2*g[0],x:-g[0],y:-g[1],height:S.height+2*g[1],className:"ink-flow__edge-textbg",style:h,rx:m,ry:m}),p.jsx("text",{className:"ink-flow__edge-text",y:S.height/2,dy:"0.3em",ref:M,style:l,children:u}),x]})):null}Ub.displayName="EdgeText";var Fb=n.memo(Ub);function Wb(n){var e=n.id,t=n.path,r=n.labelX,o=n.labelY,i=n.label,u=n.labelStyle,a=n.labelShowBg,c=n.labelBgStyle,l=n.labelBgPadding,s=n.labelBgBorderRadius,f=n.style,d=n.markerEnd,h=n.markerStart,v=n.className,g=n.interactionWidth,y=void 0===g?20:g;return p.jsxs(p.Fragment,{children:[p.jsx("path",{id:e,style:f,d:t,fill:"none",className:w(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),y&&p.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:y,className:"ink-flow__edge-interaction"}),i&&hw(r)&&hw(o)?p.jsx(Fb,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function $b(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2;return e===exports.Position.Left||e===exports.Position.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function Gb(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,c=n.targetPosition,l=void 0===c?exports.Position.Top:c,s=a($b({pos:o,x1:e,y1:t,x2:i,y2:u}),2),f=s[0],d=s[1],h=a($b({pos:l,x1:i,y1:u,x2:e,y2:t}),2),v=h[0],p=h[1],g=a(wb({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:f,sourceControlY:d,targetControlX:v,targetControlY:p}),4),y=g[0],m=g[1],x=g[2],w=g[3];return["M".concat(e,",").concat(t," C").concat(f,",").concat(d," ").concat(v,",").concat(p," ").concat(i,",").concat(u),y,m,x,w]}function qb(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.sourcePosition,l=void 0===c?exports.Position.Bottom:c,s=n.targetPosition,f=void 0===s?exports.Position.Top:s,d=n.label,h=n.labelStyle,v=n.labelShowBg,g=n.labelBgStyle,y=n.labelBgPadding,m=n.labelBgBorderRadius,x=n.style,w=n.markerEnd,b=n.markerStart,_=n.interactionWidth,E=a(Gb({sourceX:r,sourceY:o,sourcePosition:l,targetX:i,targetY:u,targetPosition:f}),3),S=E[0],k=E[1],C=E[2],M=e.isInternal?void 0:t;return p.jsx(Wb,{id:M,path:S,labelX:k,labelY:C,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:m,style:x,markerEnd:w,markerStart:b,interactionWidth:_})}))}var Kb=qb({isInternal:!1}),Qb=qb({isInternal:!0});function Jb(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.label,l=n.labelStyle,s=n.labelShowBg,f=n.labelBgStyle,d=n.labelBgPadding,h=n.labelBgBorderRadius,v=n.style,g=n.sourcePosition,y=void 0===g?exports.Position.Bottom:g,m=n.targetPosition,x=void 0===m?exports.Position.Top:m,w=n.markerEnd,b=n.markerStart,_=n.pathOptions,E=n.interactionWidth,S=a(Ob({sourceX:r,sourceY:o,sourcePosition:y,targetX:i,targetY:u,targetPosition:x,borderRadius:null==_?void 0:_.borderRadius,offset:null==_?void 0:_.offset}),3),k=S[0],C=S[1],M=S[2],N=e.isInternal?void 0:t;return p.jsx(Wb,{id:N,path:k,labelX:C,labelY:M,label:c,labelStyle:l,labelShowBg:s,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:w,markerStart:b,interactionWidth:E})}))}Kb.displayName="SimpleBezierEdge",Qb.displayName="SimpleBezierEdgeInternal";var n_=Jb({isInternal:!1}),e_=Jb({isInternal:!0});function t_(e){return n.memo((function(o){var i,u=o.id,a=r(o,["id"]),c=e.isInternal?void 0:u;return p.jsx(n_,t({},a,{id:c,pathOptions:n.useMemo((function(){var n;return{borderRadius:0,offset:null===(n=a.pathOptions)||void 0===n?void 0:n.offset}}),[null===(i=a.pathOptions)||void 0===i?void 0:i.offset])}))}))}n_.displayName="SmoothStepEdge",e_.displayName="SmoothStepEdgeInternal";var r_=t_({isInternal:!1}),o_=t_({isInternal:!0});function i_(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.label,l=n.labelStyle,s=n.labelShowBg,f=n.labelBgStyle,d=n.labelBgPadding,h=n.labelBgBorderRadius,v=n.style,g=n.markerEnd,y=n.markerStart,m=n.interactionWidth,x=a(function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=a(Eb({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),u=i[0],c=i[1],l=i[2],s=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),u,c,l,s]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=x[0],b=x[1],_=x[2],E=e.isInternal?void 0:t;return p.jsx(Wb,{id:E,path:w,labelX:b,labelY:_,label:c,labelStyle:l,labelShowBg:s,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:g,markerStart:y,interactionWidth:m})}))}r_.displayName="StepEdge",o_.displayName="StepEdgeInternal";var u_=i_({isInternal:!1}),a_=i_({isInternal:!0});function c_(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.sourcePosition,l=void 0===c?exports.Position.Bottom:c,s=n.targetPosition,f=void 0===s?exports.Position.Top:s,d=n.label,h=n.labelStyle,v=n.labelShowBg,g=n.labelBgStyle,y=n.labelBgPadding,m=n.labelBgBorderRadius,x=n.style,w=n.markerEnd,b=n.markerStart,_=n.pathOptions,E=n.interactionWidth,S=a(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,c=n.targetPosition,l=void 0===c?exports.Position.Top:c,s=n.curvature,f=void 0===s?.25:s,d=a(_b({pos:o,x1:e,y1:t,x2:i,y2:u,c:f}),2),h=d[0],v=d[1],p=a(_b({pos:l,x1:i,y1:u,x2:e,y2:t,c:f}),2),g=p[0],y=p[1],m=a(wb({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:h,sourceControlY:v,targetControlX:g,targetControlY:y}),4),x=m[0],w=m[1],b=m[2],_=m[3];return["M".concat(e,",").concat(t," C").concat(h,",").concat(v," ").concat(g,",").concat(y," ").concat(i,",").concat(u),x,w,b,_]}({sourceX:r,sourceY:o,sourcePosition:l,targetX:i,targetY:u,targetPosition:f,curvature:null==_?void 0:_.curvature}),3),k=S[0],C=S[1],M=S[2],N=e.isInternal?void 0:t;return p.jsx(Wb,{id:N,path:k,labelX:C,labelY:M,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:m,style:x,markerEnd:w,markerStart:b,interactionWidth:E})}))}u_.displayName="StraightEdge",a_.displayName="StraightEdgeInternal";var l_=c_({isInternal:!1}),s_=c_({isInternal:!0});l_.displayName="BezierEdge",s_.displayName="BezierEdgeInternal";var f_={default:s_,straight:a_,step:o_,smoothstep:e_,simplebezier:Qb},d_={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},h_=function(n,e,t){return t===exports.Position.Left?n-e:t===exports.Position.Right?n+e:n},v_=function(n,e,t){return t===exports.Position.Top?n-e:t===exports.Position.Bottom?n+e:n},p_="ink-flow__edgeupdater";function g_(n){var e=n.position,t=n.centerX,r=n.centerY,o=n.radius,i=void 0===o?10:o,u=n.onMouseDown,a=n.onMouseEnter,c=n.onMouseOut,l=n.type;return p.jsx("circle",{onMouseDown:u,onMouseEnter:a,onMouseOut:c,className:w([p_,"".concat(p_,"-").concat(l)]),cx:h_(t,i,e),cy:v_(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function y_(n){var e=n.isUpdatable,t=n.edgeUpdaterRadius,r=n.edge,o=n.targetHandleId,i=n.sourceHandleId,u=n.sourceX,a=n.sourceY,c=n.targetX,l=n.targetY,s=n.sourcePosition,f=n.targetPosition,d=n.onEdgeUpdate,h=n.onEdgeUpdateStart,v=n.onEdgeUpdateEnd,g=n.setUpdating,y=n.setUpdateHover,m=rw(),x=function(n,e){if(0===n.button){var t=m.getState(),u=t.autoPanOnConnect,a=t.domNode,c=t.isValidConnection,l=t.connectionMode,s=t.connectionRadius,f=t.lib,p=t.onConnectStart,y=t.onConnectEnd,x=t.cancelConnection,w=t.nodeLookup,b=t.rfId,_=t.panBy,E=t.updateConnection,S=e?r.target:r.source,k=(e?o:i)||null,C=e?"target":"source",M=e;g(!0),null==h||h(n,r,C);Yy.onPointerDown(n.nativeEvent,{autoPanOnConnect:u,connectionMode:l,connectionRadius:s,domNode:a,handleId:k,nodeId:S,nodeLookup:w,isTarget:M,edgeUpdaterType:C,lib:f,flowId:b,cancelConnection:x,panBy:_,isValidConnection:c,onConnect:function(n){return null==d?void 0:d(r,n)},onConnectStart:p,onConnectEnd:y,onEdgeUpdateEnd:function(n){g(!1),null==v||v(n,r,C)},updateConnection:E,getTransform:function(){return m.getState().transform},getConnectionStartHandle:function(){return m.getState().connectionStartHandle}})}},w=function(){return y(!0)},b=function(){return y(!1)};return p.jsxs(p.Fragment,{children:[("source"===e||!0===e)&&p.jsx(g_,{position:s,centerX:u,centerY:a,radius:t,onMouseDown:function(n){return x(n,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===e||!0===e)&&p.jsx(g_,{position:f,centerX:c,centerY:l,radius:t,onMouseDown:function(n){return x(n,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function m_(n){var e;return n&&!(!n.internals.handleBounds&&!(null===(e=n.handles)||void 0===e?void 0:e.length))&&!!(n.measured.width||n.width||n.initialWidth)}function x_(n){var e,t,r,o;if(!n)return null;var i=[],a=[];try{for(var c=u(n),l=c.next();!l.done;l=c.next()){var s=l.value;s.width=null!==(r=s.width)&&void 0!==r?r:1,s.height=null!==(o=s.height)&&void 0!==o?o:1,"source"===s.type?i.push(s):"target"===s.type&&a.push(s)}}catch(n){e={error:n}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}return{source:i,target:a}}function w_(n,e,t){var r,o;void 0===t&&(t=null);var i=(null!==(r=null==t?void 0:t.x)&&void 0!==r?r:0)+e.internals.positionAbsolute.x,u=(null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0)+e.internals.positionAbsolute.y,a=null!=t?t:dw(e),c=a.width,l=a.height;switch(n){case exports.Position.Top:return[i+c/2,u];case exports.Position.Right:return[i+c,u+l/2];case exports.Position.Bottom:return[i+c/2,u+l];case exports.Position.Left:return[i,u+l/2]}}function b_(n,e){return n&&(e?n.find((function(n){return n.id===e})):n[0])||null}function __(e){var r=e.id,o=e.edgesFocusable,i=e.edgesUpdatable,u=e.elementsSelectable,c=e.onClick,l=e.onDoubleClick,s=e.onContextMenu,f=e.onMouseEnter,d=e.onMouseMove,h=e.onMouseLeave,v=e.edgeUpdaterRadius,g=e.onEdgeUpdate,y=e.onEdgeUpdateStart,m=e.onEdgeUpdateEnd,x=e.rfId,b=e.edgeTypes,_=e.noPanClassName,E=e.onError,S=e.disableKeyboardA11y,k=tw((function(n){return n.edgeLookup.get(r)})),C=tw((function(n){return n.defaultEdgeOptions})),M=(k=C?t(t({},C),k):k).type||"default",N=(null==b?void 0:b[M])||f_[M];void 0===N&&(null==E||E("011",pv(M)),M="default",N=f_.default);var O=!!(k.focusable||o&&void 0===k.focusable),P=void 0!==g&&(k.updatable||i&&void 0===k.updatable),j=!!(k.selectable||u&&void 0===k.selectable),I=n.useRef(null),A=a(n.useState(!1),2),z=A[0],L=A[1],T=a(n.useState(!1),2),B=T[0],R=T[1],D=rw(),V=tw(n.useCallback((function(n){var e=n.nodeLookup.get(k.source),o=n.nodeLookup.get(k.target);if(!e||!o)return t({zIndex:k.zIndex},d_);var i=function(n){var e,t,r,o,i,u=n.sourceNode,c=n.targetNode;if(!m_(u)||!m_(c))return null;var l=u.internals.handleBounds||x_(u.handles),s=c.internals.handleBounds||x_(c.handles),f=b_(null!==(e=null==l?void 0:l.source)&&void 0!==e?e:[],n.sourceHandle),d=b_(n.connectionMode===exports.ConnectionMode.Strict?null!==(t=null==s?void 0:s.target)&&void 0!==t?t:[]:(null!==(r=null==s?void 0:s.target)&&void 0!==r?r:[]).concat(null!==(o=null==s?void 0:s.source)&&void 0!==o?o:[]),n.targetHandle),h=(null==f?void 0:f.position)||exports.Position.Bottom,v=(null==d?void 0:d.position)||exports.Position.Top;if(!f||!d)return null===(i=n.onError)||void 0===i||i.call(n,"008",hv(f?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var p=a(w_(h,u,f),2),g=p[0],y=p[1],m=a(w_(v,c,d),2);return{sourceX:g,sourceY:y,targetX:m[0],targetY:m[1],sourcePosition:h,targetPosition:v}}({id:r,sourceNode:e,targetNode:o,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:n.connectionMode,onError:E}),u=function(n){var e=n.sourceNode,t=n.targetNode,r=n.selected,o=void 0!==r&&r,i=n.zIndex,u=void 0===i?0:i,a=n.elevateOnSelect;if(void 0===a||!a)return u;var c=o||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return u+(c?l:0)}({selected:k.selected,zIndex:k.zIndex,sourceNode:e,targetNode:o,elevateOnSelect:n.elevateEdgesOnSelect});return t({zIndex:u},i||d_)}),[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Rw),H=V.zIndex,Y=V.sourceX,Z=V.sourceY,X=V.targetX,U=V.targetY,F=V.sourcePosition,W=V.targetPosition,$=n.useMemo((function(){return k.markerStart?"url('#".concat(Hb(k.markerStart,x),"')"):void 0}),[k.markerStart,x]),G=n.useMemo((function(){return k.markerEnd?"url('#".concat(Hb(k.markerEnd,x),"')"):void 0}),[k.markerEnd,x]);if(k.hidden||null===Y||null===Z||null===X||null===U)return null;var q=l?function(n){l(n,t({},k))}:void 0,K=s?function(n){s(n,t({},k))}:void 0,Q=f?function(n){f(n,t({},k))}:void 0,J=d?function(n){d(n,t({},k))}:void 0,nn=h?function(n){h(n,t({},k))}:void 0;return p.jsx("svg",{style:{zIndex:H},children:p.jsxs("g",{className:w(["ink-flow__edge","ink-flow__edge-".concat(M),k.className,_,{selected:k.selected,animated:k.animated,inactive:!j&&!c,updating:z,selectable:j}]),onClick:function(n){var e,t=D.getState(),o=t.addSelectedEdges,i=t.unselectNodesAndEdges,u=t.multiSelectionActive;j&&(D.setState({nodesSelectionActive:!1}),k.selected&&u?(i({nodes:[],edges:[k]}),null===(e=I.current)||void 0===e||e.blur()):o([r])),c&&c(n,k)},onDoubleClick:q,onContextMenu:K,onMouseEnter:Q,onMouseMove:J,onMouseLeave:nn,onKeyDown:O?function(n){var e;if(!S&&mv.includes(n.key)&&j){var t=D.getState(),o=t.unselectNodesAndEdges,i=t.addSelectedEdges;"Escape"===n.key?(null===(e=I.current)||void 0===e||e.blur(),o({edges:[k]})):i([r])}}:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":r,"data-testid":"rf__edge-".concat(r),"aria-label":null===k.ariaLabel?void 0:k.ariaLabel||"Edge from ".concat(k.source," to ").concat(k.target),"aria-describedby":O?"".concat("ink-flow__edge-desc","-").concat(x):void 0,ref:I,children:[!B&&p.jsx(N,{id:r,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:Y,sourceY:Z,targetX:X,targetY:U,sourcePosition:F,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:$,markerEnd:G,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),P&&p.jsx(y_,{edge:k,isUpdatable:P,edgeUpdaterRadius:v,onEdgeUpdate:g,onEdgeUpdateStart:y,onEdgeUpdateEnd:m,sourceX:Y,sourceY:Z,targetX:X,targetY:U,sourcePosition:F,targetPosition:W,setUpdateHover:L,setUpdating:R,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle})]})})}var E_=function(n){return{width:n.width,height:n.height,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function S_(e){var t=e.defaultMarkerColor,r=e.rfId,o=e.noPanClassName,i=e.onEdgeUpdate,u=e.onEdgeContextMenu,a=e.onEdgeMouseEnter,c=e.onEdgeMouseMove,l=e.onEdgeMouseLeave,s=e.onEdgeClick,f=e.edgeTypes,d=tw(E_,Rw),h=d.edgesFocusable,v=d.edgesUpdatable,g=d.elementsSelectable,y=d.onError,m=function(e){var t=tw(n.useCallback((function(n){return n.edges.map((function(n){return n.id}))}),[e]),Rw);return t}(!1);return p.jsxs("div",{className:"ink-flow__edges",children:[p.jsx(Xb,{defaultColor:t,rfId:r}),m.map((function(n){return p.jsx(__,{id:n,edgesFocusable:h,edgesUpdatable:v,elementsSelectable:g,noPanClassName:o,onEdgeUpdate:i,onContextMenu:u,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,onClick:s,rfId:r,onError:y,edgeTypes:f},n)}))]})}S_.displayName="EdgeRenderer";var k_,C_=n.memo(S_),M_=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function N_(n){var e=n.children,t=tw(M_);return p.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:e})}var O_=((k_={})[exports.Position.Left]=exports.Position.Right,k_[exports.Position.Right]=exports.Position.Left,k_[exports.Position.Top]=exports.Position.Bottom,k_[exports.Position.Bottom]=exports.Position.Top,k_),P_=function(e){var r,o,i=e.nodeId,u=e.handleType,c=e.style,l=e.type,s=void 0===l?exports.ConnectionLineType.Bezier:l,f=e.CustomComponent,d=e.connectionStatus,h=tw(n.useCallback((function(n){var e;return{fromNode:n.nodeLookup.get(i),handleId:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.handleId,toX:(n.connectionPosition.x-n.transform[0])/n.transform[2],toY:(n.connectionPosition.y-n.transform[1])/n.transform[2],connectionMode:n.connectionMode}}),[i]),Rw),v=h.fromNode,g=h.handleId,y=h.toX,m=h.toY,x=h.connectionMode,w=null==v?void 0:v.internals.handleBounds,b=null==w?void 0:w[u];if(x===exports.ConnectionMode.Loose&&(b=b||(null==w?void 0:w["source"===u?"target":"source"])),!v||!b)return null;var _=g?b.find((function(n){return n.id===g})):b[0],E=_?_.x+_.width/2:(null!==(r=v.measured.width)&&void 0!==r?r:0)/2,S=_?_.y+_.height/2:null!==(o=v.measured.height)&&void 0!==o?o:0,k=v.internals.positionAbsolute.x+E,C=v.internals.positionAbsolute.y+S,M=null==_?void 0:_.position,N=M?O_[M]:null;if(!M||!N)return null;if(f)return p.jsx(f,{connectionLineType:s,connectionLineStyle:c,fromNode:v,fromHandle:_,fromX:k,fromY:C,toX:y,toY:m,fromPosition:M,toPosition:N,connectionStatus:d});var O="",P={sourceX:k,sourceY:C,sourcePosition:M,targetX:y,targetY:m,targetPosition:N};return O=s===exports.ConnectionLineType.Bezier?a(Uv(P),1)[0]:s===exports.ConnectionLineType.Step?a(Qv(t(t({},P),{borderRadius:0})),1)[0]:s===exports.ConnectionLineType.SmoothStep?a(Qv(P),1)[0]:s===exports.ConnectionLineType.SimpleBezier?a(Gb(P),1)[0]:"M".concat(k,",").concat(C," ").concat(y,",").concat(m),p.jsx("path",{d:O,fill:"none",className:"react-flow__connection-path",style:c})};P_.displayName="ConnectionLine";var j_=function(n){var e,t;return{nodeId:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.nodeId,handleType:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.type,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height}};function I_(n){var e=n.containerStyle,t=n.style,r=n.type,o=n.component,i=tw(j_,Rw),u=i.nodeId,a=i.handleType,c=i.nodesConnectable,l=i.width,s=i.height,f=i.connectionStatus;return!!(u&&a&&l&&c)?p.jsx("svg",{style:e,width:l,height:s,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:w(["react-flow__connection",f]),children:p.jsx(P_,{nodeId:u,handleType:a,style:t,type:r,CustomComponent:o,connectionStatus:f})})}):null}function A_(n){var e=n.onNodeClick,t=n.onNodeDoubleClick,r=n.onNodeMouseEnter,o=n.onNodeMouseMove,i=n.onNodeMouseLeave,u=n.onNodeContextMenu,a=n.onEdgeClick,c=n.onEdgeDoubleClick,l=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeContextMenu,h=n.rfId,v=n.minZoom,g=n.maxZoom,y=n.noPanClassName,m=n.noDragClassName,x=n.nodeOrigin,w=n.viewport,b=n.disableKeyboardA11y,_=n.translateExtent,E=n.defaultViewport,S=n.nodeTypes,k=n.edgeTypes,C=n.elementsSelectable,M=n.defaultMarkerColor,N=n.connectionLineType,O=n.connectionLineStyle,P=n.connectionLineComponent,j=n.connectionLineContainerStyle,I=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,T=n.onPaneMouseLeave,B=n.onPaneScroll;return p.jsx(cb,{minZoom:v,maxZoom:g,noPanClassName:y,noDragClassName:m,isControlledViewport:!!w,disableKeyboardA11y:b,translateExtent:_,defaultViewport:E,elementsSelectable:C,onPaneClick:I,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:T,onPaneScroll:B,children:p.jsxs(N_,{children:[p.jsx(C_,{rfId:h,edgeTypes:k,noPanClassName:y,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,onEdgeContextMenu:d,defaultMarkerColor:M}),p.jsx(I_,{style:O,type:N,component:P,containerStyle:j}),p.jsx("div",{className:"ink-flow__edgelabel-renderer"}),p.jsx(Db,{rfId:h,nodeTypes:S,nodeOrigin:x,noDragClassName:m,noPanClassName:y,disableKeyboardA11y:!1,onNodeClick:e,onNodeDoubleClick:t,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),p.jsx("div",{className:"ink-flow__viewport-portal"})]})})}A_.displayName="GraphView";var z_=n.memo(A_),L_={x:0,y:0,zoom:1},T_={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},B_=function(n){var e,t,r=void 0===n?{}:n,o=r.nodes,i=r.edges,u=r.defaultNodes,a=r.defaultEdges;r.width,r.height,r.fitView;var c=new Map,l=new Map,s=new Map,f=new Map,d=null!==(e=null!=a?a:i)&&void 0!==e?e:[],h=null!==(t=null!=u?u:o)&&void 0!==t?t:[];aw(s,f,d),cw(h,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:h,nodeLookup:c,parentLookup:l,edges:d,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:yv,nodeExtent:yv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:exports.ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:T_,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"react",debug:!1}},R_={dagre:Jv};var D_={exports:{}};
|
|
16
|
+
*/b.exports=function(){if(x)return _;x=1;var e=n,t=k(),r="function"==typeof Object.is?Object.is:function(n,e){return n===e&&(0!==n||1/n==1/e)||n!=n&&e!=e},o=t.useSyncExternalStore,i=e.useRef,u=e.useEffect,a=e.useMemo,c=e.useDebugValue;return _.useSyncExternalStoreWithSelector=function(n,e,t,l,s){var f=i(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=a((function(){function n(n){if(!u){if(u=!0,o=n,n=l(n),void 0!==s&&d.hasValue){var e=d.value;if(s(e,n))return i=e}return i=n}if(e=i,r(o,n))return e;var t=l(n);return void 0!==s&&s(e,t)?e:(o=n,i=t)}var o,i,u=!1,a=void 0===t?null:t;return[function(){return n(e())},null===a?void 0:function(){return n(a())}]}),[e,t,l,s]);var h=o(n,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),c(h),h},_}();var C=s(b.exports);const M=n=>{let e;const t=new Set,r=(n,r)=>{const o="function"==typeof n?n(e):n;if(!Object.is(o,e)){const n=e;e=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},e,o),t.forEach((t=>t(e,n)))}},o=()=>e,i={setState:r,getState:o,getInitialState:()=>u,subscribe:n=>(t.add(n),()=>t.delete(n)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=e=n(r,o,i);return i},{useDebugValue:N}=n,{useSyncExternalStoreWithSelector:O}=C,P=n=>n;function j(n,e=P,t){const r=O(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return N(r),r}const I=(n,e)=>{const t=(n=>n?M(n):M)(n),r=(n,r=e)=>j(t,n,r);return Object.assign(r,t),r};var A=n.createContext(null),z=A.Provider,L=function(){return L=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},L.apply(this,arguments)};function T(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function R(n,e,t){if(2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var D,V,H,Y,Z,X,F,U,W,$,G,q,K,Q,J,nn,en,tn,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,xn,wn,bn,_n,En,Sn,kn,Cn,Mn,Nn,On,Pn,jn,In,An,zn,Ln,Tn,Bn,Rn,Dn,Vn,Hn,Yn,Zn,Xn,Fn,Un,Wn,$n,Gn,qn,Kn,Qn,Jn,ne,ee,te,re,oe,ie,ue,ae,ce,le,se,fe,de,he,ve,pe,ge,ye,me,xe,we,be,_e,Ee,Se,ke,Ce,Me,Ne,Oe,Pe,je,Ie,Ae,ze,Le,Te,Be,Re,De,Ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function He(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ye(){return Y?H:(Y=1,H=function(n,e){return n===e||n!=n&&e!=e})}function Ze(){if(X)return Z;X=1;var n=Ye();return Z=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1},Z}function Xe(){if(nn)return J;nn=1;var n=V?D:(V=1,D=function(){this.__data__=[],this.size=0}),e=function(){if(U)return F;U=1;var n=Ze(),e=Array.prototype.splice;return F=function(t){var r=this.__data__,o=n(r,t);return!(o<0||(o==r.length-1?r.pop():e.call(r,o,1),--this.size,0))}}(),t=function(){if($)return W;$=1;var n=Ze();return W=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}}(),r=function(){if(q)return G;q=1;var n=Ze();return G=function(e){return n(this.__data__,e)>-1}}(),o=function(){if(Q)return K;Q=1;var n=Ze();return K=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,J=i}function Fe(){if(fn)return sn;fn=1;var n="object"==typeof Ve&&Ve&&Ve.Object===Object&&Ve;return sn=n}function Ue(){if(hn)return dn;hn=1;var n=Fe(),e="object"==typeof self&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return dn=t}function We(){if(pn)return vn;pn=1;var n=Ue().Symbol;return vn=n}function $e(){if(bn)return wn;bn=1;var n=We(),e=function(){if(yn)return gn;yn=1;var n=We(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;return gn=function(n){var e=t.call(n,o),i=n[o];try{n[o]=void 0;var u=!0}catch(n){}var a=r.call(n);return u&&(e?n[o]=i:delete n[o]),a}}(),t=function(){if(xn)return mn;xn=1;var n=Object.prototype.toString;return mn=function(e){return n.call(e)}}(),r=n?n.toStringTag:void 0;return wn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?e(n):t(n)}}function Ge(){return En?_n:(En=1,_n=function(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)})}function qe(){if(kn)return Sn;kn=1;var n=$e(),e=Ge();return Sn=function(t){if(!e(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function Ke(){if(jn)return Pn;jn=1;var n=Function.prototype.toString;return Pn=function(e){if(null!=e){try{return n.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function Qe(){if(Bn)return Tn;Bn=1;var n=function(){if(An)return In;An=1;var n=qe(),e=function(){if(On)return Nn;On=1;var n,e=function(){if(Mn)return Cn;Mn=1;var n=Ue()["__core-js_shared__"];return Cn=n}(),t=(n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Nn=function(n){return!!t&&t in n}}(),t=Ge(),r=Ke(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,c=u.hasOwnProperty,l=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return In=function(i){return!(!t(i)||e(i))&&(n(i)?l:o).test(r(i))}}(),e=Ln?zn:(Ln=1,zn=function(n,e){return null==n?void 0:n[e]});return Tn=function(t,r){var o=e(t,r);return n(o)?o:void 0}}function Je(){if(Dn)return Rn;Dn=1;var n=Qe()(Ue(),"Map");return Rn=n}function nt(){if(Hn)return Vn;Hn=1;var n=Qe()(Object,"create");return Vn=n}function et(){if(ie)return oe;ie=1;var n=re?te:(re=1,te=function(n){var e=typeof n;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n});return oe=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}}function tt(){if(pe)return ve;pe=1;var n=function(){if(ee)return ne;ee=1;var n=function(){if(Jn)return Qn;Jn=1;var n=function(){if(Zn)return Yn;Zn=1;var n=nt();return Yn=function(){this.__data__=n?n(null):{},this.size=0}}(),e=Fn?Xn:(Fn=1,Xn=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}),t=function(){if(Wn)return Un;Wn=1;var n=nt(),e=Object.prototype.hasOwnProperty;return Un=function(t){var r=this.__data__;if(n){var o=r[t];return"__lodash_hash_undefined__"===o?void 0:o}return e.call(r,t)?r[t]:void 0}}(),r=function(){if(Gn)return $n;Gn=1;var n=nt(),e=Object.prototype.hasOwnProperty;return $n=function(t){var r=this.__data__;return n?void 0!==r[t]:e.call(r,t)}}(),o=function(){if(Kn)return qn;Kn=1;var n=nt();return qn=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,Qn=i}(),e=Xe(),t=Je();return ne=function(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}}(),e=function(){if(ae)return ue;ae=1;var n=et();return ue=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}}(),t=function(){if(le)return ce;le=1;var n=et();return ce=function(e){return n(this,e).get(e)}}(),r=function(){if(fe)return se;fe=1;var n=et();return se=function(e){return n(this,e).has(e)}}(),o=function(){if(he)return de;he=1;var n=et();return de=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,ve=i}function rt(){if(xe)return me;xe=1;var n=Xe(),e=function(){if(tn)return en;tn=1;var n=Xe();return en=function(){this.__data__=new n,this.size=0}}(),t=on?rn:(on=1,rn=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}),r=an?un:(an=1,un=function(n){return this.__data__.get(n)}),o=ln?cn:(ln=1,cn=function(n){return this.__data__.has(n)}),i=function(){if(ye)return ge;ye=1;var n=Xe(),e=Je(),t=tt();return ge=function(r,o){var i=this.__data__;if(i instanceof n){var u=i.__data__;if(!e||u.length<199)return u.push([r,o]),this.size=++i.size,this;i=this.__data__=new t(u)}return i.set(r,o),this.size=i.size,this}}();function u(e){var t=this.__data__=new n(e);this.size=t.size}return u.prototype.clear=e,u.prototype.delete=t,u.prototype.get=r,u.prototype.has=o,u.prototype.set=i,me=u}function ot(){return be||(be=1,we=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}),we}function it(){if(Ee)return _e;Ee=1;var n=Qe(),e=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return _e=e}function ut(){if(ke)return Se;ke=1;var n=it();return Se=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}}function at(){if(Me)return Ce;Me=1;var n=ut(),e=Ye(),t=Object.prototype.hasOwnProperty;return Ce=function(r,o,i){var u=r[o];t.call(r,o)&&e(u,i)&&(void 0!==i||o in r)||n(r,o,i)}}function ct(){if(Oe)return Ne;Oe=1;var n=at(),e=ut();return Ne=function(t,r,o,i){var u=!o;o||(o={});for(var a=-1,c=r.length;++a<c;){var l=r[a],s=i?i(o[l],t[l],l,o,t):void 0;void 0===s&&(s=t[l]),u?e(o,l,s):n(o,l,s)}return o}}function lt(){return Ae?Ie:(Ae=1,Ie=function(n){return null!=n&&"object"==typeof n})}function st(){if(Be)return Te;Be=1;var n=function(){if(Le)return ze;Le=1;var n=$e(),e=lt();return ze=function(t){return e(t)&&"[object Arguments]"==n(t)}}(),e=lt(),t=Object.prototype,r=t.hasOwnProperty,o=t.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return e(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return Te=i}function ft(){if(De)return Re;De=1;var n=Array.isArray;return Re=n}var dt,ht,vt,pt,gt,yt,mt,xt,wt,bt,_t,Et={exports:{}};function St(){return vt||(vt=1,function(n,e){var t=Ue(),r=ht?dt:(ht=1,dt=function(){return!1}),o=e&&!e.nodeType&&e,i=o&&n&&!n.nodeType&&n,u=i&&i.exports===o?t.Buffer:void 0,a=(u?u.isBuffer:void 0)||r;n.exports=a}(Et,Et.exports)),Et.exports}function kt(){if(gt)return pt;gt=1;var n=/^(?:0|[1-9]\d*)$/;return pt=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}}function Ct(){return mt?yt:(mt=1,yt=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Mt(){return _t?bt:(_t=1,bt=function(n){return function(e){return n(e)}})}var Nt,Ot,Pt,jt,It,At,zt,Lt,Tt,Bt,Rt,Dt,Vt,Ht,Yt,Zt,Xt,Ft,Ut,Wt,$t,Gt,qt,Kt,Qt,Jt,nr,er={exports:{}};function tr(){return Nt||(Nt=1,n=er,e=er.exports,t=Fe(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r&&t.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(n){}}(),n.exports=u),er.exports;var n,e,t,r,o,i,u}function rr(){if(Pt)return Ot;Pt=1;var n=function(){if(wt)return xt;wt=1;var n=$e(),e=Ct(),t=lt(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,xt=function(o){return t(o)&&e(o.length)&&!!r[n(o)]}}(),e=Mt(),t=tr(),r=t&&t.isTypedArray,o=r?e(r):n;return Ot=o}function or(){if(It)return jt;It=1;var n=je?Pe:(je=1,Pe=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}),e=st(),t=ft(),r=St(),o=kt(),i=rr(),u=Object.prototype.hasOwnProperty;return jt=function(a,c){var l=t(a),s=!l&&e(a),f=!l&&!s&&r(a),d=!l&&!s&&!f&&i(a),h=l||s||f||d,v=h?n(a.length,String):[],p=v.length;for(var g in a)!c&&!u.call(a,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,p))||v.push(g);return v}}function ir(){if(zt)return At;zt=1;var n=Object.prototype;return At=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}}function ur(){return Tt||(Tt=1,Lt=function(n,e){return function(t){return n(e(t))}}),Lt}function ar(){if(Vt)return Dt;Vt=1;var n=ir(),e=function(){if(Rt)return Bt;Rt=1;var n=ur()(Object.keys,Object);return Bt=n}(),t=Object.prototype.hasOwnProperty;return Dt=function(r){if(!n(r))return e(r);var o=[];for(var i in Object(r))t.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function cr(){if(Yt)return Ht;Yt=1;var n=qe(),e=Ct();return Ht=function(t){return null!=t&&e(t.length)&&!n(t)}}function lr(){if(Xt)return Zt;Xt=1;var n=or(),e=ar(),t=cr();return Zt=function(r){return t(r)?n(r):e(r)}}function sr(){if(Qt)return Kt;Qt=1;var n=or(),e=function(){if(qt)return Gt;qt=1;var n=Ge(),e=ir(),t=$t?Wt:($t=1,Wt=function(n){var e=[];if(null!=n)for(var t in Object(n))e.push(t);return e}),r=Object.prototype.hasOwnProperty;return Gt=function(o){if(!n(o))return t(o);var i=e(o),u=[];for(var a in o)("constructor"!=a||!i&&r.call(o,a))&&u.push(a);return u}}(),t=cr();return Kt=function(r){return t(r)?n(r,!0):e(r)}}var fr,dr,hr,vr,pr,gr,yr,mr,xr,wr,br,_r,Er,Sr,kr,Cr,Mr,Nr,Or,Pr,jr,Ir,Ar,zr,Lr,Tr,Br,Rr,Dr,Vr,Hr,Yr,Zr,Xr,Fr,Ur,Wr,$r,Gr,qr,Kr,Qr,Jr,no,eo,to,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,xo,wo,bo,_o,Eo,So,ko,Co,Mo,No,Oo,Po,jo,Io,Ao,zo,Lo,To,Bo,Ro,Do,Vo,Ho,Yo,Zo,Xo,Fo,Uo,Wo,$o,Go,qo,Ko,Qo,Jo,ni,ei,ti,ri,oi,ii,ui,ai,ci,li,si,fi,di,hi,vi,pi,gi,yi,mi,xi,wi,bi,_i,Ei,Si,ki,Ci,Mi,Ni,Oi,Pi,ji,Ii,Ai,zi,Li,Ti,Bi,Ri,Di,Vi,Hi,Yi,Zi,Xi,Fi,Ui,Wi,$i,Gi,qi,Ki,Qi,Ji,nu,eu,tu,ru,ou,iu,uu,au,cu,lu,su,fu,du,hu,vu,pu,gu,yu,mu,xu,wu,bu,_u,Eu,Su,ku,Cu,Mu,Nu,Ou,Pu,ju,Iu,Au,zu,Lu,Tu,Bu,Ru,Du,Vu,Hu,Yu,Zu,Xu,Fu,Uu,Wu,$u,Gu,qu,Ku,Qu,Ju,na,ea,ta,ra,oa,ia,ua,aa,ca,la,sa,fa,da,ha,va,pa,ga,ya,ma,xa,wa,ba,_a,Ea,Sa,ka,Ca,Ma,Na,Oa,Pa,ja,Ia,Aa,za,La,Ta,Ba,Ra,Da,Va,Ha,Ya,Za,Xa,Fa,Ua,Wa,$a,Ga,qa,Ka,Qa,Ja,nc,ec,tc,rc,oc,ic,uc,ac,cc,lc,sc,fc,dc,hc,vc,pc,gc,yc,mc,xc,wc,bc,_c={exports:{}};function Ec(){return fr||(fr=1,function(n,e){var t=Ue(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?t.Buffer:void 0,u=i?i.allocUnsafe:void 0;n.exports=function(n,e){if(e)return n.slice();var t=n.length,r=u?u(t):new n.constructor(t);return n.copy(r),r}}(_c,_c.exports)),_c.exports}function Sc(){return hr||(hr=1,dr=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}),dr}function kc(){return pr||(pr=1,vr=function(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var u=n[t];e(u,t,n)&&(i[o++]=u)}return i}),vr}function Cc(){return yr?gr:(yr=1,gr=function(){return[]})}function Mc(){if(xr)return mr;xr=1;var n=kc(),e=Cc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return mr=r?function(e){return null==e?[]:(e=Object(e),n(r(e),(function(n){return t.call(e,n)})))}:e}function Nc(){return Er||(Er=1,_r=function(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}),_r}function Oc(){if(kr)return Sr;kr=1;var n=ur()(Object.getPrototypeOf,Object);return Sr=n}function Pc(){if(Mr)return Cr;Mr=1;var n=Nc(),e=Oc(),t=Mc(),r=Cc(),o=Object.getOwnPropertySymbols;return Cr=o?function(r){for(var o=[];r;)n(o,t(r)),r=e(r);return o}:r}function jc(){if(jr)return Pr;jr=1;var n=Nc(),e=ft();return Pr=function(t,r,o){var i=r(t);return e(t)?i:n(i,o(t))}}function Ic(){if(Ar)return Ir;Ar=1;var n=jc(),e=Mc(),t=lr();return Ir=function(r){return n(r,t,e)}}function Ac(){if(Hr)return Vr;Hr=1;var n=Qe()(Ue(),"Set");return Vr=n}function zc(){if(Fr)return Xr;Fr=1;var n=function(){if(Br)return Tr;Br=1;var n=Qe()(Ue(),"DataView");return Tr=n}(),e=Je(),t=function(){if(Dr)return Rr;Dr=1;var n=Qe()(Ue(),"Promise");return Rr=n}(),r=Ac(),o=function(){if(Zr)return Yr;Zr=1;var n=Qe()(Ue(),"WeakMap");return Yr=n}(),i=$e(),u=Ke(),a="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",d=u(n),h=u(e),v=u(t),p=u(r),g=u(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=f||e&&y(new e)!=a||t&&y(t.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var e=i(n),t="[object Object]"==e?n.constructor:void 0,r=t?u(t):"";if(r)switch(r){case d:return f;case h:return a;case v:return c;case p:return l;case g:return s}return e}),Xr=y}function Lc(){if(Gr)return $r;Gr=1;var n=Ue().Uint8Array;return $r=n}function Tc(){if(Kr)return qr;Kr=1;var n=Lc();return qr=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}}function Bc(){if(io)return oo;io=1;var n=Tc();return oo=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}}function Rc(){if(lo)return co;lo=1;var n=Ge(),e=Object.create,t=function(){function t(){}return function(r){if(!n(r))return{};if(e)return e(r);t.prototype=r;var o=new t;return t.prototype=void 0,o}}();return co=t}function Dc(){if(fo)return so;fo=1;var n=Rc(),e=Oc(),t=ir();return so=function(r){return"function"!=typeof r.constructor||t(r)?{}:n(e(r))}}function Vc(){if(_o)return bo;_o=1;var n=rt(),e=ot(),t=at(),r=function(){if(Ut)return Ft;Ut=1;var n=ct(),e=lr();return Ft=function(t,r){return t&&n(r,e(r),t)}}(),o=function(){if(nr)return Jt;nr=1;var n=ct(),e=sr();return Jt=function(t,r){return t&&n(r,e(r),t)}}(),i=Ec(),u=Sc(),a=function(){if(br)return wr;br=1;var n=ct(),e=Mc();return wr=function(t,r){return n(t,e(t),r)}}(),c=function(){if(Or)return Nr;Or=1;var n=ct(),e=Pc();return Nr=function(t,r){return n(t,e(t),r)}}(),l=Ic(),s=function(){if(Lr)return zr;Lr=1;var n=jc(),e=Pc(),t=sr();return zr=function(r){return n(r,t,e)}}(),f=zc(),d=function(){if(Wr)return Ur;Wr=1;var n=Object.prototype.hasOwnProperty;return Ur=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r},Ur}(),h=function(){if(ao)return uo;ao=1;var n=Tc(),e=function(){if(Jr)return Qr;Jr=1;var n=Tc();return Qr=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}}(),t=function(){if(eo)return no;eo=1;var n=/\w*$/;return no=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}(),r=function(){if(ro)return to;ro=1;var n=We(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;return to=function(n){return t?Object(t.call(n)):{}}}(),o=Bc();return uo=function(i,u,a){var c=i.constructor;switch(u){case"[object ArrayBuffer]":return n(i);case"[object Boolean]":case"[object Date]":return new c(+i);case"[object DataView]":return e(i,a);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 o(i,a);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(i);case"[object RegExp]":return t(i);case"[object Symbol]":return r(i)}}}(),v=Dc(),p=ft(),g=St(),y=function(){if(go)return po;go=1;var n=function(){if(vo)return ho;vo=1;var n=zc(),e=lt();return ho=function(t){return e(t)&&"[object Map]"==n(t)}}(),e=Mt(),t=tr(),r=t&&t.isMap,o=r?e(r):n;return po=o}(),m=Ge(),x=function(){if(wo)return xo;wo=1;var n=function(){if(mo)return yo;mo=1;var n=zc(),e=lt();return yo=function(t){return e(t)&&"[object Set]"==n(t)}}(),e=Mt(),t=tr(),r=t&&t.isSet,o=r?e(r):n;return xo=o}(),w=lr(),b=sr(),_="[object Arguments]",E="[object Function]",S="[object Object]",k={};return k[_]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[S]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[E]=k["[object WeakMap]"]=!1,bo=function C(M,N,O,P,j,I){var A,z=1&N,L=2&N,T=4&N;if(O&&(A=j?O(M,P,j,I):O(M)),void 0!==A)return A;if(!m(M))return M;var B=p(M);if(B){if(A=d(M),!z)return u(M,A)}else{var R=f(M),D=R==E||"[object GeneratorFunction]"==R;if(g(M))return i(M,z);if(R==S||R==_||D&&!j){if(A=L||D?{}:v(M),!z)return L?c(M,o(A,M)):a(M,r(A,M))}else{if(!k[R])return j?M:{};A=h(M,R,z)}}I||(I=new n);var V=I.get(M);if(V)return V;I.set(M,A),x(M)?M.forEach((function(n){A.add(C(n,N,O,n,M,I))})):y(M)&&M.forEach((function(n,e){A.set(e,C(n,N,O,e,M,I))}));var H=B?void 0:(T?L?s:l:L?b:w)(M);return e(H||M,(function(n,e){H&&(n=M[e=n]),t(A,e,C(n,N,O,e,M,I))})),A},bo}function Hc(){if(So)return Eo;So=1;var n=Vc();return Eo=function(e){return n(e,4)}}function Yc(){return Co?ko:(Co=1,ko=function(n){return function(){return n}})}function Zc(){if(Po)return Oo;Po=1;var n=(No?Mo:(No=1,Mo=function(n){return function(e,t,r){for(var o=-1,i=Object(e),u=r(e),a=u.length;a--;){var c=u[n?a:++o];if(!1===t(i[c],c,i))break}return e}}))();return Oo=n}function Xc(){if(Io)return jo;Io=1;var n=Zc(),e=lr();return jo=function(t,r){return t&&n(t,r,e)}}function Fc(){if(To)return Lo;To=1;var n=Xc(),e=function(){if(zo)return Ao;zo=1;var n=cr();return Ao=function(e,t){return function(r,o){if(null==r)return r;if(!n(r))return e(r,o);for(var i=r.length,u=t?i:-1,a=Object(r);(t?u--:++u<i)&&!1!==o(a[u],u,a););return r}}}()(n);return Lo=e}function Uc(){return Ro?Bo:(Ro=1,Bo=function(n){return n})}function Wc(){if(Vo)return Do;Vo=1;var n=Uc();return Do=function(e){return"function"==typeof e?e:n}}function $c(){if(Yo)return Ho;Yo=1;var n=ot(),e=Fc(),t=Wc(),r=ft();return Ho=function(o,i){return(r(o)?n:e)(o,t(i))}}function Gc(){return Xo?Zo:(Xo=1,Zo=$c())}function qc(){if(Qo)return Ko;Qo=1;var n=tt(),e=$o?Wo:($o=1,Wo=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=qo?Go:(qo=1,Go=function(n){return this.__data__.has(n)});function r(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,Ko=r}function Kc(){return ti?ei:(ti=1,ei=function(n,e){return n.has(e)})}function Qc(){if(oi)return ri;oi=1;var n=qc(),e=(ni||(ni=1,Jo=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}),Jo),t=Kc();return ri=function(r,o,i,u,a,c){var l=1&i,s=r.length,f=o.length;if(s!=f&&!(l&&f>s))return!1;var d=c.get(r),h=c.get(o);if(d&&h)return d==o&&h==r;var v=-1,p=!0,g=2&i?new n:void 0;for(c.set(r,o),c.set(o,r);++v<s;){var y=r[v],m=o[v];if(u)var x=l?u(m,y,v,o,r,c):u(y,m,v,r,o,c);if(void 0!==x){if(x)continue;p=!1;break}if(g){if(!e(o,(function(n,e){if(!t(g,e)&&(y===n||a(y,n,i,u,c)))return g.push(e)}))){p=!1;break}}else if(y!==m&&!a(y,m,i,u,c)){p=!1;break}}return c.delete(r),c.delete(o),p},ri}function Jc(){return ci||(ci=1,ai=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}),ai}function nl(){if(vi)return hi;vi=1;var n=rt(),e=Qc(),t=function(){if(si)return li;si=1;var n=We(),e=Lc(),t=Ye(),r=Qc(),o=ui?ii:(ui=1,ii=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}),i=Jc(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return li=function(n,u,c,l,s,f,d){switch(c){case"[object DataView]":if(n.byteLength!=u.byteLength||n.byteOffset!=u.byteOffset)return!1;n=n.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=u.byteLength||!f(new e(n),new e(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+n,+u);case"[object Error]":return n.name==u.name&&n.message==u.message;case"[object RegExp]":case"[object String]":return n==u+"";case"[object Map]":var h=o;case"[object Set]":var v=1&l;if(h||(h=i),n.size!=u.size&&!v)return!1;var p=d.get(n);if(p)return p==u;l|=2,d.set(n,u);var g=r(h(n),h(u),l,s,f,d);return d.delete(n),g;case"[object Symbol]":if(a)return a.call(n)==a.call(u)}return!1}}(),r=function(){if(di)return fi;di=1;var n=Ic(),e=Object.prototype.hasOwnProperty;return fi=function(t,r,o,i,u,a){var c=1&o,l=n(t),s=l.length;if(s!=n(r).length&&!c)return!1;for(var f=s;f--;){var d=l[f];if(!(c?d in r:e.call(r,d)))return!1}var h=a.get(t),v=a.get(r);if(h&&v)return h==r&&v==t;var p=!0;a.set(t,r),a.set(r,t);for(var g=c;++f<s;){var y=t[d=l[f]],m=r[d];if(i)var x=c?i(m,y,d,r,t,a):i(y,m,d,t,r,a);if(!(void 0===x?y===m||u(y,m,o,i,a):x)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var w=t.constructor,b=r.constructor;w==b||!("constructor"in t)||!("constructor"in r)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(t),a.delete(r),p}}(),o=zc(),i=ft(),u=St(),a=rr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return hi=function(d,h,v,p,g,y){var m=i(d),x=i(h),w=m?l:o(d),b=x?l:o(h),_=(w=w==c?s:w)==s,E=(b=b==c?s:b)==s,S=w==b;if(S&&u(d)){if(!u(h))return!1;m=!0,_=!1}if(S&&!_)return y||(y=new n),m||a(d)?e(d,h,v,p,g,y):t(d,h,w,v,p,g,y);if(!(1&v)){var k=_&&f.call(d,"__wrapped__"),C=E&&f.call(h,"__wrapped__");if(k||C){var M=k?d.value():d,N=C?h.value():h;return y||(y=new n),g(M,N,v,p,y)}}return!!S&&(y||(y=new n),r(d,h,v,p,g,y))}}function el(){if(gi)return pi;gi=1;var n=nl(),e=lt();return pi=function t(r,o,i,u,a){return r===o||(null==r||null==o||!e(r)&&!e(o)?r!=r&&o!=o:n(r,o,i,u,t,a))},pi}function tl(){if(wi)return xi;wi=1;var n=Ge();return xi=function(e){return e==e&&!n(e)}}function rl(){return Si?Ei:(Si=1,Ei=function(n,e){return function(t){return null!=t&&t[n]===e&&(void 0!==e||n in Object(t))}})}function ol(){if(Ni)return Mi;Ni=1;var n=$e(),e=lt();return Mi=function(t){return"symbol"==typeof t||e(t)&&"[object Symbol]"==n(t)}}function il(){if(Pi)return Oi;Pi=1;var n=ft(),e=ol(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Oi=function(o,i){if(n(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!e(o))||r.test(o)||!t.test(o)||null!=i&&o in Object(i)}}function ul(){return Ri||(Ri=1,Bi=function(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}),Bi}function al(){if(Yi)return Hi;Yi=1;var n=function(){if(Vi)return Di;Vi=1;var n=We(),e=ul(),t=ft(),r=ol(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return Di=function n(o){if("string"==typeof o)return o;if(t(o))return e(o,n)+"";if(r(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},Di}();return Hi=function(e){return null==e?"":n(e)}}function cl(){if(Xi)return Zi;Xi=1;var n=ft(),e=il(),t=function(){if(Ti)return Li;Ti=1;var n=function(){if(zi)return Ai;zi=1;var n=function(){if(Ii)return ji;Ii=1;var n=tt();function e(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,e=r?r.apply(this,n):n[0],i=o.cache;if(i.has(e))return i.get(e);var u=t.apply(this,n);return o.cache=i.set(e,u)||i,u};return o.cache=new(e.Cache||n),o}return e.Cache=n,ji=e}();return Ai=function(e){var t=n(e,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}}(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(e,(function(n,e,o,i){r.push(o?i.replace(t,"$1"):e||n)})),r}));return Li=r}(),r=al();return Zi=function(o,i){return n(o)?o:e(o,i)?[o]:t(r(o))}}function ll(){if(Ui)return Fi;Ui=1;var n=ol();return Fi=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}}function sl(){if($i)return Wi;$i=1;var n=cl(),e=ll();return Wi=function(t,r){for(var o=0,i=(r=n(r,t)).length;null!=t&&o<i;)t=t[e(r[o++])];return o&&o==i?t:void 0}}function fl(){if(nu)return Ji;nu=1;var n=cl(),e=st(),t=ft(),r=kt(),o=Ct(),i=ll();return Ji=function(u,a,c){for(var l=-1,s=(a=n(a,u)).length,f=!1;++l<s;){var d=i(a[l]);if(!(f=null!=u&&c(u,d)))break;u=u[d]}return f||++l!=s?f:!!(s=null==u?0:u.length)&&o(s)&&r(d,s)&&(t(u)||e(u))}}function dl(){if(tu)return eu;tu=1;var n=Qi?Ki:(Qi=1,Ki=function(n,e){return null!=n&&e in Object(n)}),e=fl();return eu=function(t,r){return null!=t&&e(t,r,n)}}function hl(){return uu?iu:(uu=1,iu=function(n){return function(e){return null==e?void 0:e[n]}})}function vl(){if(du)return fu;du=1;var n=function(){if(Ci)return ki;Ci=1;var n=function(){if(mi)return yi;mi=1;var n=rt(),e=el();return yi=function(t,r,o,i){var u=o.length,a=u,c=!i;if(null==t)return!a;for(t=Object(t);u--;){var l=o[u];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++u<a;){var s=(l=o[u])[0],f=t[s],d=l[1];if(c&&l[2]){if(void 0===f&&!(s in t))return!1}else{var h=new n;if(i)var v=i(f,d,s,t,r,h);if(!(void 0===v?e(d,f,3,i,h):v))return!1}}return!0}}(),e=function(){if(_i)return bi;_i=1;var n=tl(),e=lr();return bi=function(t){for(var r=e(t),o=r.length;o--;){var i=r[o],u=t[i];r[o]=[i,u,n(u)]}return r}}(),t=rl();return ki=function(r){var o=e(r);return 1==o.length&&o[0][2]?t(o[0][0],o[0][1]):function(e){return e===r||n(e,r,o)}}}(),e=function(){if(ou)return ru;ou=1;var n=el(),e=function(){if(qi)return Gi;qi=1;var n=sl();return Gi=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}}(),t=dl(),r=il(),o=tl(),i=rl(),u=ll();return ru=function(a,c){return r(a)&&o(c)?i(u(a),c):function(r){var o=e(r,a);return void 0===o&&o===c?t(r,a):n(c,o,3)}}}(),t=Uc(),r=ft(),o=function(){if(su)return lu;su=1;var n=hl(),e=function(){if(cu)return au;cu=1;var n=sl();return au=function(e){return function(t){return n(t,e)}}}(),t=il(),r=ll();return lu=function(o){return t(o)?n(r(o)):e(o)}}();return fu=function(i){return"function"==typeof i?i:null==i?t:"object"==typeof i?r(i)?e(i[0],i[1]):n(i):o(i)}}function pl(){if(vu)return hu;vu=1;var n=kc(),e=function(){if(Uo)return Fo;Uo=1;var n=Fc();return Fo=function(e,t){var r=[];return n(e,(function(n,e,o){t(n,e,o)&&r.push(n)})),r}}(),t=vl(),r=ft();return hu=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function gl(){if(mu)return yu;mu=1;var n=function(){if(gu)return pu;gu=1;var n=Object.prototype.hasOwnProperty;return pu=function(e,t){return null!=e&&n.call(e,t)}}(),e=fl();return yu=function(t,r){return null!=t&&e(t,r,n)}}function yl(){if(wu)return xu;wu=1;var n=ar(),e=zc(),t=st(),r=ft(),o=cr(),i=St(),u=ir(),a=rr(),c=Object.prototype.hasOwnProperty;return xu=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||a(l)||t(l)))return!l.length;var s=e(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(u(l))return!n(l).length;for(var f in l)if(c.call(l,f))return!1;return!0}}function ml(){return _u?bu:(_u=1,bu=function(n){return void 0===n})}function xl(){if(Su)return Eu;Su=1;var n=Fc(),e=cr();return Eu=function(t,r){var o=-1,i=e(t)?Array(t.length):[];return n(t,(function(n,e,t){i[++o]=r(n,e,t)})),i}}function wl(){if(Cu)return ku;Cu=1;var n=ul(),e=vl(),t=xl(),r=ft();return ku=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function bl(){if(Iu)return ju;Iu=1;var n=(Nu||(Nu=1,Mu=function(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}),Mu),e=Fc(),t=vl(),r=Pu?Ou:(Pu=1,Ou=function(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}),o=ft();return ju=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,t(u,4),a,l,e)},ju}function _l(){if(Xu)return Zu;Xu=1;var n=ar(),e=zc(),t=cr(),r=function(){if(zu)return Au;zu=1;var n=$e(),e=ft(),t=lt();return Au=function(r){return"string"==typeof r||!e(r)&&t(r)&&"[object String]"==n(r)}}(),o=function(){if(Yu)return Hu;Yu=1;var n=function(){if(Tu)return Lu;Tu=1;var n=hl()("length");return Lu=n}(),e=function(){if(Ru)return Bu;Ru=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Bu=function(e){return n.test(e)}}(),t=function(){if(Vu)return Du;Vu=1;var n="\\ud800-\\udfff",e="["+n+"]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+t+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+c+a+")*",s="(?:"+[o+t+"?",t,i,u,e].join("|")+")",f=RegExp(r+"(?="+r+")|"+s+l,"g");return Du=function(n){for(var e=f.lastIndex=0;f.test(n);)++e;return e}}();return Hu=function(r){return e(r)?t(r):n(r)}}();return Zu=function(i){if(null==i)return 0;if(t(i))return r(i)?o(i):i.length;var u=e(i);return"[object Map]"==u||"[object Set]"==u?i.size:n(i).length}}function El(){if(Uu)return Fu;Uu=1;var n=ot(),e=Rc(),t=Xc(),r=vl(),o=Oc(),i=ft(),u=St(),a=qe(),c=Ge(),l=rr();return Fu=function(s,f,d){var h=i(s),v=h||u(s)||l(s);if(f=r(f,4),null==d){var p=s&&s.constructor;d=v?h?new p:[]:c(s)&&a(p)?e(o(s)):{}}return(v?n:t)(s,(function(n,e,t){return f(d,n,e,t)})),d}}function Sl(){if(qu)return Gu;qu=1;var n=Nc(),e=function(){if($u)return Wu;$u=1;var n=We(),e=st(),t=ft(),r=n?n.isConcatSpreadable:void 0;return Wu=function(n){return t(n)||e(n)||!!(r&&n&&n[r])}}();return Gu=function t(r,o,i,u,a){var c=-1,l=r.length;for(i||(i=e),a||(a=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?t(s,o-1,i,u,a):n(a,s):u||(a[a.length]=s)}return a},Gu}function kl(){if(na)return Ju;na=1;var n=Qu?Ku:(Qu=1,Ku=function(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}),e=Math.max;return Ju=function(t,r,o){return r=e(void 0===r?t.length-1:r,0),function(){for(var i=arguments,u=-1,a=e(i.length-r,0),c=Array(a);++u<a;)c[u]=i[r+u];u=-1;for(var l=Array(r+1);++u<r;)l[u]=i[u];return l[r]=o(c),n(t,this,l)}},Ju}function Cl(){if(ua)return ia;ua=1;var n=function(){if(ta)return ea;ta=1;var n=Yc(),e=it(),t=Uc();return ea=e?function(t,r){return e(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:t}(),e=function(){if(oa)return ra;oa=1;var n=Date.now;return ra=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},ra}(),t=e(n);return ia=t}function Ml(){if(ca)return aa;ca=1;var n=Uc(),e=kl(),t=Cl();return aa=function(r,o){return t(e(r,o,n),r+"")},aa}function Nl(){return sa||(sa=1,la=function(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}),la}function Ol(){if(Ca)return ka;Ca=1;var n=qc(),e=function(){if(ma)return ya;ma=1;var n=function(){if(ga)return pa;ga=1;var n=Nl(),e=da?fa:(da=1,fa=function(n){return n!=n}),t=(va||(va=1,ha=function(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}),ha);return pa=function(r,o,i){return o==o?t(r,o,i):n(r,e,i)},pa}();return ya=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1},ya}(),t=(wa||(wa=1,xa=function(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}),xa),r=Kc(),o=function(){if(Sa)return Ea;Sa=1;var n=Ac(),e=_a?ba:(_a=1,ba=function(){}),t=Jc(),r=n&&1/t(new n([,-0]))[1]==1/0?function(e){return new n(e)}:e;return Ea=r}(),i=Jc();return ka=function(u,a,c){var l=-1,s=e,f=u.length,d=!0,h=[],v=h;if(c)d=!1,s=t;else if(f>=200){var p=a?null:o(u);if(p)return i(p);d=!1,s=r,v=new n}else v=a?[]:h;n:for(;++l<f;){var g=u[l],y=a?a(g):g;if(g=c||0!==g?g:0,d&&y==y){for(var m=v.length;m--;)if(v[m]===y)continue n;a&&v.push(y),h.push(g)}else s(v,y,c)||(v!==h&&v.push(y),h.push(g))}return h},ka}function Pl(){if(Na)return Ma;Na=1;var n=cr(),e=lt();return Ma=function(t){return e(t)&&n(t)}}function jl(){if(Pa)return Oa;Pa=1;var n=Sl(),e=Ml(),t=Ol(),r=Pl(),o=e((function(e){return t(n(e,1,r,!0))}));return Oa=o}function Il(){if(za)return Aa;za=1;var n=function(){if(Ia)return ja;Ia=1;var n=ul();return ja=function(e,t){return n(t,(function(n){return e[n]}))}}(),e=lr();return Aa=function(t){return null==t?[]:n(t,e(t))}}function Al(){if(Ta)return La;var n;Ta=1;try{n={clone:Hc(),constant:Yc(),each:Gc(),filter:pl(),has:gl(),isArray:ft(),isEmpty:yl(),isFunction:qe(),isUndefined:ml(),keys:lr(),map:wl(),reduce:bl(),size:_l(),transform:El(),union:jl(),values:Il()}}catch(n){}return n||(n=window._),La=n}function zl(){if(Ra)return Ba;Ra=1;var n=Al();Ba=t;var e="\0";function t(t){this._isDirected=!n.has(t,"directed")||t.directed,this._isMultigraph=!!n.has(t,"multigraph")&&t.multigraph,this._isCompound=!!n.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[e]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(n,e){n[e]?n[e]++:n[e]=1}function o(n,e){--n[e]||delete n[e]}function i(e,t,r,o){var i=""+t,u=""+r;if(!e&&i>u){var a=i;i=u,u=a}return i+""+u+""+(n.isUndefined(o)?"\0":o)}function u(n,e){return i(n,e.v,e.w,e.name)}return t.prototype._nodeCount=0,t.prototype._edgeCount=0,t.prototype.isDirected=function(){return this._isDirected},t.prototype.isMultigraph=function(){return this._isMultigraph},t.prototype.isCompound=function(){return this._isCompound},t.prototype.setGraph=function(n){return this._label=n,this},t.prototype.graph=function(){return this._label},t.prototype.setDefaultNodeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultNodeLabelFn=e,this},t.prototype.nodeCount=function(){return this._nodeCount},t.prototype.nodes=function(){return n.keys(this._nodes)},t.prototype.sources=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._in[t])}))},t.prototype.sinks=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._out[t])}))},t.prototype.setNodes=function(e,t){var r=arguments,o=this;return n.each(e,(function(n){r.length>1?o.setNode(n,t):o.setNode(n)})),this},t.prototype.setNode=function(t,r){return n.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=e,this._children[t]={},this._children[e][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},t.prototype.node=function(n){return this._nodes[n]},t.prototype.hasNode=function(e){return n.has(this._nodes,e)},t.prototype.removeNode=function(e){var t=this;if(n.has(this._nodes,e)){var r=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],n.each(this.children(e),(function(n){t.setParent(n)})),delete this._children[e]),n.each(n.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],n.each(n.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},t.prototype.setParent=function(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(r))r=e;else{for(var o=r+="";!n.isUndefined(o);o=this.parent(o))if(o===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this},t.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},t.prototype.parent=function(n){if(this._isCompound){var t=this._parent[n];if(t!==e)return t}},t.prototype.children=function(t){if(n.isUndefined(t)&&(t=e),this._isCompound){var r=this._children[t];if(r)return n.keys(r)}else{if(t===e)return this.nodes();if(this.hasNode(t))return[]}},t.prototype.predecessors=function(e){var t=this._preds[e];if(t)return n.keys(t)},t.prototype.successors=function(e){var t=this._sucs[e];if(t)return n.keys(t)},t.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return n.union(t,this.successors(e))},t.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},t.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),n.each(this._edgeObjs,(function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,r.edge(n))}));var o={};function i(n){var e=r.parent(n);return void 0===e||t.hasNode(e)?(o[n]=e,e):e in o?o[e]:i(e)}return this._isCompound&&n.each(t.nodes(),(function(n){t.setParent(n,i(n))})),t},t.prototype.setDefaultEdgeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultEdgeLabelFn=e,this},t.prototype.edgeCount=function(){return this._edgeCount},t.prototype.edges=function(){return n.values(this._edgeObjs)},t.prototype.setPath=function(e,t){var r=this,o=arguments;return n.reduce(e,(function(n,e){return o.length>1?r.setEdge(n,e,t):r.setEdge(n,e),e})),this},t.prototype.setEdge=function(){var e,t,o,u,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(e=c.v,t=c.w,o=c.name,2===arguments.length&&(u=arguments[1],a=!0)):(e=c,t=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),e=""+e,t=""+t,n.isUndefined(o)||(o=""+o);var l=i(this._isDirected,e,t,o);if(n.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=u),this;if(!n.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?u:this._defaultEdgeLabelFn(e,t,o);var s=function(n,e,t,r){var o=""+e,i=""+t;if(!n&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};return r&&(a.name=r),a}(this._isDirected,e,t,o);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[l]=s,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=s,this._out[e][l]=s,this._edgeCount++,this},t.prototype.edge=function(n,e,t){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,e,t);return this._edgeLabels[r]},t.prototype.hasEdge=function(e,t,r){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return n.has(this._edgeLabels,o)},t.prototype.removeEdge=function(n,e,t){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,e,t),a=this._edgeObjs[r];return a&&(n=a.v,e=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[e],n),o(this._sucs[n],e),delete this._in[e][r],delete this._out[n][r],this._edgeCount--),this},t.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.v===t})):o}},t.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.w===t})):o}},t.prototype.nodeEdges=function(n,e){var t=this.inEdges(n,e);if(t)return t.concat(this.outEdges(n,e))},Ba}function Ll(){if(Xa)return Za;Xa=1;var n=Al(),e=zl();function t(e){return n.map(e.nodes(),(function(t){var r=e.node(t),o=e.parent(t),i={v:t};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(e){return n.map(e.edges(),(function(t){var r=e.edge(t),o={v:t.v,w:t.w};return n.isUndefined(t.name)||(o.name=t.name),n.isUndefined(r)||(o.value=r),o}))}return Za={write:function(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t(e),edges:r(e)};return n.isUndefined(e.graph())||(o.value=n.clone(e.graph())),o},read:function(t){var r=new e(t.options).setGraph(t.value);return n.each(t.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(t.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Tl(){if(Ua)return Fa;Ua=1;var n=Al();return Fa=function(e){var t,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,t.push(o),n.each(e.successors(o),i),n.each(e.predecessors(o),i))}return n.each(e.nodes(),(function(n){t=[],i(n),t.length&&o.push(t)})),o},Fa}function Bl(){if($a)return Wa;$a=1;var n=Al();function e(){this._arr=[],this._keyIndices={}}return Wa=e,e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},e.prototype.has=function(e){return n.has(this._keyIndices,e)},e.prototype.priority=function(n){var e=this._keyIndices[n];if(void 0!==e)return this._arr[e].priority},e.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!n.has(r,e)){var o=this._arr,i=o.length;return r[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,e){var t=this._keyIndices[n];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)},e.prototype._heapify=function(n){var e=this._arr,t=2*n,r=t+1,o=n;t<e.length&&(o=e[t].priority<e[o].priority?t:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},e.prototype._decrease=function(n){for(var e,t=this._arr,r=t[n].priority;0!==n&&!(t[e=n>>1].priority<r);)this._swap(n,e),n=e},e.prototype._swap=function(n,e){var t=this._arr,r=this._keyIndices,o=t[n],i=t[e];t[n]=i,t[e]=o,r[i.key]=n,r[o.key]=e},Wa}function Rl(){if(qa)return Ga;qa=1;var n=Al(),e=Bl();Ga=function(n,r,o,i){return function(n,t,r,o){var i,u,a={},c=new e,l=function(n){var e=n.v!==i?n.v:n.w,t=a[e],o=r(n),l=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+n+" Weight: "+o);l<t.distance&&(t.distance=l,t.predecessor=i,c.decrease(e,l))};for(n.nodes().forEach((function(n){var e=n===t?0:Number.POSITIVE_INFINITY;a[n]={distance:e},c.add(n,e)}));c.size()>0&&(i=c.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return a}(n,String(r),o||t,i||function(e){return n.outEdges(e)})};var t=n.constant(1);return Ga}function Dl(){if(Qa)return Ka;Qa=1;var n=Rl(),e=Al();return Ka=function(t,r,o){return e.transform(t.nodes(),(function(e,i){e[i]=n(t,i,r,o)}),{})}}function Vl(){if(nc)return Ja;nc=1;var n=Al();return Ja=function(e){var t=0,r=[],o={},i=[];function u(a){var c=o[a]={onStack:!0,lowlink:t,index:t++};if(r.push(a),e.successors(a).forEach((function(e){n.has(o,e)?o[e].onStack&&(c.lowlink=Math.min(c.lowlink,o[e].index)):(u(e),c.lowlink=Math.min(c.lowlink,o[e].lowlink))})),c.lowlink===c.index){var l,s=[];do{l=r.pop(),o[l].onStack=!1,s.push(l)}while(a!==l);i.push(s)}}return e.nodes().forEach((function(e){n.has(o,e)||u(e)})),i},Ja}function Hl(){if(tc)return ec;tc=1;var n=Al(),e=Vl();return ec=function(t){return n.filter(e(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function Yl(){if(oc)return rc;oc=1;var n=Al();rc=function(n,t,r){return function(n,e,t){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(e){n!==e&&(r[n][e]={distance:Number.POSITIVE_INFINITY})})),t(n).forEach((function(t){var o=t.v===n?t.w:t.v,i=e(t);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var e=r[n];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[n],o=e[t],u=i[t],a=r.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)}))}))})),r}(n,t||e,r||function(e){return n.outEdges(e)})};var e=n.constant(1);return rc}function Zl(){if(uc)return ic;uc=1;var n=Al();function e(e){var r={},o={},i=[];if(n.each(e.sinks(),(function u(a){if(n.has(o,a))throw new t;n.has(r,a)||(o[a]=!0,r[a]=!0,n.each(e.predecessors(a),u),delete o[a],i.push(a))})),n.size(r)!==e.nodeCount())throw new t;return i}function t(){}return ic=e,e.CycleException=t,t.prototype=new Error,ic}function Xl(){if(cc)return ac;cc=1;var n=Zl();return ac=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}function Fl(){if(sc)return lc;sc=1;var n=Al();function e(t,r,o,i,u,a){n.has(i,r)||(i[r]=!0,o||a.push(r),n.each(u(r),(function(n){e(t,n,o,i,u,a)})),o&&a.push(r))}return lc=function(t,r,o){n.isArray(r)||(r=[r]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),u=[],a={};return n.each(r,(function(n){if(!t.hasNode(n))throw new Error("Graph does not have node: "+n);e(t,n,"post"===o,a,i,u)})),u},lc}function Ul(){if(dc)return fc;dc=1;var n=Fl();return fc=function(e,t){return n(e,t,"post")}}function Wl(){if(vc)return hc;vc=1;var n=Fl();return hc=function(e,t){return n(e,t,"pre")}}function $l(){if(gc)return pc;gc=1;var n=Al(),e=zl(),t=Bl();return pc=function(r,o){var i,u=new e,a={},c=new t;function l(n){var e=n.v===i?n.w:n.v,t=c.priority(e);if(void 0!==t){var r=o(n);r<t&&(a[e]=i,c.decrease(e,r))}}if(0===r.nodeCount())return u;n.each(r.nodes(),(function(n){c.add(n,Number.POSITIVE_INFINITY),u.setNode(n)})),c.decrease(r.nodes()[0],0);for(var s=!1;c.size()>0;){if(i=c.removeMin(),n.has(a,i))u.setEdge(i,a[i]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(i).forEach(l)}return u},pc}try{bc=function(){if(wc)return xc;wc=1;var n=Ya?Ha:(Ya=1,Ha={Graph:zl(),version:Va?Da:(Va=1,Da="2.1.8")});return xc={Graph:n.Graph,json:Ll(),alg:mc?yc:(mc=1,yc={components:Tl(),dijkstra:Rl(),dijkstraAll:Dl(),findCycles:Hl(),floydWarshall:Yl(),isAcyclic:Xl(),postorder:Ul(),preorder:Wl(),prim:$l(),tarjan:Vl(),topsort:Zl()}),version:n.version}}()}catch(L){}bc||(bc=window.graphlib);var Gl,ql,Kl,Ql,Jl,ns,es,ts,rs,os,is,us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,xs,ws,bs,_s,Es,Ss,ks,Cs,Ms,Ns,Os,Ps,js,Is,As,zs,Ls,Ts,Bs,Rs,Ds,Vs,Hs,Ys,Zs,Xs,Fs,Us,Ws,$s,Gs,qs,Ks,Qs,Js,nf,ef,tf,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,xf,wf,bf,_f,Ef,Sf,kf,Cf,Mf,Nf,Of,Pf,jf,If,Af,zf,Lf=bc;function Tf(){if(Ql)return Kl;Ql=1;var n=Ye(),e=cr(),t=kt(),r=Ge();return Kl=function(o,i,u){if(!r(u))return!1;var a=typeof i;return!!("number"==a?e(u)&&t(i,u.length):"string"==a&&i in u)&&n(u[i],o)}}function Bf(){if(ss)return ls;ss=1;var n=function(){if(cs)return as;cs=1;var n=function(){if(us)return is;us=1;var n=function(){if(os)return rs;os=1;var n=/\s/;return rs=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}}(),e=/^\s+/;return is=function(t){return t?t.slice(0,n(t)+1).replace(e,""):t}}(),e=Ge(),t=ol(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return as=function(a){if("number"==typeof a)return a;if(t(a))return NaN;if(e(a)){var c="function"==typeof a.valueOf?a.valueOf():a;a=e(c)?c+"":c}if("string"!=typeof a)return 0===a?a:+a;a=n(a);var l=o.test(a);return l||i.test(a)?u(a.slice(2),l?2:8):r.test(a)?NaN:+a}}(),e=1/0;return ls=function(t){return t?(t=n(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}}function Rf(){if(ms)return ys;ms=1;var n=Sl();return ys=function(e){return null!=e&&e.length?n(e,1):[]}}function Df(){if(Cs)return ks;Cs=1;var n=ol();return ks=function(e,t,r){for(var o=-1,i=e.length;++o<i;){var u=e[o],a=t(u);if(null!=a&&(void 0===c?a==a&&!n(a):r(a,c)))var c=a,l=u}return l},ks}function Vf(){if(Is)return js;Is=1;var n=ut(),e=Ye();return js=function(t,r,o){(void 0!==o&&!e(t[r],o)||void 0===o&&!(r in t))&&n(t,r,o)}}function Hf(){return Ts?Ls:(Ts=1,Ls=function(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]})}function Yf(){return $s?Ws:($s=1,Ws=function(n,e){return n<e})}function Zf(){if(kf)return Sf;kf=1;var n=ul(),e=sl(),t=vl(),r=xl(),o=(xf||(xf=1,mf=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}),mf),i=Mt(),u=function(){if(Ef)return _f;Ef=1;var n=function(){if(bf)return wf;bf=1;var n=ol();return wf=function(e,t){if(e!==t){var r=void 0!==e,o=null===e,i=e==e,u=n(e),a=void 0!==t,c=null===t,l=t==t,s=n(t);if(!c&&!s&&!u&&e>t||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&e<t||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}}();return _f=function(e,t,r){for(var o=-1,i=e.criteria,u=t.criteria,a=i.length,c=r.length;++o<a;){var l=n(i[o],u[o]);if(l)return o>=c?l:l*("desc"==r[o]?-1:1)}return e.index-t.index}}(),a=Uc(),c=ft();return Sf=function(l,s,f){s=s.length?n(s,(function(n){return c(n)?function(t){return e(t,1===n.length?n[0]:n)}:n})):[a];var d=-1;s=n(s,i(t));var h=r(l,(function(e,t,r){return{criteria:n(s,(function(n){return n(e)})),index:++d,value:e}}));return o(h,(function(n,e){return u(n,e,f)}))}}try{zf={cloneDeep:function(){if(ql)return Gl;ql=1;var n=Vc();return Gl=function(e){return n(e,5)}}(),constant:Yc(),defaults:function(){if(ns)return Jl;ns=1;var n=Ml(),e=Ye(),t=Tf(),r=sr(),o=Object.prototype,i=o.hasOwnProperty,u=n((function(n,u){n=Object(n);var a=-1,c=u.length,l=c>2?u[2]:void 0;for(l&&t(u[0],u[1],l)&&(c=1);++a<c;)for(var s=u[a],f=r(s),d=-1,h=f.length;++d<h;){var v=f[d],p=n[v];(void 0===p||e(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return Jl=u}(),each:Gc(),filter:pl(),find:function(){if(gs)return ps;gs=1;var n=function(){if(ts)return es;ts=1;var n=vl(),e=cr(),t=lr();return es=function(r){return function(o,i,u){var a=Object(o);if(!e(o)){var c=n(i,3);o=t(o),i=function(n){return c(a[n],n,a)}}var l=r(o,i,u);return l>-1?a[c?o[l]:l]:void 0}}}()(function(){if(vs)return hs;vs=1;var n=Nl(),e=vl(),t=function(){if(ds)return fs;ds=1;var n=Bf();return fs=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return hs=function(o,i,u){var a=null==o?0:o.length;if(!a)return-1;var c=null==u?0:t(u);return c<0&&(c=r(a+c,0)),n(o,e(i,3),c)},hs}());return ps=n}(),flatten:Rf(),forEach:$c(),forIn:function(){if(ws)return xs;ws=1;var n=Zc(),e=Wc(),t=sr();return xs=function(r,o){return null==r?r:n(r,e(o),t)}}(),has:gl(),isUndefined:ml(),last:(_s||(_s=1,bs=function(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}),bs),map:wl(),mapValues:function(){if(Ss)return Es;Ss=1;var n=ut(),e=Xc(),t=vl();return Es=function(r,o){var i={};return o=t(o,3),e(r,(function(e,t,r){n(i,t,o(e,t,r))})),i}}(),max:function(){if(Ps)return Os;Ps=1;var n=Df(),e=Ns?Ms:(Ns=1,Ms=function(n,e){return n>e}),t=Uc();return Os=function(r){return r&&r.length?n(r,t,e):void 0},Os}(),merge:function(){if(Us)return Fs;Us=1;var n=function(){if(Ys)return Hs;Ys=1;var n=rt(),e=Vf(),t=Zc(),r=function(){if(Vs)return Ds;Vs=1;var n=Vf(),e=Ec(),t=Bc(),r=Sc(),o=Dc(),i=st(),u=ft(),a=Pl(),c=St(),l=qe(),s=Ge(),f=function(){if(zs)return As;zs=1;var n=$e(),e=Oc(),t=lt(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return As=function(r){if(!t(r)||"[object Object]"!=n(r))return!1;var o=e(r);if(null===o)return!0;var c=u.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==a}}(),d=rr(),h=Hf(),v=function(){if(Rs)return Bs;Rs=1;var n=ct(),e=sr();return Bs=function(t){return n(t,e(t))}}();return Ds=function(p,g,y,m,x,w,b){var _=h(p,y),E=h(g,y),S=b.get(E);if(S)n(p,y,S);else{var k=w?w(_,E,y+"",p,g,b):void 0,C=void 0===k;if(C){var M=u(E),N=!M&&c(E),O=!M&&!N&&d(E);k=E,M||N||O?u(_)?k=_:a(_)?k=r(_):N?(C=!1,k=e(E,!0)):O?(C=!1,k=t(E,!0)):k=[]:f(E)||i(E)?(k=_,i(_)?k=v(_):s(_)&&!l(_)||(k=o(E))):C=!1}C&&(b.set(E,k),x(k,E,m,w,b),b.delete(E)),n(p,y,k)}}}(),o=Ge(),i=sr(),u=Hf();return Hs=function a(c,l,s,f,d){c!==l&&t(l,(function(t,i){if(d||(d=new n),o(t))r(c,l,i,s,a,f,d);else{var h=f?f(u(c,i),t,i+"",c,l,d):void 0;void 0===h&&(h=t),e(c,i,h)}}),i)},Hs}(),e=function(){if(Xs)return Zs;Xs=1;var n=Ml(),e=Tf();return Zs=function(t){return n((function(n,r){var o=-1,i=r.length,u=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,a&&e(r[0],r[1],a)&&(u=i<3?void 0:u,i=1),n=Object(n);++o<i;){var c=r[o];c&&t(n,c,o,u)}return n}))}}()((function(e,t,r){n(e,t,r)}));return Fs=e}(),min:function(){if(qs)return Gs;qs=1;var n=Df(),e=Yf(),t=Uc();return Gs=function(r){return r&&r.length?n(r,t,e):void 0},Gs}(),minBy:function(){if(Qs)return Ks;Qs=1;var n=Df(),e=vl(),t=Yf();return Ks=function(r,o){return r&&r.length?n(r,e(o,2),t):void 0},Ks}(),now:function(){if(nf)return Js;nf=1;var n=Ue();return Js=function(){return n.Date.now()}}(),pick:function(){if(ff)return sf;ff=1;var n=function(){if(af)return uf;af=1;var n=function(){if(of)return rf;of=1;var n=sl(),e=function(){if(tf)return ef;tf=1;var n=at(),e=cl(),t=kt(),r=Ge(),o=ll();return ef=function(i,u,a,c){if(!r(i))return i;for(var l=-1,s=(u=e(u,i)).length,f=s-1,d=i;null!=d&&++l<s;){var h=o(u[l]),v=a;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(l!=f){var p=d[h];void 0===(v=c?c(p,h,d):void 0)&&(v=r(p)?p:t(u[l+1])?[]:{})}n(d,h,v),d=d[h]}return i}}(),t=cl();return rf=function(r,o,i){for(var u=-1,a=o.length,c={};++u<a;){var l=o[u],s=n(r,l);i(s,l)&&e(c,t(l,r),s)}return c}}(),e=dl();return uf=function(t,r){return n(t,r,(function(n,r){return e(t,r)}))}}(),e=function(){if(lf)return cf;lf=1;var n=Rf(),e=kl(),t=Cl();return cf=function(r){return t(e(r,void 0,n),r+"")}}()((function(e,t){return null==e?{}:n(e,t)}));return sf=e}(),range:function(){if(yf)return gf;yf=1;var n=function(){if(pf)return vf;pf=1;var n=function(){if(hf)return df;hf=1;var n=Math.ceil,e=Math.max;return df=function(t,r,o,i){for(var u=-1,a=e(n((r-t)/(o||1)),0),c=Array(a);a--;)c[i?a:++u]=t,t+=o;return c},df}(),e=Tf(),t=Bf();return vf=function(r){return function(o,i,u){return u&&"number"!=typeof u&&e(o,i,u)&&(i=u=void 0),o=t(o),void 0===i?(i=o,o=0):i=t(i),u=void 0===u?o<i?1:-1:t(u),n(o,i,u,r)}},vf}()();return gf=n}(),reduce:bl(),sortBy:function(){if(Mf)return Cf;Mf=1;var n=Sl(),e=Zf(),t=Ml(),r=Tf(),o=t((function(t,o){if(null==t)return[];var i=o.length;return i>1&&r(t,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(t,n(o,1),[])}));return Cf=o}(),uniqueId:function(){if(Of)return Nf;Of=1;var n=al(),e=0;return Nf=function(t){var r=++e;return n(t)+r},Nf}(),values:Il(),zipObject:function(){if(Af)return If;Af=1;var n=at(),e=jf?Pf:(jf=1,Pf=function(n,e,t){for(var r=-1,o=n.length,i=e.length,u={};++r<o;){var a=r<i?e[r]:void 0;t(u,n[r],a)}return u});return If=function(t,r){return e(t||[],r||[],n)}}()}}catch(L){}zf||(zf=window._);var Xf=zf,Ff=Uf;function Uf(){var n={};n._next=n._prev=n,this._sentinel=n}function Wf(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function $f(n,e){if("_next"!==n&&"_prev"!==n)return e}Uf.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return Wf(e),e},Uf.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&Wf(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},Uf.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,$f)),t=t._prev;return"["+n.join(", ")+"]"};var Gf=Xf,qf=Lf.Graph,Kf=Ff,Qf=Gf.constant(1);function Jf(n,e,t,r,o){var i=o?[]:void 0;return Gf.forEach(n.inEdges(r.v),(function(r){var u=n.edge(r),a=n.node(r.v);o&&i.push({v:r.v,w:r.w}),a.out-=u,nd(e,t,a)})),Gf.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,nd(e,t,u)})),n.removeNode(r.v),i}function nd(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var ed=Xf,td=function(n,e){if(n.nodeCount()<=1)return[];var t=function(n,e){var t=new qf,r=0,o=0;Gf.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),Gf.forEach(n.edges(),(function(n){var i=t.edge(n.v,n.w)||0,u=e(n),a=i+u;t.setEdge(n.v,n.w,a),o=Math.max(o,t.node(n.v).out+=u),r=Math.max(r,t.node(n.w).in+=u)}));var i=Gf.range(o+r+3).map((function(){return new Kf})),u=r+1;return Gf.forEach(t.nodes(),(function(n){nd(i,u,t.node(n))})),{graph:t,buckets:i,zeroIdx:u}}(n,e||Qf),r=function(n,e,t){for(var r,o=[],i=e[e.length-1],u=e[0];n.nodeCount();){for(;r=u.dequeue();)Jf(n,e,t,r);for(;r=i.dequeue();)Jf(n,e,t,r);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(r=e[a].dequeue()){o=o.concat(Jf(n,e,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return Gf.flatten(Gf.map(r,(function(e){return n.outEdges(e.v,e.w)})),!0)},rd={run:function(n){var e="greedy"===n.graph().acyclicer?td(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],t={},r={};return ed.forEach(n.nodes(),(function o(i){ed.has(r,i)||(r[i]=!0,t[i]=!0,ed.forEach(n.outEdges(i),(function(n){ed.has(t,n.w)?e.push(n):o(n.w)})),delete t[i])})),e}(n);ed.forEach(e,(function(e){var t=n.edge(e);n.removeEdge(e),t.forwardName=e.name,t.reversed=!0,n.setEdge(e.w,e.v,t,ed.uniqueId("rev"))}))},undo:function(n){ed.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}}))}},od=Xf,id=Lf.Graph,ud={addDummyNode:ad,simplify:function(n){var e=(new id).setGraph(n.graph());return od.forEach(n.nodes(),(function(t){e.setNode(t,n.node(t))})),od.forEach(n.edges(),(function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},o=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(n){var e=new id({multigraph:n.isMultigraph()}).setGraph(n.graph());return od.forEach(n.nodes(),(function(t){n.children(t).length||e.setNode(t,n.node(t))})),od.forEach(n.edges(),(function(t){e.setEdge(t,n.edge(t))})),e},successorWeights:function(n){var e=od.map(n.nodes(),(function(e){var t={};return od.forEach(n.outEdges(e),(function(e){t[e.w]=(t[e.w]||0)+n.edge(e).weight})),t}));return od.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=od.map(n.nodes(),(function(e){var t={};return od.forEach(n.inEdges(e),(function(e){t[e.v]=(t[e.v]||0)+n.edge(e).weight})),t}));return od.zipObject(n.nodes(),e)},intersectRect:function(n,e){var t,r,o=n.x,i=n.y,u=e.x-o,a=e.y-i,c=n.width/2,l=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*c>Math.abs(u)*l?(a<0&&(l=-l),t=l*u/a,r=l):(u<0&&(c=-c),t=c,r=c*a/u),{x:o+t,y:i+r}},buildLayerMatrix:function(n){var e=od.map(od.range(cd(n)+1),(function(){return[]}));return od.forEach(n.nodes(),(function(t){var r=n.node(t),o=r.rank;od.isUndefined(o)||(e[o][r.order]=t)})),e},normalizeRanks:function(n){var e=od.min(od.map(n.nodes(),(function(e){return n.node(e).rank})));od.forEach(n.nodes(),(function(t){var r=n.node(t);od.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(n){var e=od.min(od.map(n.nodes(),(function(e){return n.node(e).rank}))),t=[];od.forEach(n.nodes(),(function(r){var o=n.node(r).rank-e;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;od.forEach(t,(function(e,t){od.isUndefined(e)&&t%o!=0?--r:r&&od.forEach(e,(function(e){n.node(e).rank+=r}))}))},addBorderNode:function(n,e,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),ad(n,"border",o,e)},maxRank:cd,partition:function(n,e){var t={lhs:[],rhs:[]};return od.forEach(n,(function(n){e(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,e){var t=od.now();try{return e()}finally{console.log(n+" time: "+(od.now()-t)+"ms")}},notime:function(n,e){return e()}};function ad(n,e,t,r){var o;do{o=od.uniqueId(r)}while(n.hasNode(o));return t.dummy=e,n.setNode(o,t),o}function cd(n){return od.max(od.map(n.nodes(),(function(e){var t=n.node(e).rank;if(!od.isUndefined(t))return t})))}var ld=Xf,sd=ud,fd={run:function(n){n.graph().dummyChains=[],ld.forEach(n.edges(),(function(e){!function(n,e){var t,r,o,i=e.v,u=n.node(i).rank,a=e.w,c=n.node(a).rank,l=e.name,s=n.edge(e),f=s.labelRank;if(c!==u+1){for(n.removeEdge(e),o=0,++u;u<c;++o,++u)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:e,rank:u},t=sd.addDummyNode(n,"edge",r,"_d"),u===f&&(r.width=s.width,r.height=s.height,r.dummy="edge-label",r.labelpos=s.labelpos),n.setEdge(i,t,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(t),i=t;n.setEdge(i,a,{weight:s.weight},l)}}(n,e)}))},undo:function(n){ld.forEach(n.graph().dummyChains,(function(e){var t,r=n.node(e),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)t=n.successors(e)[0],n.removeNode(e),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),e=t,r=n.node(e)}))}},dd=Xf,hd=function(n){var e={};dd.forEach(n.sources(),(function t(r){var o=n.node(r);if(dd.has(e,r))return o.rank;e[r]=!0;var i=dd.min(dd.map(n.outEdges(r),(function(e){return t(e.w)-n.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},vd=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},pd=Xf,gd=Lf.Graph,yd=vd,md=function(n){var e,t,r=new gd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});xd(r,n)<i;)e=wd(r,n),t=r.hasNode(e.v)?yd(n,e):-yd(n,e),bd(r,n,t);return r};function xd(n,e){return pd.forEach(n.nodes(),(function t(r){pd.forEach(e.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||yd(e,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),t(u))}))})),n.nodeCount()}function wd(n,e){return pd.minBy(e.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return yd(e,t)}))}function bd(n,e,t){pd.forEach(n.nodes(),(function(n){e.node(n).rank+=t}))}var _d=Xf,Ed=md,Sd=vd,kd=hd,Cd=Lf.alg.preorder,Md=Lf.alg.postorder,Nd=ud.simplify,Od=Pd;function Pd(n){n=Nd(n),kd(n);var e,t=Ed(n);for(Ad(t),jd(t,n);e=Ld(t);)Bd(t,n,e,Td(t,n,e))}function jd(n,e){var t=Md(n,n.nodes());t=t.slice(0,t.length-1),_d.forEach(t,(function(t){!function(n,e,t){var r=n.node(t).parent;n.edge(t,r).cutvalue=Id(n,e,t)}(n,e,t)}))}function Id(n,e,t){var r=n.node(t).parent,o=!0,i=e.edge(t,r),u=0;return i||(o=!1,i=e.edge(r,t)),u=i.weight,_d.forEach(e.nodeEdges(t),(function(i){var a,c,l=i.v===t,s=l?i.w:i.v;if(s!==r){var f=l===o,d=e.edge(i).weight;if(u+=f?d:-d,a=t,c=s,n.hasEdge(a,c)){var h=n.edge(t,s).cutvalue;u+=f?-h:h}}})),u}function Ad(n,e){arguments.length<2&&(e=n.nodes()[0]),zd(n,{},1,e)}function zd(n,e,t,r,o){var i=t,u=n.node(r);return e[r]=!0,_d.forEach(n.neighbors(r),(function(o){_d.has(e,o)||(t=zd(n,e,t,o,r))})),u.low=i,u.lim=t++,o?u.parent=o:delete u.parent,t}function Ld(n){return _d.find(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function Td(n,e,t){var r=t.v,o=t.w;e.hasEdge(r,o)||(r=t.w,o=t.v);var i=n.node(r),u=n.node(o),a=i,c=!1;i.lim>u.lim&&(a=u,c=!0);var l=_d.filter(e.edges(),(function(e){return c===Rd(n,n.node(e.v),a)&&c!==Rd(n,n.node(e.w),a)}));return _d.minBy(l,(function(n){return Sd(e,n)}))}function Bd(n,e,t,r){var o=t.v,i=t.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Ad(n),jd(n,e),function(n,e){var t=_d.find(n.nodes(),(function(n){return!e.node(n).parent})),r=Cd(n,t);r=r.slice(1),_d.forEach(r,(function(t){var r=n.node(t).parent,o=e.edge(t,r),i=!1;o||(o=e.edge(r,t),i=!0),e.node(t).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,e)}function Rd(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}Pd.initLowLimValues=Ad,Pd.initCutValues=jd,Pd.calcCutValue=Id,Pd.leaveEdge=Ld,Pd.enterEdge=Td,Pd.exchangeEdges=Bd;var Dd=hd,Vd=md,Hd=Od,Yd=Dd;var Zd=Xf,Xd=Xf,Fd=ud,Ud={run:function(n){var e=Fd.addDummyNode(n,"root",{},"_root"),t=function(n){var e={};function t(r,o){var i=n.children(r);i&&i.length&&Xd.forEach(i,(function(n){t(n,o+1)})),e[r]=o}return Xd.forEach(n.children(),(function(n){t(n,1)})),e}(n),r=Xd.max(Xd.values(t))-1,o=2*r+1;n.graph().nestingRoot=e,Xd.forEach(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return Xd.reduce(n.edges(),(function(e,t){return e+n.edge(t).weight}),0)}(n)+1;Xd.forEach(n.children(),(function(u){Wd(n,e,o,i,r,t,u)})),n.graph().nodeRankFactor=o},cleanup:function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,Xd.forEach(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}};function Wd(n,e,t,r,o,i,u){var a=n.children(u);if(a.length){var c=Fd.addBorderNode(n,"_bt"),l=Fd.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(c,u),s.borderTop=c,n.setParent(l,u),s.borderBottom=l,Xd.forEach(a,(function(a){Wd(n,e,t,r,o,i,a);var s=n.node(a),f=s.borderTop?s.borderTop:a,d=s.borderBottom?s.borderBottom:a,h=s.borderTop?r:2*r,v=f!==d?1:o-i[u]+1;n.setEdge(c,f,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(d,l,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(u)||n.setEdge(e,c,{weight:0,minlen:o+i[u]})}else u!==e&&n.setEdge(e,u,{weight:0,minlen:t})}var $d=Xf,Gd=ud;function qd(n,e,t,r,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],c=Gd.addDummyNode(n,"border",u,t);o[e][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var Kd=Xf,Qd={adjust:function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Jd(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){Kd.forEach(n.nodes(),(function(e){eh(n.node(e))})),Kd.forEach(n.edges(),(function(e){var t=n.edge(e);Kd.forEach(t.points,eh),Kd.has(t,"y")&&eh(t)}))}(n),"lr"!==e&&"rl"!==e||(function(n){Kd.forEach(n.nodes(),(function(e){th(n.node(e))})),Kd.forEach(n.edges(),(function(e){var t=n.edge(e);Kd.forEach(t.points,th),Kd.has(t,"x")&&th(t)}))}(n),Jd(n))}};function Jd(n){Kd.forEach(n.nodes(),(function(e){nh(n.node(e))})),Kd.forEach(n.edges(),(function(e){nh(n.edge(e))}))}function nh(n){var e=n.width;n.width=n.height,n.height=e}function eh(n){n.y=-n.y}function th(n){var e=n.x;n.x=n.y,n.y=e}var rh=Xf,oh=Xf;function ih(n,e,t){for(var r=oh.zipObject(t,oh.map(t,(function(n,e){return e}))),o=oh.flatten(oh.map(e,(function(e){return oh.sortBy(oh.map(n.outEdges(e),(function(e){return{pos:r[e.w],weight:n.edge(e).weight}})),"pos")})),!0),i=1;i<t.length;)i<<=1;var u=2*i-1;i-=1;var a=oh.map(new Array(u),(function(){return 0})),c=0;return oh.forEach(o.forEach((function(n){var e=n.pos+i;a[e]+=n.weight;for(var t=0;e>0;)e%2&&(t+=a[e+1]),a[e=e-1>>1]+=n.weight;c+=n.weight*t}))),c}var uh=Xf,ah=Xf,ch=Xf,lh=ud;function sh(n,e,t){for(var r;e.length&&(r=ch.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var fh=Xf,dh=Xf,hh=Lf.Graph,vh=Xf,ph=Xf,gh=function(n){var e={},t=rh.filter(n.nodes(),(function(e){return!n.children(e).length})),r=rh.max(rh.map(t,(function(e){return n.node(e).rank}))),o=rh.map(rh.range(r+1),(function(){return[]}));var i=rh.sortBy(t,(function(e){return n.node(e).rank}));return rh.forEach(i,(function t(r){if(!rh.has(e,r)){e[r]=!0;var i=n.node(r);o[i.rank].push(r),rh.forEach(n.successors(r),t)}})),o},yh=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=ih(n,e[r-1],e[r]);return t},mh=function n(e,t,r,o){var i=e.children(t),u=e.node(t),a=u?u.borderLeft:void 0,c=u?u.borderRight:void 0,l={};a&&(i=fh.filter(i,(function(n){return n!==a&&n!==c})));var s=function(n,e){return uh.map(e,(function(e){var t=n.inEdges(e);if(t.length){var r=uh.reduce(t,(function(e,t){var r=n.edge(t),o=n.node(t.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);fh.forEach(s,(function(t){if(e.children(t.v).length){var i=n(e,t.v,r,o);l[t.v]=i,fh.has(i,"barycenter")&&(u=t,a=i,fh.isUndefined(u.barycenter)?(u.barycenter=a.barycenter,u.weight=a.weight):(u.barycenter=(u.barycenter*u.weight+a.barycenter*a.weight)/(u.weight+a.weight),u.weight+=a.weight))}var u,a}));var f=function(n,e){var t={};return ah.forEach(n,(function(n,e){var r=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};ah.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),ah.forEach(e.edges(),(function(n){var e=t[n.v],r=t[n.w];ah.isUndefined(e)||ah.isUndefined(r)||(r.indegree++,e.out.push(t[n.w]))})),function(n){var e=[];function t(n){return function(e){e.merged||(ah.isUndefined(e.barycenter)||ah.isUndefined(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function r(e){return function(t){t.in.push(e),0==--t.indegree&&n.push(t)}}for(;n.length;){var o=n.pop();e.push(o),ah.forEach(o.in.reverse(),t(o)),ah.forEach(o.out,r(o))}return ah.map(ah.filter(e,(function(n){return!n.merged})),(function(n){return ah.pick(n,["vs","i","barycenter","weight"])}))}(ah.filter(t,(function(n){return!n.indegree})))}(s,r);!function(n,e){fh.forEach(n,(function(n){n.vs=fh.flatten(n.vs.map((function(n){return e[n]?e[n].vs:n})),!0)}))}(f,l);var d=function(n,e){var t,r=lh.partition(n,(function(n){return ch.has(n,"barycenter")})),o=r.lhs,i=ch.sortBy(r.rhs,(function(n){return-n.i})),u=[],a=0,c=0,l=0;o.sort((t=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:t?e.i-n.i:n.i-e.i})),l=sh(u,i,l),ch.forEach(o,(function(n){l+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,c+=n.weight,l=sh(u,i,l)}));var s={vs:ch.flatten(u,!0)};return c&&(s.barycenter=a/c,s.weight=c),s}(f,o);if(a&&(d.vs=fh.flatten([a,d.vs,c],!0),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(c)[0]);fh.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+v.order)/(d.weight+2),d.weight+=2}return d},xh=function(n,e,t){var r=function(n){for(var e;n.hasNode(e=dh.uniqueId("_root")););return e}(n),o=new hh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return n.node(e)}));return dh.forEach(n.nodes(),(function(i){var u=n.node(i),a=n.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||r),dh.forEach(n[t](i),(function(e){var t=e.v===i?e.w:e.v,r=o.edge(t,i),u=dh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:n.edge(e).weight+u})})),dh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o},wh=Lf.Graph,bh=ud;function _h(n,e,t){return ph.map(e,(function(e){return xh(n,e,t)}))}function Eh(n,e){var t=new wh;ph.forEach(n,(function(n){var r=n.graph().root,o=mh(n,r,t,e);ph.forEach(o.vs,(function(e,t){n.node(e).order=t})),function(n,e,t){var r,o={};vh.forEach(t,(function(t){for(var i,u,a=n.parent(t);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=r,r=a),u&&u!==a)return void e.setEdge(u,a);a=i}}))}(n,t,o.vs)}))}function Sh(n,e){ph.forEach(e,(function(e){ph.forEach(e,(function(e,t){n.node(e).order=t}))}))}var kh=Xf,Ch=Lf.Graph,Mh=ud;function Nh(n,e,t){if(e>t){var r=e;e=t,t=r}var o=n[e];o||(n[e]=o={}),o[t]=!0}function Oh(n,e,t){if(e>t){var r=e;e=t,t=r}return kh.has(n[e],t)}var Ph=Xf,jh=ud,Ih=function(n){var e,t=Mh.buildLayerMatrix(n),r=kh.merge(function(n,e){var t={};return kh.reduce(e,(function(e,r){var o=0,i=0,u=e.length,a=kh.last(r);return kh.forEach(r,(function(e,c){var l=function(n,e){if(n.node(e).dummy)return kh.find(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),s=l?n.node(l).order:u;(l||e===a)&&(kh.forEach(r.slice(i,c+1),(function(e){kh.forEach(n.predecessors(e),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(e).dummy||Nh(t,r,e)}))})),i=c+1,o=s)})),r})),t}(n,t),function(n,e){var t={};function r(e,r,o,i,u){var a;kh.forEach(kh.range(r,o),(function(r){a=e[r],n.node(a).dummy&&kh.forEach(n.predecessors(a),(function(e){var r=n.node(e);r.dummy&&(r.order<i||r.order>u)&&Nh(t,e,a)}))}))}return kh.reduce(e,(function(e,t){var o,i=-1,u=0;return kh.forEach(t,(function(a,c){if("border"===n.node(a).dummy){var l=n.predecessors(a);l.length&&(o=n.node(l[0]).order,r(t,u,c,i,o),u=c,i=o)}r(t,u,t.length,o,e.length)})),t})),t}(n,t)),o={};kh.forEach(["u","d"],(function(i){e="u"===i?t:kh.values(t).reverse(),kh.forEach(["l","r"],(function(t){"r"===t&&(e=kh.map(e,(function(n){return kh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,t,r){var o={},i={},u={};return kh.forEach(e,(function(n){kh.forEach(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),kh.forEach(e,(function(n){var e=-1;kh.forEach(n,(function(n){var a=r(n);if(a.length){a=kh.sortBy(a,(function(n){return u[n]}));for(var c=(a.length-1)/2,l=Math.floor(c),s=Math.ceil(c);l<=s;++l){var f=a[l];i[n]===n&&e<u[f]&&!Oh(t,n,f)&&(i[f]=n,i[n]=o[n]=o[f],e=u[f])}}}))})),{root:o,align:i}}(0,e,r,u),c=function(n,e,t,r,o){var i={},u=function(n,e,t,r){var o=new Ch,i=n.graph(),u=function(n,e,t){return function(r,o,i){var u,a=r.node(o),c=r.node(i),l=0;if(l+=a.width/2,kh.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(l+=t?u:-u),u=0,l+=(a.dummy?e:n)/2,l+=(c.dummy?e:n)/2,l+=c.width/2,kh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(l+=t?u:-u),u=0,l}}(i.nodesep,i.edgesep,r);return kh.forEach(e,(function(e){var r;kh.forEach(e,(function(e){var i=t[e];if(o.setNode(i),r){var a=t[r],c=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,e,r),c||0))}r=e}))})),o}(n,e,t,o),a=o?"borderLeft":"borderRight";function c(n,e){for(var t=u.nodes(),r=t.pop(),o={};r;)o[r]?n(r):(o[r]=!0,t.push(r),t=t.concat(e(r))),r=t.pop()}return c((function(n){i[n]=u.inEdges(n).reduce((function(n,e){return Math.max(n,i[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var t=u.outEdges(e).reduce((function(n,e){return Math.min(n,i[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=n.node(e);t!==Number.POSITIVE_INFINITY&&r.borderType!==a&&(i[e]=Math.max(i[e],t))}),u.successors.bind(u)),kh.forEach(r,(function(n){i[n]=i[t[n]]})),i}(n,e,a.root,a.align,"r"===t);"r"===t&&(c=kh.mapValues(c,(function(n){return-n}))),o[i+t]=c}))}));var i=function(n,e){return kh.minBy(kh.values(e),(function(e){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return kh.forIn(e,(function(e,o){var i=function(n,e){return n.node(e).width}(n,o)/2;t=Math.max(e+i,t),r=Math.min(e-i,r)})),t-r}))}(n,o);return function(n,e){var t=kh.values(e),r=kh.min(t),o=kh.max(t);kh.forEach(["u","d"],(function(t){kh.forEach(["l","r"],(function(i){var u,a=t+i,c=n[a];if(c!==e){var l=kh.values(c);(u="l"===i?r-kh.min(l):o-kh.max(l))&&(n[a]=kh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return kh.mapValues(n.ul,(function(t,r){if(e)return n[e.toLowerCase()][r];var o=kh.sortBy(kh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Ah=Xf,zh=rd,Lh=fd,Th=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Hd(n)}(n);break;case"tight-tree":!function(n){Dd(n),Vd(n)}(n);break;case"longest-path":Yd(n)}},Bh=ud.normalizeRanks,Rh=function(n){var e=function(n){var e={},t=0;return Zd.forEach(n.children(),(function r(o){var i=t;Zd.forEach(n.children(o),r),e[o]={low:i,lim:t++}})),e}(n);Zd.forEach(n.graph().dummyChains,(function(t){for(var r=n.node(t),o=r.edgeObj,i=function(n,e,t,r){var o,i,u=[],a=[],c=Math.min(e[t].low,e[r].low),l=Math.max(e[t].lim,e[r].lim);o=t;do{o=n.parent(o),u.push(o)}while(o&&(e[o].low>c||l>e[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,c=0,l=u[c],s=!0;t!==o.w;){if(r=n.node(t),s){for(;(l=u[c])!==a&&n.node(l).maxRank<r.rank;)c++;l===a&&(s=!1)}if(!s){for(;c<u.length-1&&n.node(l=u[c+1]).minRank<=r.rank;)c++;l=u[c]}n.setParent(t,l),t=n.successors(t)[0]}}))},Dh=ud.removeEmptyRanks,Vh=Ud,Hh=function(n){$d.forEach(n.children(),(function e(t){var r=n.children(t),o=n.node(t);if(r.length&&$d.forEach(r,e),$d.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)qd(n,"borderLeft","_bl",t,o,i),qd(n,"borderRight","_br",t,o,i)}}))},Yh=Qd,Zh=function(n){var e=bh.maxRank(n),t=_h(n,ph.range(1,e+1),"inEdges"),r=_h(n,ph.range(e-1,-1,-1),"outEdges"),o=gh(n);Sh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Eh(a%2?t:r,a%4>=2),o=bh.buildLayerMatrix(n);var l=yh(n,o);l<u&&(c=0,i=ph.cloneDeep(o),u=l)}Sh(n,i)},Xh=function(n){(function(n){var e=jh.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Ph.forEach(e,(function(e){var o=Ph.max(Ph.map(e,(function(e){return n.node(e).height})));Ph.forEach(e,(function(e){n.node(e).y=r+o/2})),r+=o+t}))})(n=jh.asNonCompoundGraph(n)),Ph.forEach(Ih(n),(function(e,t){n.node(t).x=e}))},Fh=ud,Uh=Lf.Graph,Wh=["nodesep","edgesep","ranksep","marginx","marginy"],$h={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Gh=["acyclicer","ranker","rankdir","align"],qh=["width","height"],Kh={width:0,height:0},Qh=["minlen","weight","width","height","labeloffset"],Jh={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nv=["labelpos"];function ev(n,e){return Ah.mapValues(Ah.pick(n,e),Number)}function tv(n){var e={};return Ah.forEach(n,(function(n,t){e[t.toLowerCase()]=n})),e}var rv=Xf,ov=ud,iv=Lf.Graph,uv={debugOrdering:function(n){var e=ov.buildLayerMatrix(n),t=new iv({compound:!0,multigraph:!0}).setGraph({});return rv.forEach(n.nodes(),(function(e){t.setNode(e,{label:e}),t.setParent(e,"layer"+n.node(e).rank)})),rv.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),rv.forEach(e,(function(n,e){var r="layer"+e;t.setNode(r,{rank:"same"}),rv.reduce(n,(function(n,e){return t.setEdge(n,e,{style:"invis"}),e}))})),t}},av=He({graphlib:Lf,layout:function(n,e){var t=e&&e.debugTiming?Fh.time:Fh.notime;t("layout",(function(){var e=t(" buildLayoutGraph",(function(){return function(n){var e=new Uh({multigraph:!0,compound:!0}),t=tv(n.graph());return e.setGraph(Ah.merge({},$h,ev(t,Wh),Ah.pick(t,Gh))),Ah.forEach(n.nodes(),(function(t){var r=tv(n.node(t));e.setNode(t,Ah.defaults(ev(r,qh),Kh)),e.setParent(t,n.parent(t))})),Ah.forEach(n.edges(),(function(t){var r=tv(n.edge(t));e.setEdge(t,Ah.merge({},Jh,ev(r,Qh),Ah.pick(r,nv)))})),e}(n)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,Ah.forEach(n.edges(),(function(t){var r=n.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),e(" removeSelfEdges",(function(){!function(n){Ah.forEach(n.edges(),(function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}}))}(n)})),e(" acyclic",(function(){zh.run(n)})),e(" nestingGraph.run",(function(){Vh.run(n)})),e(" rank",(function(){Th(Fh.asNonCompoundGraph(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),o={rank:(n.node(e.w).rank-r.rank)/2+r.rank,e:e};Fh.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){Dh(n)})),e(" nestingGraph.cleanup",(function(){Vh.cleanup(n)})),e(" normalizeRanks",(function(){Bh(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;Ah.forEach(n.nodes(),(function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=Ah.max(e,r.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){Ah.forEach(n.nodes(),(function(e){var t=n.node(e);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))}))}(n)})),e(" normalize.run",(function(){Lh.run(n)})),e(" parentDummyChains",(function(){Rh(n)})),e(" addBorderSegments",(function(){Hh(n)})),e(" order",(function(){Zh(n)})),e(" insertSelfEdges",(function(){!function(n){var e=Fh.buildLayerMatrix(n);Ah.forEach(e,(function(e){var t=0;Ah.forEach(e,(function(e,r){var o=n.node(e);o.order=r+t,Ah.forEach(o.selfEdges,(function(e){Fh.addDummyNode(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++t,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(n)})),e(" adjustCoordinateSystem",(function(){Yh.adjust(n)})),e(" position",(function(){Xh(n)})),e(" positionSelfEdges",(function(){!function(n){Ah.forEach(n.nodes(),(function(e){var t=n.node(e);if("selfedge"===t.dummy){var r=n.node(t.e.v),o=r.x+r.width/2,i=r.y,u=t.x-o,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],t.label.x=t.x,t.label.y=t.y}}))}(n)})),e(" removeBorderNodes",(function(){!function(n){Ah.forEach(n.nodes(),(function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),o=n.node(t.borderBottom),i=n.node(Ah.last(t.borderLeft)),u=n.node(Ah.last(t.borderRight));t.width=Math.abs(u.x-i.x),t.height=Math.abs(o.y-r.y),t.x=i.x+t.width/2,t.y=r.y+t.height/2}})),Ah.forEach(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){Lh.undo(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t=n.edge(e);if(Ah.has(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}}))}(n)})),e(" undoCoordinateSystem",(function(){Yh.undo(n)})),e(" translateGraph",(function(){!function(n){var e=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function c(n){var i=n.x,u=n.y,a=n.width,c=n.height;e=Math.min(e,i-a/2),t=Math.max(t,i+a/2),r=Math.min(r,u-c/2),o=Math.max(o,u+c/2)}Ah.forEach(n.nodes(),(function(e){c(n.node(e))})),Ah.forEach(n.edges(),(function(e){var t=n.edge(e);Ah.has(t,"x")&&c(t)})),e-=u,r-=a,Ah.forEach(n.nodes(),(function(t){var o=n.node(t);o.x-=e,o.y-=r})),Ah.forEach(n.edges(),(function(t){var o=n.edge(t);Ah.forEach(o.points,(function(n){n.x-=e,n.y-=r})),Ah.has(o,"x")&&(o.x-=e),Ah.has(o,"y")&&(o.y-=r)})),i.width=t-e+u,i.height=o-r+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t,r,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=u,r=i),o.points.unshift(Fh.intersectRect(i,t)),o.points.push(Fh.intersectRect(u,r))}))}(n)})),e(" reversePoints",(function(){!function(n){Ah.forEach(n.edges(),(function(e){var t=n.edge(e);t.reversed&&t.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){zh.undo(n)}))}(e,t)})),t(" updateInputGraph",(function(){!function(n,e){Ah.forEach(n.nodes(),(function(t){var r=n.node(t),o=e.node(t);r&&(r.x=o.x,r.y=o.y,e.children(t).length&&(r.width=o.width,r.height=o.height))})),Ah.forEach(n.edges(),(function(t){var r=n.edge(t),o=e.edge(t);r.points=o.points,Ah.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(n,e)}))}))},debug:uv,util:{time:ud.time,notime:ud.notime},version:"0.8.5"}),cv=function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},lv=function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},sv=function(){return"The Ink Flow parent container needs a width and a height to render the graph."},fv=function(){return"Only child nodes can use a parent extent."},dv=function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},hv=function(n,e){var t=e.id,r=e.sourceHandle,o=e.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(t,".")},vv=function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},pv=function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},gv=function(n){return'Node with id "'.concat(n,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},yv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],mv=["Enter"," ","Escape"],xv=.5,wv=2,bv=[0,0],_v=function(n,e){void 0===e&&(e=[0,0]);var t=Rv(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||e,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},Ev=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=jv(t,e.nodeOrigin);return Ov(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pv(t)};function Sv(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?_v(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Bv(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,x=f+v*m[0],w=d+p*m[1];h=[[x,w],[x+g-v,w+y-p]]}}else null==a||a("005",fv());var b=Bv(h)?Cv(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}var kv=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Cv=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:kv(n.x,e[0][0],e[1][0]),y:kv(n.y,e[0][1],e[1][1])}},Mv=function(n,e,t){return n<e?kv(Math.abs(n-e),1,50)/50:n>t?-kv(Math.abs(n-t),1,50)/50:0},Nv=function(n,e){return[20*Mv(n.x,35,e.width-35),20*Mv(n.y,35,e.height-35)]},Ov=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},Pv=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},jv=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=_v(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}},Iv=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},Av=function(n,e,t,r){var o=n.x,i=n.y,u=B(e,3),a=u[0],c=u[1],l=u[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return t?Iv(s,r):s},zv=function(n,e){var t=n.x,r=n.y,o=B(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}},Lv=function(n,e,t,r,o,i){var u=e/(n.width*(1+i)),a=t/(n.height*(1+i)),c=Math.min(u,a),l=kv(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}},Tv=function(){var n;return"undefined"!=typeof navigator&&(null===(n=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===n?void 0:n.indexOf("Mac"))>=0};function Bv(n){return void 0!==n&&"parent"!==n}function Rv(n){var e,t,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var Dv={x:0,y:0};function Vv(n,e){var t=e.snapGrid,r=void 0===t?[0,0]:t,o=e.snapToGrid,i=void 0!==o&&o,u=e.transform,a=Hv(n),c=a.x,l=a.y,s=Av({x:c,y:l},u),f=i?Iv(s,r):s,d=f.x,h=f.y;return L({xSnapped:d,ySnapped:h},s)}exports.ConnectionMode=void 0,exports.PanOnScrollMode=void 0,exports.SelectionMode=void 0,exports.ConnectionLineType=void 0,exports.MarkerType=void 0,exports.Position=void 0;var Hv=function(n,e){var t,r,o,i,u=function(n){return"clientX"in n}(n),a=u?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}};function Yv(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-e),Math.abs(c-t)]}function Zv(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function Xv(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case exports.Position.Left:return[t-Zv(t-o,u),r];case exports.Position.Right:return[t+Zv(o-t,u),r];case exports.Position.Top:return[t,r-Zv(r-i,u)];case exports.Position.Bottom:return[t,r+Zv(i-r,u)]}}function Fv(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?exports.Position.Top:a,l=n.curvature,s=void 0===l?.25:l,f=B(Xv({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=B(Xv({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],y=B(Yv({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],x=y[1],w=y[2],b=y[3];return["M".concat(e,",").concat(t," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),m,x,w,b]}function Uv(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,u=r<e?r+i:r-i,a=Math.abs(o-t)/2;return[u,o<t?o+a:o-a,i,a]}!function(n){n.Strict="strict",n.Loose="loose"}(exports.ConnectionMode||(exports.ConnectionMode={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(exports.PanOnScrollMode||(exports.PanOnScrollMode={})),function(n){n.Partial="partial",n.Full="full"}(exports.SelectionMode||(exports.SelectionMode={})),function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(exports.ConnectionLineType||(exports.ConnectionLineType={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(exports.MarkerType||(exports.MarkerType={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(exports.Position||(exports.Position={}));var Wv,$v=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")};var Gv=((Wv={})[exports.Position.Left]={x:-1,y:0},Wv[exports.Position.Right]={x:1,y:0},Wv[exports.Position.Top]={x:0,y:-1},Wv[exports.Position.Bottom]={x:0,y:1},Wv),qv=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Kv(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?exports.Position.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?exports.Position.Top:l,f=n.center,d=n.offset,h=Gv[a],v=Gv[s],p={x:i.x+h.x*d,y:i.y+h.y*d},g={x:c.x+v.x*d,y:c.y+v.y*d},y=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?exports.Position.Bottom:t,o=n.target;return r===exports.Position.Left||r===exports.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),m=0!==y.x?"x":"y",x=y[m],w=[],b={x:0,y:0},_={x:0,y:0},E=B(Uv({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],C=E[2],M=E[3];if(h[m]*v[m]==-1){r=null!==(e=f.x)&&void 0!==e?e:S,o=null!==(t=f.y)&&void 0!==t?t:k;var N=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];w=h[m]===x?"x"===m?N:O:"x"===m?O:N}else{var P=[{x:p.x,y:g.y}],j=[{x:g.x,y:p.y}];if(w="x"===m?h.x===x?j:P:h.y===x?P:j,a===s){var I=Math.abs(i[m]-c[m]);if(I<=d){var A=Math.min(d-1,d-I);h[m]===x?b[m]=(p[m]>i[m]?-1:1)*A:_[m]=(g[m]>c[m]?-1:1)*A}}if(a!==s){var z="x"===m?"y":"x",L=h[m]===v[z],T=p[z]>g[z],D=p[z]<g[z];(1===h[m]&&(!L&&T||L&&D)||1!==h[m]&&(!L&&D||L&&T))&&(w="x"===m?P:j)}var V={x:p.x+b.x,y:p.y+b.y},H={x:g.x+_.x,y:g.y+_.y};Math.max(Math.abs(V.x-w[0].x),Math.abs(H.x-w[0].x))>=Math.max(Math.abs(V.y-w[0].y),Math.abs(H.y-w[0].y))?(r=(V.x+H.x)/2,o=w[0].y):(r=w[0].x,o=(V.y+H.y)/2)}return[R(R([i,{x:p.x+b.x,y:p.y+b.y}],B(w),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,C,M]}function Qv(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?exports.Position.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=B(Kv({source:{x:e,y:t},sourcePosition:o,target:{x:i,y:u},targetPosition:c,center:{x:f,y:d},offset:void 0===h?20:h}),5),p=v[0],g=v[1],y=v[2],m=v[3],x=v[4];return[p.reduce((function(n,e,t){return n+(t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(qv(n,e)/2,qv(e,t)/2,r),i=e.x,u=e.y;if(n.x===i&&i===t.x||n.y===u&&u===t.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<t.x?-1:1,c=n.y<t.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<t.x?1:-1,s=n.y<t.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[t-1],e,p[t+1],s):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y))}),""),g,y,m,x]}function Jv(n,e,t){var r=(null==t?void 0:t.rankdir)||"TB",o=new av.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(L({rankdir:r},t));var i=n.map((function(n){return L({},n)}));i.forEach((function(n){var e,t;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(e=n.data)||void 0===e?void 0:e.width)||200,i=(null===(t=n.data)||void 0===t?void 0:t.height)||56;o.setNode(n.id,{width:r,height:i})})),e.forEach((function(n){o.setEdge(n.source,n.target)})),av.layout(o),i.forEach((function(n){var e=o.node(n.id),t="bottom",i="top";switch(r){case"TB":default:t="bottom",i="top";break;case"BT":t="top",i="bottom";break;case"LR":t="right",i="left";break;case"RL":t="left",i="right"}n.targetPosition=i,n.sourcePosition=t,n.position={x:e.x-e.width/2,y:e.y-e.height/2}}));var u=function(n){var e=n.centerNodeId,t=n.containerHeight,r=void 0===t?0:t,o=n.containerWidth,i=void 0===o?0:o,u=n.centerByBBox,a=n.nodes,c=n.nodeOrigin,l=void 0===c?bv:c;if(!e&&!u||!r||!i)return Dv;if(null==e?void 0:e.trim()){var s=null==a?void 0:a.find((function(n){return n.id===(null==e?void 0:e.trim())}));if(s){var f=function(n,e){if(!n)return Dv;var t=Rv(n),r=t.width,o=t.height,i=r*e[0],u=o*e[1];return{x:n.position.x+r/2-i,y:n.position.y+o/2-u}}(s,l);return{x:i/2-f.x,y:r/2-f.y}}}return u?(f=function(n,e){if(!(null==n?void 0:n.length))return Dv;var t=Ev(n,{nodeOrigin:e}),r=t.x,o=t.y;return{x:r+t.width/2,y:o+t.height/2}}(a,l),{x:i/2-f.x,y:r/2-f.y}):Dv}({centerByBBox:null==t?void 0:t.centerByBBox,centerNodeId:null==t?void 0:t.centerNodeId,nodes:i,containerWidth:null==t?void 0:t.width,containerHeight:null==t?void 0:t.height,nodeOrigin:null==t?void 0:t.nodeOrigin}),a=u.x,c=void 0===a?0:a,l=u.y,s=void 0===l?0:l;i.forEach((function(n){n.position={x:n.position.x+c,y:n.position.y+s}}));var f={overflowBoundary:!1,transform:{x:0,y:0,zoom:1}};return(null==t?void 0:t.width)&&(null==t?void 0:t.height)&&t.fitViewOptions&&(f=function(n,e){var t=e||{},r=t.minZoom,o=void 0===r?xv:r,i=t.maxZoom,u=void 0===i?wv:i,a=t.padding,c=void 0===a?.1:a,l=t.nodeOrigin,s=void 0===l?bv:l,f=t.width,d=t.height,h=Ev(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:Lv(h,f,d,o,u,c),overflowBoundary:v}}(i,L({width:t.width,height:t.height,nodeOrigin:t.nodeOrigin},t.fitViewOptions))),{nodes:i,edges:e,transform:f.transform,overflowBoundary:f.overflowBoundary}}var np={assign:Object.assign,getHeight:function(n,e,t,r){return void 0===r&&(r="height"),"center"===t?(n[r]+e[r])/2:n.height}},ep=np,tp={getId:function(n){return n.id||n.name},getPreH:function(n){return n.preH||0},getPreV:function(n){return n.preV||0},getHGap:function(n){return n.hgap||18},getVGap:function(n){return n.vgap||18},getChildren:function(n){return n.children},getHeight:function(n){return n.height||36},getWidth:function(n){var e=n.label||" ";return n.width||18*e.split("").length}};function rp(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof rp)return n;t.data=n;var r=e.getHGap(n),o=e.getVGap(n);return t.preH=e.getPreH(n),t.preV=e.getPreV(n),t.width=e.getWidth(n),t.height=e.getHeight(n),t.width+=t.preH,t.height+=t.preV,t.id=e.getId(n),t.x=t.y=0,t.depth=0,t.children||(t.children=[]),t.addGap(r,o),t}ep.assign(rp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,e){var t=this;t.hgap+=n,t.vgap+=e,t.width+=2*n,t.height+=2*e},eachNode:function(n){for(var e,t=[this];e=t.shift();)n(e),t=e.children.concat(t)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var e,t=[this];e=t.shift();)n(e),t=t.concat(e.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){n.left=Math.min(n.left,e.x),n.top=Math.min(n.top,e.y),n.width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height)})),n},translate:function(n,e){void 0===n&&(n=0),void 0===e&&(e=0),this.eachNode((function(t){t.x+=n,t.y+=e,t.x+=t.preH,t.y+=t.preV}))},right2left:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-e.left)-n.width})),n.translate(e.width,0)},bottom2top:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-e.top)-n.height})),n.translate(0,e.height)}});var op=function(n,e,t){void 0===e&&(e={});var r,o=new rp(n,e=ep.assign({},tp,e)),i=[o];if(!t&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var u=e.getChildren(r.data),a=u?u.length:0;if(r.children=new Array(a),u&&a)for(var c=0;c<a;c++){var l=new rp(u[c],e);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},ip=op,up=function(){function n(n,e){void 0===e&&(e={}),this.options=e,this.rootNode=ip(n,e)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),ap=up;function cp(n,e,t,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=e||0,o.y=t||0,o.x=0,o.c=r||[],o.cs=r.length,o.prelim=0,o.mod=0,o.shift=0,o.change=0,o.tl=null,o.tr=null,o.el=null,o.er=null,o.msel=0,o.mser=0}function lp(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach((function(n){lp(n,e,t)}))}function sp(n,e){var t=e?n.y:n.x;return n.children.forEach((function(n){t=Math.min(sp(n,e),t)})),t}function fp(n,e){lp(n,-sp(n,e),e)}function dp(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach((function(n,r){dp(n,e.children[r],t)}))}function hp(n,e,t){void 0===t&&(t=0),e?(n.x=t,t+=n.width):(n.y=t,t+=n.height),n.children.forEach((function(n){hp(n,e,t)}))}cp.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach((function(n){t.push(cp.fromNode(n,e))})),e?new cp(n.height,n.width,n.x,t):new cp(n.width,n.height,n.y,t)};var vp=op,pp=function(n,e){for(var t=vp(n.data,e,!0),r=vp(n.data,e,!0),o=n.children.length,i=Math.round(o/2),u=e.getSide||function(n,e){return e<i?"right":"left"},a=0;a<o;a++){var c=n.children[a];"right"===u(c,a)?r.children.push(c):t.children.push(c)}return t.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:t,right:r}},gp=pp,yp=["LR","RL","TB","BT","H","V"],mp=["LR","RL","H"],xp=yp[0],wp=function(n,e,t){var r=e.direction||xp;if(e.isHorizontal=function(n){return mp.indexOf(n)>-1}(r),r&&-1===yp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===yp[0])t(n,e);else if(r===yp[1])t(n,e),n.right2left();else if(r===yp[2])t(n,e);else if(r===yp[3])t(n,e),n.bottom2top();else if(r===yp[4]||r===yp[5]){var o=gp(n,e),i=o.left,u=o.right;t(i,e),t(u,e),e.isHorizontal?i.right2left():i.bottom2top(),u.translate(i.x-u.x,i.y-u.y),n.x=i.x,n.y=u.y;var a=n.getBoundingBox();e.isHorizontal?a.top<0&&n.translate(0,-a.top):a.left<0&&n.translate(-a.left,0)}var c=e.fixedRoot;return void 0===c&&(c=!0),c&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),function(n,e){if(e.radial){var t=e.isHorizontal?["x","y"]:["y","x"],r=t[0],o=t[1],i={x:1/0,y:1/0},u={x:-1/0,y:-1/0},a=0;n.DFTraverse((function(n){a++;var e=n.x,t=n.y;i.x=Math.min(i.x,e),i.y=Math.min(i.y,t),u.x=Math.max(u.x,e),u.y=Math.max(u.y,t)}));var c=u[o]-i[o];if(0===c)return;var l=2*Math.PI/a;n.DFTraverse((function(e){var t=(e[o]-i[o])/c*(2*Math.PI-l)+l,u=e[r]-n[r];e.x=Math.cos(t)*u,e.y=Math.sin(t)*u}))}}(n,e),n};function bp(n,e){return bp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},bp(n,e)}var _p=function(n,e){void 0===e&&(e={});var t=e.isHorizontal;function r(n){0===n.cs?(n.el=n,n.er=n,n.msel=n.mser=0):(n.el=n.c[0].el,n.msel=n.c[0].msel,n.er=n.c[n.cs-1].er,n.mser=n.c[n.cs-1].mser)}function o(n,e,t){for(var r=n.c[e-1],o=r.mod,l=n.c[e],s=l.mod;null!==r&&null!==l;){c(r)>t.low&&(t=t.nxt);var f=o+r.prelim+r.w-(s+l.prelim);f>0&&(s+=f,i(n,e,t.index,f));var d=c(r),h=c(l);d<=h&&null!==(r=a(r))&&(o+=r.mod),d>=h&&null!==(l=u(l))&&(s+=l.mod)}!r&&l?function(n,e,t,r){var o=n.c[0].el;o.tl=t;var i=r-t.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[e].el,n.c[0].msel=n.c[e].msel}(n,e,l,s):r&&!l&&function(n,e,t,r){var o=n.c[e].er;o.tr=t;var i=r-t.mod-n.c[e].mser;o.mod+=i,o.prelim-=i,n.c[e].er=n.c[e-1].er,n.c[e].mser=n.c[e-1].mser}(n,e,r,o)}function i(n,e,t,r){n.c[e].mod+=r,n.c[e].msel+=r,n.c[e].mser+=r,function(n,e,t,r){if(t!==e-1){var o=e-t;n.c[t+1].shift+=r/o,n.c[e].shift-=r/o,n.c[e].change-=r-r/o}}(n,e,t,r)}function u(n){return 0===n.cs?n.tl:n.c[0]}function a(n){return 0===n.cs?n.tr:n.c[n.cs-1]}function c(n){return n.y+n.h}function l(n,e,t){for(;null!==t&&n>=t.low;)t=t.nxt;return{low:n,index:e,nxt:t}}hp(n,t);var s=cp.fromNode(n,t);return function n(e){if(0!==e.cs){n(e.c[0]);for(var t=l(c(e.c[0].el),0,null),i=1;i<e.cs;++i){n(e.c[i]);var u=c(e.c[i].er);o(e,i,t),t=l(u,i,t)}!function(n){n.prelim=(n.c[0].prelim+n.c[0].mod+n.c[n.cs-1].mod+n.c[n.cs-1].prelim+n.c[n.cs-1].w)/2-n.w/2}(e),r(e)}else r(e)}(s),function n(e,t){t+=e.mod,e.x=e.prelim+t,function(n){for(var e=0,t=0,r=0;r<n.cs;r++)t+=(e+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=t}(e);for(var r=0;r<e.cs;r++)n(e.c[r],t)}(s,0),dp(s,n,t),fp(n,t),n},Ep=wp,Sp=np,kp=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,bp(t,r),e.prototype.execute=function(){return Ep(this.rootNode,this.options,_p)},e}(ap),Cp={},Mp=np;function Np(n,e){void 0===e&&(e=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=e}var Op={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Pp(n,e,t){t?(e.x=n.x,e.y=n.y):(e.x=n.y,e.y=n.x),n.children.forEach((function(n,r){Pp(n,e.children[r],t)}))}function jp(n,e){return jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},jp(n,e)}var Ip=function(n,e){void 0===e&&(e={}),e=Mp.assign({},Op,e);var t,r=0,o=function n(e){if(!e)return null;e.width=0,e.depth&&e.depth>r&&(r=e.depth);var t=e.children,o=t.length,i=new Np(e.height,[]);return t.forEach((function(e,t){var r=n(e);i.children.push(r),0===t&&(i.leftChild=r),t===o-1&&(i.rightChild=r)})),i.originNode=e,i.isLeaf=e.isLeaf(),i}(n);return function n(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=r;else{var t=e.children.map((function(e){return n(e)})),o=Math.min.apply(null,t);e.drawingDepth=o-1}return e.drawingDepth}(o),function n(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,t&&(r.y=t.y+t.height+e.nodeSep,r.originNode.parent!==t.originNode.parent&&(r.y+=e.subTreeSep)),t=r):(r.children.forEach((function(e){n(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Pp(o,n,e.isHorizontal),n},Ap=wp,zp=np,Lp=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,jp(t,r),e.prototype.execute=function(){var n=this;return n.rootNode.width=0,Ap(n.rootNode,n.options,Ip)},e}(ap),Tp={},Bp=np;function Rp(n,e){return Rp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Rp(n,e)}var Dp=ap,Vp=function(n,e,t,r){var o=null;n.eachNode((function(n){!function(n,e,t,r,o){var i=("function"==typeof t?t(n):t)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=e?e.y:0)}catch(n){}if(n.x+=i,e){if(n.y=e.y+Bp.getHeight(e,n,o),e.parent&&n.parent.id!==e.parent.id){var u=e.parent,a=u.y+Bp.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,e,t,r),o=n}))},Hp=pp,Yp=np,Zp=["LR","RL","H"],Xp=Zp[0],Fp=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,Rp(t,r),e.prototype.execute=function(){var n=this.options,e=this.rootNode;n.isHorizontal=!0;var t=n.indent,r=void 0===t?20:t,o=n.dropCap,i=void 0===o||o,u=n.direction,a=void 0===u?Xp:u,c=n.align;if(a&&-1===Zp.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===Zp[0])Vp(e,r,i,c);else if(a===Zp[1])Vp(e,r,i,c),e.right2left();else if(a===Zp[2]){var l=Hp(e,n),s=l.left,f=l.right;Vp(s,r,i,c),s.right2left(),Vp(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),e.x=f.x-e.width/2}return e},e}(Dp),Up={},Wp=np;function $p(n,e){var t=0;return n.children.length?n.children.forEach((function(n){t+=$p(n,e)})):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function Gp(n){var e=n.children,t=e.length;if(t){e.forEach((function(n){Gp(n)}));var r=e[0],o=e[t-1],i=o.y-r.y+o.height,u=0;if(e.forEach((function(n){u+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==e.length||n.height>u){var a=n.y+(n.height-i)/2-r.y;e.forEach((function(n){n.translate(0,a)}))}else n.y=(r.y+r.height/2+o.y+o.height/2)/2-n.height/2}}var qp={getSubTreeSep:function(){return 0}};function Kp(n,e){return Kp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Kp(n,e)}var Qp=function(n,e){void 0===e&&(e={}),e=Wp.assign({},qp,e),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse((function(n){n.x=n.parent.x+n.parent.width})),n.parent=null,$p(n,e),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var e=n.children,t=e.length;if(t){var r=e[0];if(r.startY=n.startY+n._subTreeSep,1===t)r.y=n.y+n.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var o=1;o<t;o++){var i=e[o];i.startY=e[o-1].startY+e[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),Gp(n)},Jp=wp,ng=np,eg=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,Kp(t,r),e.prototype.execute=function(){return Jp(this.rootNode,this.options,Qp)},e}(ap),tg={};He({compactBox:function(n,e){return e=Sp.assign({},Cp,e),new kp(n,e).execute()},dendrogram:function(n,e){return e=zp.assign({},Tp,e),new Lp(n,e).execute()},indented:function(n,e){return e=Yp.assign({},Up,e),new Fp(n,e).execute()},mindmap:function(n,e){return e=ng.assign({},tg,e),new eg(n,e).execute()}});var rg={value:()=>{}};function og(){for(var n,e=0,t=arguments.length,r={};e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new ig(r)}function ig(n){this._=n}function ug(n,e){for(var t,r=0,o=n.length;r<o;++r)if((t=n[r]).name===e)return t.value}function ag(n,e,t){for(var r=0,o=n.length;r<o;++r)if(n[r].name===e){n[r]=rg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}ig.prototype=og.prototype={constructor:ig,on:function(n,e){var t,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");if(t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:e}}))),u=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<a;)if(t=(n=i[u]).type)o[t]=ag(o[t],n.name,e);else if(null==e)for(t in o)o[t]=ag(o[t],n.name,null);return this}for(;++u<a;)if((t=(n=i[u]).type)&&(t=ug(o[t],n.name)))return t},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new ig(n)},call:function(n,e){if((t=arguments.length-2)>0)for(var t,r,o=new Array(t),i=0;i<t;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,t=(r=this._[n]).length;i<t;++i)r[i].value.apply(e,o)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],o=0,i=r.length;o<i;++o)r[o].value.apply(e,t)}};var cg="http://www.w3.org/1999/xhtml",lg={svg:"http://www.w3.org/2000/svg",xhtml:cg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function sg(n){var e=n+="",t=e.indexOf(":");return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),lg.hasOwnProperty(e)?{space:lg[e],local:n}:n}function fg(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===cg&&e.documentElement.namespaceURI===cg?e.createElement(n):e.createElementNS(t,n)}}function dg(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function hg(n){var e=sg(n);return(e.local?dg:fg)(e)}function vg(){}function pg(n){return null==n?vg:function(){return this.querySelector(n)}}function gg(){return[]}function yg(n){return null==n?gg:function(){return this.querySelectorAll(n)}}function mg(n){return function(){return this.matches(n)}}function xg(n){return function(e){return e.matches(n)}}var wg=Array.prototype.find;function bg(){return this.firstElementChild}var _g=Array.prototype.filter;function Eg(){return Array.from(this.children)}function Sg(n){return new Array(n.length)}function kg(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}function Cg(n,e,t,r,o,i){for(var u,a=0,c=e.length,l=i.length;a<l;++a)(u=e[a])?(u.__data__=i[a],r[a]=u):t[a]=new kg(n,i[a]);for(;a<c;++a)(u=e[a])&&(o[a]=u)}function Mg(n,e,t,r,o,i,u){var a,c,l,s=new Map,f=e.length,d=i.length,h=new Array(f);for(a=0;a<f;++a)(c=e[a])&&(h[a]=l=u.call(c,c.__data__,a,e)+"",s.has(l)?o[a]=c:s.set(l,c));for(a=0;a<d;++a)l=u.call(n,i[a],a,i)+"",(c=s.get(l))?(r[a]=c,c.__data__=i[a],s.delete(l)):t[a]=new kg(n,i[a]);for(a=0;a<f;++a)(c=e[a])&&s.get(h[a])===c&&(o[a]=c)}function Ng(n){return n.__data__}function Og(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function Pg(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function jg(n){return function(){this.removeAttribute(n)}}function Ig(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Ag(n,e){return function(){this.setAttribute(n,e)}}function zg(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function Lg(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function Tg(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function Bg(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Rg(n){return function(){this.style.removeProperty(n)}}function Dg(n,e,t){return function(){this.style.setProperty(n,e,t)}}function Vg(n,e,t){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function Hg(n,e){return n.style.getPropertyValue(e)||Bg(n).getComputedStyle(n,null).getPropertyValue(e)}function Yg(n){return function(){delete this[n]}}function Zg(n,e){return function(){this[n]=e}}function Xg(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function Fg(n){return n.trim().split(/^|\s+/)}function Ug(n){return n.classList||new Wg(n)}function Wg(n){this._node=n,this._names=Fg(n.getAttribute("class")||"")}function $g(n,e){for(var t=Ug(n),r=-1,o=e.length;++r<o;)t.add(e[r])}function Gg(n,e){for(var t=Ug(n),r=-1,o=e.length;++r<o;)t.remove(e[r])}function qg(n){return function(){$g(this,n)}}function Kg(n){return function(){Gg(this,n)}}function Qg(n,e){return function(){(e.apply(this,arguments)?$g:Gg)(this,n)}}function Jg(){this.textContent=""}function ny(n){return function(){this.textContent=n}}function ey(n){return function(){var e=n.apply(this,arguments);this.textContent=null==e?"":e}}function ty(){this.innerHTML=""}function ry(n){return function(){this.innerHTML=n}}function oy(n){return function(){var e=n.apply(this,arguments);this.innerHTML=null==e?"":e}}function iy(){this.nextSibling&&this.parentNode.appendChild(this)}function uy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ay(){return null}function cy(){var n=this.parentNode;n&&n.removeChild(this)}function ly(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function sy(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function fy(n){return function(){var e=this.__on;if(e){for(var t,r=0,o=-1,i=e.length;r<i;++r)t=e[r],n.type&&t.type!==n.type||t.name!==n.name?e[++o]=t:this.removeEventListener(t.type,t.listener,t.options);++o?e.length=o:delete this.__on}}}function dy(n,e,t){return function(){var r,o=this.__on,i=function(n){return function(e){n.call(this,e,this.__data__)}}(e);if(o)for(var u=0,a=o.length;u<a;++u)if((r=o[u]).type===n.type&&r.name===n.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=t),void(r.value=e);this.addEventListener(n.type,i,t),r={type:n.type,name:n.name,value:e,listener:i,options:t},o?o.push(r):this.__on=[r]}}function hy(n,e,t){var r=Bg(n),o=r.CustomEvent;"function"==typeof o?o=new o(e,t):(o=r.document.createEvent("Event"),t?(o.initEvent(e,t.bubbles,t.cancelable),o.detail=t.detail):o.initEvent(e,!1,!1)),n.dispatchEvent(o)}function vy(n,e){return function(){return hy(this,n,e)}}function py(n,e){return function(){return hy(this,n,e.apply(this,arguments))}}kg.prototype={constructor:kg,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},Wg.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var gy=[null];function yy(n,e){this._groups=n,this._parents=e}function my(){return new yy([[document.documentElement]],gy)}function xy(n){return"string"==typeof n?new yy([[document.querySelector(n)]],[document.documentElement]):new yy([[n]],gy)}function wy(n,e){if(n=function(n){let e;for(;e=n.sourceEvent;)n=e;return n}(n),void 0===e&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[n.clientX-o.left-e.clientLeft,n.clientY-o.top-e.clientTop]}}return[n.pageX,n.pageY]}yy.prototype=my.prototype={constructor:yy,select:function(n){"function"!=typeof n&&(n=pg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u,a=e[o],c=a.length,l=r[o]=new Array(c),s=0;s<c;++s)(i=a[s])&&(u=n.call(i,i.__data__,s,a))&&("__data__"in i&&(u.__data__=i.__data__),l[s]=u);return new yy(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(e=n.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(n):yg(n);for(var e=this._groups,t=e.length,r=[],o=[],i=0;i<t;++i)for(var u,a=e[i],c=a.length,l=0;l<c;++l)(u=a[l])&&(r.push(n.call(u,u.__data__,l,a)),o.push(u));return new yy(r,o)},selectChild:function(n){return this.select(null==n?bg:function(n){return function(){return wg.call(this.children,n)}}("function"==typeof n?n:xg(n)))},selectChildren:function(n){return this.selectAll(null==n?Eg:function(n){return function(){return _g.call(this.children,n)}}("function"==typeof n?n:xg(n)))},filter:function(n){"function"!=typeof n&&(n=mg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u=e[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new yy(r,this._parents)},data:function(n,e){if(!arguments.length)return Array.from(this,Ng);var t,r=e?Mg:Cg,o=this._parents,i=this._groups;"function"!=typeof n&&(t=n,n=function(){return t});for(var u=i.length,a=new Array(u),c=new Array(u),l=new Array(u),s=0;s<u;++s){var f=o[s],d=i[s],h=d.length,v=Og(n.call(f,f&&f.__data__,s,o)),p=v.length,g=c[s]=new Array(p),y=a[s]=new Array(p);r(f,d,g,y,l[s]=new Array(h),v,e);for(var m,x,w=0,b=0;w<p;++w)if(m=g[w]){for(w>=b&&(b=w+1);!(x=y[b])&&++b<p;);m._next=x||null}}return(a=new yy(a,o))._enter=c,a._exit=l,a},enter:function(){return new yy(this._enter||this._groups.map(Sg),this._parents)},exit:function(){return new yy(this._exit||this._groups.map(Sg),this._parents)},join:function(n,e,t){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=e&&(o=e(o))&&(o=o.selection()),null==t?i.remove():t(i),r&&o?r.merge(o).order():o},merge:function(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,o=t.length,i=r.length,u=Math.min(o,i),a=new Array(o),c=0;c<u;++c)for(var l,s=t[c],f=r[c],d=s.length,h=a[c]=new Array(d),v=0;v<d;++v)(l=s[v]||f[v])&&(h[v]=l);for(;c<o;++c)a[c]=t[c];return new yy(a,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r,o=n[e],i=o.length-1,u=o[i];--i>=0;)(r=o[i])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(n){function e(e,t){return e&&t?n(e.__data__,t.__data__):!e-!t}n||(n=Pg);for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i){for(var u,a=t[i],c=a.length,l=o[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(l[s]=u);l.sort(e)}return new yy(o,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],o=0,i=r.length;o<i;++o){var u=r[o];if(u)return u}return null},size:function(){let n=0;for(const e of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o,i=e[t],u=0,a=i.length;u<a;++u)(o=i[u])&&n.call(o,o.__data__,u,i);return this},attr:function(n,e){var t=sg(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((null==e?t.local?Ig:jg:"function"==typeof e?t.local?Tg:Lg:t.local?zg:Ag)(t,e))},style:function(n,e,t){return arguments.length>1?this.each((null==e?Rg:"function"==typeof e?Vg:Dg)(n,e,null==t?"":t)):Hg(this.node(),n)},property:function(n,e){return arguments.length>1?this.each((null==e?Yg:"function"==typeof e?Xg:Zg)(n,e)):this.node()[n]},classed:function(n,e){var t=Fg(n+"");if(arguments.length<2){for(var r=Ug(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof e?Qg:e?qg:Kg)(t,e))},text:function(n){return arguments.length?this.each(null==n?Jg:("function"==typeof n?ey:ny)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?ty:("function"==typeof n?oy:ry)(n)):this.node().innerHTML},raise:function(){return this.each(iy)},lower:function(){return this.each(uy)},append:function(n){var e="function"==typeof n?n:hg(n);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(n,e){var t="function"==typeof n?n:hg(n),r=null==e?ay:"function"==typeof e?e:pg(e);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(cy)},clone:function(n){return this.select(n?sy:ly)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,e,t){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");return t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),{type:n,name:e}}))}(n+""),u=i.length;if(!(arguments.length<2)){for(a=e?dy:fy,r=0;r<u;++r)this.each(a(i[r],e,t));return this}var a=this.node().__on;if(a)for(var c,l=0,s=a.length;l<s;++l)for(r=0,c=a[l];r<u;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(n,e){return this.each(("function"==typeof e?py:vy)(n,e))},[Symbol.iterator]:function*(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r,o=n[e],i=0,u=o.length;i<u;++i)(r=o[i])&&(yield r)}};const by={passive:!1},_y={capture:!0,passive:!1};function Ey(n){n.stopImmediatePropagation()}function Sy(n){n.preventDefault(),n.stopImmediatePropagation()}function ky(n){var e=n.document.documentElement,t=xy(n).on("dragstart.drag",Sy,_y);"onselectstart"in e?t.on("selectstart.drag",Sy,_y):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Cy(n,e){var t=n.document.documentElement,r=xy(n).on("dragstart.drag",null);e&&(r.on("click.drag",Sy,_y),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in t?r.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}var My=n=>()=>n;function Ny(n,{sourceEvent:e,subject:t,target:r,identifier:o,active:i,x:u,y:a,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function Oy(n){return!n.ctrlKey&&!n.button}function Py(){return this.parentNode}function jy(n,e){return null==e?{x:n.x,y:n.y}:e}function Iy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ay(n,e){if(!n.parentId)return!1;var t=e.get(n.parentId);return!!t&&(!!t.selected||Ay(t,e))}function zy(n,e,t){var r=n;do{if(null==r?void 0:r.matches(e))return!0;if(r===t)return!1;r=r.parentElement}while(r);return!1}function Ly(n){var e,t,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=T(u),s=l.next();!s.done;s=l.next()){var f=B(s.value,2),d=f[0],h=f[1],v=null===(r=a.get(d))||void 0===r?void 0:r.internals.userNode;v&&c.push(L(L({},v),{position:h.position}))}}catch(n){e={error:n}}finally{try{s&&!s.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}if(!i)return[c[0],c];var p=a.get(i).internals.userNode;return[L(L({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function Ty(n){var e=n.onNodeMouseDown,t=n.getStoreItems,r=n.onDragStart,o=n.onDrag,i=n.onDragStop,u={x:null,y:null},a=0,c=new Map,l=!1,s={x:0,y:0},f=null,d=!1,h=null;return{update:function(n){var v=n.noDragClassName,p=n.handleSelector,g=n.domNode,y=n.isSelectable,m=n.nodeId;function x(n,e){var r,i,a=n.x,l=n.y,s=t(),f=s.nodeLookup,d=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,x=s.onError,w=s.updateNodePositions;u={x:a,y:l};var b=!1,_={x:0,y:0,x2:0,y2:0};if(c.size>1&&d){var E=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==e.filter||e.filter(n)){var r=jv(n,e.nodeOrigin);t=Ov(t,r)}})),Pv(t)}(c,{nodeOrigin:p});_=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}}(E)}try{for(var S=T(c),k=S.next();!k.done;k=S.next()){var C=B(k.value,2),M=C[0],N=C[1],O={x:a-N.distance.x,y:l-N.distance.y};v&&(O=Iv(O,h));var P=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!N.extent){var j=N.internals.positionAbsolute,I=j.x-_.x+d[0][0],A=j.x+N.measured.width-_.x2+d[1][0];P=[[I,j.y-_.y+d[0][1]],[A,j.y+N.measured.height-_.y2+d[1][1]]]}var z=Sv({nodeId:M,nextPosition:O,nodeLookup:f,nodeExtent:P,nodeOrigin:p,onError:x}),L=z.position,R=z.positionAbsolute;b=b||N.position.x!==L.x||N.position.y!==L.y,N.position=L,N.internals.positionAbsolute=R}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(b&&(w(c,!0),e&&(o||g||!m&&y))){var D=B(Ly({nodeId:m,dragItems:c,nodeLookup:f}),2),V=D[0],H=D[1];null==o||o(e,c,V,H),null==g||g(e,V,H),m||null==y||y(e,H)}}function w(){var n,e;if(f){var r=B(Nv(s,f),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=t(),l=c.transform,d=c.panBy;u.x=(null!==(n=u.x)&&void 0!==n?n:0)-o/l[2],u.y=(null!==(e=u.y)&&void 0!==e?e:0)-i/l[2],d({x:o,y:i})&&x(u,null)}a=requestAnimationFrame(w)}}function b(n){var o,i=t(),a=i.nodeLookup,l=i.multiSelectionActive,s=i.nodesDraggable,f=i.transform,h=i.snapGrid,v=i.snapToGrid,p=i.selectNodesOnDrag,g=i.onNodeDragStart,x=i.onSelectionDragStart,w=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||w(),y&&p&&m&&(null==e||e(m));var b=Vv(n.sourceEvent,{transform:f,snapGrid:h,snapToGrid:v});if(u=b,c=function(n,e,t,r){var o,i,u,a,c=new Map;try{for(var l=T(n),s=l.next();!s.done;s=l.next()){var f=B(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!Ay(h,n))&&(h.draggable||e&&void 0===h.draggable)){var v=n.get(d);v&&c.set(d,{id:d,position:v.position||{x:0,y:0},distance:{x:t.x-v.internals.positionAbsolute.x,y:t.y-v.internals.positionAbsolute.y},extent:v.extent,parentId:v.parentId,origin:v.origin,expandParent:v.expandParent,internals:{positionAbsolute:v.internals.positionAbsolute||{x:0,y:0}},measured:{width:null!==(u=v.measured.width)&&void 0!==u?u:0,height:null!==(a=v.measured.height)&&void 0!==a?a:0}})}}}catch(n){o={error:n}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return c}(a,s,b,m),c.size>0&&(r||g||!m&&x)){var _=B(Ly({nodeId:m,dragItems:c,nodeLookup:a}),2),E=_[0],S=_[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==x||x(n.sourceEvent,S)}}h=xy(g);var _=function(){var n,e,t,r,o=Oy,i=Py,u=jy,a=Iy,c={},l=og("start","drag","end"),s=0,f=0;function d(n){n.on("mousedown.drag",h).filter(a).on("touchstart.drag",g).on("touchmove.drag",y,by).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(u,a){if(!r&&o.call(this,u,a)){var c=x(this,i.call(this,u,a),u,a,"mouse");c&&(xy(u.view).on("mousemove.drag",v,_y).on("mouseup.drag",p,_y),ky(u.view),Ey(u),t=!1,n=u.clientX,e=u.clientY,c("start",u))}}function v(r){if(Sy(r),!t){var o=r.clientX-n,i=r.clientY-e;t=o*o+i*i>f}c.mouse("drag",r)}function p(n){xy(n.view).on("mousemove.drag mouseup.drag",null),Cy(n.view,t),Sy(n),c.mouse("end",n)}function g(n,e){if(o.call(this,n,e)){var t,r,u=n.changedTouches,a=i.call(this,n,e),c=u.length;for(t=0;t<c;++t)(r=x(this,a,n,e,u[t].identifier,u[t]))&&(Ey(n),r("start",n,u[t]))}}function y(n){var e,t,r=n.changedTouches,o=r.length;for(e=0;e<o;++e)(t=c[r[e].identifier])&&(Sy(n),t("drag",n,r[e]))}function m(n){var e,t,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<i;++e)(t=c[o[e].identifier])&&(Ey(n),t("end",n,o[e]))}function x(n,e,t,r,o,i){var a,f,h,v=l.copy(),p=wy(i||t,e);if(null!=(h=u.call(n,new Ny("beforestart",{sourceEvent:t,target:d,identifier:o,active:s,x:p[0],y:p[1],dx:0,dy:0,dispatch:v}),r)))return a=h.x-p[0]||0,f=h.y-p[1]||0,function t(i,u,l){var g,y=p;switch(i){case"start":c[o]=t,g=s++;break;case"end":delete c[o],--s;case"drag":p=wy(l||u,e),g=s}v.call(i,n,new Ny(i,{sourceEvent:u,subject:h,target:d,identifier:o,active:g,x:p[0]+a,y:p[1]+f,dx:p[0]-y[0],dy:p[1]-y[1],dispatch:v}),r)}}return d.filter=function(n){return arguments.length?(o="function"==typeof n?n:My(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:My(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:My(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:My(!!n),d):a},d.on=function(){var n=l.on.apply(l,arguments);return n===l?d:n},d.clickDistance=function(n){return arguments.length?(f=(n=+n)*n,d):Math.sqrt(f)},d}().on("start",(function(n){var e=t(),r=e.domNode,o=e.nodeDragThreshold,i=e.transform,a=e.snapGrid,c=e.snapToGrid;0===o&&b(n);var l=Vv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=Hv(n.sourceEvent,f)})).on("drag",(function(n){var e,r,o=t(),i=o.autoPanOnNodeDrag,a=o.transform,h=o.snapGrid,v=o.snapToGrid,p=o.nodeDragThreshold,g=Vv(n.sourceEvent,{transform:a,snapGrid:h,snapToGrid:v});if(!l&&i&&d&&(l=!0,w()),!d){var y=g.xSnapped-(null!==(e=u.x)&&void 0!==e?e:0),m=g.ySnapped-(null!==(r=u.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&b(n)}(u.x!==g.xSnapped||u.y!==g.ySnapped)&&c&&d&&(s=Hv(n.sourceEvent,f),x(g,n.sourceEvent))})).on("end",(function(n){if(d&&(l=!1,d=!1,cancelAnimationFrame(a),c.size>0)){var e=t(),r=e.nodeLookup,o=e.updateNodePositions,u=e.onNodeDragStop,s=e.onSelectionDragStop;if(o(c,!1),i||u||!m&&s){var f=B(Ly({nodeId:m,dragItems:c,nodeLookup:r}),2),h=f[0],v=f[1];null==i||i(n.sourceEvent,c,h,v),null==u||u(n.sourceEvent,h,v),m||null==s||s(n.sourceEvent,v)}}})).filter((function(n){var e=n.target;return!n.button&&(!v||!zy(e,".".concat(v),g))&&(!p||zy(e,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function By(n,e,t,r){return(e[t]||[]).reduce((function(e,o){return"".concat(n.id,"-").concat(o.id,"-").concat(t)!==r&&e.push({id:o.id||null,type:t,nodeId:n.id,x:n.internals.positionAbsolute.x+o.x+o.width/2,y:n.internals.positionAbsolute.y+o.y+o.height/2}),e}),[])}function Ry(n,e){return n||((null==e?void 0:e.classList.contains("target"))?"target":(null==e?void 0:e.classList.contains("source"))?"source":null)}Ny.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var Dy=function(){return!0},Vy=null;function Hy(n,e){var t=e.handle,r=e.connectionMode,o=e.fromNodeId,i=e.fromHandleId,u=e.fromType,a=e.doc,c=e.lib,l=e.flowId,s=e.isValidConnection,f=void 0===s?Dy:s,d="target"===u,h=t?a.querySelector(".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==t?void 0:t.nodeId,"-").concat(null==t?void 0:t.id,"-").concat(null==t?void 0:t.type,'"]')):null,v=Hv(n),p=v.x,g=v.y,y=a.elementFromPoint(p,g),m=(null==y?void 0:y.classList.contains("".concat(c,"-flow__handle")))?y:h,x={handleDomNode:m,isValid:!1,connection:null,endHandle:null};if(m){var w=Ry(void 0,m),b=m.getAttribute("data-nodeid"),_=m.getAttribute("data-handleid"),E=m.classList.contains("connectable"),S=m.classList.contains("connectableend");if(!b)return x;var k={source:d?b:o,sourceHandle:d?_:i,target:d?o:b,targetHandle:d?i:_};x.connection=k,E&&S&&(r===exports.ConnectionMode.Strict?d&&"source"===w||!d&&"target"===w:b!==o||_!==i)&&(x.endHandle={nodeId:b,handleId:_,type:w},x.isValid=f(k))}return x}var Yy={onPointerDown:function(n,e){var t,r=e.connectionMode,o=e.connectionRadius,i=e.handleId,u=e.nodeId,a=e.edgeUpdaterType,c=e.isTarget,l=e.domNode,s=e.nodeLookup,f=e.lib,d=e.autoPanOnConnect,h=e.flowId,v=e.panBy,p=e.cancelConnection,g=e.onConnectStart,y=e.onConnect,m=e.onConnectEnd,x=e.isValidConnection,w=void 0===x?Dy:x,b=e.onEdgeUpdateEnd,_=e.updateConnection,E=e.getTransform,S=e.getConnectionStartHandle,k=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),C=0,M=Hv(n),N=M.x,O=M.y,P=null==k?void 0:k.elementFromPoint(N,O),j=Ry(a,P),I=null==l?void 0:l.getBoundingClientRect();if(I&&j){var A=Hv(n,I),z=!1,L=null,D=!1,V=null,H=function(n){var e,t,r=n.nodeLookup,o=n.nodeId,i=n.handleId,u=n.handleType,a=[];try{for(var c=T(r),l=c.next();!l.done;l=c.next()){var s=B(l.value,2)[1];if(s.internals.handleBounds){var f="".concat(o,"-").concat(i,"-").concat(u),d=By(s,s.internals.handleBounds,"source",f),h=By(s,s.internals.handleBounds,"target",f);a.push.apply(a,R(R([],B(d),!1),B(h),!1))}}}catch(n){e={error:n}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}return a}({nodeLookup:s,nodeId:u,handleId:i,handleType:j});_({connectionPosition:A,connectionStatus:null,connectionStartHandle:Vy={nodeId:u,handleId:i,type:j},connectionEndHandle:null}),null==g||g(n,{nodeId:u,handleId:i,handleType:j}),k.addEventListener("mousemove",Z),k.addEventListener("mouseup",X),k.addEventListener("touchmove",Z),k.addEventListener("touchend",X)}function Y(){if(d&&I){var n=B(Nv(A,I),2),e=n[0],t=n[1];v({x:e,y:t}),C=requestAnimationFrame(Y)}}function Z(n){S()||X(n);var e=E();A=Hv(n,I),t=function(n,e,t){var r,o,i=[],u=1/0;try{for(var a=T(t),c=a.next();!c.done;c=a.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));s<=e&&(s<u?i=[l]:s===u&&i.push(l),u=s)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i.length?1===i.length?i[0]:i.find((function(n){return"target"===n.type}))||i[0]:null}(Av(A,e,!1,[1,1]),o,H),z||(Y(),z=!0);var a,l,s,d=Hy(n,{handle:t,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:w,doc:k,lib:f,flowId:h});V=d.handleDomNode,L=d.connection,D=d.isValid,_({connectionStartHandle:Vy,connectionPosition:t&&D?zv({x:t.x,y:t.y},e):A,connectionStatus:(a=!!t,l=D,s=null,l?s="valid":a&&!l&&(s="invalid"),s),connectionEndHandle:d.endHandle})}function X(n){(t||V)&&L&&D&&(null==y||y(L)),null==m||m(n),a&&(null==b||b(n)),p(),cancelAnimationFrame(C),z=!1,D=!1,L=null,V=null,Vy=null,k.removeEventListener("mousemove",Z),k.removeEventListener("mouseup",X),k.removeEventListener("touchmove",Z),k.removeEventListener("touchend",X)}},isValid:Hy};function Zy(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Xy(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Fy(){}var Uy=.7,Wy=1/Uy,$y="\\s*([+-]?\\d+)\\s*",Gy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ky=/^#([0-9a-f]{3,8})$/,Qy=new RegExp(`^rgb\\(${$y},${$y},${$y}\\)$`),Jy=new RegExp(`^rgb\\(${qy},${qy},${qy}\\)$`),nm=new RegExp(`^rgba\\(${$y},${$y},${$y},${Gy}\\)$`),em=new RegExp(`^rgba\\(${qy},${qy},${qy},${Gy}\\)$`),tm=new RegExp(`^hsl\\(${Gy},${qy},${qy}\\)$`),rm=new RegExp(`^hsla\\(${Gy},${qy},${qy},${Gy}\\)$`),om={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function im(){return this.rgb().formatHex()}function um(){return this.rgb().formatRgb()}function am(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Ky.exec(n))?(t=e[1].length,e=parseInt(e[1],16),6===t?cm(e):3===t?new fm(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===t?lm(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===t?lm(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Qy.exec(n))?new fm(e[1],e[2],e[3],1):(e=Jy.exec(n))?new fm(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nm.exec(n))?lm(e[1],e[2],e[3],e[4]):(e=em.exec(n))?lm(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=tm.exec(n))?ym(e[1],e[2]/100,e[3]/100,1):(e=rm.exec(n))?ym(e[1],e[2]/100,e[3]/100,e[4]):om.hasOwnProperty(n)?cm(om[n]):"transparent"===n?new fm(NaN,NaN,NaN,0):null}function cm(n){return new fm(n>>16&255,n>>8&255,255&n,1)}function lm(n,e,t,r){return r<=0&&(n=e=t=NaN),new fm(n,e,t,r)}function sm(n,e,t,r){return 1===arguments.length?((o=n)instanceof Fy||(o=am(o)),o?new fm((o=o.rgb()).r,o.g,o.b,o.opacity):new fm):new fm(n,e,t,null==r?1:r);var o}function fm(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}function dm(){return`#${gm(this.r)}${gm(this.g)}${gm(this.b)}`}function hm(){const n=vm(this.opacity);return`${1===n?"rgb(":"rgba("}${pm(this.r)}, ${pm(this.g)}, ${pm(this.b)}${1===n?")":`, ${n})`}`}function vm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function pm(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function gm(n){return((n=pm(n))<16?"0":"")+n.toString(16)}function ym(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new xm(n,e,t,r)}function mm(n){if(n instanceof xm)return new xm(n.h,n.s,n.l,n.opacity);if(n instanceof Fy||(n=am(n)),!n)return new xm;if(n instanceof xm)return n;var e=(n=n.rgb()).r/255,t=n.g/255,r=n.b/255,o=Math.min(e,t,r),i=Math.max(e,t,r),u=NaN,a=i-o,c=(i+o)/2;return a?(u=e===i?(t-r)/a+6*(t<r):t===i?(r-e)/a+2:(e-t)/a+4,a/=c<.5?i+o:2-i-o,u*=60):a=c>0&&c<1?0:u,new xm(u,a,c,n.opacity)}function xm(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}function wm(n){return(n=(n||0)%360)<0?n+360:n}function bm(n){return Math.max(0,Math.min(1,n||0))}function _m(n,e,t){return 255*(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)}Zy(Fy,am,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:im,formatHex:im,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mm(this).formatHsl()},formatRgb:um,toString:um}),Zy(fm,sm,Xy(Fy,{brighter(n){return n=null==n?Wy:Math.pow(Wy,n),new fm(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?Uy:Math.pow(Uy,n),new fm(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new fm(pm(this.r),pm(this.g),pm(this.b),vm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dm,formatHex:dm,formatHex8:function(){return`#${gm(this.r)}${gm(this.g)}${gm(this.b)}${gm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hm,toString:hm})),Zy(xm,(function(n,e,t,r){return 1===arguments.length?mm(n):new xm(n,e,t,null==r?1:r)}),Xy(Fy,{brighter(n){return n=null==n?Wy:Math.pow(Wy,n),new xm(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?Uy:Math.pow(Uy,n),new xm(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,o=2*t-r;return new fm(_m(n>=240?n-240:n+120,o,r),_m(n,o,r),_m(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new xm(wm(this.h),bm(this.s),bm(this.l),vm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=vm(this.opacity);return`${1===n?"hsl(":"hsla("}${wm(this.h)}, ${100*bm(this.s)}%, ${100*bm(this.l)}%${1===n?")":`, ${n})`}`}}));var Em=n=>()=>n;function Sm(n,e){var t=e-n;return t?function(n,e){return function(t){return n+t*e}}(n,t):Em(isNaN(n)?e:n)}var km=function n(e){var t=function(n){return 1==(n=+n)?Sm:function(e,t){return t-e?function(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}(e,t,n):Em(isNaN(e)?t:e)}}(e);function r(n,e){var r=t((n=sm(n)).r,(e=sm(e)).r),o=t(n.g,e.g),i=t(n.b,e.b),u=Sm(n.opacity,e.opacity);return function(e){return n.r=r(e),n.g=o(e),n.b=i(e),n.opacity=u(e),n+""}}return r.gamma=n,r}(1);function Cm(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var Mm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nm=new RegExp(Mm.source,"g");function Om(n,e){var t,r,o,i=Mm.lastIndex=Nm.lastIndex=0,u=-1,a=[],c=[];for(n+="",e+="";(t=Mm.exec(n))&&(r=Nm.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),a[u]?a[u]+=o:a[++u]=o),(t=t[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:Cm(t,r)})),i=Nm.lastIndex;return i<e.length&&(o=e.slice(i),a[u]?a[u]+=o:a[++u]=o),a.length<2?c[0]?function(n){return function(e){return n(e)+""}}(c[0].x):function(n){return function(){return n}}(e):(e=c.length,function(n){for(var t,r=0;r<e;++r)a[(t=c[r]).i]=t.x(n);return a.join("")})}var Pm,jm=180/Math.PI,Im={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Am(n,e,t,r,o,i){var u,a,c;return(u=Math.sqrt(n*n+e*e))&&(n/=u,e/=u),(c=n*t+e*r)&&(t-=n*c,r-=e*c),(a=Math.sqrt(t*t+r*r))&&(t/=a,r/=a,c/=a),n*r<e*t&&(n=-n,e=-e,c=-c,u=-u),{translateX:o,translateY:i,rotate:Math.atan2(e,n)*jm,skewX:Math.atan(c)*jm,scaleX:u,scaleY:a}}function zm(n,e,t,r){function o(n){return n.length?n.pop()+" ":""}return function(i,u){var a=[],c=[];return i=n(i),u=n(u),function(n,r,o,i,u,a){if(n!==o||r!==i){var c=u.push("translate(",null,e,null,t);a.push({i:c-4,x:Cm(n,o)},{i:c-2,x:Cm(r,i)})}else(o||i)&&u.push("translate("+o+e+i+t)}(i.translateX,i.translateY,u.translateX,u.translateY,a,c),function(n,e,t,i){n!==e?(n-e>180?e+=360:e-n>180&&(n+=360),i.push({i:t.push(o(t)+"rotate(",null,r)-2,x:Cm(n,e)})):e&&t.push(o(t)+"rotate("+e+r)}(i.rotate,u.rotate,a,c),function(n,e,t,i){n!==e?i.push({i:t.push(o(t)+"skewX(",null,r)-2,x:Cm(n,e)}):e&&t.push(o(t)+"skewX("+e+r)}(i.skewX,u.skewX,a,c),function(n,e,t,r,i,u){if(n!==t||e!==r){var a=i.push(o(i)+"scale(",null,",",null,")");u.push({i:a-4,x:Cm(n,t)},{i:a-2,x:Cm(e,r)})}else 1===t&&1===r||i.push(o(i)+"scale("+t+","+r+")")}(i.scaleX,i.scaleY,u.scaleX,u.scaleY,a,c),i=u=null,function(n){for(var e,t=-1,r=c.length;++t<r;)a[(e=c[t]).i]=e.x(n);return a.join("")}}}var Lm=zm((function(n){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?Im:Am(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Tm=zm((function(n){return null==n?Im:(Pm||(Pm=document.createElementNS("http://www.w3.org/2000/svg","g")),Pm.setAttribute("transform",n),(n=Pm.transform.baseVal.consolidate())?Am((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):Im)}),", ",")",")");function Bm(n){return((n=Math.exp(n))+1/n)/2}var Rm,Dm,Vm=function n(e,t,r){function o(n,o){var i,u,a=n[0],c=n[1],l=n[2],s=o[0],f=o[1],d=o[2],h=s-a,v=f-c,p=h*h+v*v;if(p<1e-12)u=Math.log(d/l)/e,i=function(n){return[a+n*h,c+n*v,l*Math.exp(e*n*u)]};else{var g=Math.sqrt(p),y=(d*d-l*l+r*p)/(2*l*t*g),m=(d*d-l*l-r*p)/(2*d*t*g),x=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(m*m+1)-m);u=(w-x)/e,i=function(n){var r,o=n*u,i=Bm(x),s=l/(t*g)*(i*(r=e*o+x,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(x));return[a+s*h,c+s*v,l*i/Bm(e*o+x)]}}return i.duration=1e3*u*e/Math.SQRT2,i}return o.rho=function(e){var t=Math.max(.001,+e),r=t*t;return n(t,r,r*r)},o}(Math.SQRT2,2,4),Hm=0,Ym=0,Zm=0,Xm=0,Fm=0,Um=0,Wm="object"==typeof performance&&performance.now?performance:Date,$m="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Gm(){return Fm||($m(qm),Fm=Wm.now()+Um)}function qm(){Fm=0}function Km(){this._call=this._time=this._next=null}function Qm(n,e,t){var r=new Km;return r.restart(n,e,t),r}function Jm(){Fm=(Xm=Wm.now())+Um,Hm=Ym=0;try{!function(){Gm(),++Hm;for(var n,e=Rm;e;)(n=Fm-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Hm}()}finally{Hm=0,function(){for(var n,e,t=Rm,r=1/0;t;)t._call?(r>t._time&&(r=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:Rm=e);Dm=n,ex(r)}(),Fm=0}}function nx(){var n=Wm.now(),e=n-Xm;e>1e3&&(Um-=e,Xm=n)}function ex(n){Hm||(Ym&&(Ym=clearTimeout(Ym)),n-Fm>24?(n<1/0&&(Ym=setTimeout(Jm,n-Wm.now()-Um)),Zm&&(Zm=clearInterval(Zm))):(Zm||(Xm=Wm.now(),Zm=setInterval(nx,1e3)),Hm=1,$m(Jm)))}function tx(n,e,t){var r=new Km;return e=null==e?0:+e,r.restart((t=>{r.stop(),n(t+e)}),e,t),r}Km.prototype=Qm.prototype={constructor:Km,restart:function(n,e,t){if("function"!=typeof n)throw new TypeError("callback is not a function");t=(null==t?Gm():+t)+(null==e?0:+e),this._next||Dm===this||(Dm?Dm._next=this:Rm=this,Dm=this),this._call=n,this._time=t,ex()},stop:function(){this._call&&(this._call=null,this._time=1/0,ex())}};var rx=og("start","end","cancel","interrupt"),ox=[];function ix(n,e,t,r,o,i){var u=n.__transition;if(u){if(t in u)return}else n.__transition={};!function(n,e,t){var r,o=n.__transition;function i(c){var l,s,f,d;if(1!==t.state)return a();for(l in o)if((d=o[l]).name===t.name){if(3===d.state)return tx(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",n,n.__data__,d.index,d.group),delete o[l]):+l<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",n,n.__data__,d.index,d.group),delete o[l])}if(tx((function(){3===t.state&&(t.state=4,t.timer.restart(u,t.delay,t.time),u(c))})),t.state=2,t.on.call("start",n,n.__data__,t.index,t.group),2===t.state){for(t.state=3,r=new Array(f=t.tween.length),l=0,s=-1;l<f;++l)(d=t.tween[l].value.call(n,n.__data__,t.index,t.group))&&(r[++s]=d);r.length=s+1}}function u(e){for(var o=e<t.duration?t.ease.call(null,e/t.duration):(t.timer.restart(a),t.state=5,1),i=-1,u=r.length;++i<u;)r[i].call(n,o);5===t.state&&(t.on.call("end",n,n.__data__,t.index,t.group),a())}function a(){for(var r in t.state=6,t.timer.stop(),delete o[e],o)return;delete n.__transition}o[e]=t,t.timer=Qm((function(n){t.state=1,t.timer.restart(i,t.delay,t.time),t.delay<=n&&i(n-t.delay)}),0,t.time)}(n,t,{name:e,index:r,group:o,on:rx,tween:ox,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function ux(n,e){var t=cx(n,e);if(t.state>0)throw new Error("too late; already scheduled");return t}function ax(n,e){var t=cx(n,e);if(t.state>3)throw new Error("too late; already running");return t}function cx(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function lx(n,e){var t,r,o,i=n.__transition,u=!0;if(i){for(o in e=null==e?null:e+"",i)(t=i[o]).name===e?(r=t.state>2&&t.state<5,t.state=6,t.timer.stop(),t.on.call(r?"interrupt":"cancel",n,n.__data__,t.index,t.group),delete i[o]):u=!1;u&&delete n.__transition}}function sx(n,e){var t,r;return function(){var o=ax(this,n),i=o.tween;if(i!==t)for(var u=0,a=(r=t=i).length;u<a;++u)if(r[u].name===e){(r=r.slice()).splice(u,1);break}o.tween=r}}function fx(n,e,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=ax(this,n),u=i.tween;if(u!==r){o=(r=u).slice();for(var a={name:e,value:t},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function dx(n,e,t){var r=n._id;return n.each((function(){var n=ax(this,r);(n.value||(n.value={}))[e]=t.apply(this,arguments)})),function(n){return cx(n,r).value[e]}}function hx(n,e){var t;return("number"==typeof e?Cm:e instanceof am?km:(t=am(e))?(e=t,km):Om)(n,e)}function vx(n){return function(){this.removeAttribute(n)}}function px(n){return function(){this.removeAttributeNS(n.space,n.local)}}function gx(n,e,t){var r,o,i=t+"";return function(){var u=this.getAttribute(n);return u===i?null:u===r?o:o=e(r=u,t)}}function yx(n,e,t){var r,o,i=t+"";return function(){var u=this.getAttributeNS(n.space,n.local);return u===i?null:u===r?o:o=e(r=u,t)}}function mx(n,e,t){var r,o,i;return function(){var u,a,c=t(this);if(null!=c)return(u=this.getAttribute(n))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=e(r=u,c));this.removeAttribute(n)}}function xx(n,e,t){var r,o,i;return function(){var u,a,c=t(this);if(null!=c)return(u=this.getAttributeNS(n.space,n.local))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=e(r=u,c));this.removeAttributeNS(n.space,n.local)}}function wx(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}(n,o)),t}return o._value=e,o}function bx(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}(n,o)),t}return o._value=e,o}function _x(n,e){return function(){ux(this,n).delay=+e.apply(this,arguments)}}function Ex(n,e){return e=+e,function(){ux(this,n).delay=e}}function Sx(n,e){return function(){ax(this,n).duration=+e.apply(this,arguments)}}function kx(n,e){return e=+e,function(){ax(this,n).duration=e}}var Cx=my.prototype.constructor;function Mx(n){return function(){this.style.removeProperty(n)}}var Nx=0;function Ox(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function Px(){return++Nx}var jx=my.prototype;Ox.prototype={constructor:Ox,select:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=pg(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var a,c,l=r[u],s=l.length,f=i[u]=new Array(s),d=0;d<s;++d)(a=l[d])&&(c=n.call(a,a.__data__,d,l))&&("__data__"in a&&(c.__data__=a.__data__),f[d]=c,ix(f[d],e,t,d,f,cx(a,t)));return new Ox(i,this._parents,e,t)},selectAll:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=yg(n));for(var r=this._groups,o=r.length,i=[],u=[],a=0;a<o;++a)for(var c,l=r[a],s=l.length,f=0;f<s;++f)if(c=l[f]){for(var d,h=n.call(c,c.__data__,f,l),v=cx(c,t),p=0,g=h.length;p<g;++p)(d=h[p])&&ix(d,e,t,p,h,v);i.push(h),u.push(c)}return new Ox(i,u,e,t)},selectChild:jx.selectChild,selectChildren:jx.selectChildren,filter:function(n){"function"!=typeof n&&(n=mg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u=e[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new Ox(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,o=t.length,i=Math.min(r,o),u=new Array(r),a=0;a<i;++a)for(var c,l=e[a],s=t[a],f=l.length,d=u[a]=new Array(f),h=0;h<f;++h)(c=l[h]||s[h])&&(d[h]=c);for(;a<r;++a)u[a]=e[a];return new Ox(u,this._parents,this._name,this._id)},selection:function(){return new Cx(this._groups,this._parents)},transition:function(){for(var n=this._name,e=this._id,t=Px(),r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)if(u=a[l]){var s=cx(u,e);ix(u,n,t,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Ox(r,this._parents,n,t)},call:jx.call,nodes:jx.nodes,node:jx.node,size:jx.size,empty:jx.empty,each:jx.each,on:function(n,e){var t=this._id;return arguments.length<2?cx(this.node(),t).on.on(n):this.each(function(n,e,t){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||"start"===n}))}(e)?ux:ax;return function(){var u=i(this,n),a=u.on;a!==r&&(o=(r=a).copy()).on(e,t),u.on=o}}(t,n,e))},attr:function(n,e){var t=sg(n),r="transform"===t?Tm:hx;return this.attrTween(n,"function"==typeof e?(t.local?xx:mx)(t,r,dx(this,"attr."+n,e)):null==e?(t.local?px:vx)(t):(t.local?yx:gx)(t,r,e))},attrTween:function(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;var r=sg(n);return this.tween(t,(r.local?wx:bx)(r,e))},style:function(n,e,t){var r="transform"==(n+="")?Lm:hx;return null==e?this.styleTween(n,function(n,e){var t,r,o;return function(){var i=Hg(this,n),u=(this.style.removeProperty(n),Hg(this,n));return i===u?null:i===t&&u===r?o:o=e(t=i,r=u)}}(n,r)).on("end.style."+n,Mx(n)):"function"==typeof e?this.styleTween(n,function(n,e,t){var r,o,i;return function(){var u=Hg(this,n),a=t(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=Hg(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=e(r=u,a))}}(n,r,dx(this,"style."+n,e))).each(function(n,e){var t,r,o,i,u="style."+e,a="end."+u;return function(){var c=ax(this,n),l=c.on,s=null==c.value[u]?i||(i=Mx(e)):void 0;l===t&&o===s||(r=(t=l).copy()).on(a,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,e,t){var r,o,i=t+"";return function(){var u=Hg(this,n);return u===i?null:u===r?o:o=e(r=u,t)}}(n,r,e),t).on("end.style."+n,null)},styleTween:function(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(n,e,t){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}(n,i,t)),r}return i._value=e,i}(n,e,null==t?"":t))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var e=n(this);this.textContent=null==e?"":e}}(dx(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;return this.tween(e,function(n){var e,t;function r(){var r=n.apply(this,arguments);return r!==t&&(e=(t=r)&&function(n){return function(e){this.textContent=n.call(this,e)}}(r)),e}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}(this._id))},tween:function(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r,o=cx(this.node(),t).tween,i=0,u=o.length;i<u;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==e?sx:fx)(t,n,e))},delay:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?_x:Ex)(e,n)):cx(this.node(),e).delay},duration:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?Sx:kx)(e,n)):cx(this.node(),e).duration},ease:function(n){var e=this._id;return arguments.length?this.each(function(n,e){if("function"!=typeof e)throw new Error;return function(){ax(this,n).ease=e}}(e,n)):cx(this.node(),e).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,e){return function(){var t=e.apply(this,arguments);if("function"!=typeof t)throw new Error;ax(this,n).ease=t}}(this._id,n))},end:function(){var n,e,t=this,r=t._id,o=t.size();return new Promise((function(i,u){var a={value:u},c={value:function(){0==--o&&i()}};t.each((function(){var t=ax(this,r),o=t.on;o!==n&&((e=(n=o).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),t.on=e})),0===o&&i()}))},[Symbol.iterator]:jx[Symbol.iterator]};var Ix={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function Ax(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}my.prototype.interrupt=function(n){return this.each((function(){lx(this,n)}))},my.prototype.transition=function(n){var e,t;n instanceof Ox?(e=n._id,n=n._name):(e=Px(),(t=Ix).time=Gm(),n=null==n?null:n+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)(u=a[l])&&ix(u,n,e,l,a,t||Ax(u,e));return new Ox(r,this._parents,n,e)};var zx=n=>()=>n;function Lx(n,{sourceEvent:e,target:t,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Tx(n,e,t){this.k=n,this.x=e,this.y=t}Tx.prototype={constructor:Tx,scale:function(n){return 1===n?this:new Tx(this.k*n,this.x,this.y)},translate:function(n,e){return 0===n&0===e?this:new Tx(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Bx=new Tx(1,0,0);function Rx(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Bx;return n.__zoom}function Dx(n){n.stopImmediatePropagation()}function Vx(n){n.preventDefault(),n.stopImmediatePropagation()}function Hx(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function Yx(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n).hasAttribute("viewBox")?[[(n=n.viewBox.baseVal).x,n.y],[n.x+n.width,n.y+n.height]]:[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]:[[0,0],[n.clientWidth,n.clientHeight]]}function Zx(){return this.__zoom||Bx}function Xx(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Fx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ux(n,e,t){var r=n.invertX(e[0][0])-t[0][0],o=n.invertX(e[1][0])-t[1][0],i=n.invertY(e[0][1])-t[0][1],u=n.invertY(e[1][1])-t[1][1];return n.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),u>i?(i+u)/2:Math.min(0,i)||Math.max(0,u))}Rx.prototype=Tx.prototype;var Wx,$x=function(n){return{x:n.x,y:n.y,zoom:n.k}},Gx=function(n){var e=n.x,t=n.y,r=n.zoom;return Bx.translate(e,t).scale(r)},qx=function(n,e){return n.target.closest(".".concat(e))},Kx=function(n,e){return 2===e&&Array.isArray(n)&&n.includes(2)},Qx=function(n,e){return void 0===e&&(e=0),"number"==typeof e&&e>0?n.transition().duration(e):n},Jx=function(n){var e=n.ctrlKey&&Tv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*e};function nw(n){var e=n.domNode,t=n.minZoom,r=n.maxZoom,o=n.translateExtent,i=n.viewport,u=n.onPanZoom,a=n.onPanZoomStart,c=n.onPanZoomEnd,l=n.onTransformChange,s=n.onDraggingChange,f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=function(){var n,e,t,r=Hx,o=Yx,i=Ux,u=Xx,a=Fx,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=Vm,d=og("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",Zx).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(n,e){return(e=Math.max(c[0],Math.min(c[1],e)))===n.k?n:new Tx(e,n.x,n.y)}function y(n,e,t){var r=e[0]-t[0]*n.k,o=e[1]-t[1]*n.k;return r===n.x&&o===n.y?n:new Tx(n.k,r,o)}function m(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function x(n,e,t,r){n.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=w(n,i).event(r),a=o.apply(n,i),c=null==t?m(a):"function"==typeof t?t.apply(n,i):t,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=n.__zoom,d="function"==typeof e?e.apply(n,i):e,h=f(s.invert(c).concat(l/s.k),d.invert(c).concat(l/d.k));return function(n){if(1===n)n=d;else{var e=h(n),t=l/e[2];n=new Tx(t,c[0]-e[0]*t,c[1]-e[1]*t)}u.zoom(null,n)}}))}function w(n,e,t){return!t&&n.__zooming||new b(n,e)}function b(n,e){this.that=n,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,e),this.taps=0}function _(n,...e){if(r.apply(this,arguments)){var t=w(this,e).event(n),o=this.__zoom,a=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,u.apply(this,arguments)))),s=wy(n);if(t.wheel)t.mouse[0][0]===s[0]&&t.mouse[0][1]===s[1]||(t.mouse[1]=o.invert(t.mouse[0]=s)),clearTimeout(t.wheel);else{if(o.k===a)return;t.mouse=[s,o.invert(s)],lx(this),t.start()}Vx(n),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),150),t.zoom("mouse",i(y(g(o,a),t.mouse[0],t.mouse[1]),t.extent,l))}}function E(n,...e){if(!t&&r.apply(this,arguments)){var o=n.currentTarget,u=w(this,e,!0).event(n),a=xy(n.view).on("mousemove.zoom",(function(n){if(Vx(n),!u.moved){var e=n.clientX-s,t=n.clientY-f;u.moved=e*e+t*t>h}u.event(n).zoom("mouse",i(y(u.that.__zoom,u.mouse[0]=wy(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),Cy(n.view,u.moved),Vx(n),u.event(n).end()}),!0),c=wy(n,o),s=n.clientX,f=n.clientY;ky(n.view),Dx(n),u.mouse=[c,this.__zoom.invert(c)],lx(this),u.start()}}function S(n,...e){if(r.apply(this,arguments)){var t=this.__zoom,u=wy(n.changedTouches?n.changedTouches[0]:n,this),a=t.invert(u),c=t.k*(n.shiftKey?.5:2),f=i(y(g(t,c),u,a),o.apply(this,e),l);Vx(n),s>0?xy(this).transition().duration(s).call(x,f,u,n):xy(this).call(p.transform,f,u,n)}}function k(t,...o){if(r.apply(this,arguments)){var i,u,a,c,l=t.touches,s=l.length,f=w(this,o,t.changedTouches.length===s).event(t);for(Dx(t),u=0;u<s;++u)c=[c=wy(a=l[u],this),this.__zoom.invert(c),a.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!n);n&&(n=clearTimeout(n)),i&&(f.taps<2&&(e=c[0],n=setTimeout((function(){n=null}),500)),lx(this),f.start())}}function C(n,...e){if(this.__zooming){var t,r,o,u,a=w(this,e).event(n),c=n.changedTouches,s=c.length;for(Vx(n),t=0;t<s;++t)o=wy(r=c[t],this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=o:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=o);if(r=a.that.__zoom,a.touch1){var f=a.touch0[0],d=a.touch0[1],h=a.touch1[0],v=a.touch1[1],p=(p=h[0]-f[0])*p+(p=h[1]-f[1])*p,m=(m=v[0]-d[0])*m+(m=v[1]-d[1])*m;r=g(r,Math.sqrt(p/m)),o=[(f[0]+h[0])/2,(f[1]+h[1])/2],u=[(d[0]+v[0])/2,(d[1]+v[1])/2]}else{if(!a.touch0)return;o=a.touch0[0],u=a.touch0[1]}a.zoom("touch",i(y(r,o,u),a.extent,l))}}function M(n,...r){if(this.__zooming){var o,i,u=w(this,r).event(n),a=n.changedTouches,c=a.length;for(Dx(n),t&&clearTimeout(t),t=setTimeout((function(){t=null}),500),o=0;o<c;++o)i=a[o],u.touch0&&u.touch0[2]===i.identifier?delete u.touch0:u.touch1&&u.touch1[2]===i.identifier&&delete u.touch1;if(u.touch1&&!u.touch0&&(u.touch0=u.touch1,delete u.touch1),u.touch0)u.touch0[1]=this.__zoom.invert(u.touch0[0]);else if(u.end(),2===u.taps&&(i=wy(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var l=xy(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return p.transform=function(n,e,t,r){var o=n.selection?n.selection():n;o.property("__zoom",Zx),n!==o?x(n,e,t,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(n,e,t,r){p.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),t,r)},p.scaleTo=function(n,e,t,r){p.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,u=null==t?m(n):"function"==typeof t?t.apply(this,arguments):t,a=r.invert(u),c="function"==typeof e?e.apply(this,arguments):e;return i(y(g(r,c),u,a),n,l)}),t,r)},p.translateBy=function(n,e,t,r){p.transform(n,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof t?t.apply(this,arguments):t),o.apply(this,arguments),l)}),null,r)},p.translateTo=function(n,e,t,r,u){p.transform(n,(function(){var n=o.apply(this,arguments),u=this.__zoom,a=null==r?m(n):"function"==typeof r?r.apply(this,arguments):r;return i(Bx.translate(a[0],a[1]).scale(u.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof t?-t.apply(this,arguments):-t),n,l)}),r,u)},b.prototype={event:function(n){return n&&(this.sourceEvent=n),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(n,e){return this.mouse&&"mouse"!==n&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var e=xy(this.that).datum();d.call(n,this.that,new Lx(n,{sourceEvent:this.sourceEvent,target:p,type:n,transform:this.that.__zoom,dispatch:d}),e)}},p.wheelDelta=function(n){return arguments.length?(u="function"==typeof n?n:zx(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:zx(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:zx(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:zx([[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]]),p):o},p.scaleExtent=function(n){return arguments.length?(c[0]=+n[0],c[1]=+n[1],p):[c[0],c[1]]},p.translateExtent=function(n){return arguments.length?(l[0][0]=+n[0][0],l[1][0]=+n[1][0],l[0][1]=+n[0][1],l[1][1]=+n[1][1],p):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},p.constrain=function(n){return arguments.length?(i=n,p):i},p.duration=function(n){return arguments.length?(s=+n,p):s},p.interpolate=function(n){return arguments.length?(f=n,p):f},p.on=function(){var n=d.on.apply(d,arguments);return n===d?p:n},p.clickDistance=function(n){return arguments.length?(h=(n=+n)*n,p):Math.sqrt(h)},p.tapDistance=function(n){return arguments.length?(v=+n,p):v},p}().scaleExtent([t,r]).translateExtent(o),v=xy(e).call(h);x({x:i.x,y:i.y,zoom:kv(i.zoom,t,r)},[[0,0],[d.width,d.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,e){v&&(null==h||h.transform(Qx(v,null==e?void 0:e.duration),n))}function m(){h.on("zoom",null)}function x(n,e,t){var r=Gx(n),o=null==h?void 0:h.constrain()(r,e,t);return o&&y(o),o}return h.wheelDelta(Jx),{update:function(n){var e=n.noWheelClassName,t=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,d=n.panOnDrag,y=n.panOnScrollMode,x=n.panOnScrollSpeed,w=n.preventScrolling,b=n.zoomOnPinch,_=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!f.isZoomingOrPanning&&m();var C=!i||S||o?function(n){var e=n.noWheelClassName,t=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!t&&"wheel"===n.type&&!n.ctrlKey||qx(n,e))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:e,preventScrolling:w,d3ZoomHandler:p}):function(n){var e=n.zoomPanValues,t=n.noWheelClassName,r=n.d3Selection,o=n.d3Zoom,i=n.panOnScrollMode,u=n.panOnScrollSpeed,a=n.zoomOnPinch,c=n.onPanZoomStart,l=n.onPanZoom,s=n.onPanZoomEnd;return function(n){if(qx(n,t))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=wy(n),h=Jx(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===exports.PanOnScrollMode.Vertical?0:n.deltaX*p,y=i===exports.PanOnScrollMode.Horizontal?0:n.deltaY*p;!Tv()&&n.shiftKey&&i!==exports.PanOnScrollMode.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=$x(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,null==c||c(n,m)),e.isPanScrolling&&(null==l||l(n,m),e.panScrollTimeout=setTimeout((function(){null==s||s(n,m),e.isPanScrolling=!1}),150))}}}({zoomPanValues:f,noWheelClassName:e,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:x,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var M=function(n){var e=n.zoomPanValues,t=n.onDraggingChange,r=n.onPanZoomStart;return function(n){var o,i,u;if(!(null===(o=n.sourceEvent)||void 0===o?void 0:o.internal)){var a=$x(n.transform);e.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,"mousedown"===(null===(u=n.sourceEvent)||void 0===u?void 0:u.type)&&t(!0),r&&(null==r||r(n.sourceEvent,a))}}}({zoomPanValues:f,onDraggingChange:s,onPanZoomStart:a});h.on("start",M);var N=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var u,a,c;e.usedRightMouseButton=!(!r||!Kx(t,null!==(u=e.mouseButton)&&void 0!==u?u:0)),(null===(a=n.sourceEvent)||void 0===a?void 0:a.sync)||o([n.transform.x,n.transform.y,n.transform.k]),i&&!(null===(c=n.sourceEvent)||void 0===c?void 0:c.internal)&&(null==i||i(n.sourceEvent,$x(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",N);var O=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.panOnScroll,o=n.onDraggingChange,i=n.onPanZoomEnd,u=n.onPaneContextMenu;return function(n){var a,c,l,s;if(!(null===(a=n.sourceEvent)||void 0===a?void 0:a.internal)&&(e.isZoomingOrPanning=!1,u&&Kx(t,null!==(c=e.mouseButton)&&void 0!==c?c:0)&&!e.usedRightMouseButton&&n.sourceEvent&&u(n.sourceEvent),e.usedRightMouseButton=!1,o(!1),i&&(l=e.prevViewport,s=n.transform,l.x!==s.x||l.y!==s.y||l.zoom!==s.k))){var f=$x(n.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout((function(){null==i||i(n.sourceEvent,f)}),r?150:0)}}}({zoomPanValues:f,panOnDrag:d,panOnScroll:i,onPaneContextMenu:r,onPanZoomEnd:c,onDraggingChange:s});h.on("end",O)}var P=function(n){var e=n.zoomActivationKeyPressed,t=n.zoomOnScroll,r=n.zoomOnPinch,o=n.panOnDrag,i=n.panOnScroll,u=n.zoomOnDoubleClick,a=n.userSelectionActive,c=n.noWheelClassName,l=n.noPanClassName,s=n.lib;return function(n){var f=e||t,d=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(qx(n,"".concat(s,"-flow__node"))||qx(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(qx(n,c)&&"wheel"===n.type)return!1;if(qx(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!e))return!1;if(!r&&n.ctrlKey&&"wheel"===n.type)return!1;if(!f&&!i&&!d&&"wheel"===n.type)return!1;if(!o&&("mousedown"===n.type||"touchstart"===n.type))return!1;if(Array.isArray(o)&&!o.includes(n.button)&&"mousedown"===n.type)return!1;var h=Array.isArray(o)&&o.includes(n.button)||!n.button||n.button<=1;return(!n.ctrlKey||"wheel"===n.type)&&h}}({zoomActivationKeyPressed:S,panOnDrag:d,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:b,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:k});h.filter(P),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,e){var t=Gx(n);return y(t,e),t},setViewportConstrained:x,getViewport:function(){var n=v?Rx(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,e){v&&(null==h||h.scaleTo(Qx(v,null==e?void 0:e.duration),n))},scaleBy:function(n,e){v&&(null==h||h.scaleBy(Qx(v,null==e?void 0:e.duration),n))},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var e=Gx(n),t=v.property("__zoom");t.k===n.zoom&&t.x===n.x&&t.y===n.y||null==h||h.transform(v,e,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(Wx||(Wx={}));L(L({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var ew=cv();function tw(e,t){var r=n.useContext(A);if(null===r)throw new Error(ew);return j(r,e,t)}function rw(){var e=n.useContext(A);if(null===e)throw new Error(ew);return n.useMemo((function(){return{getState:e.getState,setState:e.setState,subscribe:e.subscribe}}),[e])}function ow(n,e){var r,o,i;void 0===e&&(e={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var c=(null==e?void 0:e.elevateNodesOnSelect)?1e3:0;try{for(var l=u(n),s=l.next();!s.done;s=l.next()){var f=a(s.value,2)[1],d=f.parentId;if(d){if(!n.has(d))throw new Error("Parent node ".concat(d," not found"));var h=n.get(d),v=iw(f,n,t(t({},f.position),{z:(hw(f.zIndex)?f.zIndex:0)+(f.selected?c:0)}),null!==(i=null==h?void 0:h.origin)&&void 0!==i?i:e.nodeOrigin),p=v.x,g=v.y,y=v.z,m=f.internals.positionAbsolute,x=p!==m.x||g!==m.y;(x||y!==f.internals.z)&&(f.internals=t(t({},f.internals),{positionAbsolute:x?{x:p,y:g}:m,z:y}))}}}catch(n){r={error:n}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}}function iw(n,e,t,r){var o,i,u,a,c,l;if(void 0===r&&(r=[0,0]),!n.parentId)return t;var s=e.get(n.parentId),f=uw(s,r).position;return iw(s,e,{x:(null!==(o=t.x)&&void 0!==o?o:0)+f.x,y:(null!==(i=t.y)&&void 0!==i?i:0)+f.y,z:(null!==(u=s.internals.z)&&void 0!==u?u:0)>(null!==(a=t.z)&&void 0!==a?a:0)?null!==(c=s.internals.z)&&void 0!==c?c:0:null!==(l=t.z)&&void 0!==l?l:0},s.origin||r)}var uw=function(n,e){void 0===e&&(e=[0,0]);var t=dw(n),r=t.width,o=t.height,i=("internals"in n?n.internals.positionAbsolute:n.position)||{x:0,y:0},u=n.origin||e,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}};function aw(n,e,t){var r,o;n.clear(),e.clear();try{for(var i=u(t),a=i.next();!a.done;a=i.next()){var c=a.value,l=c.source,s=c.target,f=c.sourceHandle,d=void 0===f?null:f,h=c.targetHandle,v=void 0===h?null:h,p="".concat(l,"-source-").concat(d),g="".concat(s,"-target-").concat(v),y=n.get(p)||new Map,m=n.get(g)||new Map,x={edgeId:c.id,source:l,target:s,sourceHandle:d,targetHandle:v};e.set(c.id,c),n.set(p,y.set("".concat(s,"-").concat(v),x)),n.set(g,m.set("".concat(l,"-").concat(d),x))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}function cw(n,e,r,o){void 0===o&&(o={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var i=new Map(e);e.clear(),r.clear();var u=(null==o?void 0:o.elevateNodesOnSelect)?1e3:0;n.forEach((function(n){var a,c,l,s,f=i.get(n.id);if(o.checkEquality&&n===(null==f?void 0:f.internals.userNode)||(f=t(t(t({},o.defaults),n),{measured:{width:null!==(c=null===(a=n.measured)||void 0===a?void 0:a.width)&&void 0!==c?c:0,height:null!==(s=null===(l=n.measured)||void 0===l?void 0:l.height)&&void 0!==s?s:0},internals:{positionAbsolute:n.position||{x:0,y:0},handleBounds:null==f?void 0:f.internals.handleBounds,z:(hw(n.zIndex)?n.zIndex:0)+(n.selected?u:0),userNode:n}})),e.set(n.id,f),n.parentId){var d=r.get(n.parentId);d?d.push(f):r.set(n.parentId,[f])}})),r.size>0&&ow(e,o)}function lw(n,e,t,r){var o,i,a,c,l,s=[],f=new Map;try{for(var d=u(n),h=d.next();!h.done;h=d.next()){var v=h.value,p=e.get(v.parentId);if(p){var g=null!==(c=null===(a=f.get(v.parentId))||void 0===a?void 0:a.expandedRect)&&void 0!==c?c:gw(p,null!==(l=p.origin)&&void 0!==l?l:r),y=ww(g,v.rect);f.set(v.parentId,{expandedRect:y,parent:p})}}}catch(n){o={error:n}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}return f.size>0&&f.forEach((function(e,r){var o=e.expandedRect,i=e.parent,u=uw(i,i.origin).position,a=dw(i),c=o.x<u.x?Math.round(Math.abs(u.x-o.x)):0,l=o.y<u.y?Math.round(Math.abs(u.y-o.y)):0;if(c>0||l>0){s.push({id:r,type:"position",position:{x:u.x-c,y:u.y-l}});var f=t.get(r);null==f||f.forEach((function(e){n.some((function(n){return n.id===e.id}))||s.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+l}})}))}(a.width<o.width||a.height<o.height)&&s.push({id:r,type:"dimensions",setAttributes:!0,dimensions:{width:Math.max(a.width,Math.round(o.width)),height:Math.max(a.height,Math.round(o.height))}})})),s}var sw=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},fw=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:sw(n.x,e[0][0],e[1][0]),y:sw(n.y,e[0][1],e[1][1])}};function dw(n){var e,t,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var hw=function(n){return!isNaN(n)&&isFinite(n)},vw=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},pw=function(n,e,t,r){var o=n.x,i=n.y,u=a(e,3),c=u[0],l=u[1],s=u[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var f={x:(o-c)/s,y:(i-l)/s};return t?vw(f,r):f},gw=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=uw(n,e).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0,height:null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0}},yw=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},mw=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},xw=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},ww=function(n,e){return xw(yw(mw(n),mw(e)))};function bw(e){return n.forwardRef(e)}var _w=function(n,e){var t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),r=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*r)},Ew=function(n,e,t,r,o,i){var u=e/(n.width*(1+i)),a=t/(n.height*(1+i)),c=Math.min(u,a),l=sw(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}};function Sw(n){return void 0!==n&&"parent"!==n}var kw=function(n){return Cw(n)},Cw=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};var Mw=function(n){return hw(n.width)&&hw(n.height)&&hw(n.x)&&hw(n.y)},Nw=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},Ow=["INPUT","SELECT","TEXTAREA"];function Pw(n){var e,t,r=(null===(t=null===(e=n.composedPath)||void 0===e?void 0:e.call(n))||void 0===t?void 0:t[0])||n.target;return Ow.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var jw=function(n){return"clientX"in n},Iw=function(n,e){var t,r,o,i,u=jw(n),a=u?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}},Aw=function(n,e,r,o){void 0===o&&(o=[0,0]);var i=e.querySelectorAll(n);if(!i||!i.length)return null;var u=Array.from(i),a=e.getBoundingClientRect(),c=a.width*o[0],l=a.height*o[1];return u.map((function(n){var e=n.getBoundingClientRect();return t({id:n.getAttribute("data-handleid"),position:n.getAttribute("data-handlepos"),x:(e.left-a.left-c)/r,y:(e.top-a.top-l)/r},Nw(n))}))},zw="undefined"!=typeof document?document:null;function Lw(e,t){void 0===e&&(e=null),void 0===t&&(t={target:zw,actInsideInputWithModifier:!0});var r=a(n.useState(!1),2),o=r[0],i=r[1],u=n.useRef(!1),l=n.useRef(new Set([])),s=a(n.useMemo((function(){if(null!==e){var n=(Array.isArray(e)?e:[e]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),t=n.reduce((function(n,e){return n.concat.apply(n,c([],a(e),!1))}),[]);return[n,t]}return[[],[]]}),[e]),2),f=s[0],d=s[1];return n.useEffect((function(){var n=(null==t?void 0:t.target)||zw;if(null!==e){var r=function(n){if(u.current=n.ctrlKey||n.metaKey||n.shiftKey,(!u.current||u.current&&!t.actInsideInputWithModifier)&&Pw(n))return!1;var e=Bw(n.code,d);l.current.add(n[e]),Tw(f,l.current,!1)&&(n.preventDefault(),i(!0))},o=function(n){if((!u.current||u.current&&!t.actInsideInputWithModifier)&&Pw(n))return!1;var e=Bw(n.code,d);Tw(f,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(n[e]),"Meta"===n.key&&l.current.clear(),u.current=!1},a=function(){l.current.clear(),i(!1)};return null==n||n.addEventListener("keydown",r),null==n||n.addEventListener("keyup",o),window.addEventListener("blur",a),window.addEventListener("contextmenu",a),function(){null==n||n.removeEventListener("keydown",r),null==n||n.removeEventListener("keyup",o),window.removeEventListener("blur",a),window.removeEventListener("contextmenu",a)}}}),[e,i]),o}function Tw(n,e,t){return n.filter((function(n){return t||n.length===e.size})).some((function(n){return n.every((function(n){return e.has(n)}))}))}function Bw(n,e){return e.includes(n)?"code":"key"}function Rw(n,e){if(Object.is(n,e))return!0;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[t,r]of n)if(!Object.is(r,e.get(t)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}var Dw={position:"absolute",width:"100%",height:"100%",top:0,left:0};var Vw=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function Hw(e){var t=e.onPaneContextMenu,r=e.zoomOnScroll,o=void 0===r||r,i=e.zoomOnPinch,u=void 0===i||i,a=e.panOnScroll,c=void 0!==a&&a,l=e.panOnScrollSpeed,s=void 0===l?.5:l,f=e.panOnScrollMode,d=void 0===f?exports.PanOnScrollMode.Free:f,h=e.zoomOnDoubleClick,v=void 0===h||h,g=e.panOnDrag,y=void 0===g||g,m=e.defaultViewport,x=e.translateExtent,w=e.zoomActivationKeyCode,b=e.preventScrolling,_=void 0===b||b,E=e.children,S=e.noWheelClassName,k=e.noPanClassName,C=e.onViewportChange,M=e.isControlledViewport,N=rw(),O=n.useRef(null),P=tw(Vw,Rw),j=P.userSelectionActive,I=P.lib,A=Lw(w),z=n.useRef();return function(e){var t=rw();n.useEffect((function(){var n=function(){var n,r;if(!e.current)return!1;var o=Nw(e.current);0!==o.height&&0!==o.width||null===(r=(n=t.getState()).onError)||void 0===r||r.call(n,"004",sv()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);var r=new ResizeObserver((function(){return n()}));return r.observe(e.current),function(){window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}}),[])}(O),n.useEffect((function(){if(O.current){var n=N.getState();z.current=nw({domNode:O.current,minZoom:n.minZoom,maxZoom:n.maxZoom,translateExtent:x,viewport:m,onTransformChange:function(n){null==C||C({x:n[0],y:n[1],zoom:n[2]}),M||N.setState({transform:n})},onDraggingChange:function(n){return N.setState({paneDragging:n})},onPanZoomStart:function(n,e){var t=N.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(n,e),null==r||r(e)},onPanZoom:function(n,e){var t=N.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(n,e),null==r||r(e)},onPanZoomEnd:function(n,e){var t=N.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(n,e),null==r||r(e)}});var e=z.current.getViewport(),t=e.x,r=e.y,o=e.zoom;return N.setState({panZoom:z.current,transform:[t,r,o],domNode:O.current.closest(".ink-flow")}),function(){var n;null===(n=z.current)||void 0===n||n.destroy()}}}),[]),n.useEffect((function(){var n;null===(n=z.current)||void 0===n||n.update({onPaneContextMenu:t,zoomOnScroll:o,zoomOnPinch:u,panOnScroll:c,panOnScrollSpeed:s,panOnScrollMode:d,zoomOnDoubleClick:v,panOnDrag:y,zoomActivationKeyPressed:A,preventScrolling:_,noPanClassName:k,userSelectionActive:j,noWheelClassName:S,lib:I})}),[t,o,u,c,s,d,v,y,A,_,k,j,S,I]),p.jsx("div",{className:"ink-flow__renderer",ref:O,style:Dw,children:E})}var Yw={actInsideInputWithModifier:!1};function Zw(n,e){switch(n.type){case"select":e.selected=n.selected;break;case"position":void 0!==n.position&&(e.position=n.position),void 0!==n.dragging&&(e.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(e.measured={width:n.dimensions.width,height:n.dimensions.height},n.setAttributes&&(e.width=n.dimensions.width,e.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(e.resizing=n.resizing)}}function Xw(n,e){var r,o,i,a,c,l,s=[],f=new Map;try{for(var d=u(n),h=d.next();!h.done;h=d.next()){if("add"!==(_=h.value).type)if("remove"===_.type||"replace"===_.type)f.set(_.id,[_]);else{var v=f.get(_.id);v?v.push(_):f.set(_.id,[_])}else s.push(_.item)}}catch(n){r={error:n}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}try{for(var p=u(e),g=p.next();!g.done;g=p.next()){var y=g.value,m=f.get(y.id);if(m){if("remove"!==m[0].type)if("replace"!==m[0].type){var x=t({},y);try{for(var w=(c=void 0,u(m)),b=w.next();!b.done;b=w.next()){var _;Zw(_=b.value,x)}}catch(n){c={error:n}}finally{try{b&&!b.done&&(l=w.return)&&l.call(w)}finally{if(c)throw c.error}}s.push(x)}else s.push(t({},m[0].item))}else s.push(y)}}catch(n){i={error:n}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return s}function Fw(n,e){return{id:n,type:"select",selected:e}}function Uw(n,e,t){var r,o;void 0===e&&(e=new Set),void 0===t&&(t=!1);var i=[];try{for(var c=u(n),l=c.next();!l.done;l=c.next()){var s=a(l.value,2),f=s[0],d=s[1],h=e.has(f);void 0===d.selected&&!h||d.selected===h||(t&&(d.selected=h),i.push(Fw(d.id,h)))}}catch(n){r={error:n}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}return i}function Ww(n){var e,t,r,o,i,c,l=n.items,s=void 0===l?[]:l,f=n.lookup,d=[],h=new Map(s.map((function(n){return[n.id,n]})));try{for(var v=u(s),p=v.next();!p.done;p=v.next()){var g=p.value,y=f.get(g.id),m=null!==(c=null===(i=null==y?void 0:y.internals)||void 0===i?void 0:i.userNode)&&void 0!==c?c:y;void 0!==m&&m!==g&&d.push({id:g.id,item:g,type:"replace"}),void 0===m&&d.push({item:g,type:"add"})}}catch(n){e={error:n}}finally{try{p&&!p.done&&(t=v.return)&&t.call(v)}finally{if(e)throw e.error}}try{for(var x=u(f),w=x.next();!w.done;w=x.next()){var b=a(w.value,1)[0];void 0===h.get(b)&&d.push({id:b,type:"remove"})}}catch(n){r={error:n}}finally{try{w&&!w.done&&(o=x.return)&&o.call(x)}finally{if(r)throw r.error}}return d}function $w(n){return{id:n.id,type:"remove"}}var Gw=function(n,e){void 0===e&&(e=[0,0]);var t=dw(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||e,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},qw=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=uw(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}}(t,e.nodeOrigin);return yw(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xw(t)},Kw=function(n,e,r,o,i,c){var l,s,f,d,h,v,p,g,y=a(void 0===r?[0,0,1]:r,3),m=y[0],x=y[1],w=y[2];void 0===o&&(o=!1),void 0===i&&(i=!1),void 0===c&&(c=[0,0]);var b=t(t({},pw(e,[m,x,w])),{width:e.width/w,height:e.height/w}),_=[];try{for(var E=u(n),S=E.next();!S.done;S=E.next()){var k=a(S.value,2)[1],C=k.measured,M=k.selectable,N=void 0===M||M,O=k.hidden,P=void 0!==O&&O,j=null!==(h=null!==(d=null!==(f=C.width)&&void 0!==f?f:k.width)&&void 0!==d?d:k.initialWidth)&&void 0!==h?h:null,I=null!==(g=null!==(p=null!==(v=C.height)&&void 0!==v?v:k.height)&&void 0!==p?p:k.initialHeight)&&void 0!==g?g:null;if(!(i&&!N||P)){var A=_w(b,gw(k,c));(null===j||null===I||o&&A>0||A>=(null!=j?j:0)*(null!=I?I:0)||k.dragging)&&_.push(k)}}}catch(n){l={error:n}}finally{try{S&&!S.done&&(s=E.return)&&s.call(E)}finally{if(l)throw l.error}}return _};function Qw(n,e){var t,r,o,i=n.nodeLookup,u=n.width,a=n.height,c=n.panZoom,l=n.minZoom,s=n.maxZoom,f=n.nodeOrigin,d=void 0===f?[0,0]:f,h=[],v=(null==e?void 0:e.nodes)?new Set(e.nodes.map((function(n){return n.id}))):null;if(i.forEach((function(n){!(n.measured.width&&n.measured.height&&((null==e?void 0:e.includeHiddenNodes)||!n.hidden))||v&&!v.has(n.id)||h.push(n)})),h.length>0){var p=qw(h,{nodeOrigin:d}),g=p.width>=u||p.height>=a;if("overflow"===(null==e?void 0:e.when)&&!g)return!0;var y=Ew(p,u,a,null!==(t=null==e?void 0:e.minZoom)&&void 0!==t?t:l,null!==(r=null==e?void 0:e.maxZoom)&&void 0!==r?r:s,null!==(o=null==e?void 0:e.padding)&&void 0!==o?o:.1);return c.setViewport(y,{duration:null==e?void 0:e.duration}),!0}return!1}function Jw(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?Gw(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Sw(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,x=f+v*m[0],w=d+p*m[1];h=[[x,w],[x+g-v,w+y-p]]}}else null==a||a("005",fv());var b=Sw(h)?fw(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}function nb(n){return o(this,arguments,void 0,(function(n){var e,t,r,o,a,c,l,s,f,d,h,v,p,g,y,m,x,w,b,_=n.nodesToRemove,E=void 0===_?[]:_,S=n.edgesToRemove,k=void 0===S?[]:S,C=n.nodes,M=n.edges,N=n.onBeforeDelete;return i(this,(function(n){switch(n.label){case 0:e=new Set(E.map((function(n){return n.id}))),t=[],r=function(n){if(!1===n.deletable)return"continue";var r=e.has(n.id),o=!r&&n.parentId&&t.find((function(e){return e.id===n.parentId}));(r||o)&&t.push(n)};try{for(o=u(C),a=o.next();!a.done;a=o.next())c=a.value,r(c)}catch(n){m={error:n}}finally{try{a&&!a.done&&(x=o.return)&&x.call(o)}finally{if(m)throw m.error}}l=new Set(k.map((function(n){return n.id}))),s=M.filter((function(n){return!1!==n.deletable})),f=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))}(t,s),d=f,h=function(n){l.has(n.id)&&!d.find((function(e){return e.id===n.id}))&&d.push(n)};try{for(v=u(s),p=v.next();!p.done;p=v.next())g=p.value,h(g)}catch(n){w={error:n}}finally{try{p&&!p.done&&(b=v.return)&&b.call(v)}finally{if(w)throw w.error}}return N?[4,N({nodes:t,edges:d})]:[2,{edges:d,nodes:t}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:d,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var eb=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function tb(){var n=tw(eb,Rw),e=n.userSelectionActive,t=n.userSelectionRect;return e&&t?p.jsx("div",{className:"ink-flow__selection ink-flow__container",style:{width:t.width,height:t.height,transform:"translate(".concat(t.x,"px, ").concat(t.y,"px)")}}):null}var rb=function(n,e){return function(t){t.target===e.current&&(null==n||n(t))}},ob=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function ib(e){var t=e.isSelecting;e.selectionMode;var r=e.panOnDrag,o=e.onSelectionStart,i=e.onSelectionEnd,c=e.onPaneClick,l=e.onPaneContextMenu,s=e.onPaneScroll,f=e.onPaneMouseEnter,d=e.onPaneMouseMove,h=e.onPaneMouseLeave,v=e.children,g=n.useRef(null),y=rw(),m=n.useRef(0),x=n.useRef(0),b=n.useRef(),_=n.useRef(new Map),E=tw(ob,Rw),S=E.userSelectionActive,k=E.elementsSelectable,C=E.dragging,M=function(){y.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,x.current=0},N=function(n){null==c||c(n),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},O=s?function(n){return s(n)}:void 0,P=k&&(t||S);return p.jsxs("div",{className:w(["ink-flow__pane",{draggable:r,dragging:C,selection:t}]),onClick:P?void 0:rb(N,g),onContextMenu:rb((function(n){Array.isArray(r)&&(null==r?void 0:r.includes(2))?n.preventDefault():null==l||l(n)}),g),onWheel:rb(O,g),onMouseEnter:P?void 0:f,onMouseDown:P?function(n){var e,r,i,c,l=y.getState(),s=l.resetSelectedElements,f=l.domNode,d=l.edgeLookup;if(b.current=null==f?void 0:f.getBoundingClientRect(),k&&t&&0===n.button&&n.target===g.current&&b.current){_.current=new Map;try{for(var h=u(d),v=h.next();!v.done;v=h.next()){var p=a(v.value,2),m=p[0],x=p[1];_.current.set(x.source,(null===(i=_.current.get(x.source))||void 0===i?void 0:i.add(m))||new Set([m])),_.current.set(x.target,(null===(c=_.current.get(x.target))||void 0===c?void 0:c.add(m))||new Set([m]))}}catch(n){e={error:n}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}var w=Iw(n.nativeEvent,b.current),E=w.x,S=w.y;s(),y.setState({userSelectionRect:{width:0,height:0,startX:E,startY:S,x:E,y:S}}),null==o||o(n)}}:void 0,onMouseMove:P?function(n){var e,r,o,i,a=y.getState(),c=a.userSelectionRect,l=a.edgeLookup,s=a.transform,f=a.nodeOrigin,d=a.nodeLookup,h=a.triggerNodeChanges,v=a.triggerEdgeChanges;if(t&&b.current&&c){var p=Iw(n.nativeEvent,b.current),g=p.x,w=p.y,E=c.startX,S=c.startY,k={startX:E,startY:S,x:g<E?g:E,y:w<S?w:S,width:Math.abs(g-E),height:Math.abs(w-S)},C=Kw(d,k,s,!1,!0,f),M=new Set,N=new Set;try{for(var O=u(C),P=O.next();!P.done;P=O.next()){var j=P.value;N.add(j.id);var I=_.current.get(j.id);if(I)try{for(var A=(o=void 0,u(I)),z=A.next();!z.done;z=A.next()){var L=z.value;M.add(L)}}catch(n){o={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(n){e={error:n}}finally{try{P&&!P.done&&(r=O.return)&&r.call(O)}finally{if(e)throw e.error}}if(m.current!==N.size)m.current=N.size,h(Uw(d,N,!0));if(x.current!==M.size)x.current=M.size,v(Uw(l,M));y.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:d,onMouseUp:P?function(n){if(0===n.button){var e=y.getState().userSelectionRect;!S&&e&&n.target===g.current&&(null==N||N(n)),y.setState({nodesSelectionActive:m.current>0}),M(),null==i||i(n)}}:void 0,onMouseLeave:P?function(n){S&&(y.setState({nodesSelectionActive:m.current>0}),null==i||i(n)),M()}:h,ref:g,style:Dw,children:[v,p.jsx(tb,{})]})}var ub=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function ab(e){var t=e.children,r=e.onPaneClick,o=e.onPaneMouseEnter,i=e.onPaneMouseMove,u=e.onPaneMouseLeave,a=e.onPaneContextMenu,c=e.onPaneScroll,l=e.deleteKeyCode,s=e.selectionKeyCode,f=e.selectionOnDrag,d=e.selectionMode,h=e.onSelectionStart,v=e.onSelectionEnd,g=e.multiSelectionKeyCode,y=e.panActivationKeyCode,m=e.zoomActivationKeyCode,x=e.elementsSelectable,w=e.zoomOnScroll,b=e.zoomOnPinch,_=e.panOnScroll,E=e.panOnScrollSpeed,S=e.panOnScrollMode,k=e.zoomOnDoubleClick,C=e.panOnDrag,M=e.defaultViewport,N=e.translateExtent,O=e.minZoom,P=e.maxZoom,j=e.preventScrolling;e.onSelectionContextMenu;var I=e.noWheelClassName,A=e.noPanClassName;e.disableKeyboardA11y;var z=e.onViewportChange,L=e.isControlledViewport,T=tw(ub);T.nodesSelectionActive;var B=T.userSelectionActive,R=Lw(s),D=Lw(y),V=D||C,H=D||_,Y=R||B||f&&!0!==V;return function(e){var t=e.deleteKeyCode,r=e.multiSelectionKeyCode,o=rw(),i=Lw(t,Yw),u=Lw(r);n.useEffect((function(){if(i){var n=o.getState();n.edges,n.nodes,o.setState({nodesSelectionActive:!1})}}),[i]),n.useEffect((function(){o.setState({multiSelectionActive:u})}),[u])}({deleteKeyCode:l,multiSelectionKeyCode:g}),p.jsx(Hw,{onPaneContextMenu:a,elementsSelectable:x,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:E,panOnScrollMode:S,zoomOnDoubleClick:k,panOnDrag:!R&&V,defaultViewport:M,translateExtent:N,minZoom:O,maxZoom:P,zoomActivationKeyCode:m,preventScrolling:j,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:L,children:p.jsx(ib,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:u,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:d,children:t})})}ab.displayName="FlowRenderer";var cb=n.memo(ab);var lb="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function sb(e){var t=a(n.useState(!1),2),r=t[0],o=t[1],i=a(n.useState((function(){return function(n){var e=[];return{get:function(){return e},reset:function(){e=[]},push:function(t){e.push(t),n()}}}((function(){return o(!0)}))})),1),u=i[0];return lb((function(){if(r){var n=u.get();n.length&&(e(n),u.reset()),o(!1)}else u.reset()}),[r]),u}var fb=n.createContext(null);function db(e){var t=e.children,r=rw(),o=n.useCallback((function(n){var e,t,o=r.getState(),i=o.nodes,a=void 0===i?[]:i,c=o.onNodesChange,l=o.nodeLookup,s=a;try{for(var f=u(n),d=f.next();!d.done;d=f.next()){var h=d.value;s="function"==typeof h?h(s):h}}catch(n){e={error:n}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}c&&c({changes:Ww({items:s,lookup:l}),userNodes:s})}),[]),i=sb(o),a=n.useCallback((function(n){var e,t,o=r.getState(),i=o.edges,a=void 0===i?[]:i,c=o.onEdgesChange,l=o.edgeLookup,s=a;try{for(var f=u(n),d=f.next();!d.done;d=f.next()){var h=d.value;s="function"==typeof h?h(s):h}}catch(n){e={error:n}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}c&&c({changes:Ww({items:s,lookup:l}),userEdges:s})}),[]),c=sb(a),l=n.useMemo((function(){return{nodeQueue:i,edgeQueue:c}}),[]);return p.jsx(fb.Provider,{value:l,children:t})}var hb=function(){var e=rw();return n.useMemo((function(){return{zoomIn:function(n){var t;return null===(t=e.getState().panZoom)||void 0===t?void 0:t.scaleBy(1.2,{duration:null==n?void 0:n.duration})},zoomOut:function(n){var t;return null===(t=e.getState().panZoom)||void 0===t?void 0:t.scaleBy(1/1.2,{duration:null==n?void 0:n.duration})},zoomTo:function(n,t){var r;return null===(r=e.getState().panZoom)||void 0===r?void 0:r.scaleTo(n,{duration:null==t?void 0:t.duration})},getZoom:function(){return e.getState().transform[2]},setViewport:function(n,t){var r,o,i,u=e.getState(),c=a(u.transform,3),l=c[0],s=c[1],f=c[2],d=u.panZoom;null==d||d.setViewport({x:null!==(r=n.x)&&void 0!==r?r:l,y:null!==(o=n.y)&&void 0!==o?o:s,zoom:null!==(i=n.zoom)&&void 0!==i?i:f},{duration:null==t?void 0:t.duration})},getViewport:function(){var n=a(e.getState().transform,3);return{x:n[0],y:n[1],zoom:n[2]}},fitView:function(n){var t=e.getState(),r=t.nodeLookup,o=t.width,i=t.height,u=t.nodeOrigin,a=t.minZoom,c=t.maxZoom,l=t.panZoom;return!!l&&Qw({nodeLookup:r,width:o,height:i,nodeOrigin:u,minZoom:a,maxZoom:c,panZoom:l},n)},setCenter:function(n,t,r){var o=e.getState(),i=o.width,u=o.height,a=o.panZoom,c=o.transform,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:c[2],s=i/2-n*l,f=u/2-t*l;null==a||a.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(n,t){var r,o=e.getState(),i=o.width,u=o.height,a=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Ew(n,i,u,a,c,null!==(r=null==t?void 0:t.padding)&&void 0!==r?r:.1);null==l||l.setViewport(s,{duration:null==t?void 0:t.duration})},screenToFlowPosition:function(n,t){void 0===t&&(t={snapToGrid:!0});var r=e.getState(),o=r.transform,i=r.snapGrid,u=r.domNode;if(!u)return n;var a=u.getBoundingClientRect(),c=a.x,l=a.y,s={x:n.x-c,y:n.y-l};return pw(s,o,t.snapToGrid,i)},flowToScreenPosition:function(n){var t=e.getState(),r=t.transform,o=t.domNode;if(!o)return n;var i=o.getBoundingClientRect(),u=i.x,c=i.y,l=function(n,e){var t=n.x,r=n.y,o=a(e,3),i=o[0],u=o[1],c=o[2];return{x:t*c+i,y:r*c+u}}(n,r);return{x:l.x+u,y:l.y+c}}}}),[])},vb=function(n){return!!n.panZoom};function pb(){var e=this,r=hb(),u=rw(),l=function(){var e=n.useContext(fb);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),s=tw(vb);n.useEffect((function(){window.inkFlowStoreState=u.getState()}),[u]);var f=n.useMemo((function(){var n=function(n){return u.getState().nodeLookup.get(n)},r=function(n){l.nodeQueue.push(n)},s=function(n){var e,r,o,i,a=u.getState(),c=a.nodeLookup,l=a.nodeOrigin,s=kw(n)?n:c.get(n.id),f=s.parentId?function(n,e,r,o){var i,u;void 0===o&&(o=[0,0]);for(var a=e,c=t({},n);a;){var l=r.get(e);if(a=null==l?void 0:l.parentId,l){var s=l.origin||o,f=(null!==(i=l.measured.width)&&void 0!==i?i:0)*s[0],d=(null!==(u=l.measured.height)&&void 0!==u?u:0)*s[1];c.x+=l.position.x-f,c.y+=l.position.y-d}}return c}(s.position,s.parentId,c,l):s.position,d={id:s.id,position:f,width:null!==(r=null===(e=s.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:s.width,height:null!==(i=null===(o=s.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:s.height,data:s.data};return gw(d)},f=function(n,e,o){void 0===o&&(o={replace:!1}),r((function(r){return r.map((function(r){if(r.id===n){var i="function"==typeof e?e(r):e;return o.replace&&kw(i)?i:t(t({},r),i)}return r}))}))};return{getNodes:function(){return u.getState().nodes.map((function(n){return t({},n)}))},getNode:function(e){var t;return null===(t=n(e))||void 0===t?void 0:t.internals.userNode},getInternalNode:n,getEdges:function(){var n=u.getState().edges;return(void 0===n?[]:n).map((function(n){return t({},n)}))},getEdge:function(n){return u.getState().edgeLookup.get(n)},setNodes:r,setEdges:function(n){l.edgeQueue.push(n)},addNodes:function(n){var e=Array.isArray(n)?n:[n];l.nodeQueue.push((function(n){return c(c([],a(n),!1),a(e),!1)}))},addEdges:function(n){var e=Array.isArray(n)?n:[n];l.edgeQueue.push((function(n){return c(c([],a(n),!1),a(e),!1)}))},toObject:function(){var n=u.getState(),e=n.nodes,r=void 0===e?[]:e,o=n.edges,i=void 0===o?[]:o,c=a(n.transform,3),l=c[0],s=c[1],f=c[2];return{nodes:r.map((function(n){return t({},n)})),edges:i.map((function(n){return t({},n)})),viewport:{x:l,y:s,zoom:f}}},deleteElements:function(n){return o(e,[n],void 0,(function(n){var e,t,r,o,a,c,l,s,f,d,h,v,p,g,y,m,x=n.nodes,w=void 0===x?[]:x,b=n.edges,_=void 0===b?[]:b;return i(this,(function(n){switch(n.label){case 0:return e=u.getState(),t=e.nodes,r=e.edges,o=e.onNodesDelete,a=e.onEdgesDelete,c=e.triggerNodeChanges,l=e.triggerEdgeChanges,s=e.onDelete,f=e.onBeforeDelete,[4,nb({nodesToRemove:w,edgesToRemove:_,nodes:t,edges:r,onBeforeDelete:f})];case 1:return d=n.sent(),h=d.nodes,v=d.edges,p=v.length>0,g=h.length>0,p&&(y=v.map($w),null==a||a(v),l(y)),g&&(m=h.map($w),null==o||o(h),c(m)),(g||p)&&(null==s||s({nodes:h,edges:v})),[2,{deletedNodes:h,deletedEdges:v}]}}))}))},getIntersectingNodes:function(n,e,t){void 0===e&&(e=!0);var r=Mw(n),o=r?n:s(n),i=void 0!==t;return o?(t||u.getState().nodes).filter((function(t){var a=u.getState().nodeLookup.get(t.id);if(a&&!r&&(t.id===n.id||!a.internals.positionAbsolute))return!1;var c=gw(i?t:a),l=_w(c,o);return e&&l>0||l>=o.width*o.height})):[]},isNodeIntersecting:function(n,e,t){void 0===t&&(t=!0);var r=Mw(n)?n:s(n);if(!r)return!1;var o=_w(r,e);return t&&o>0||o>=r.width*r.height},updateNode:f,updateNodeData:function(n,e,r){void 0===r&&(r={replace:!1}),f(n,(function(n){var o="function"==typeof e?e(n):e;return r.replace?t(t({},n),{data:o}):t(t({},n),{data:t(t({},n.data),o)})}),r)},setLayoutAnchorId:function(n){u.getState().setLayoutAnchorId(n)}}}),[]);return n.useMemo((function(){return t(t(t({},f),r),{viewportInitialized:s})}),[s])}var gb=function(n){return n.updateNodeInternals};function yb(e){var t=tw(n.useCallback(function(n){return function(e){return n?Kw(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map((function(n){return n.id})):Array.from(e.nodeLookup.keys())}}(e),[e]),Rw);return t}var mb=n.createContext(null),xb=mb.Provider;mb.Consumer;function wb(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-e),Math.abs(c-t)]}function bb(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function _b(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case exports.Position.Left:return[t-bb(t-o,u),r];case exports.Position.Right:return[t+bb(o-t,u),r];case exports.Position.Top:return[t,r-bb(r-i,u)];case exports.Position.Bottom:return[t,r+bb(i-r,u)]}}function Eb(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,u=r<e?r+i:r-i,a=Math.abs(o-t)/2;return[u,o<t?o+a:o-a,i,a]}var Sb,kb=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")};var Cb=((Sb={})[exports.Position.Left]={x:-1,y:0},Sb[exports.Position.Right]={x:1,y:0},Sb[exports.Position.Top]={x:0,y:-1},Sb[exports.Position.Bottom]={x:0,y:1},Sb),Mb=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Nb(n){var e,t,r,o,i=n.source,u=n.sourcePosition,l=void 0===u?exports.Position.Bottom:u,s=n.target,f=n.targetPosition,d=void 0===f?exports.Position.Top:f,h=n.center,v=n.offset,p=Cb[l],g=Cb[d],y={x:i.x+p.x*v,y:i.y+p.y*v},m={x:s.x+g.x*v,y:s.y+g.y*v},x=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?exports.Position.Bottom:t,o=n.target;return r===exports.Position.Left||r===exports.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:y,sourcePosition:l,target:m}),w=0!==x.x?"x":"y",b=x[w],_=[],E={x:0,y:0},S={x:0,y:0},k=a(Eb({sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}),4),C=k[0],M=k[1],N=k[2],O=k[3];if(p[w]*g[w]==-1){r=null!==(e=h.x)&&void 0!==e?e:C,o=null!==(t=h.y)&&void 0!==t?t:M;var P=[{x:r,y:y.y},{x:r,y:m.y}],j=[{x:y.x,y:o},{x:m.x,y:o}];_=p[w]===b?"x"===w?P:j:"x"===w?j:P}else{var I=[{x:y.x,y:m.y}],A=[{x:m.x,y:y.y}];if(_="x"===w?p.x===b?A:I:p.y===b?I:A,l===d){var z=Math.abs(i[w]-s[w]);if(z<=v){var L=Math.min(v-1,v-z);p[w]===b?E[w]=(y[w]>i[w]?-1:1)*L:S[w]=(m[w]>s[w]?-1:1)*L}}if(l!==d){var T="x"===w?"y":"x",B=p[w]===g[T],R=y[T]>m[T],D=y[T]<m[T];(1===p[w]&&(!B&&R||B&&D)||1!==p[w]&&(!B&&D||B&&R))&&(_="x"===w?I:A)}var V={x:y.x+E.x,y:y.y+E.y},H={x:m.x+S.x,y:m.y+S.y};Math.max(Math.abs(V.x-_[0].x),Math.abs(H.x-_[0].x))>=Math.max(Math.abs(V.y-_[0].y),Math.abs(H.y-_[0].y))?(r=(V.x+H.x)/2,o=_[0].y):(r=_[0].x,o=(V.y+H.y)/2)}return[c(c([i,{x:y.x+E.x,y:y.y+E.y}],a(_),!1),[{x:m.x+S.x,y:m.y+S.y},s],!1),r,o,N,O]}function Ob(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,c=n.targetPosition,l=void 0===c?exports.Position.Top:c,s=n.borderRadius,f=void 0===s?5:s,d=n.centerX,h=n.centerY,v=n.offset,p=a(Nb({source:{x:e,y:t},sourcePosition:o,target:{x:i,y:u},targetPosition:l,center:{x:d,y:h},offset:void 0===v?20:v}),5),g=p[0],y=p[1],m=p[2],x=p[3],w=p[4],b=g.reduce((function(n,e,t){var r="";return r=t>0&&t<g.length-1?function(n,e,t,r){var o=Math.min(Mb(n,e)/2,Mb(e,t)/2,r),i=e.x,u=e.y;if(n.x===i&&i===t.x||n.y===u&&u===t.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<t.x?-1:1,c=n.y<t.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<t.x?1:-1,s=n.y<t.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(g[t-1],e,g[t+1],f):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y),n+=r}),"");return[b,y,m,x,w]}var Pb=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var jb=n.memo(bw((function(e,o){var i,u,a=e.type,c=void 0===a?"source":a,l=e.position,s=void 0===l?exports.Position.Top:l,f=e.isValidConnection,d=e.isConnectable,h=void 0===d||d,v=e.isConnectableStart,g=void 0===v||v,y=e.isConnectableEnd,m=void 0===y||y,x=e.id,b=e.onConnect,_=e.children,E=e.className,S=e.onMouseDown,k=e.onTouchStart,C=r(e,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),M=x||null,N="target"===c,O=rw(),P=n.useContext(mb),j=tw(Pb,Rw),I=j.connectOnClick,A=j.noPanClassName,z=j.rfId,L=tw(function(n,e,t){return function(r){var o=r.connectionStartHandle,i=r.connectionEndHandle,u=r.connectionClickStartHandle,a=r.connectionMode,c=r.connectionStatus,l=(null==i?void 0:i.nodeId)===n&&(null==i?void 0:i.handleId)===e&&(null==i?void 0:i.type)===t;return{connectingFrom:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.handleId)===e&&(null==o?void 0:o.type)===t,connectingTo:l,clickConnecting:(null==u?void 0:u.nodeId)===n&&(null==u?void 0:u.handleId)===e&&(null==u?void 0:u.type)===t,isPossibleEndHandle:a===exports.ConnectionMode.Strict?(null==o?void 0:o.type)!==t:n!==(null==o?void 0:o.nodeId)||e!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(P,M,c),Rw),T=L.connectingFrom,B=L.connectingTo,R=L.clickConnecting,D=L.isPossibleEndHandle,V=L.connectionInProcess,H=L.valid;P||null===(u=(i=O.getState()).onError)||void 0===u||u.call(i,"010",vv());var Y=function(n){var e=O.getState(),r=e.defaultEdgeOptions,o=e.onConnect,i=e.hasDefaultEdges,u=t(t({},r),n);if(i){var a=O.getState(),c=a.edges;(0,a.setEdges)(function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(r="id"in(o=n)&&"source"in o&&"target"in o?t({},n):t(t({},n),{id:kb(n)}),e)?e:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,e.concat(r)):e;var r,o}(u,c))}null==o||o(u),null==b||b(u)},Z=function(n){if(P){var e=jw(n.nativeEvent);if(g&&(e&&0===n.button||!e)){var t=O.getState();Yy.onPointerDown(n.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:N,handleId:M,nodeId:P,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:Y,isValidConnection:f||t.isValidConnection,getTransform:function(){return O.getState().transform},getConnectionStartHandle:function(){return O.getState().connectionStartHandle}})}e?null==S||S(n):null==k||k(n)}};return p.jsx("div",t({"data-handleid":M,"data-nodeid":P,"data-handlepos":s,"data-id":"".concat(z,"-").concat(P,"-").concat(M,"-").concat(c),className:w(["ink-flow__handle","ink-flow__handle-".concat(s),"nodrag",A,E,{source:!N,target:N,connectable:h,connectablestart:g,connectableend:m,clickconnecting:R,connectingfrom:T,connectingto:B,valid:H,connectionindicator:h&&(!V||D)&&(V?m:g)}]),onMouseDown:Z,onTouchStart:Z,onClick:I?function(n){var e=O.getState(),t=e.onClickConnectStart,r=e.onClickConnectEnd,o=e.connectionClickStartHandle,i=e.connectionMode,u=e.isValidConnection,a=e.lib,l=e.rfId;if(P&&(o||g)){if(!o)return null==t||t(n.nativeEvent,{nodeId:P,handleId:M,handleType:c}),void O.setState({connectionClickStartHandle:{nodeId:P,type:c,handleId:M}});var s=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),d=f||u,h=Yy.isValid(n.nativeEvent,{handle:{nodeId:P,id:M,type:c},connectionMode:i,fromNodeId:o.nodeId,fromHandleId:o.handleId||null,fromType:o.type,isValidConnection:d,flowId:l,doc:s,lib:a}),v=h.connection;h.isValid&&v&&Y(v),null==r||r(n),O.setState({connectionClickStartHandle:null})}}:void 0,ref:o},C,{children:_}))})));var Ib={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ab={input:function(n){var e=n.data,t=n.isConnectable,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r;return p.jsxs(p.Fragment,{children:[null==e?void 0:e.label,p.jsx(jb,{type:"source",position:o,isConnectable:t})]})},default:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?exports.Position.Top:r,i=n.sourcePosition,u=void 0===i?exports.Position.Bottom:i;return p.jsxs(p.Fragment,{children:[p.jsx(jb,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label,p.jsx(jb,{type:"source",position:u,isConnectable:t})]})},output:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?exports.Position.Top:r;return p.jsxs(p.Fragment,{children:[p.jsx(jb,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};function zb(n){var e=n.id,t=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,u=t.getState(),a=u.addSelectedNodes,c=u.unselectNodesAndEdges,l=u.multiSelectionActive,s=u.nodeLookup,f=u.onError,d=s.get(e);d?(t.setState({nodesSelectionActive:!1}),d.selected?(o||d.selected&&l)&&(c({nodes:[d],edges:[]}),requestAnimationFrame((function(){var n;return null===(n=null==i?void 0:i.current)||void 0===n?void 0:n.blur()}))):a([e])):null==f||f("012",gv(e))}function Lb(e){var r,o=e.id,i=e.onClick,c=e.onMouseEnter,l=e.onMouseMove,s=e.onMouseLeave,f=e.onContextMenu,d=e.onDoubleClick,h=e.nodesDraggable,v=e.elementsSelectable,g=e.nodesConnectable,y=e.nodesFocusable,m=e.resizeObserver,x=e.noDragClassName,b=e.noPanClassName,_=e.disableKeyboardA11y,E=e.rfId,S=e.nodeTypes,k=e.nodeExtent,C=e.nodeOrigin,M=e.onError,N=tw((function(n){var e=n.nodeLookup.get(o),t=n.parentLookup.has(o);return{node:e,internals:e.internals,isParent:t}}),Rw),O=N.node,P=N.internals,j=N.isParent,I=O.type||"default",A=(null==S?void 0:S[I])||Ab[I];void 0===A&&(null==M||M("003",lv(I)),I="default",A=Ab.default);var z=!!(O.draggable||h&&void 0===O.draggable),L=!!(O.selectable||v&&void 0===O.selectable),T=!!(O.connectable||g&&void 0===O.connectable),B=!!(O.focusable||y&&void 0===O.focusable),R=rw(),D=function(n){var e,t,r,o,i,u;return void 0!==(null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==(null!==(u=null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:n.height)&&void 0!==u?u:n.initialHeight)}(O),V=function(e){var t=e.node,r=e.nodeType,o=e.hasDimensions,i=e.resizeObserver,u=rw(),a=n.useRef(null),c=n.useRef(null),l=n.useRef(t.sourcePosition),s=n.useRef(t.targetPosition),f=n.useRef(r),d=o&&!!t.internals.handleBounds&&!t.hidden;return n.useEffect((function(){!a.current||d&&c.current===a.current||(c.current&&(null==i||i.unobserve(c.current)),null==i||i.observe(a.current),c.current=a.current)}),[d]),n.useEffect((function(){return function(){c.current&&(null==i||i.unobserve(c.current),c.current=null)}}),[]),n.useEffect((function(){if(a.current){var n=f.current!==r,e=l.current!==t.sourcePosition,o=s.current!==t.targetPosition;(n||e||o)&&(f.current=r,l.current=t.sourcePosition,s.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:a.current,force:!0}]])))}}),[t.id,r,t.sourcePosition,t.targetPosition]),a}({node:O,nodeType:I,hasDimensions:D,resizeObserver:m}),H=function(e){var t=e.nodeRef,r=e.disabled,o=void 0!==r&&r,i=e.noDragClassName,u=e.handleSelector,c=e.nodeId,l=e.isSelectable,s=rw(),f=a(n.useState(!1),2),d=f[0],h=f[1],v=n.useRef();return n.useEffect((function(){v.current=Ty({getStoreItems:function(){return s.getState()},onNodeMouseDown:function(n){zb({id:n,store:s,nodeRef:t})},onDragStart:function(){h(!0)},onDragStop:function(){h(!1)}})}),[]),n.useEffect((function(){var n,e;if(o)null===(n=v.current)||void 0===n||n.destroy();else if(t.current)return null===(e=v.current)||void 0===e||e.update({noDragClassName:i,handleSelector:u,domNode:t.current,isSelectable:l,nodeId:c}),function(){var n;null===(n=v.current)||void 0===n||n.destroy()}}),[i,u,o,l,t,c]),d}({nodeRef:V,disabled:O.hidden||!z,noDragClassName:x,handleSelector:O.dragHandle,nodeId:o,isSelectable:L}),Y=function(){var e=rw(),t=n.useCallback((function(n){var t,r,o=e.getState(),i=o.nodeExtent,c=o.snapToGrid,l=o.snapGrid,s=o.nodesDraggable,f=o.onError,d=o.updateNodePositions,h=o.nodeLookup,v=o.nodeOrigin,p=new Map,g=function(n){return function(e){return e.selected&&(e.draggable||n&&void 0===e.draggable)}}(s),y=c?l[0]:5,m=c?l[1]:5,x=n.direction.x*y*n.factor,w=n.direction.y*m*n.factor;try{for(var b=u(h),_=b.next();!_.done;_=b.next()){var E=a(_.value,2)[1];if(g(E)){var S={x:E.internals.positionAbsolute.x+x,y:E.internals.positionAbsolute.y+w};c&&(S=vw(S,l));var k=Jw({nodeId:E.id,nextPosition:S,nodeLookup:h,nodeExtent:i,nodeOrigin:v,onError:f}),C=k.position,M=k.positionAbsolute;E.position=C,E.internals.positionAbsolute=M,p.set(E.id,E)}}}catch(n){t={error:n}}finally{try{_&&!_.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}d(p)}),[]);return t}();if(O.hidden)return null;var Z=dw(O),X=function(n){var e,t,r,o,i,u,a,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(t=null!==(e=n.width)&&void 0!==e?e:n.initialWidth)&&void 0!==t?t:null===(r=n.style)||void 0===r?void 0:r.width,height:null!==(i=null!==(o=n.height)&&void 0!==o?o:n.initialHeight)&&void 0!==i?i:null===(u=n.style)||void 0===u?void 0:u.height}:{width:null!==(a=n.width)&&void 0!==a?a:null===(c=n.style)||void 0===c?void 0:c.width,height:null!==(l=n.height)&&void 0!==l?l:null===(s=n.style)||void 0===s?void 0:s.height}}(O),F=(k?fw(P.positionAbsolute,k):P.positionAbsolute)||{x:0,y:0},U=function(n){var e=n.x,t=n.y,r=n.width,o=n.height,i=n.origin,u=void 0===i?[0,0]:i;return!r||!o||u[0]<0||u[1]<0||u[0]>1||u[1]>1?{x:e,y:t}:{x:e-r*u[0],y:t-o*u[1]}}(t(t(t({},F),Z),{origin:O.origin||C})),W=L||z||i||c||l||s,$=c?function(n){return c(n,t({},P.userNode))}:void 0,G=l?function(n){return l(n,t({},P.userNode))}:void 0,q=s?function(n){return s(n,t({},P.userNode))}:void 0,K=f?function(n){return f(n,t({},P.userNode))}:void 0,Q=d?function(n){return d(n,t({},P.userNode))}:void 0;return p.jsx("div",{className:w(["ink-flow__node","ink-flow__node-".concat(I),(r={},r[b]=z,r),O.className,{selected:O.selected,selectable:L,parent:j,draggable:z,dragging:H}]),ref:V,style:t(t({zIndex:P.z,transform:"translate(".concat(U.x,"px,").concat(U.y,"px)"),pointerEvents:W?"all":"none",visibility:D?"visible":"hidden"},O.style),X),"data-id":o,"data-testid":"rf__node-".concat(o),onMouseEnter:$,onMouseMove:G,onMouseLeave:q,onContextMenu:K,onClick:function(n){var e=R.getState(),r=e.selectNodesOnDrag,u=e.nodeDragThreshold;L&&(!r||!z||u>0)&&zb({id:o,store:R,nodeRef:V}),i&&i(n,t({},P.userNode))},onDoubleClick:Q,onKeyDown:B?function(n){if(!Pw(n.nativeEvent)&&!_)if(mv.includes(n.key)&&L){var e="Escape"===n.key;zb({id:o,store:R,unselect:e,nodeRef:V})}else z&&O.selected&&Object.prototype.hasOwnProperty.call(Ib,n.key)&&(R.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~F.x,", y: ").concat(~~F.y)}),Y({direction:Ib[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:B?0:void 0,role:B?"button":void 0,"aria-describedby":_?void 0:"".concat("ink-flow__node-desc","-").concat(E),"aria-label":O.ariaLabel,children:p.jsx(xb,{value:o,children:p.jsx(A,t({id:o,data:O.data,type:I,positionAbsoluteX:F.x,positionAbsoluteY:F.y,selected:O.selected,isConnectable:T,sourcePosition:O.sourcePosition,targetPosition:O.targetPosition,dragging:H,dragHandle:O.dragHandle,zIndex:P.z},Z))})})}var Tb=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function Bb(e){var t=tw(Tb,Rw),r=t.nodesDraggable,o=t.nodesConnectable,i=t.nodesFocusable,u=t.elementsSelectable,c=t.onError,l=yb(!1),s=function(){var e=tw(gb),t=a(n.useState((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(n){var t=new Map;n.forEach((function(n){var e=n.target.getAttribute("data-id");t.set(e,{id:e,nodeElement:n.target})})),e(t)}))})),1),r=t[0];return n.useEffect((function(){return function(){null==r||r.disconnect()}}),[r]),r}();return p.jsx("div",{className:"ink-flow__nodes",style:Dw,children:l.map((function(n){return p.jsx(Lb,{id:n,nodeTypes:e.nodeTypes,nodeOrigin:e.nodeOrigin,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:u,onError:c},n)}))})}Bb.displayName="NodeRenderer";var Rb,Db=n.memo(Bb),Vb=((Rb={})[exports.MarkerType.Arrow]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return p.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},Rb[exports.MarkerType.ArrowClosed]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return p.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Rb);function Hb(n,e){if(!n)return"";if("string"==typeof n)return n;var t=e?"".concat(e,"__"):"";return"".concat(t).concat(Object.keys(n).sort().map((function(e){return"".concat(e,"=").concat(n[e])})).join("&"))}var Yb=function(e){var t=e.id,r=e.type,o=e.color,i=e.width,u=void 0===i?12.5:i,a=e.height,c=void 0===a?12.5:a,l=e.markerUnits,s=void 0===l?"strokeWidth":l,f=e.strokeWidth,d=e.orient,h=void 0===d?"auto-start-reverse":d,v=function(e){var t=rw(),r=n.useMemo((function(){var n,r;return Object.prototype.hasOwnProperty.call(Vb,e)?Vb[e]:(null===(r=(n=t.getState()).onError)||void 0===r||r.call(n,"009",dv(e)),null)}),[e]);return r}(r);return v?p.jsx("marker",{className:"ink-flow__arrowhead",id:t,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:p.jsx(v,{color:o,strokeWidth:f})}):null},Zb=function(e){var r=e.defaultColor,o=e.rfId,i=tw((function(n){return n.edges})),u=tw((function(n){return n.defaultEdgeOptions})),a=n.useMemo((function(){var n=function(n,e){var r=e.id,o=e.defaultColor,i=e.defaultMarkerStart,u=e.defaultMarkerEnd,a=new Set;return n.reduce((function(n,e){return[e.markerStart||i,e.markerEnd||u].forEach((function(e){if(e&&"object"==typeof e){var i=Hb(e,r);a.has(i)||(n.push(t({id:i,color:e.color||o},e)),a.add(i))}})),n}),[]).sort((function(n,e){return n.id.localeCompare(e.id)}))}(i,{id:o,defaultColor:r,defaultMarkerStart:null==u?void 0:u.markerStart,defaultMarkerEnd:null==u?void 0:u.markerEnd});return n}),[i,u,o,r]);return a.length?p.jsx("svg",{className:"ink-flow__marker",children:p.jsx("defs",{children:a.map((function(n){return p.jsx(Yb,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id)}))})}):null};Zb.displayName="MarkerDefinitions";var Xb=n.memo(Zb);function Fb(e){var o=e.x,i=e.y,u=e.label,c=e.labelStyle,l=void 0===c?{}:c,s=e.labelShowBg,f=void 0===s||s,d=e.labelBgStyle,h=void 0===d?{}:d,v=e.labelBgPadding,g=void 0===v?[2,4]:v,y=e.labelBgBorderRadius,m=void 0===y?2:y,x=e.children,b=e.className,_=r(e,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),E=a(n.useState({x:1,y:0,width:0,height:0}),2),S=E[0],k=E[1],C=w(["ink-flow__edge-textwrapper",b]),M=n.useCallback((function(n){if(null!==n){var e=n.getBBox();k({x:e.x,y:e.y,width:e.width,height:e.height})}}),[]);return void 0!==u&&u?p.jsxs("g",t({transform:"translate(".concat(o-S.width/2," ").concat(i-S.height/2,")"),className:C,visibility:S.width?"visible":"hidden"},_,{children:[f&&p.jsx("rect",{width:S.width+2*g[0],x:-g[0],y:-g[1],height:S.height+2*g[1],className:"ink-flow__edge-textbg",style:h,rx:m,ry:m}),p.jsx("text",{className:"ink-flow__edge-text",y:S.height/2,dy:"0.3em",ref:M,style:l,children:u}),x]})):null}Fb.displayName="EdgeText";var Ub=n.memo(Fb);function Wb(n){var e=n.id,t=n.path,r=n.labelX,o=n.labelY,i=n.label,u=n.labelStyle,a=n.labelShowBg,c=n.labelBgStyle,l=n.labelBgPadding,s=n.labelBgBorderRadius,f=n.style,d=n.markerEnd,h=n.markerStart,v=n.className,g=n.interactionWidth,y=void 0===g?20:g;return p.jsxs(p.Fragment,{children:[p.jsx("path",{id:e,style:f,d:t,fill:"none",className:w(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),y&&p.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:y,className:"ink-flow__edge-interaction"}),i&&hw(r)&&hw(o)?p.jsx(Ub,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function $b(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2;return e===exports.Position.Left||e===exports.Position.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function Gb(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,c=n.targetPosition,l=void 0===c?exports.Position.Top:c,s=a($b({pos:o,x1:e,y1:t,x2:i,y2:u}),2),f=s[0],d=s[1],h=a($b({pos:l,x1:i,y1:u,x2:e,y2:t}),2),v=h[0],p=h[1],g=a(wb({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:f,sourceControlY:d,targetControlX:v,targetControlY:p}),4),y=g[0],m=g[1],x=g[2],w=g[3];return["M".concat(e,",").concat(t," C").concat(f,",").concat(d," ").concat(v,",").concat(p," ").concat(i,",").concat(u),y,m,x,w]}function qb(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.sourcePosition,l=void 0===c?exports.Position.Bottom:c,s=n.targetPosition,f=void 0===s?exports.Position.Top:s,d=n.label,h=n.labelStyle,v=n.labelShowBg,g=n.labelBgStyle,y=n.labelBgPadding,m=n.labelBgBorderRadius,x=n.style,w=n.markerEnd,b=n.markerStart,_=n.interactionWidth,E=a(Gb({sourceX:r,sourceY:o,sourcePosition:l,targetX:i,targetY:u,targetPosition:f}),3),S=E[0],k=E[1],C=E[2],M=e.isInternal?void 0:t;return p.jsx(Wb,{id:M,path:S,labelX:k,labelY:C,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:m,style:x,markerEnd:w,markerStart:b,interactionWidth:_})}))}var Kb=qb({isInternal:!1}),Qb=qb({isInternal:!0});function Jb(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.label,l=n.labelStyle,s=n.labelShowBg,f=n.labelBgStyle,d=n.labelBgPadding,h=n.labelBgBorderRadius,v=n.style,g=n.sourcePosition,y=void 0===g?exports.Position.Bottom:g,m=n.targetPosition,x=void 0===m?exports.Position.Top:m,w=n.markerEnd,b=n.markerStart,_=n.pathOptions,E=n.interactionWidth,S=a(Ob({sourceX:r,sourceY:o,sourcePosition:y,targetX:i,targetY:u,targetPosition:x,borderRadius:null==_?void 0:_.borderRadius,offset:null==_?void 0:_.offset}),3),k=S[0],C=S[1],M=S[2],N=e.isInternal?void 0:t;return p.jsx(Wb,{id:N,path:k,labelX:C,labelY:M,label:c,labelStyle:l,labelShowBg:s,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:w,markerStart:b,interactionWidth:E})}))}Kb.displayName="SimpleBezierEdge",Qb.displayName="SimpleBezierEdgeInternal";var n_=Jb({isInternal:!1}),e_=Jb({isInternal:!0});function t_(e){return n.memo((function(o){var i,u=o.id,a=r(o,["id"]),c=e.isInternal?void 0:u;return p.jsx(n_,t({},a,{id:c,pathOptions:n.useMemo((function(){var n;return{borderRadius:0,offset:null===(n=a.pathOptions)||void 0===n?void 0:n.offset}}),[null===(i=a.pathOptions)||void 0===i?void 0:i.offset])}))}))}n_.displayName="SmoothStepEdge",e_.displayName="SmoothStepEdgeInternal";var r_=t_({isInternal:!1}),o_=t_({isInternal:!0});function i_(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.label,l=n.labelStyle,s=n.labelShowBg,f=n.labelBgStyle,d=n.labelBgPadding,h=n.labelBgBorderRadius,v=n.style,g=n.markerEnd,y=n.markerStart,m=n.interactionWidth,x=a(function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=a(Eb({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),u=i[0],c=i[1],l=i[2],s=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),u,c,l,s]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=x[0],b=x[1],_=x[2],E=e.isInternal?void 0:t;return p.jsx(Wb,{id:E,path:w,labelX:b,labelY:_,label:c,labelStyle:l,labelShowBg:s,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:g,markerStart:y,interactionWidth:m})}))}r_.displayName="StepEdge",o_.displayName="StepEdgeInternal";var u_=i_({isInternal:!1}),a_=i_({isInternal:!0});function c_(e){return n.memo((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,u=n.targetY,c=n.sourcePosition,l=void 0===c?exports.Position.Bottom:c,s=n.targetPosition,f=void 0===s?exports.Position.Top:s,d=n.label,h=n.labelStyle,v=n.labelShowBg,g=n.labelBgStyle,y=n.labelBgPadding,m=n.labelBgBorderRadius,x=n.style,w=n.markerEnd,b=n.markerStart,_=n.pathOptions,E=n.interactionWidth,S=a(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?exports.Position.Bottom:r,i=n.targetX,u=n.targetY,c=n.targetPosition,l=void 0===c?exports.Position.Top:c,s=n.curvature,f=void 0===s?.25:s,d=a(_b({pos:o,x1:e,y1:t,x2:i,y2:u,c:f}),2),h=d[0],v=d[1],p=a(_b({pos:l,x1:i,y1:u,x2:e,y2:t,c:f}),2),g=p[0],y=p[1],m=a(wb({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:h,sourceControlY:v,targetControlX:g,targetControlY:y}),4),x=m[0],w=m[1],b=m[2],_=m[3];return["M".concat(e,",").concat(t," C").concat(h,",").concat(v," ").concat(g,",").concat(y," ").concat(i,",").concat(u),x,w,b,_]}({sourceX:r,sourceY:o,sourcePosition:l,targetX:i,targetY:u,targetPosition:f,curvature:null==_?void 0:_.curvature}),3),k=S[0],C=S[1],M=S[2],N=e.isInternal?void 0:t;return p.jsx(Wb,{id:N,path:k,labelX:C,labelY:M,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:m,style:x,markerEnd:w,markerStart:b,interactionWidth:E})}))}u_.displayName="StraightEdge",a_.displayName="StraightEdgeInternal";var l_=c_({isInternal:!1}),s_=c_({isInternal:!0});l_.displayName="BezierEdge",s_.displayName="BezierEdgeInternal";var f_={default:s_,straight:a_,step:o_,smoothstep:e_,simplebezier:Qb},d_={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},h_=function(n,e,t){return t===exports.Position.Left?n-e:t===exports.Position.Right?n+e:n},v_=function(n,e,t){return t===exports.Position.Top?n-e:t===exports.Position.Bottom?n+e:n},p_="ink-flow__edgeupdater";function g_(n){var e=n.position,t=n.centerX,r=n.centerY,o=n.radius,i=void 0===o?10:o,u=n.onMouseDown,a=n.onMouseEnter,c=n.onMouseOut,l=n.type;return p.jsx("circle",{onMouseDown:u,onMouseEnter:a,onMouseOut:c,className:w([p_,"".concat(p_,"-").concat(l)]),cx:h_(t,i,e),cy:v_(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function y_(n){var e=n.isUpdatable,t=n.edgeUpdaterRadius,r=n.edge,o=n.targetHandleId,i=n.sourceHandleId,u=n.sourceX,a=n.sourceY,c=n.targetX,l=n.targetY,s=n.sourcePosition,f=n.targetPosition,d=n.onEdgeUpdate,h=n.onEdgeUpdateStart,v=n.onEdgeUpdateEnd,g=n.setUpdating,y=n.setUpdateHover,m=rw(),x=function(n,e){if(0===n.button){var t=m.getState(),u=t.autoPanOnConnect,a=t.domNode,c=t.isValidConnection,l=t.connectionMode,s=t.connectionRadius,f=t.lib,p=t.onConnectStart,y=t.onConnectEnd,x=t.cancelConnection,w=t.nodeLookup,b=t.rfId,_=t.panBy,E=t.updateConnection,S=e?r.target:r.source,k=(e?o:i)||null,C=e?"target":"source",M=e;g(!0),null==h||h(n,r,C);Yy.onPointerDown(n.nativeEvent,{autoPanOnConnect:u,connectionMode:l,connectionRadius:s,domNode:a,handleId:k,nodeId:S,nodeLookup:w,isTarget:M,edgeUpdaterType:C,lib:f,flowId:b,cancelConnection:x,panBy:_,isValidConnection:c,onConnect:function(n){return null==d?void 0:d(r,n)},onConnectStart:p,onConnectEnd:y,onEdgeUpdateEnd:function(n){g(!1),null==v||v(n,r,C)},updateConnection:E,getTransform:function(){return m.getState().transform},getConnectionStartHandle:function(){return m.getState().connectionStartHandle}})}},w=function(){return y(!0)},b=function(){return y(!1)};return p.jsxs(p.Fragment,{children:[("source"===e||!0===e)&&p.jsx(g_,{position:s,centerX:u,centerY:a,radius:t,onMouseDown:function(n){return x(n,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===e||!0===e)&&p.jsx(g_,{position:f,centerX:c,centerY:l,radius:t,onMouseDown:function(n){return x(n,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function m_(n){var e;return n&&!(!n.internals.handleBounds&&!(null===(e=n.handles)||void 0===e?void 0:e.length))&&!!(n.measured.width||n.width||n.initialWidth)}function x_(n){var e,t,r,o;if(!n)return null;var i=[],a=[];try{for(var c=u(n),l=c.next();!l.done;l=c.next()){var s=l.value;s.width=null!==(r=s.width)&&void 0!==r?r:1,s.height=null!==(o=s.height)&&void 0!==o?o:1,"source"===s.type?i.push(s):"target"===s.type&&a.push(s)}}catch(n){e={error:n}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}return{source:i,target:a}}function w_(n,e,t){var r,o;void 0===t&&(t=null);var i=(null!==(r=null==t?void 0:t.x)&&void 0!==r?r:0)+e.internals.positionAbsolute.x,u=(null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0)+e.internals.positionAbsolute.y,a=null!=t?t:dw(e),c=a.width,l=a.height;switch(n){case exports.Position.Top:return[i+c/2,u];case exports.Position.Right:return[i+c,u+l/2];case exports.Position.Bottom:return[i+c/2,u+l];case exports.Position.Left:return[i,u+l/2]}}function b_(n,e){return n&&(e?n.find((function(n){return n.id===e})):n[0])||null}function __(e){var r=e.id,o=e.edgesFocusable,i=e.edgesUpdatable,u=e.elementsSelectable,c=e.onClick,l=e.onDoubleClick,s=e.onContextMenu,f=e.onMouseEnter,d=e.onMouseMove,h=e.onMouseLeave,v=e.edgeUpdaterRadius,g=e.onEdgeUpdate,y=e.onEdgeUpdateStart,m=e.onEdgeUpdateEnd,x=e.rfId,b=e.edgeTypes,_=e.noPanClassName,E=e.onError,S=e.disableKeyboardA11y,k=tw((function(n){return n.edgeLookup.get(r)})),C=tw((function(n){return n.defaultEdgeOptions})),M=(k=C?t(t({},C),k):k).type||"default",N=(null==b?void 0:b[M])||f_[M];void 0===N&&(null==E||E("011",pv(M)),M="default",N=f_.default);var O=!!(k.focusable||o&&void 0===k.focusable),P=void 0!==g&&(k.updatable||i&&void 0===k.updatable),j=!!(k.selectable||u&&void 0===k.selectable),I=n.useRef(null),A=a(n.useState(!1),2),z=A[0],L=A[1],T=a(n.useState(!1),2),B=T[0],R=T[1],D=rw(),V=tw(n.useCallback((function(n){var e=n.nodeLookup.get(k.source),o=n.nodeLookup.get(k.target);if(!e||!o)return t({zIndex:k.zIndex},d_);var i=function(n){var e,t,r,o,i,u=n.sourceNode,c=n.targetNode;if(!m_(u)||!m_(c))return null;var l=u.internals.handleBounds||x_(u.handles),s=c.internals.handleBounds||x_(c.handles),f=b_(null!==(e=null==l?void 0:l.source)&&void 0!==e?e:[],n.sourceHandle),d=b_(n.connectionMode===exports.ConnectionMode.Strict?null!==(t=null==s?void 0:s.target)&&void 0!==t?t:[]:(null!==(r=null==s?void 0:s.target)&&void 0!==r?r:[]).concat(null!==(o=null==s?void 0:s.source)&&void 0!==o?o:[]),n.targetHandle),h=(null==f?void 0:f.position)||exports.Position.Bottom,v=(null==d?void 0:d.position)||exports.Position.Top;if(!f||!d)return null===(i=n.onError)||void 0===i||i.call(n,"008",hv(f?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var p=a(w_(h,u,f),2),g=p[0],y=p[1],m=a(w_(v,c,d),2);return{sourceX:g,sourceY:y,targetX:m[0],targetY:m[1],sourcePosition:h,targetPosition:v}}({id:r,sourceNode:e,targetNode:o,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:n.connectionMode,onError:E}),u=function(n){var e=n.sourceNode,t=n.targetNode,r=n.selected,o=void 0!==r&&r,i=n.zIndex,u=void 0===i?0:i,a=n.elevateOnSelect;if(void 0===a||!a)return u;var c=o||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return u+(c?l:0)}({selected:k.selected,zIndex:k.zIndex,sourceNode:e,targetNode:o,elevateOnSelect:n.elevateEdgesOnSelect});return t({zIndex:u},i||d_)}),[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Rw),H=V.zIndex,Y=V.sourceX,Z=V.sourceY,X=V.targetX,F=V.targetY,U=V.sourcePosition,W=V.targetPosition,$=n.useMemo((function(){return k.markerStart?"url('#".concat(Hb(k.markerStart,x),"')"):void 0}),[k.markerStart,x]),G=n.useMemo((function(){return k.markerEnd?"url('#".concat(Hb(k.markerEnd,x),"')"):void 0}),[k.markerEnd,x]);if(k.hidden||null===Y||null===Z||null===X||null===F)return null;var q=l?function(n){l(n,t({},k))}:void 0,K=s?function(n){s(n,t({},k))}:void 0,Q=f?function(n){f(n,t({},k))}:void 0,J=d?function(n){d(n,t({},k))}:void 0,nn=h?function(n){h(n,t({},k))}:void 0;return p.jsx("svg",{style:{zIndex:H},children:p.jsxs("g",{className:w(["ink-flow__edge","ink-flow__edge-".concat(M),k.className,_,{selected:k.selected,animated:k.animated,inactive:!j&&!c,updating:z,selectable:j}]),onClick:function(n){var e,t=D.getState(),o=t.addSelectedEdges,i=t.unselectNodesAndEdges,u=t.multiSelectionActive;j&&(D.setState({nodesSelectionActive:!1}),k.selected&&u?(i({nodes:[],edges:[k]}),null===(e=I.current)||void 0===e||e.blur()):o([r])),c&&c(n,k)},onDoubleClick:q,onContextMenu:K,onMouseEnter:Q,onMouseMove:J,onMouseLeave:nn,onKeyDown:O?function(n){var e;if(!S&&mv.includes(n.key)&&j){var t=D.getState(),o=t.unselectNodesAndEdges,i=t.addSelectedEdges;"Escape"===n.key?(null===(e=I.current)||void 0===e||e.blur(),o({edges:[k]})):i([r])}}:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":r,"data-testid":"rf__edge-".concat(r),"aria-label":null===k.ariaLabel?void 0:k.ariaLabel||"Edge from ".concat(k.source," to ").concat(k.target),"aria-describedby":O?"".concat("ink-flow__edge-desc","-").concat(x):void 0,ref:I,children:[!B&&p.jsx(N,{id:r,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:Y,sourceY:Z,targetX:X,targetY:F,sourcePosition:U,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:$,markerEnd:G,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),P&&p.jsx(y_,{edge:k,isUpdatable:P,edgeUpdaterRadius:v,onEdgeUpdate:g,onEdgeUpdateStart:y,onEdgeUpdateEnd:m,sourceX:Y,sourceY:Z,targetX:X,targetY:F,sourcePosition:U,targetPosition:W,setUpdateHover:L,setUpdating:R,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle})]})})}var E_=function(n){return{width:n.width,height:n.height,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function S_(e){var t=e.defaultMarkerColor,r=e.rfId,o=e.noPanClassName,i=e.onEdgeUpdate,u=e.onEdgeContextMenu,a=e.onEdgeMouseEnter,c=e.onEdgeMouseMove,l=e.onEdgeMouseLeave,s=e.onEdgeClick,f=e.edgeTypes,d=tw(E_,Rw),h=d.edgesFocusable,v=d.edgesUpdatable,g=d.elementsSelectable,y=d.onError,m=function(e){var t=tw(n.useCallback((function(n){return n.edges.map((function(n){return n.id}))}),[e]),Rw);return t}(!1);return p.jsxs("div",{className:"ink-flow__edges",children:[p.jsx(Xb,{defaultColor:t,rfId:r}),m.map((function(n){return p.jsx(__,{id:n,edgesFocusable:h,edgesUpdatable:v,elementsSelectable:g,noPanClassName:o,onEdgeUpdate:i,onContextMenu:u,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,onClick:s,rfId:r,onError:y,edgeTypes:f},n)}))]})}S_.displayName="EdgeRenderer";var k_,C_=n.memo(S_),M_=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function N_(n){var e=n.children,t=tw(M_);return p.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:e})}var O_=((k_={})[exports.Position.Left]=exports.Position.Right,k_[exports.Position.Right]=exports.Position.Left,k_[exports.Position.Top]=exports.Position.Bottom,k_[exports.Position.Bottom]=exports.Position.Top,k_),P_=function(e){var r,o,i=e.nodeId,u=e.handleType,c=e.style,l=e.type,s=void 0===l?exports.ConnectionLineType.Bezier:l,f=e.CustomComponent,d=e.connectionStatus,h=tw(n.useCallback((function(n){var e;return{fromNode:n.nodeLookup.get(i),handleId:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.handleId,toX:(n.connectionPosition.x-n.transform[0])/n.transform[2],toY:(n.connectionPosition.y-n.transform[1])/n.transform[2],connectionMode:n.connectionMode}}),[i]),Rw),v=h.fromNode,g=h.handleId,y=h.toX,m=h.toY,x=h.connectionMode,w=null==v?void 0:v.internals.handleBounds,b=null==w?void 0:w[u];if(x===exports.ConnectionMode.Loose&&(b=b||(null==w?void 0:w["source"===u?"target":"source"])),!v||!b)return null;var _=g?b.find((function(n){return n.id===g})):b[0],E=_?_.x+_.width/2:(null!==(r=v.measured.width)&&void 0!==r?r:0)/2,S=_?_.y+_.height/2:null!==(o=v.measured.height)&&void 0!==o?o:0,k=v.internals.positionAbsolute.x+E,C=v.internals.positionAbsolute.y+S,M=null==_?void 0:_.position,N=M?O_[M]:null;if(!M||!N)return null;if(f)return p.jsx(f,{connectionLineType:s,connectionLineStyle:c,fromNode:v,fromHandle:_,fromX:k,fromY:C,toX:y,toY:m,fromPosition:M,toPosition:N,connectionStatus:d});var O="",P={sourceX:k,sourceY:C,sourcePosition:M,targetX:y,targetY:m,targetPosition:N};return O=s===exports.ConnectionLineType.Bezier?a(Fv(P),1)[0]:s===exports.ConnectionLineType.Step?a(Qv(t(t({},P),{borderRadius:0})),1)[0]:s===exports.ConnectionLineType.SmoothStep?a(Qv(P),1)[0]:s===exports.ConnectionLineType.SimpleBezier?a(Gb(P),1)[0]:"M".concat(k,",").concat(C," ").concat(y,",").concat(m),p.jsx("path",{d:O,fill:"none",className:"react-flow__connection-path",style:c})};P_.displayName="ConnectionLine";var j_=function(n){var e,t;return{nodeId:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.nodeId,handleType:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.type,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height}};function I_(n){var e=n.containerStyle,t=n.style,r=n.type,o=n.component,i=tw(j_,Rw),u=i.nodeId,a=i.handleType,c=i.nodesConnectable,l=i.width,s=i.height,f=i.connectionStatus;return!!(u&&a&&l&&c)?p.jsx("svg",{style:e,width:l,height:s,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:w(["react-flow__connection",f]),children:p.jsx(P_,{nodeId:u,handleType:a,style:t,type:r,CustomComponent:o,connectionStatus:f})})}):null}function A_(n){var e=n.onNodeClick,t=n.onNodeDoubleClick,r=n.onNodeMouseEnter,o=n.onNodeMouseMove,i=n.onNodeMouseLeave,u=n.onNodeContextMenu,a=n.onEdgeClick,c=n.onEdgeDoubleClick,l=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeContextMenu,h=n.rfId,v=n.minZoom,g=n.maxZoom,y=n.noPanClassName,m=n.noDragClassName,x=n.nodeOrigin,w=n.viewport,b=n.disableKeyboardA11y,_=n.translateExtent,E=n.defaultViewport,S=n.nodeTypes,k=n.edgeTypes,C=n.elementsSelectable,M=n.defaultMarkerColor,N=n.connectionLineType,O=n.connectionLineStyle,P=n.connectionLineComponent,j=n.connectionLineContainerStyle,I=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,T=n.onPaneMouseLeave,B=n.onPaneScroll;return p.jsx(cb,{minZoom:v,maxZoom:g,noPanClassName:y,noDragClassName:m,isControlledViewport:!!w,disableKeyboardA11y:b,translateExtent:_,defaultViewport:E,elementsSelectable:C,onPaneClick:I,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:T,onPaneScroll:B,children:p.jsxs(N_,{children:[p.jsx(C_,{rfId:h,edgeTypes:k,noPanClassName:y,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,onEdgeContextMenu:d,defaultMarkerColor:M}),p.jsx(I_,{style:O,type:N,component:P,containerStyle:j}),p.jsx("div",{className:"ink-flow__edgelabel-renderer"}),p.jsx(Db,{rfId:h,nodeTypes:S,nodeOrigin:x,noDragClassName:m,noPanClassName:y,disableKeyboardA11y:!1,onNodeClick:e,onNodeDoubleClick:t,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),p.jsx("div",{className:"ink-flow__viewport-portal"})]})})}A_.displayName="GraphView";var z_=n.memo(A_),L_={x:0,y:0,zoom:1},T_={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},B_=function(n){var e,t,r=void 0===n?{}:n,o=r.nodes,i=r.edges,u=r.defaultNodes,a=r.defaultEdges;r.width,r.height,r.fitView;var c=new Map,l=new Map,s=new Map,f=new Map,d=null!==(e=null!=a?a:i)&&void 0!==e?e:[],h=null!==(t=null!=u?u:o)&&void 0!==t?t:[];aw(s,f,d),cw(h,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:h,nodeLookup:c,parentLookup:l,edges:d,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:yv,nodeExtent:yv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:exports.ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:T_,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"react",debug:!1}},R_={dagre:Jv};var D_={exports:{}};
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Lodash <https://lodash.com/>
|
|
@@ -21,5 +21,5 @@ v=g,function(){var n={}.hasOwnProperty;function e(){for(var n="",e=0;e<arguments
|
|
|
21
21
|
* Released under MIT license <https://lodash.com/license>
|
|
22
22
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
23
23
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
24
|
-
*/!function(n,e){(function(){var t,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",u=16,a=32,c=64,s=128,f=256,d=1/0,h=9007199254740991,v=NaN,p=4294967295,g=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",a],["partialRight",c],["rearg",f]],y="[object Arguments]",m="[object Array]",x="[object Boolean]",w="[object Date]",b="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",M="[object Promise]",N="[object RegExp]",O="[object Set]",P="[object String]",j="[object Symbol]",I="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",T="[object Float64Array]",B="[object Int8Array]",R="[object Int16Array]",D="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",Z="[object Uint32Array]",X=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(W.source),q=RegExp($.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,en=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,on=RegExp(rn.source),un=/^\s+/,an=/\s/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,sn=/,? & /,fn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dn=/[()=,{}\[\]\/\s]/,hn=/\\(\\)?/g,vn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pn=/\w*$/,gn=/^[-+]0x[0-9a-f]+$/i,yn=/^0b[01]+$/i,mn=/^\[object .+?Constructor\]$/,xn=/^0o[0-7]+$/i,wn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_n=/($^)/,En=/['\n\r\u2028\u2029\\]/g,Sn="\\ud800-\\udfff",kn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Cn="\\u2700-\\u27bf",Mn="a-z\\xdf-\\xf6\\xf8-\\xff",Nn="A-Z\\xc0-\\xd6\\xd8-\\xde",On="\\ufe0e\\ufe0f",Pn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jn="['’]",In="["+Sn+"]",An="["+Pn+"]",zn="["+kn+"]",Ln="\\d+",Tn="["+Cn+"]",Bn="["+Mn+"]",Rn="[^"+Sn+Pn+Ln+Cn+Mn+Nn+"]",Dn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+Nn+"]",Xn="\\u200d",Un="(?:"+Bn+"|"+Rn+")",Fn="(?:"+Zn+"|"+Rn+")",Wn="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Dn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Xn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Tn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,In].join("|")+")",ne=RegExp(jn,"g"),ee=RegExp(zn,"g"),te=RegExp(Dn+"(?="+Dn+")|"+Jn+Kn,"g"),re=RegExp([Zn+"?"+Bn+"+"+Wn+"(?="+[An,Zn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Zn+Un,"$"].join("|")+")",Zn+"?"+Un+"+"+Wn,Zn+"+"+$n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ln,Qn].join("|"),"g"),oe=RegExp("["+Xn+Sn+kn+On+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ue=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,ce={};ce[L]=ce[T]=ce[B]=ce[R]=ce[D]=ce[V]=ce[H]=ce[Y]=ce[Z]=!0,ce[y]=ce[m]=ce[A]=ce[x]=ce[z]=ce[w]=ce[b]=ce[_]=ce[S]=ce[k]=ce[C]=ce[N]=ce[O]=ce[P]=ce[I]=!1;var le={};le[y]=le[m]=le[A]=le[z]=le[x]=le[w]=le[L]=le[T]=le[B]=le[R]=le[D]=le[S]=le[k]=le[C]=le[N]=le[O]=le[P]=le[j]=le[V]=le[H]=le[Y]=le[Z]=!0,le[b]=le[_]=le[I]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,de=parseInt,he="object"==typeof l&&l&&l.Object===Object&&l,ve="object"==typeof self&&self&&self.Object===Object&&self,pe=he||ve||Function("return this")(),ge=e&&!e.nodeType&&e,ye=ge&&n&&!n.nodeType&&n,me=ye&&ye.exports===ge,xe=me&&he.process,we=function(){try{var n=ye&&ye.require&&ye.require("util").types;return n||xe&&xe.binding&&xe.binding("util")}catch(n){}}(),be=we&&we.isArrayBuffer,_e=we&&we.isDate,Ee=we&&we.isMap,Se=we&&we.isRegExp,ke=we&&we.isSet,Ce=we&&we.isTypedArray;function Me(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Ne(n,e,t,r){for(var o=-1,i=null==n?0:n.length;++o<i;){var u=n[o];e(r,u,t(u),n)}return r}function Oe(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}function Pe(n,e){for(var t=null==n?0:n.length;t--&&!1!==e(n[t],t,n););return n}function je(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(!e(n[t],t,n))return!1;return!0}function Ie(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var u=n[t];e(u,t,n)&&(i[o++]=u)}return i}function Ae(n,e){return!!(null==n?0:n.length)&&Ze(n,e,0)>-1}function ze(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}function Le(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}function Te(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}function Be(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}function Re(n,e,t,r){var o=null==n?0:n.length;for(r&&o&&(t=n[--o]);o--;)t=e(t,n[o],o,n);return t}function De(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}var Ve=We("length");function He(n,e,t){var r;return t(n,(function(n,t,o){if(e(n,t,o))return r=t,!1})),r}function Ye(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}function Ze(n,e,t){return e==e?function(n,e,t){var r=t-1,o=n.length;for(;++r<o;)if(n[r]===e)return r;return-1}(n,e,t):Ye(n,Ue,t)}function Xe(n,e,t,r){for(var o=t-1,i=n.length;++o<i;)if(r(n[o],e))return o;return-1}function Ue(n){return n!=n}function Fe(n,e){var t=null==n?0:n.length;return t?qe(n,e)/t:v}function We(n){return function(e){return null==e?t:e[n]}}function $e(n){return function(e){return null==n?t:n[e]}}function Ge(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}function qe(n,e){for(var r,o=-1,i=n.length;++o<i;){var u=e(n[o]);u!==t&&(r=r===t?u:r+u)}return r}function Ke(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}function Qe(n){return n?n.slice(0,pt(n)+1).replace(un,""):n}function Je(n){return function(e){return n(e)}}function nt(n,e){return Le(e,(function(e){return n[e]}))}function et(n,e){return n.has(e)}function tt(n,e){for(var t=-1,r=n.length;++t<r&&Ze(e,n[t],0)>-1;);return t}function rt(n,e){for(var t=n.length;t--&&Ze(e,n[t],0)>-1;);return t}var ot=$e({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),it=$e({"&":"&","<":"<",">":">",'"':""","'":"'"});function ut(n){return"\\"+se[n]}function at(n){return oe.test(n)}function ct(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}function lt(n,e){return function(t){return n(e(t))}}function st(n,e){for(var t=-1,r=n.length,o=0,u=[];++t<r;){var a=n[t];a!==e&&a!==i||(n[t]=i,u[o++]=t)}return u}function ft(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}function dt(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=[n,n]})),t}function ht(n){return at(n)?function(n){var e=te.lastIndex=0;for(;te.test(n);)++e;return e}(n):Ve(n)}function vt(n){return at(n)?function(n){return n.match(te)||[]}(n):function(n){return n.split("")}(n)}function pt(n){for(var e=n.length;e--&&an.test(n.charAt(e)););return e}var gt=$e({"&":"&","<":"<",">":">",""":'"',"'":"'"});var yt=function n(e){var l,an=(e=null==e?pe:yt.defaults(pe.Object(),e,yt.pick(pe,ue))).Array,Sn=e.Date,kn=e.Error,Cn=e.Function,Mn=e.Math,Nn=e.Object,On=e.RegExp,Pn=e.String,jn=e.TypeError,In=an.prototype,An=Cn.prototype,zn=Nn.prototype,Ln=e["__core-js_shared__"],Tn=An.toString,Bn=zn.hasOwnProperty,Rn=0,Dn=(l=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",Vn=zn.toString,Hn=Tn.call(Nn),Yn=pe._,Zn=On("^"+Tn.call(Bn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xn=me?e.Buffer:t,Un=e.Symbol,Fn=e.Uint8Array,Wn=Xn?Xn.allocUnsafe:t,$n=lt(Nn.getPrototypeOf,Nn),Gn=Nn.create,qn=zn.propertyIsEnumerable,Kn=In.splice,Qn=Un?Un.isConcatSpreadable:t,Jn=Un?Un.iterator:t,te=Un?Un.toStringTag:t,oe=function(){try{var n=hi(Nn,"defineProperty");return n({},"",{}),n}catch(n){}}(),se=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=Sn&&Sn.now!==pe.Date.now&&Sn.now,ve=e.setTimeout!==pe.setTimeout&&e.setTimeout,ge=Mn.ceil,ye=Mn.floor,xe=Nn.getOwnPropertySymbols,we=Xn?Xn.isBuffer:t,Ve=e.isFinite,$e=In.join,mt=lt(Nn.keys,Nn),xt=Mn.max,wt=Mn.min,bt=Sn.now,_t=e.parseInt,Et=Mn.random,St=In.reverse,kt=hi(e,"DataView"),Ct=hi(e,"Map"),Mt=hi(e,"Promise"),Nt=hi(e,"Set"),Ot=hi(e,"WeakMap"),Pt=hi(Nn,"create"),jt=Ot&&new Ot,It={},At=Di(kt),zt=Di(Ct),Lt=Di(Mt),Tt=Di(Nt),Bt=Di(Ot),Rt=Un?Un.prototype:t,Dt=Rt?Rt.valueOf:t,Vt=Rt?Rt.toString:t;function Ht(n){if(ta(n)&&!Uu(n)&&!(n instanceof Ut)){if(n instanceof Xt)return n;if(Bn.call(n,"__wrapped__"))return Vi(n)}return new Xt(n)}var Yt=function(){function n(){}return function(e){if(!ea(e))return{};if(Gn)return Gn(e);n.prototype=e;var r=new n;return n.prototype=t,r}}();function Zt(){}function Xt(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=t}function Ut(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Ft(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Wt(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function $t(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Gt(n){var e=-1,t=null==n?0:n.length;for(this.__data__=new $t;++e<t;)this.add(n[e])}function qt(n){var e=this.__data__=new Wt(n);this.size=e.size}function Kt(n,e){var t=Uu(n),r=!t&&Xu(n),o=!t&&!r&&Gu(n),i=!t&&!r&&!o&&sa(n),u=t||r||o||i,a=u?Ke(n.length,Pn):[],c=a.length;for(var l in n)!e&&!Bn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||wi(l,c))||a.push(l);return a}function Qt(n){var e=n.length;return e?n[Gr(0,e-1)]:t}function Jt(n,e){return Ti(jo(n),cr(e,0,n.length))}function nr(n){return Ti(jo(n))}function er(n,e,r){(r!==t&&!Hu(n[e],r)||r===t&&!(e in n))&&ur(n,e,r)}function tr(n,e,r){var o=n[e];Bn.call(n,e)&&Hu(o,r)&&(r!==t||e in n)||ur(n,e,r)}function rr(n,e){for(var t=n.length;t--;)if(Hu(n[t][0],e))return t;return-1}function or(n,e,t,r){return hr(n,(function(n,o,i){e(r,n,t(n),i)})),r}function ir(n,e){return n&&Io(e,Ia(e),n)}function ur(n,e,t){"__proto__"==e&&oe?oe(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ar(n,e){for(var r=-1,o=e.length,i=an(o),u=null==n;++r<o;)i[r]=u?t:Ma(n,e[r]);return i}function cr(n,e,r){return n==n&&(r!==t&&(n=n<=r?n:r),e!==t&&(n=n>=e?n:e)),n}function lr(n,e,r,o,i,u){var a,c=1&e,l=2&e,s=4&e;if(r&&(a=i?r(n,o,i,u):r(n)),a!==t)return a;if(!ea(n))return n;var f=Uu(n);if(f){if(a=function(n){var e=n.length,t=new n.constructor(e);e&&"string"==typeof n[0]&&Bn.call(n,"index")&&(t.index=n.index,t.input=n.input);return t}(n),!c)return jo(n,a)}else{var d=gi(n),h=d==_||d==E;if(Gu(n))return ko(n,c);if(d==C||d==y||h&&!i){if(a=l||h?{}:mi(n),!c)return l?function(n,e){return Io(n,pi(n),e)}(n,function(n,e){return n&&Io(e,Aa(e),n)}(a,n)):function(n,e){return Io(n,vi(n),e)}(n,ir(a,n))}else{if(!le[d])return i?n:{};a=function(n,e,t){var r=n.constructor;switch(e){case A:return Co(n);case x:case w:return new r(+n);case z:return function(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}(n,t);case L:case T:case B:case R:case D:case V:case H:case Y:case Z:return Mo(n,t);case S:return new r;case k:case P:return new r(n);case N:return function(n){var e=new n.constructor(n.source,pn.exec(n));return e.lastIndex=n.lastIndex,e}(n);case O:return new r;case j:return o=n,Dt?Nn(Dt.call(o)):{}}var o}(n,d,c)}}u||(u=new qt);var v=u.get(n);if(v)return v;u.set(n,a),aa(n)?n.forEach((function(t){a.add(lr(t,e,r,t,n,u))})):ra(n)&&n.forEach((function(t,o){a.set(o,lr(t,e,r,o,n,u))}));var p=f?t:(s?l?ui:ii:l?Aa:Ia)(n);return Oe(p||n,(function(t,o){p&&(t=n[o=t]),tr(a,o,lr(t,e,r,o,n,u))})),a}function sr(n,e,r){var o=r.length;if(null==n)return!o;for(n=Nn(n);o--;){var i=r[o],u=e[i],a=n[i];if(a===t&&!(i in n)||!u(a))return!1}return!0}function fr(n,e,o){if("function"!=typeof n)throw new jn(r);return Ii((function(){n.apply(t,o)}),e)}function dr(n,e,t,r){var o=-1,i=Ae,u=!0,a=n.length,c=[],l=e.length;if(!a)return c;t&&(e=Le(e,Je(t))),r?(i=ze,u=!1):e.length>=200&&(i=et,u=!1,e=new Gt(e));n:for(;++o<a;){var s=n[o],f=null==t?s:t(s);if(s=r||0!==s?s:0,u&&f==f){for(var d=l;d--;)if(e[d]===f)continue n;c.push(s)}else i(e,f,r)||c.push(s)}return c}Ht.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:Ht}},Ht.prototype=Zt.prototype,Ht.prototype.constructor=Ht,Xt.prototype=Yt(Zt.prototype),Xt.prototype.constructor=Xt,Ut.prototype=Yt(Zt.prototype),Ut.prototype.constructor=Ut,Ft.prototype.clear=function(){this.__data__=Pt?Pt(null):{},this.size=0},Ft.prototype.delete=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e},Ft.prototype.get=function(n){var e=this.__data__;if(Pt){var r=e[n];return r===o?t:r}return Bn.call(e,n)?e[n]:t},Ft.prototype.has=function(n){var e=this.__data__;return Pt?e[n]!==t:Bn.call(e,n)},Ft.prototype.set=function(n,e){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Pt&&e===t?o:e,this},Wt.prototype.clear=function(){this.__data__=[],this.size=0},Wt.prototype.delete=function(n){var e=this.__data__,t=rr(e,n);return!(t<0)&&(t==e.length-1?e.pop():Kn.call(e,t,1),--this.size,!0)},Wt.prototype.get=function(n){var e=this.__data__,r=rr(e,n);return r<0?t:e[r][1]},Wt.prototype.has=function(n){return rr(this.__data__,n)>-1},Wt.prototype.set=function(n,e){var t=this.__data__,r=rr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this},$t.prototype.clear=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ct||Wt),string:new Ft}},$t.prototype.delete=function(n){var e=fi(this,n).delete(n);return this.size-=e?1:0,e},$t.prototype.get=function(n){return fi(this,n).get(n)},$t.prototype.has=function(n){return fi(this,n).has(n)},$t.prototype.set=function(n,e){var t=fi(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this},Gt.prototype.add=Gt.prototype.push=function(n){return this.__data__.set(n,o),this},Gt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.clear=function(){this.__data__=new Wt,this.size=0},qt.prototype.delete=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t},qt.prototype.get=function(n){return this.__data__.get(n)},qt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.set=function(n,e){var t=this.__data__;if(t instanceof Wt){var r=t.__data__;if(!Ct||r.length<199)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $t(r)}return t.set(n,e),this.size=t.size,this};var hr=Lo(br),vr=Lo(_r,!0);function pr(n,e){var t=!0;return hr(n,(function(n,r,o){return t=!!e(n,r,o)})),t}function gr(n,e,r){for(var o=-1,i=n.length;++o<i;){var u=n[o],a=e(u);if(null!=a&&(c===t?a==a&&!la(a):r(a,c)))var c=a,l=u}return l}function yr(n,e){var t=[];return hr(n,(function(n,r,o){e(n,r,o)&&t.push(n)})),t}function mr(n,e,t,r,o){var i=-1,u=n.length;for(t||(t=xi),o||(o=[]);++i<u;){var a=n[i];e>0&&t(a)?e>1?mr(a,e-1,t,r,o):Te(o,a):r||(o[o.length]=a)}return o}var xr=To(),wr=To(!0);function br(n,e){return n&&xr(n,e,Ia)}function _r(n,e){return n&&wr(n,e,Ia)}function Er(n,e){return Ie(e,(function(e){return Qu(n[e])}))}function Sr(n,e){for(var r=0,o=(e=bo(e,n)).length;null!=n&&r<o;)n=n[Ri(e[r++])];return r&&r==o?n:t}function kr(n,e,t){var r=e(n);return Uu(n)?r:Te(r,t(n))}function Cr(n){return null==n?n===t?"[object Undefined]":"[object Null]":te&&te in Nn(n)?function(n){var e=Bn.call(n,te),r=n[te];try{n[te]=t;var o=!0}catch(n){}var i=Vn.call(n);o&&(e?n[te]=r:delete n[te]);return i}(n):function(n){return Vn.call(n)}(n)}function Mr(n,e){return n>e}function Nr(n,e){return null!=n&&Bn.call(n,e)}function Or(n,e){return null!=n&&e in Nn(n)}function Pr(n,e,r){for(var o=r?ze:Ae,i=n[0].length,u=n.length,a=u,c=an(u),l=1/0,s=[];a--;){var f=n[a];a&&e&&(f=Le(f,Je(e))),l=wt(f.length,l),c[a]=!r&&(e||i>=120&&f.length>=120)?new Gt(a&&f):t}f=n[0];var d=-1,h=c[0];n:for(;++d<i&&s.length<l;){var v=f[d],p=e?e(v):v;if(v=r||0!==v?v:0,!(h?et(h,p):o(s,p,r))){for(a=u;--a;){var g=c[a];if(!(g?et(g,p):o(n[a],p,r)))continue n}h&&h.push(p),s.push(v)}}return s}function jr(n,e,r){var o=null==(n=Oi(n,e=bo(e,n)))?n:n[Ri(Ki(e))];return null==o?t:Me(o,n,r)}function Ir(n){return ta(n)&&Cr(n)==y}function Ar(n,e,r,o,i){return n===e||(null==n||null==e||!ta(n)&&!ta(e)?n!=n&&e!=e:function(n,e,r,o,i,u){var a=Uu(n),c=Uu(e),l=a?m:gi(n),s=c?m:gi(e),f=(l=l==y?C:l)==C,d=(s=s==y?C:s)==C,h=l==s;if(h&&Gu(n)){if(!Gu(e))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new qt),a||sa(n)?ri(n,e,r,o,i,u):function(n,e,t,r,o,i,u){switch(t){case z:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case A:return!(n.byteLength!=e.byteLength||!i(new Fn(n),new Fn(e)));case x:case w:case k:return Hu(+n,+e);case b:return n.name==e.name&&n.message==e.message;case N:case P:return n==e+"";case S:var a=ct;case O:var c=1&r;if(a||(a=ft),n.size!=e.size&&!c)return!1;var l=u.get(n);if(l)return l==e;r|=2,u.set(n,e);var s=ri(a(n),a(e),r,o,i,u);return u.delete(n),s;case j:if(Dt)return Dt.call(n)==Dt.call(e)}return!1}(n,e,l,r,o,i,u);if(!(1&r)){var v=f&&Bn.call(n,"__wrapped__"),p=d&&Bn.call(e,"__wrapped__");if(v||p){var g=v?n.value():n,_=p?e.value():e;return u||(u=new qt),i(g,_,r,o,u)}}if(!h)return!1;return u||(u=new qt),function(n,e,r,o,i,u){var a=1&r,c=ii(n),l=c.length,s=ii(e),f=s.length;if(l!=f&&!a)return!1;var d=l;for(;d--;){var h=c[d];if(!(a?h in e:Bn.call(e,h)))return!1}var v=u.get(n),p=u.get(e);if(v&&p)return v==e&&p==n;var g=!0;u.set(n,e),u.set(e,n);var y=a;for(;++d<l;){var m=n[h=c[d]],x=e[h];if(o)var w=a?o(x,m,h,e,n,u):o(m,x,h,n,e,u);if(!(w===t?m===x||i(m,x,r,o,u):w)){g=!1;break}y||(y="constructor"==h)}if(g&&!y){var b=n.constructor,_=e.constructor;b==_||!("constructor"in n)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(g=!1)}return u.delete(n),u.delete(e),g}(n,e,r,o,i,u)}(n,e,r,o,Ar,i))}function zr(n,e,r,o){var i=r.length,u=i,a=!o;if(null==n)return!u;for(n=Nn(n);i--;){var c=r[i];if(a&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++i<u;){var l=(c=r[i])[0],s=n[l],f=c[1];if(a&&c[2]){if(s===t&&!(l in n))return!1}else{var d=new qt;if(o)var h=o(s,f,l,n,e,d);if(!(h===t?Ar(f,s,3,o,d):h))return!1}}return!0}function Lr(n){return!(!ea(n)||(e=n,Dn&&Dn in e))&&(Qu(n)?Zn:mn).test(Di(n));var e}function Tr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Uu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Br(n){if(!ki(n))return mt(n);var e=[];for(var t in Nn(n))Bn.call(n,t)&&"constructor"!=t&&e.push(t);return e}function Rr(n){if(!ea(n))return function(n){var e=[];if(null!=n)for(var t in Nn(n))e.push(t);return e}(n);var e=ki(n),t=[];for(var r in n)("constructor"!=r||!e&&Bn.call(n,r))&&t.push(r);return t}function Dr(n,e){return n<e}function Vr(n,e){var t=-1,r=Wu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++t]=e(n,o,i)})),r}function Hr(n){var e=di(n);return 1==e.length&&e[0][2]?Mi(e[0][0],e[0][1]):function(t){return t===n||zr(t,n,e)}}function Yr(n,e){return _i(n)&&Ci(e)?Mi(Ri(n),e):function(r){var o=Ma(r,n);return o===t&&o===e?Na(r,n):Ar(e,o,3)}}function Zr(n,e,r,o,i){n!==e&&xr(e,(function(u,a){if(i||(i=new qt),ea(u))!function(n,e,r,o,i,u,a){var c=Pi(n,r),l=Pi(e,r),s=a.get(l);if(s)return void er(n,r,s);var f=u?u(c,l,r+"",n,e,a):t,d=f===t;if(d){var h=Uu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Uu(c)?f=c:$u(c)?f=jo(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=Mo(l,!0)):f=[]:ia(l)||Xu(l)?(f=c,Xu(c)?f=ma(c):ea(c)&&!Qu(c)||(f=mi(l))):d=!1}d&&(a.set(l,f),i(f,l,o,u,a),a.delete(l));er(n,r,f)}(n,e,a,r,Zr,o,i);else{var c=o?o(Pi(n,a),u,a+"",n,e,i):t;c===t&&(c=u),er(n,a,c)}}),Aa)}function Xr(n,e){var r=n.length;if(r)return wi(e+=e<0?r:0,r)?n[e]:t}function Ur(n,e,t){e=e.length?Le(e,(function(n){return Uu(n)?function(e){return Sr(e,1===n.length?n[0]:n)}:n})):[oc];var r=-1;e=Le(e,Je(si()));var o=Vr(n,(function(n,t,o){var i=Le(e,(function(e){return e(n)}));return{criteria:i,index:++r,value:n}}));return function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}(o,(function(n,e){return function(n,e,t){var r=-1,o=n.criteria,i=e.criteria,u=o.length,a=t.length;for(;++r<u;){var c=No(o[r],i[r]);if(c)return r>=a?c:c*("desc"==t[r]?-1:1)}return n.index-e.index}(n,e,t)}))}function Fr(n,e,t){for(var r=-1,o=e.length,i={};++r<o;){var u=e[r],a=Sr(n,u);t(a,u)&&no(i,bo(u,n),a)}return i}function Wr(n,e,t,r){var o=r?Xe:Ze,i=-1,u=e.length,a=n;for(n===e&&(e=jo(e)),t&&(a=Le(n,Je(t)));++i<u;)for(var c=0,l=e[i],s=t?t(l):l;(c=o(a,s,c,r))>-1;)a!==n&&Kn.call(a,c,1),Kn.call(n,c,1);return n}function $r(n,e){for(var t=n?e.length:0,r=t-1;t--;){var o=e[t];if(t==r||o!==i){var i=o;wi(o)?Kn.call(n,o,1):ho(n,o)}}return n}function Gr(n,e){return n+ye(Et()*(e-n+1))}function qr(n,e){var t="";if(!n||e<1||e>h)return t;do{e%2&&(t+=n),(e=ye(e/2))&&(n+=n)}while(e);return t}function Kr(n,e){return Ai(Ni(n,e,oc),n+"")}function Qr(n){return Qt(Ha(n))}function Jr(n,e){var t=Ha(n);return Ti(t,cr(e,0,t.length))}function no(n,e,r,o){if(!ea(n))return n;for(var i=-1,u=(e=bo(e,n)).length,a=u-1,c=n;null!=c&&++i<u;){var l=Ri(e[i]),s=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return n;if(i!=a){var f=c[l];(s=o?o(f,l,c):t)===t&&(s=ea(f)?f:wi(e[i+1])?[]:{})}tr(c,l,s),c=c[l]}return n}var eo=jt?function(n,e){return jt.set(n,e),n}:oc,to=oe?function(n,e){return oe(n,"toString",{configurable:!0,enumerable:!1,value:ec(e),writable:!0})}:oc;function ro(n){return Ti(Ha(n))}function oo(n,e,t){var r=-1,o=n.length;e<0&&(e=-e>o?0:o+e),(t=t>o?o:t)<0&&(t+=o),o=e>t?0:t-e>>>0,e>>>=0;for(var i=an(o);++r<o;)i[r]=n[r+e];return i}function io(n,e){var t;return hr(n,(function(n,r,o){return!(t=e(n,r,o))})),!!t}function uo(n,e,t){var r=0,o=null==n?r:n.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=n[i];null!==u&&!la(u)&&(t?u<=e:u<e)?r=i+1:o=i}return o}return ao(n,e,oc,t)}function ao(n,e,r,o){var i=0,u=null==n?0:n.length;if(0===u)return 0;for(var a=(e=r(e))!=e,c=null===e,l=la(e),s=e===t;i<u;){var f=ye((i+u)/2),d=r(n[f]),h=d!==t,v=null===d,p=d==d,g=la(d);if(a)var y=o||p;else y=s?p&&(o||h):c?p&&h&&(o||!v):l?p&&h&&!v&&(o||!g):!v&&!g&&(o?d<=e:d<e);y?i=f+1:u=f}return wt(u,4294967294)}function co(n,e){for(var t=-1,r=n.length,o=0,i=[];++t<r;){var u=n[t],a=e?e(u):u;if(!t||!Hu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function lo(n){return"number"==typeof n?n:la(n)?v:+n}function so(n){if("string"==typeof n)return n;if(Uu(n))return Le(n,so)+"";if(la(n))return Vt?Vt.call(n):"";var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function fo(n,e,t){var r=-1,o=Ae,i=n.length,u=!0,a=[],c=a;if(t)u=!1,o=ze;else if(i>=200){var l=e?null:Ko(n);if(l)return ft(l);u=!1,o=et,c=new Gt}else c=e?[]:a;n:for(;++r<i;){var s=n[r],f=e?e(s):s;if(s=t||0!==s?s:0,u&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue n;e&&c.push(f),a.push(s)}else o(c,f,t)||(c!==a&&c.push(f),a.push(s))}return a}function ho(n,e){return null==(n=Oi(n,e=bo(e,n)))||delete n[Ri(Ki(e))]}function vo(n,e,t,r){return no(n,e,t(Sr(n,e)),r)}function po(n,e,t,r){for(var o=n.length,i=r?o:-1;(r?i--:++i<o)&&e(n[i],i,n););return t?oo(n,r?0:i,r?i+1:o):oo(n,r?i+1:0,r?o:i)}function go(n,e){var t=n;return t instanceof Ut&&(t=t.value()),Be(e,(function(n,e){return e.func.apply(e.thisArg,Te([n],e.args))}),t)}function yo(n,e,t){var r=n.length;if(r<2)return r?fo(n[0]):[];for(var o=-1,i=an(r);++o<r;)for(var u=n[o],a=-1;++a<r;)a!=o&&(i[o]=dr(i[o]||u,n[a],e,t));return fo(mr(i,1),e,t)}function mo(n,e,r){for(var o=-1,i=n.length,u=e.length,a={};++o<i;){var c=o<u?e[o]:t;r(a,n[o],c)}return a}function xo(n){return $u(n)?n:[]}function wo(n){return"function"==typeof n?n:oc}function bo(n,e){return Uu(n)?n:_i(n,e)?[n]:Bi(xa(n))}var _o=Kr;function Eo(n,e,r){var o=n.length;return r=r===t?o:r,!e&&r>=o?n:oo(n,e,r)}var So=se||function(n){return pe.clearTimeout(n)};function ko(n,e){if(e)return n.slice();var t=n.length,r=Wn?Wn(t):new n.constructor(t);return n.copy(r),r}function Co(n){var e=new n.constructor(n.byteLength);return new Fn(e).set(new Fn(n)),e}function Mo(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function No(n,e){if(n!==e){var r=n!==t,o=null===n,i=n==n,u=la(n),a=e!==t,c=null===e,l=e==e,s=la(e);if(!c&&!s&&!u&&n>e||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&n<e||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}function Oo(n,e,t,r){for(var o=-1,i=n.length,u=t.length,a=-1,c=e.length,l=xt(i-u,0),s=an(c+l),f=!r;++a<c;)s[a]=e[a];for(;++o<u;)(f||o<i)&&(s[t[o]]=n[o]);for(;l--;)s[a++]=n[o++];return s}function Po(n,e,t,r){for(var o=-1,i=n.length,u=-1,a=t.length,c=-1,l=e.length,s=xt(i-a,0),f=an(s+l),d=!r;++o<s;)f[o]=n[o];for(var h=o;++c<l;)f[h+c]=e[c];for(;++u<a;)(d||o<i)&&(f[h+t[u]]=n[o++]);return f}function jo(n,e){var t=-1,r=n.length;for(e||(e=an(r));++t<r;)e[t]=n[t];return e}function Io(n,e,r,o){var i=!r;r||(r={});for(var u=-1,a=e.length;++u<a;){var c=e[u],l=o?o(r[c],n[c],c,r,n):t;l===t&&(l=n[c]),i?ur(r,c,l):tr(r,c,l)}return r}function Ao(n,e){return function(t,r){var o=Uu(t)?Ne:or,i=e?e():{};return o(t,n,si(r,2),i)}}function zo(n){return Kr((function(e,r){var o=-1,i=r.length,u=i>1?r[i-1]:t,a=i>2?r[2]:t;for(u=n.length>3&&"function"==typeof u?(i--,u):t,a&&bi(r[0],r[1],a)&&(u=i<3?t:u,i=1),e=Nn(e);++o<i;){var c=r[o];c&&n(e,c,o,u)}return e}))}function Lo(n,e){return function(t,r){if(null==t)return t;if(!Wu(t))return n(t,r);for(var o=t.length,i=e?o:-1,u=Nn(t);(e?i--:++i<o)&&!1!==r(u[i],i,u););return t}}function To(n){return function(e,t,r){for(var o=-1,i=Nn(e),u=r(e),a=u.length;a--;){var c=u[n?a:++o];if(!1===t(i[c],c,i))break}return e}}function Bo(n){return function(e){var r=at(e=xa(e))?vt(e):t,o=r?r[0]:e.charAt(0),i=r?Eo(r,1).join(""):e.slice(1);return o[n]()+i}}function Ro(n){return function(e){return Be(Qa(Xa(e).replace(ne,"")),n,"")}}function Do(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Yt(n.prototype),r=n.apply(t,e);return ea(r)?r:t}}function Vo(n){return function(e,r,o){var i=Nn(e);if(!Wu(e)){var u=si(r,3);e=Ia(e),r=function(n){return u(i[n],n,i)}}var a=n(e,r,o);return a>-1?i[u?e[a]:a]:t}}function Ho(n){return oi((function(e){var o=e.length,i=o,u=Xt.prototype.thru;for(n&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new jn(r);if(u&&!c&&"wrapper"==ci(a))var c=new Xt([],!0)}for(i=c?i:o;++i<o;){var l=ci(a=e[i]),s="wrapper"==l?ai(a):t;c=s&&Ei(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[ci(s[0])].apply(c,s[3]):1==a.length&&Ei(a)?c[l]():c.thru(a)}return function(){var n=arguments,t=n[0];if(c&&1==n.length&&Uu(t))return c.plant(t).value();for(var r=0,i=o?e[r].apply(this,n):t;++r<o;)i=e[r].call(this,i);return i}}))}function Yo(n,e,r,o,i,u,a,c,l,f){var d=e&s,h=1&e,v=2&e,p=24&e,g=512&e,y=v?t:Do(n);return function s(){for(var m=arguments.length,x=an(m),w=m;w--;)x[w]=arguments[w];if(p)var b=li(s),_=function(n,e){for(var t=n.length,r=0;t--;)n[t]===e&&++r;return r}(x,b);if(o&&(x=Oo(x,o,i,p)),u&&(x=Po(x,u,a,p)),m-=_,p&&m<f){var E=st(x,b);return Go(n,e,Yo,s.placeholder,r,x,E,c,l,f-m)}var S=h?r:this,k=v?S[n]:n;return m=x.length,c?x=function(n,e){var r=n.length,o=wt(e.length,r),i=jo(n);for(;o--;){var u=e[o];n[o]=wi(u,r)?i[u]:t}return n}(x,c):g&&m>1&&x.reverse(),d&&l<m&&(x.length=l),this&&this!==pe&&this instanceof s&&(k=y||Do(k)),k.apply(S,x)}}function Zo(n,e){return function(t,r){return function(n,e,t,r){return br(n,(function(n,o,i){e(r,t(n),o,i)})),r}(t,n,e(r),{})}}function Xo(n,e){return function(r,o){var i;if(r===t&&o===t)return e;if(r!==t&&(i=r),o!==t){if(i===t)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=lo(r),o=lo(o)),i=n(r,o)}return i}}function Uo(n){return oi((function(e){return e=Le(e,Je(si())),Kr((function(t){var r=this;return n(e,(function(n){return Me(n,r,t)}))}))}))}function Fo(n,e){var r=(e=e===t?" ":so(e)).length;if(r<2)return r?qr(e,n):e;var o=qr(e,ge(n/ht(e)));return at(e)?Eo(vt(o),0,n).join(""):o.slice(0,n)}function Wo(n){return function(e,r,o){return o&&"number"!=typeof o&&bi(e,r,o)&&(r=o=t),e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t,r){for(var o=-1,i=xt(ge((e-n)/(t||1)),0),u=an(i);i--;)u[r?i:++o]=n,n+=t;return u}(e,r,o=o===t?e<r?1:-1:va(o),n)}}function $o(n){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=ya(e),t=ya(t)),n(e,t)}}function Go(n,e,r,o,i,u,l,s,f,d){var h=8&e;e|=h?a:c,4&(e&=~(h?c:a))||(e&=-4);var v=[n,e,i,h?u:t,h?l:t,h?t:u,h?t:l,s,f,d],p=r.apply(t,v);return Ei(n)&&ji(p,v),p.placeholder=o,zi(p,n,e)}function qo(n){var e=Mn[n];return function(n,t){if(n=ya(n),(t=null==t?0:wt(pa(t),292))&&Ve(n)){var r=(xa(n)+"e").split("e");return+((r=(xa(e(r[0]+"e"+(+r[1]+t)))+"e").split("e"))[0]+"e"+(+r[1]-t))}return e(n)}}var Ko=Nt&&1/ft(new Nt([,-0]))[1]==d?function(n){return new Nt(n)}:lc;function Qo(n){return function(e){var t=gi(e);return t==S?ct(e):t==O?dt(e):function(n,e){return Le(e,(function(e){return[e,n[e]]}))}(e,n(e))}}function Jo(n,e,o,l,d,h,v,p){var g=2&e;if(!g&&"function"!=typeof n)throw new jn(r);var y=l?l.length:0;if(y||(e&=-97,l=d=t),v=v===t?v:xt(pa(v),0),p=p===t?p:pa(p),y-=d?d.length:0,e&c){var m=l,x=d;l=d=t}var w=g?t:ai(n),b=[n,e,o,l,d,m,x,h,v,p];if(w&&function(n,e){var t=n[1],r=e[1],o=t|r,u=o<131,a=r==s&&8==t||r==s&&t==f&&n[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==t;if(!u&&!a)return n;1&r&&(n[2]=e[2],o|=1&t?0:4);var c=e[3];if(c){var l=n[3];n[3]=l?Oo(l,c,e[4]):c,n[4]=l?st(n[3],i):e[4]}(c=e[5])&&(l=n[5],n[5]=l?Po(l,c,e[6]):c,n[6]=l?st(n[5],i):e[6]);(c=e[7])&&(n[7]=c);r&s&&(n[8]=null==n[8]?e[8]:wt(n[8],e[8]));null==n[9]&&(n[9]=e[9]);n[0]=e[0],n[1]=o}(b,w),n=b[0],e=b[1],o=b[2],l=b[3],d=b[4],!(p=b[9]=b[9]===t?g?0:n.length:xt(b[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==u?function(n,e,r){var o=Do(n);return function i(){for(var u=arguments.length,a=an(u),c=u,l=li(i);c--;)a[c]=arguments[c];var s=u<3&&a[0]!==l&&a[u-1]!==l?[]:st(a,l);return(u-=s.length)<r?Go(n,e,Yo,i.placeholder,t,a,s,t,t,r-u):Me(this&&this!==pe&&this instanceof i?o:n,this,a)}}(n,e,p):e!=a&&33!=e||d.length?Yo.apply(t,b):function(n,e,t,r){var o=1&e,i=Do(n);return function e(){for(var u=-1,a=arguments.length,c=-1,l=r.length,s=an(l+a),f=this&&this!==pe&&this instanceof e?i:n;++c<l;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Me(f,o?t:this,s)}}(n,e,o,l);else var _=function(n,e,t){var r=1&e,o=Do(n);return function e(){return(this&&this!==pe&&this instanceof e?o:n).apply(r?t:this,arguments)}}(n,e,o);return zi((w?eo:ji)(_,b),n,e)}function ni(n,e,r,o){return n===t||Hu(n,zn[r])&&!Bn.call(o,r)?e:n}function ei(n,e,r,o,i,u){return ea(n)&&ea(e)&&(u.set(e,n),Zr(n,e,t,ei,u),u.delete(e)),n}function ti(n){return ia(n)?t:n}function ri(n,e,r,o,i,u){var a=1&r,c=n.length,l=e.length;if(c!=l&&!(a&&l>c))return!1;var s=u.get(n),f=u.get(e);if(s&&f)return s==e&&f==n;var d=-1,h=!0,v=2&r?new Gt:t;for(u.set(n,e),u.set(e,n);++d<c;){var p=n[d],g=e[d];if(o)var y=a?o(g,p,d,e,n,u):o(p,g,d,n,e,u);if(y!==t){if(y)continue;h=!1;break}if(v){if(!De(e,(function(n,e){if(!et(v,e)&&(p===n||i(p,n,r,o,u)))return v.push(e)}))){h=!1;break}}else if(p!==g&&!i(p,g,r,o,u)){h=!1;break}}return u.delete(n),u.delete(e),h}function oi(n){return Ai(Ni(n,t,Fi),n+"")}function ii(n){return kr(n,Ia,vi)}function ui(n){return kr(n,Aa,pi)}var ai=jt?function(n){return jt.get(n)}:lc;function ci(n){for(var e=n.name+"",t=It[e],r=Bn.call(It,e)?t.length:0;r--;){var o=t[r],i=o.func;if(null==i||i==n)return o.name}return e}function li(n){return(Bn.call(Ht,"placeholder")?Ht:n).placeholder}function si(){var n=Ht.iteratee||ic;return n=n===ic?Tr:n,arguments.length?n(arguments[0],arguments[1]):n}function fi(n,e){var t,r,o=n.__data__;return("string"==(r=typeof(t=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?o["string"==typeof e?"string":"hash"]:o.map}function di(n){for(var e=Ia(n),t=e.length;t--;){var r=e[t],o=n[r];e[t]=[r,o,Ci(o)]}return e}function hi(n,e){var r=function(n,e){return null==n?t:n[e]}(n,e);return Lr(r)?r:t}var vi=xe?function(n){return null==n?[]:(n=Nn(n),Ie(xe(n),(function(e){return qn.call(n,e)})))}:gc,pi=xe?function(n){for(var e=[];n;)Te(e,vi(n)),n=$n(n);return e}:gc,gi=Cr;function yi(n,e,t){for(var r=-1,o=(e=bo(e,n)).length,i=!1;++r<o;){var u=Ri(e[r]);if(!(i=null!=n&&t(n,u)))break;n=n[u]}return i||++r!=o?i:!!(o=null==n?0:n.length)&&na(o)&&wi(u,o)&&(Uu(n)||Xu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Yt($n(n))}function xi(n){return Uu(n)||Xu(n)||!!(Qn&&n&&n[Qn])}function wi(n,e){var t=typeof n;return!!(e=null==e?h:e)&&("number"==t||"symbol"!=t&&wn.test(n))&&n>-1&&n%1==0&&n<e}function bi(n,e,t){if(!ea(t))return!1;var r=typeof e;return!!("number"==r?Wu(t)&&wi(e,t.length):"string"==r&&e in t)&&Hu(t[e],n)}function _i(n,e){if(Uu(n))return!1;var t=typeof n;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=n&&!la(n))||(en.test(n)||!nn.test(n)||null!=e&&n in Nn(e))}function Ei(n){var e=ci(n),t=Ht[e];if("function"!=typeof t||!(e in Ut.prototype))return!1;if(n===t)return!0;var r=ai(t);return!!r&&n===r[0]}(kt&&gi(new kt(new ArrayBuffer(1)))!=z||Ct&&gi(new Ct)!=S||Mt&&gi(Mt.resolve())!=M||Nt&&gi(new Nt)!=O||Ot&&gi(new Ot)!=I)&&(gi=function(n){var e=Cr(n),r=e==C?n.constructor:t,o=r?Di(r):"";if(o)switch(o){case At:return z;case zt:return S;case Lt:return M;case Tt:return O;case Bt:return I}return e});var Si=Ln?Qu:yc;function ki(n){var e=n&&n.constructor;return n===("function"==typeof e&&e.prototype||zn)}function Ci(n){return n==n&&!ea(n)}function Mi(n,e){return function(r){return null!=r&&(r[n]===e&&(e!==t||n in Nn(r)))}}function Ni(n,e,r){return e=xt(e===t?n.length-1:e,0),function(){for(var t=arguments,o=-1,i=xt(t.length-e,0),u=an(i);++o<i;)u[o]=t[e+o];o=-1;for(var a=an(e+1);++o<e;)a[o]=t[o];return a[e]=r(u),Me(n,this,a)}}function Oi(n,e){return e.length<2?n:Sr(n,oo(e,0,-1))}function Pi(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]}var ji=Li(eo),Ii=ve||function(n,e){return pe.setTimeout(n,e)},Ai=Li(to);function zi(n,e,t){var r=e+"";return Ai(n,function(n,e){var t=e.length;if(!t)return n;var r=t-1;return e[r]=(t>1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+e+"] */\n")}(r,function(n,e){return Oe(g,(function(t){var r="_."+t[0];e&t[1]&&!Ae(n,r)&&n.push(r)})),n.sort()}(function(n){var e=n.match(ln);return e?e[1].split(sn):[]}(r),t)))}function Li(n){var e=0,r=0;return function(){var o=bt(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return n.apply(t,arguments)}}function Ti(n,e){var r=-1,o=n.length,i=o-1;for(e=e===t?o:e;++r<e;){var u=Gr(r,i),a=n[u];n[u]=n[r],n[r]=a}return n.length=e,n}var Bi=function(n){var e=Lu(n,(function(n){return 500===t.size&&t.clear(),n})),t=e.cache;return e}((function(n){var e=[];return 46===n.charCodeAt(0)&&e.push(""),n.replace(tn,(function(n,t,r,o){e.push(r?o.replace(hn,"$1"):t||n)})),e}));function Ri(n){if("string"==typeof n||la(n))return n;var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function Di(n){if(null!=n){try{return Tn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Ut)return n.clone();var e=new Xt(n.__wrapped__,n.__chain__);return e.__actions__=jo(n.__actions__),e.__index__=n.__index__,e.__values__=n.__values__,e}var Hi=Kr((function(n,e){return $u(n)?dr(n,mr(e,1,$u,!0)):[]})),Yi=Kr((function(n,e){var r=Ki(e);return $u(r)&&(r=t),$u(n)?dr(n,mr(e,1,$u,!0),si(r,2)):[]})),Zi=Kr((function(n,e){var r=Ki(e);return $u(r)&&(r=t),$u(n)?dr(n,mr(e,1,$u,!0),t,r):[]}));function Xi(n,e,t){var r=null==n?0:n.length;if(!r)return-1;var o=null==t?0:pa(t);return o<0&&(o=xt(r+o,0)),Ye(n,si(e,3),o)}function Ui(n,e,r){var o=null==n?0:n.length;if(!o)return-1;var i=o-1;return r!==t&&(i=pa(r),i=r<0?xt(o+i,0):wt(i,o-1)),Ye(n,si(e,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Wi(n){return n&&n.length?n[0]:t}var $i=Kr((function(n){var e=Le(n,xo);return e.length&&e[0]===n[0]?Pr(e):[]})),Gi=Kr((function(n){var e=Ki(n),r=Le(n,xo);return e===Ki(r)?e=t:r.pop(),r.length&&r[0]===n[0]?Pr(r,si(e,2)):[]})),qi=Kr((function(n){var e=Ki(n),r=Le(n,xo);return(e="function"==typeof e?e:t)&&r.pop(),r.length&&r[0]===n[0]?Pr(r,t,e):[]}));function Ki(n){var e=null==n?0:n.length;return e?n[e-1]:t}var Qi=Kr(Ji);function Ji(n,e){return n&&n.length&&e&&e.length?Wr(n,e):n}var nu=oi((function(n,e){var t=null==n?0:n.length,r=ar(n,e);return $r(n,Le(e,(function(n){return wi(n,t)?+n:n})).sort(No)),r}));function eu(n){return null==n?n:St.call(n)}var tu=Kr((function(n){return fo(mr(n,1,$u,!0))})),ru=Kr((function(n){var e=Ki(n);return $u(e)&&(e=t),fo(mr(n,1,$u,!0),si(e,2))})),ou=Kr((function(n){var e=Ki(n);return e="function"==typeof e?e:t,fo(mr(n,1,$u,!0),t,e)}));function iu(n){if(!n||!n.length)return[];var e=0;return n=Ie(n,(function(n){if($u(n))return e=xt(n.length,e),!0})),Ke(e,(function(e){return Le(n,We(e))}))}function uu(n,e){if(!n||!n.length)return[];var r=iu(n);return null==e?r:Le(r,(function(n){return Me(e,t,n)}))}var au=Kr((function(n,e){return $u(n)?dr(n,e):[]})),cu=Kr((function(n){return yo(Ie(n,$u))})),lu=Kr((function(n){var e=Ki(n);return $u(e)&&(e=t),yo(Ie(n,$u),si(e,2))})),su=Kr((function(n){var e=Ki(n);return e="function"==typeof e?e:t,yo(Ie(n,$u),t,e)})),fu=Kr(iu);var du=Kr((function(n){var e=n.length,r=e>1?n[e-1]:t;return r="function"==typeof r?(n.pop(),r):t,uu(n,r)}));function hu(n){var e=Ht(n);return e.__chain__=!0,e}function vu(n,e){return e(n)}var pu=oi((function(n){var e=n.length,r=e?n[0]:0,o=this.__wrapped__,i=function(e){return ar(e,n)};return!(e>1||this.__actions__.length)&&o instanceof Ut&&wi(r)?((o=o.slice(r,+r+(e?1:0))).__actions__.push({func:vu,args:[i],thisArg:t}),new Xt(o,this.__chain__).thru((function(n){return e&&!n.length&&n.push(t),n}))):this.thru(i)}));var gu=Ao((function(n,e,t){Bn.call(n,t)?++n[t]:ur(n,t,1)}));var yu=Vo(Xi),mu=Vo(Ui);function xu(n,e){return(Uu(n)?Oe:hr)(n,si(e,3))}function wu(n,e){return(Uu(n)?Pe:vr)(n,si(e,3))}var bu=Ao((function(n,e,t){Bn.call(n,t)?n[t].push(e):ur(n,t,[e])}));var _u=Kr((function(n,e,t){var r=-1,o="function"==typeof e,i=Wu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Me(e,n,t):jr(n,e,t)})),i})),Eu=Ao((function(n,e,t){ur(n,t,e)}));function Su(n,e){return(Uu(n)?Le:Vr)(n,si(e,3))}var ku=Ao((function(n,e,t){n[t?0:1].push(e)}),(function(){return[[],[]]}));var Cu=Kr((function(n,e){if(null==n)return[];var t=e.length;return t>1&&bi(n,e[0],e[1])?e=[]:t>2&&bi(e[0],e[1],e[2])&&(e=[e[0]]),Ur(n,mr(e,1),[])})),Mu=he||function(){return pe.Date.now()};function Nu(n,e,r){return e=r?t:e,e=n&&null==e?n.length:e,Jo(n,s,t,t,t,t,e)}function Ou(n,e){var o;if("function"!=typeof e)throw new jn(r);return n=pa(n),function(){return--n>0&&(o=e.apply(this,arguments)),n<=1&&(e=t),o}}var Pu=Kr((function(n,e,t){var r=1;if(t.length){var o=st(t,li(Pu));r|=a}return Jo(n,r,e,t,o)})),ju=Kr((function(n,e,t){var r=3;if(t.length){var o=st(t,li(ju));r|=a}return Jo(e,r,n,t,o)}));function Iu(n,e,o){var i,u,a,c,l,s,f=0,d=!1,h=!1,v=!0;if("function"!=typeof n)throw new jn(r);function p(e){var r=i,o=u;return i=u=t,f=e,c=n.apply(o,r)}function g(n){var r=n-s;return s===t||r>=e||r<0||h&&n-f>=a}function y(){var n=Mu();if(g(n))return m(n);l=Ii(y,function(n){var t=e-(n-s);return h?wt(t,a-(n-f)):t}(n))}function m(n){return l=t,v&&i?p(n):(i=u=t,c)}function x(){var n=Mu(),r=g(n);if(i=arguments,u=this,s=n,r){if(l===t)return function(n){return f=n,l=Ii(y,e),d?p(n):c}(s);if(h)return So(l),l=Ii(y,e),p(s)}return l===t&&(l=Ii(y,e)),c}return e=ya(e)||0,ea(o)&&(d=!!o.leading,a=(h="maxWait"in o)?xt(ya(o.maxWait)||0,e):a,v="trailing"in o?!!o.trailing:v),x.cancel=function(){l!==t&&So(l),f=0,i=s=u=l=t},x.flush=function(){return l===t?c:m(Mu())},x}var Au=Kr((function(n,e){return fr(n,1,e)})),zu=Kr((function(n,e,t){return fr(n,ya(e)||0,t)}));function Lu(n,e){if("function"!=typeof n||null!=e&&"function"!=typeof e)throw new jn(r);var t=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=t.cache;if(i.has(o))return i.get(o);var u=n.apply(this,r);return t.cache=i.set(o,u)||i,u};return t.cache=new(Lu.Cache||$t),t}function Tu(n){if("function"!=typeof n)throw new jn(r);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}Lu.Cache=$t;var Bu=_o((function(n,e){var t=(e=1==e.length&&Uu(e[0])?Le(e[0],Je(si())):Le(mr(e,1),Je(si()))).length;return Kr((function(r){for(var o=-1,i=wt(r.length,t);++o<i;)r[o]=e[o].call(this,r[o]);return Me(n,this,r)}))})),Ru=Kr((function(n,e){var r=st(e,li(Ru));return Jo(n,a,t,e,r)})),Du=Kr((function(n,e){var r=st(e,li(Du));return Jo(n,c,t,e,r)})),Vu=oi((function(n,e){return Jo(n,f,t,t,t,e)}));function Hu(n,e){return n===e||n!=n&&e!=e}var Yu=$o(Mr),Zu=$o((function(n,e){return n>=e})),Xu=Ir(function(){return arguments}())?Ir:function(n){return ta(n)&&Bn.call(n,"callee")&&!qn.call(n,"callee")},Uu=an.isArray,Fu=be?Je(be):function(n){return ta(n)&&Cr(n)==A};function Wu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ta(n)&&Wu(n)}var Gu=we||yc,qu=_e?Je(_e):function(n){return ta(n)&&Cr(n)==w};function Ku(n){if(!ta(n))return!1;var e=Cr(n);return e==b||"[object DOMException]"==e||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qu(n){if(!ea(n))return!1;var e=Cr(n);return e==_||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ju(n){return"number"==typeof n&&n==pa(n)}function na(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=h}function ea(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)}function ta(n){return null!=n&&"object"==typeof n}var ra=Ee?Je(Ee):function(n){return ta(n)&&gi(n)==S};function oa(n){return"number"==typeof n||ta(n)&&Cr(n)==k}function ia(n){if(!ta(n)||Cr(n)!=C)return!1;var e=$n(n);if(null===e)return!0;var t=Bn.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&Tn.call(t)==Hn}var ua=Se?Je(Se):function(n){return ta(n)&&Cr(n)==N};var aa=ke?Je(ke):function(n){return ta(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Uu(n)&&ta(n)&&Cr(n)==P}function la(n){return"symbol"==typeof n||ta(n)&&Cr(n)==j}var sa=Ce?Je(Ce):function(n){return ta(n)&&na(n.length)&&!!ce[Cr(n)]};var fa=$o(Dr),da=$o((function(n,e){return n<=e}));function ha(n){if(!n)return[];if(Wu(n))return ca(n)?vt(n):jo(n);if(Jn&&n[Jn])return function(n){for(var e,t=[];!(e=n.next()).done;)t.push(e.value);return t}(n[Jn]());var e=gi(n);return(e==S?ct:e==O?ft:Ha)(n)}function va(n){return n?(n=ya(n))===d||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function pa(n){var e=va(n),t=e%1;return e==e?t?e-t:e:0}function ga(n){return n?cr(pa(n),0,p):0}function ya(n){if("number"==typeof n)return n;if(la(n))return v;if(ea(n)){var e="function"==typeof n.valueOf?n.valueOf():n;n=ea(e)?e+"":e}if("string"!=typeof n)return 0===n?n:+n;n=Qe(n);var t=yn.test(n);return t||xn.test(n)?de(n.slice(2),t?2:8):gn.test(n)?v:+n}function ma(n){return Io(n,Aa(n))}function xa(n){return null==n?"":so(n)}var wa=zo((function(n,e){if(ki(e)||Wu(e))Io(e,Ia(e),n);else for(var t in e)Bn.call(e,t)&&tr(n,t,e[t])})),ba=zo((function(n,e){Io(e,Aa(e),n)})),_a=zo((function(n,e,t,r){Io(e,Aa(e),n,r)})),Ea=zo((function(n,e,t,r){Io(e,Ia(e),n,r)})),Sa=oi(ar);var ka=Kr((function(n,e){n=Nn(n);var r=-1,o=e.length,i=o>2?e[2]:t;for(i&&bi(e[0],e[1],i)&&(o=1);++r<o;)for(var u=e[r],a=Aa(u),c=-1,l=a.length;++c<l;){var s=a[c],f=n[s];(f===t||Hu(f,zn[s])&&!Bn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(t,ei),Me(La,t,n)}));function Ma(n,e,r){var o=null==n?t:Sr(n,e);return o===t?r:o}function Na(n,e){return null!=n&&yi(n,e,Or)}var Oa=Zo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),n[e]=t}),ec(oc)),Pa=Zo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),Bn.call(n,e)?n[e].push(t):n[e]=[t]}),si),ja=Kr(jr);function Ia(n){return Wu(n)?Kt(n):Br(n)}function Aa(n){return Wu(n)?Kt(n,!0):Rr(n)}var za=zo((function(n,e,t){Zr(n,e,t)})),La=zo((function(n,e,t,r){Zr(n,e,t,r)})),Ta=oi((function(n,e){var t={};if(null==n)return t;var r=!1;e=Le(e,(function(e){return e=bo(e,n),r||(r=e.length>1),e})),Io(n,ui(n),t),r&&(t=lr(t,7,ti));for(var o=e.length;o--;)ho(t,e[o]);return t}));var Ba=oi((function(n,e){return null==n?{}:function(n,e){return Fr(n,e,(function(e,t){return Na(n,t)}))}(n,e)}));function Ra(n,e){if(null==n)return{};var t=Le(ui(n),(function(n){return[n]}));return e=si(e),Fr(n,t,(function(n,t){return e(n,t[0])}))}var Da=Qo(Ia),Va=Qo(Aa);function Ha(n){return null==n?[]:nt(n,Ia(n))}var Ya=Ro((function(n,e,t){return e=e.toLowerCase(),n+(t?Za(e):e)}));function Za(n){return Ka(xa(n).toLowerCase())}function Xa(n){return(n=xa(n))&&n.replace(bn,ot).replace(ee,"")}var Ua=Ro((function(n,e,t){return n+(t?"-":"")+e.toLowerCase()})),Fa=Ro((function(n,e,t){return n+(t?" ":"")+e.toLowerCase()})),Wa=Bo("toLowerCase");var $a=Ro((function(n,e,t){return n+(t?"_":"")+e.toLowerCase()}));var Ga=Ro((function(n,e,t){return n+(t?" ":"")+Ka(e)}));var qa=Ro((function(n,e,t){return n+(t?" ":"")+e.toUpperCase()})),Ka=Bo("toUpperCase");function Qa(n,e,r){return n=xa(n),(e=r?t:e)===t?function(n){return ie.test(n)}(n)?function(n){return n.match(re)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(e)||[]}var Ja=Kr((function(n,e){try{return Me(n,t,e)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,e){return Oe(e,(function(e){e=Ri(e),ur(n,e,Pu(n[e],n))})),n}));function ec(n){return function(){return n}}var tc=Ho(),rc=Ho(!0);function oc(n){return n}function ic(n){return Tr("function"==typeof n?n:lr(n,1))}var uc=Kr((function(n,e){return function(t){return jr(t,n,e)}})),ac=Kr((function(n,e){return function(t){return jr(n,t,e)}}));function cc(n,e,t){var r=Ia(e),o=Er(e,r);null!=t||ea(e)&&(o.length||!r.length)||(t=e,e=n,n=this,o=Er(e,Ia(e)));var i=!(ea(t)&&"chain"in t&&!t.chain),u=Qu(n);return Oe(o,(function(t){var r=e[t];n[t]=r,u&&(n.prototype[t]=function(){var e=this.__chain__;if(i||e){var t=n(this.__wrapped__);return(t.__actions__=jo(this.__actions__)).push({func:r,args:arguments,thisArg:n}),t.__chain__=e,t}return r.apply(n,Te([this.value()],arguments))})})),n}function lc(){}var sc=Uo(Le),fc=Uo(je),dc=Uo(De);function hc(n){return _i(n)?We(Ri(n)):function(n){return function(e){return Sr(e,n)}}(n)}var vc=Wo(),pc=Wo(!0);function gc(){return[]}function yc(){return!1}var mc=Xo((function(n,e){return n+e}),0),xc=qo("ceil"),wc=Xo((function(n,e){return n/e}),1),bc=qo("floor");var _c,Ec=Xo((function(n,e){return n*e}),1),Sc=qo("round"),kc=Xo((function(n,e){return n-e}),0);return Ht.after=function(n,e){if("function"!=typeof e)throw new jn(r);return n=pa(n),function(){if(--n<1)return e.apply(this,arguments)}},Ht.ary=Nu,Ht.assign=wa,Ht.assignIn=ba,Ht.assignInWith=_a,Ht.assignWith=Ea,Ht.at=Sa,Ht.before=Ou,Ht.bind=Pu,Ht.bindAll=nc,Ht.bindKey=ju,Ht.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Uu(n)?n:[n]},Ht.chain=hu,Ht.chunk=function(n,e,r){e=(r?bi(n,e,r):e===t)?1:xt(pa(e),0);var o=null==n?0:n.length;if(!o||e<1)return[];for(var i=0,u=0,a=an(ge(o/e));i<o;)a[u++]=oo(n,i,i+=e);return a},Ht.compact=function(n){for(var e=-1,t=null==n?0:n.length,r=0,o=[];++e<t;){var i=n[e];i&&(o[r++]=i)}return o},Ht.concat=function(){var n=arguments.length;if(!n)return[];for(var e=an(n-1),t=arguments[0],r=n;r--;)e[r-1]=arguments[r];return Te(Uu(t)?jo(t):[t],mr(e,1))},Ht.cond=function(n){var e=null==n?0:n.length,t=si();return n=e?Le(n,(function(n){if("function"!=typeof n[1])throw new jn(r);return[t(n[0]),n[1]]})):[],Kr((function(t){for(var r=-1;++r<e;){var o=n[r];if(Me(o[0],this,t))return Me(o[1],this,t)}}))},Ht.conforms=function(n){return function(n){var e=Ia(n);return function(t){return sr(t,n,e)}}(lr(n,1))},Ht.constant=ec,Ht.countBy=gu,Ht.create=function(n,e){var t=Yt(n);return null==e?t:ir(t,e)},Ht.curry=function n(e,r,o){var i=Jo(e,8,t,t,t,t,t,r=o?t:r);return i.placeholder=n.placeholder,i},Ht.curryRight=function n(e,r,o){var i=Jo(e,u,t,t,t,t,t,r=o?t:r);return i.placeholder=n.placeholder,i},Ht.debounce=Iu,Ht.defaults=ka,Ht.defaultsDeep=Ca,Ht.defer=Au,Ht.delay=zu,Ht.difference=Hi,Ht.differenceBy=Yi,Ht.differenceWith=Zi,Ht.drop=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,(e=r||e===t?1:pa(e))<0?0:e,o):[]},Ht.dropRight=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,0,(e=o-(e=r||e===t?1:pa(e)))<0?0:e):[]},Ht.dropRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0,!0):[]},Ht.dropWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0):[]},Ht.fill=function(n,e,r,o){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&bi(n,e,r)&&(r=0,o=i),function(n,e,r,o){var i=n.length;for((r=pa(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:pa(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)n[r++]=e;return n}(n,e,r,o)):[]},Ht.filter=function(n,e){return(Uu(n)?Ie:yr)(n,si(e,3))},Ht.flatMap=function(n,e){return mr(Su(n,e),1)},Ht.flatMapDeep=function(n,e){return mr(Su(n,e),d)},Ht.flatMapDepth=function(n,e,r){return r=r===t?1:pa(r),mr(Su(n,e),r)},Ht.flatten=Fi,Ht.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,d):[]},Ht.flattenDepth=function(n,e){return(null==n?0:n.length)?mr(n,e=e===t?1:pa(e)):[]},Ht.flip=function(n){return Jo(n,512)},Ht.flow=tc,Ht.flowRight=rc,Ht.fromPairs=function(n){for(var e=-1,t=null==n?0:n.length,r={};++e<t;){var o=n[e];r[o[0]]=o[1]}return r},Ht.functions=function(n){return null==n?[]:Er(n,Ia(n))},Ht.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},Ht.groupBy=bu,Ht.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},Ht.intersection=$i,Ht.intersectionBy=Gi,Ht.intersectionWith=qi,Ht.invert=Oa,Ht.invertBy=Pa,Ht.invokeMap=_u,Ht.iteratee=ic,Ht.keyBy=Eu,Ht.keys=Ia,Ht.keysIn=Aa,Ht.map=Su,Ht.mapKeys=function(n,e){var t={};return e=si(e,3),br(n,(function(n,r,o){ur(t,e(n,r,o),n)})),t},Ht.mapValues=function(n,e){var t={};return e=si(e,3),br(n,(function(n,r,o){ur(t,r,e(n,r,o))})),t},Ht.matches=function(n){return Hr(lr(n,1))},Ht.matchesProperty=function(n,e){return Yr(n,lr(e,1))},Ht.memoize=Lu,Ht.merge=za,Ht.mergeWith=La,Ht.method=uc,Ht.methodOf=ac,Ht.mixin=cc,Ht.negate=Tu,Ht.nthArg=function(n){return n=pa(n),Kr((function(e){return Xr(e,n)}))},Ht.omit=Ta,Ht.omitBy=function(n,e){return Ra(n,Tu(si(e)))},Ht.once=function(n){return Ou(2,n)},Ht.orderBy=function(n,e,r,o){return null==n?[]:(Uu(e)||(e=null==e?[]:[e]),Uu(r=o?t:r)||(r=null==r?[]:[r]),Ur(n,e,r))},Ht.over=sc,Ht.overArgs=Bu,Ht.overEvery=fc,Ht.overSome=dc,Ht.partial=Ru,Ht.partialRight=Du,Ht.partition=ku,Ht.pick=Ba,Ht.pickBy=Ra,Ht.property=hc,Ht.propertyOf=function(n){return function(e){return null==n?t:Sr(n,e)}},Ht.pull=Qi,Ht.pullAll=Ji,Ht.pullAllBy=function(n,e,t){return n&&n.length&&e&&e.length?Wr(n,e,si(t,2)):n},Ht.pullAllWith=function(n,e,r){return n&&n.length&&e&&e.length?Wr(n,e,t,r):n},Ht.pullAt=nu,Ht.range=vc,Ht.rangeRight=pc,Ht.rearg=Vu,Ht.reject=function(n,e){return(Uu(n)?Ie:yr)(n,Tu(si(e,3)))},Ht.remove=function(n,e){var t=[];if(!n||!n.length)return t;var r=-1,o=[],i=n.length;for(e=si(e,3);++r<i;){var u=n[r];e(u,r,n)&&(t.push(u),o.push(r))}return $r(n,o),t},Ht.rest=function(n,e){if("function"!=typeof n)throw new jn(r);return Kr(n,e=e===t?e:pa(e))},Ht.reverse=eu,Ht.sampleSize=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),(Uu(n)?Jt:Jr)(n,e)},Ht.set=function(n,e,t){return null==n?n:no(n,e,t)},Ht.setWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:no(n,e,r,o)},Ht.shuffle=function(n){return(Uu(n)?nr:ro)(n)},Ht.slice=function(n,e,r){var o=null==n?0:n.length;return o?(r&&"number"!=typeof r&&bi(n,e,r)?(e=0,r=o):(e=null==e?0:pa(e),r=r===t?o:pa(r)),oo(n,e,r)):[]},Ht.sortBy=Cu,Ht.sortedUniq=function(n){return n&&n.length?co(n):[]},Ht.sortedUniqBy=function(n,e){return n&&n.length?co(n,si(e,2)):[]},Ht.split=function(n,e,r){return r&&"number"!=typeof r&&bi(n,e,r)&&(e=r=t),(r=r===t?p:r>>>0)?(n=xa(n))&&("string"==typeof e||null!=e&&!ua(e))&&!(e=so(e))&&at(n)?Eo(vt(n),0,r):n.split(e,r):[]},Ht.spread=function(n,e){if("function"!=typeof n)throw new jn(r);return e=null==e?0:xt(pa(e),0),Kr((function(t){var r=t[e],o=Eo(t,0,e);return r&&Te(o,r),Me(n,this,o)}))},Ht.tail=function(n){var e=null==n?0:n.length;return e?oo(n,1,e):[]},Ht.take=function(n,e,r){return n&&n.length?oo(n,0,(e=r||e===t?1:pa(e))<0?0:e):[]},Ht.takeRight=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,(e=o-(e=r||e===t?1:pa(e)))<0?0:e,o):[]},Ht.takeRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!1,!0):[]},Ht.takeWhile=function(n,e){return n&&n.length?po(n,si(e,3)):[]},Ht.tap=function(n,e){return e(n),n},Ht.throttle=function(n,e,t){var o=!0,i=!0;if("function"!=typeof n)throw new jn(r);return ea(t)&&(o="leading"in t?!!t.leading:o,i="trailing"in t?!!t.trailing:i),Iu(n,e,{leading:o,maxWait:e,trailing:i})},Ht.thru=vu,Ht.toArray=ha,Ht.toPairs=Da,Ht.toPairsIn=Va,Ht.toPath=function(n){return Uu(n)?Le(n,Ri):la(n)?[n]:jo(Bi(xa(n)))},Ht.toPlainObject=ma,Ht.transform=function(n,e,t){var r=Uu(n),o=r||Gu(n)||sa(n);if(e=si(e,4),null==t){var i=n&&n.constructor;t=o?r?new i:[]:ea(n)&&Qu(i)?Yt($n(n)):{}}return(o?Oe:br)(n,(function(n,r,o){return e(t,n,r,o)})),t},Ht.unary=function(n){return Nu(n,1)},Ht.union=tu,Ht.unionBy=ru,Ht.unionWith=ou,Ht.uniq=function(n){return n&&n.length?fo(n):[]},Ht.uniqBy=function(n,e){return n&&n.length?fo(n,si(e,2)):[]},Ht.uniqWith=function(n,e){return e="function"==typeof e?e:t,n&&n.length?fo(n,t,e):[]},Ht.unset=function(n,e){return null==n||ho(n,e)},Ht.unzip=iu,Ht.unzipWith=uu,Ht.update=function(n,e,t){return null==n?n:vo(n,e,wo(t))},Ht.updateWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:vo(n,e,wo(r),o)},Ht.values=Ha,Ht.valuesIn=function(n){return null==n?[]:nt(n,Aa(n))},Ht.without=au,Ht.words=Qa,Ht.wrap=function(n,e){return Ru(wo(e),n)},Ht.xor=cu,Ht.xorBy=lu,Ht.xorWith=su,Ht.zip=fu,Ht.zipObject=function(n,e){return mo(n||[],e||[],tr)},Ht.zipObjectDeep=function(n,e){return mo(n||[],e||[],no)},Ht.zipWith=du,Ht.entries=Da,Ht.entriesIn=Va,Ht.extend=ba,Ht.extendWith=_a,cc(Ht,Ht),Ht.add=mc,Ht.attempt=Ja,Ht.camelCase=Ya,Ht.capitalize=Za,Ht.ceil=xc,Ht.clamp=function(n,e,r){return r===t&&(r=e,e=t),r!==t&&(r=(r=ya(r))==r?r:0),e!==t&&(e=(e=ya(e))==e?e:0),cr(ya(n),e,r)},Ht.clone=function(n){return lr(n,4)},Ht.cloneDeep=function(n){return lr(n,5)},Ht.cloneDeepWith=function(n,e){return lr(n,5,e="function"==typeof e?e:t)},Ht.cloneWith=function(n,e){return lr(n,4,e="function"==typeof e?e:t)},Ht.conformsTo=function(n,e){return null==e||sr(n,e,Ia(e))},Ht.deburr=Xa,Ht.defaultTo=function(n,e){return null==n||n!=n?e:n},Ht.divide=wc,Ht.endsWith=function(n,e,r){n=xa(n),e=so(e);var o=n.length,i=r=r===t?o:cr(pa(r),0,o);return(r-=e.length)>=0&&n.slice(r,i)==e},Ht.eq=Hu,Ht.escape=function(n){return(n=xa(n))&&q.test(n)?n.replace($,it):n},Ht.escapeRegExp=function(n){return(n=xa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},Ht.every=function(n,e,r){var o=Uu(n)?je:pr;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.find=yu,Ht.findIndex=Xi,Ht.findKey=function(n,e){return He(n,si(e,3),br)},Ht.findLast=mu,Ht.findLastIndex=Ui,Ht.findLastKey=function(n,e){return He(n,si(e,3),_r)},Ht.floor=bc,Ht.forEach=xu,Ht.forEachRight=wu,Ht.forIn=function(n,e){return null==n?n:xr(n,si(e,3),Aa)},Ht.forInRight=function(n,e){return null==n?n:wr(n,si(e,3),Aa)},Ht.forOwn=function(n,e){return n&&br(n,si(e,3))},Ht.forOwnRight=function(n,e){return n&&_r(n,si(e,3))},Ht.get=Ma,Ht.gt=Yu,Ht.gte=Zu,Ht.has=function(n,e){return null!=n&&yi(n,e,Nr)},Ht.hasIn=Na,Ht.head=Wi,Ht.identity=oc,Ht.includes=function(n,e,t,r){n=Wu(n)?n:Ha(n),t=t&&!r?pa(t):0;var o=n.length;return t<0&&(t=xt(o+t,0)),ca(n)?t<=o&&n.indexOf(e,t)>-1:!!o&&Ze(n,e,t)>-1},Ht.indexOf=function(n,e,t){var r=null==n?0:n.length;if(!r)return-1;var o=null==t?0:pa(t);return o<0&&(o=xt(r+o,0)),Ze(n,e,o)},Ht.inRange=function(n,e,r){return e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t){return n>=wt(e,t)&&n<xt(e,t)}(n=ya(n),e,r)},Ht.invoke=ja,Ht.isArguments=Xu,Ht.isArray=Uu,Ht.isArrayBuffer=Fu,Ht.isArrayLike=Wu,Ht.isArrayLikeObject=$u,Ht.isBoolean=function(n){return!0===n||!1===n||ta(n)&&Cr(n)==x},Ht.isBuffer=Gu,Ht.isDate=qu,Ht.isElement=function(n){return ta(n)&&1===n.nodeType&&!ia(n)},Ht.isEmpty=function(n){if(null==n)return!0;if(Wu(n)&&(Uu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Xu(n)))return!n.length;var e=gi(n);if(e==S||e==O)return!n.size;if(ki(n))return!Br(n).length;for(var t in n)if(Bn.call(n,t))return!1;return!0},Ht.isEqual=function(n,e){return Ar(n,e)},Ht.isEqualWith=function(n,e,r){var o=(r="function"==typeof r?r:t)?r(n,e):t;return o===t?Ar(n,e,t,r):!!o},Ht.isError=Ku,Ht.isFinite=function(n){return"number"==typeof n&&Ve(n)},Ht.isFunction=Qu,Ht.isInteger=Ju,Ht.isLength=na,Ht.isMap=ra,Ht.isMatch=function(n,e){return n===e||zr(n,e,di(e))},Ht.isMatchWith=function(n,e,r){return r="function"==typeof r?r:t,zr(n,e,di(e),r)},Ht.isNaN=function(n){return oa(n)&&n!=+n},Ht.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},Ht.isNil=function(n){return null==n},Ht.isNull=function(n){return null===n},Ht.isNumber=oa,Ht.isObject=ea,Ht.isObjectLike=ta,Ht.isPlainObject=ia,Ht.isRegExp=ua,Ht.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=h},Ht.isSet=aa,Ht.isString=ca,Ht.isSymbol=la,Ht.isTypedArray=sa,Ht.isUndefined=function(n){return n===t},Ht.isWeakMap=function(n){return ta(n)&&gi(n)==I},Ht.isWeakSet=function(n){return ta(n)&&"[object WeakSet]"==Cr(n)},Ht.join=function(n,e){return null==n?"":$e.call(n,e)},Ht.kebabCase=Ua,Ht.last=Ki,Ht.lastIndexOf=function(n,e,r){var o=null==n?0:n.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=pa(r))<0?xt(o+i,0):wt(i,o-1)),e==e?function(n,e,t){for(var r=t+1;r--;)if(n[r]===e)return r;return r}(n,e,i):Ye(n,Ue,i,!0)},Ht.lowerCase=Fa,Ht.lowerFirst=Wa,Ht.lt=fa,Ht.lte=da,Ht.max=function(n){return n&&n.length?gr(n,oc,Mr):t},Ht.maxBy=function(n,e){return n&&n.length?gr(n,si(e,2),Mr):t},Ht.mean=function(n){return Fe(n,oc)},Ht.meanBy=function(n,e){return Fe(n,si(e,2))},Ht.min=function(n){return n&&n.length?gr(n,oc,Dr):t},Ht.minBy=function(n,e){return n&&n.length?gr(n,si(e,2),Dr):t},Ht.stubArray=gc,Ht.stubFalse=yc,Ht.stubObject=function(){return{}},Ht.stubString=function(){return""},Ht.stubTrue=function(){return!0},Ht.multiply=Ec,Ht.nth=function(n,e){return n&&n.length?Xr(n,pa(e)):t},Ht.noConflict=function(){return pe._===this&&(pe._=Yn),this},Ht.noop=lc,Ht.now=Mu,Ht.pad=function(n,e,t){n=xa(n);var r=(e=pa(e))?ht(n):0;if(!e||r>=e)return n;var o=(e-r)/2;return Fo(ye(o),t)+n+Fo(ge(o),t)},Ht.padEnd=function(n,e,t){n=xa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?n+Fo(e-r,t):n},Ht.padStart=function(n,e,t){n=xa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?Fo(e-r,t)+n:n},Ht.parseInt=function(n,e,t){return t||null==e?e=0:e&&(e=+e),_t(xa(n).replace(un,""),e||0)},Ht.random=function(n,e,r){if(r&&"boolean"!=typeof r&&bi(n,e,r)&&(e=r=t),r===t&&("boolean"==typeof e?(r=e,e=t):"boolean"==typeof n&&(r=n,n=t)),n===t&&e===t?(n=0,e=1):(n=va(n),e===t?(e=n,n=0):e=va(e)),n>e){var o=n;n=e,e=o}if(r||n%1||e%1){var i=Et();return wt(n+i*(e-n+fe("1e-"+((i+"").length-1))),e)}return Gr(n,e)},Ht.reduce=function(n,e,t){var r=Uu(n)?Be:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,hr)},Ht.reduceRight=function(n,e,t){var r=Uu(n)?Re:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,vr)},Ht.repeat=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),qr(xa(n),e)},Ht.replace=function(){var n=arguments,e=xa(n[0]);return n.length<3?e:e.replace(n[1],n[2])},Ht.result=function(n,e,r){var o=-1,i=(e=bo(e,n)).length;for(i||(i=1,n=t);++o<i;){var u=null==n?t:n[Ri(e[o])];u===t&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},Ht.round=Sc,Ht.runInContext=n,Ht.sample=function(n){return(Uu(n)?Qt:Qr)(n)},Ht.size=function(n){if(null==n)return 0;if(Wu(n))return ca(n)?ht(n):n.length;var e=gi(n);return e==S||e==O?n.size:Br(n).length},Ht.snakeCase=$a,Ht.some=function(n,e,r){var o=Uu(n)?De:io;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.sortedIndex=function(n,e){return uo(n,e)},Ht.sortedIndexBy=function(n,e,t){return ao(n,e,si(t,2))},Ht.sortedIndexOf=function(n,e){var t=null==n?0:n.length;if(t){var r=uo(n,e);if(r<t&&Hu(n[r],e))return r}return-1},Ht.sortedLastIndex=function(n,e){return uo(n,e,!0)},Ht.sortedLastIndexBy=function(n,e,t){return ao(n,e,si(t,2),!0)},Ht.sortedLastIndexOf=function(n,e){if(null==n?0:n.length){var t=uo(n,e,!0)-1;if(Hu(n[t],e))return t}return-1},Ht.startCase=Ga,Ht.startsWith=function(n,e,t){return n=xa(n),t=null==t?0:cr(pa(t),0,n.length),e=so(e),n.slice(t,t+e.length)==e},Ht.subtract=kc,Ht.sum=function(n){return n&&n.length?qe(n,oc):0},Ht.sumBy=function(n,e){return n&&n.length?qe(n,si(e,2)):0},Ht.template=function(n,e,r){var o=Ht.templateSettings;r&&bi(n,e,r)&&(e=t),n=xa(n),e=_a({},e,o,ni);var i,u,a=_a({},e.imports,o.imports,ni),c=Ia(a),l=nt(a,c),s=0,f=e.interpolate||_n,d="__p += '",h=On((e.escape||_n).source+"|"+f.source+"|"+(f===J?vn:_n).source+"|"+(e.evaluate||_n).source+"|$","g"),v="//# sourceURL="+(Bn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ae+"]")+"\n";n.replace(h,(function(e,t,r,o,a,c){return r||(r=o),d+=n.slice(s,c).replace(En,ut),t&&(i=!0,d+="' +\n__e("+t+") +\n'"),a&&(u=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+e.length,e})),d+="';\n";var p=Bn.call(e,"variable")&&e.variable;if(p){if(dn.test(p))throw new kn("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(u?d.replace(X,""):d).replace(U,"$1").replace(F,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Cn(c,v+"return "+d).apply(t,l)}));if(g.source=d,Ku(g))throw g;return g},Ht.times=function(n,e){if((n=pa(n))<1||n>h)return[];var t=p,r=wt(n,p);e=si(e),n-=p;for(var o=Ke(r,e);++t<n;)e(t);return o},Ht.toFinite=va,Ht.toInteger=pa,Ht.toLength=ga,Ht.toLower=function(n){return xa(n).toLowerCase()},Ht.toNumber=ya,Ht.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,h):0===n?n:0},Ht.toString=xa,Ht.toUpper=function(n){return xa(n).toUpperCase()},Ht.trim=function(n,e,r){if((n=xa(n))&&(r||e===t))return Qe(n);if(!n||!(e=so(e)))return n;var o=vt(n),i=vt(e);return Eo(o,tt(o,i),rt(o,i)+1).join("")},Ht.trimEnd=function(n,e,r){if((n=xa(n))&&(r||e===t))return n.slice(0,pt(n)+1);if(!n||!(e=so(e)))return n;var o=vt(n);return Eo(o,0,rt(o,vt(e))+1).join("")},Ht.trimStart=function(n,e,r){if((n=xa(n))&&(r||e===t))return n.replace(un,"");if(!n||!(e=so(e)))return n;var o=vt(n);return Eo(o,tt(o,vt(e))).join("")},Ht.truncate=function(n,e){var r=30,o="...";if(ea(e)){var i="separator"in e?e.separator:i;r="length"in e?pa(e.length):r,o="omission"in e?so(e.omission):o}var u=(n=xa(n)).length;if(at(n)){var a=vt(n);u=a.length}if(r>=u)return n;var c=r-ht(o);if(c<1)return o;var l=a?Eo(a,0,c).join(""):n.slice(0,c);if(i===t)return l+o;if(a&&(c+=l.length-c),ua(i)){if(n.slice(c).search(i)){var s,f=l;for(i.global||(i=On(i.source,xa(pn.exec(i))+"g")),i.lastIndex=0;s=i.exec(f);)var d=s.index;l=l.slice(0,d===t?c:d)}}else if(n.indexOf(so(i),c)!=c){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},Ht.unescape=function(n){return(n=xa(n))&&G.test(n)?n.replace(W,gt):n},Ht.uniqueId=function(n){var e=++Rn;return xa(n)+e},Ht.upperCase=qa,Ht.upperFirst=Ka,Ht.each=xu,Ht.eachRight=wu,Ht.first=Wi,cc(Ht,(_c={},br(Ht,(function(n,e){Bn.call(Ht.prototype,e)||(_c[e]=n)})),_c),{chain:!1}),Ht.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Ht[n].placeholder=Ht})),Oe(["drop","take"],(function(n,e){Ut.prototype[n]=function(r){r=r===t?1:xt(pa(r),0);var o=this.__filtered__&&!e?new Ut(this):this.clone();return o.__filtered__?o.__takeCount__=wt(r,o.__takeCount__):o.__views__.push({size:wt(r,p),type:n+(o.__dir__<0?"Right":"")}),o},Ut.prototype[n+"Right"]=function(e){return this.reverse()[n](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(n,e){var t=e+1,r=1==t||3==t;Ut.prototype[n]=function(n){var e=this.clone();return e.__iteratees__.push({iteratee:si(n,3),type:t}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(n,e){var t="take"+(e?"Right":"");Ut.prototype[n]=function(){return this[t](1).value()[0]}})),Oe(["initial","tail"],(function(n,e){var t="drop"+(e?"":"Right");Ut.prototype[n]=function(){return this.__filtered__?new Ut(this):this[t](1)}})),Ut.prototype.compact=function(){return this.filter(oc)},Ut.prototype.find=function(n){return this.filter(n).head()},Ut.prototype.findLast=function(n){return this.reverse().find(n)},Ut.prototype.invokeMap=Kr((function(n,e){return"function"==typeof n?new Ut(this):this.map((function(t){return jr(t,n,e)}))})),Ut.prototype.reject=function(n){return this.filter(Tu(si(n)))},Ut.prototype.slice=function(n,e){n=pa(n);var r=this;return r.__filtered__&&(n>0||e<0)?new Ut(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==t&&(r=(e=pa(e))<0?r.dropRight(-e):r.take(e-n)),r)},Ut.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ut.prototype.toArray=function(){return this.take(p)},br(Ut.prototype,(function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=Ht[o?"take"+("last"==e?"Right":""):e],u=o||/^find/.test(e);i&&(Ht.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,c=e instanceof Ut,l=a[0],s=c||Uu(e),f=function(n){var e=i.apply(Ht,Te([n],a));return o&&d?e[0]:e};s&&r&&"function"==typeof l&&1!=l.length&&(c=s=!1);var d=this.__chain__,h=!!this.__actions__.length,v=u&&!d,p=c&&!h;if(!u&&s){e=p?e:new Ut(this);var g=n.apply(e,a);return g.__actions__.push({func:vu,args:[f],thisArg:t}),new Xt(g,d)}return v&&p?n.apply(this,a):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(n){var e=In[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);Ht.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Uu(o)?o:[],n)}return this[t]((function(t){return e.apply(Uu(t)?t:[],n)}))}})),br(Ut.prototype,(function(n,e){var t=Ht[e];if(t){var r=t.name+"";Bn.call(It,r)||(It[r]=[]),It[r].push({name:e,func:t})}})),It[Yo(t,2).name]=[{name:"wrapper",func:t}],Ut.prototype.clone=function(){var n=new Ut(this.__wrapped__);return n.__actions__=jo(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=jo(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=jo(this.__views__),n},Ut.prototype.reverse=function(){if(this.__filtered__){var n=new Ut(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ut.prototype.value=function(){var n=this.__wrapped__.value(),e=this.__dir__,t=Uu(n),r=e<0,o=t?n.length:0,i=function(n,e,t){var r=-1,o=t.length;for(;++r<o;){var i=t[r],u=i.size;switch(i.type){case"drop":n+=u;break;case"dropRight":e-=u;break;case"take":e=wt(e,n+u);break;case"takeRight":n=xt(n,e-u)}}return{start:n,end:e}}(0,o,this.__views__),u=i.start,a=i.end,c=a-u,l=r?a:u-1,s=this.__iteratees__,f=s.length,d=0,h=wt(c,this.__takeCount__);if(!t||!r&&o==c&&h==c)return go(n,this.__actions__);var v=[];n:for(;c--&&d<h;){for(var p=-1,g=n[l+=e];++p<f;){var y=s[p],m=y.iteratee,x=y.type,w=m(g);if(2==x)g=w;else if(!w){if(1==x)continue n;break n}}v[d++]=g}return v},Ht.prototype.at=pu,Ht.prototype.chain=function(){return hu(this)},Ht.prototype.commit=function(){return new Xt(this.value(),this.__chain__)},Ht.prototype.next=function(){this.__values__===t&&(this.__values__=ha(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?t:this.__values__[this.__index__++]}},Ht.prototype.plant=function(n){for(var e,r=this;r instanceof Zt;){var o=Vi(r);o.__index__=0,o.__values__=t,e?i.__wrapped__=o:e=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,e},Ht.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ut){var e=n;return this.__actions__.length&&(e=new Ut(this)),(e=e.reverse()).__actions__.push({func:vu,args:[eu],thisArg:t}),new Xt(e,this.__chain__)}return this.thru(eu)},Ht.prototype.toJSON=Ht.prototype.valueOf=Ht.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Ht.prototype.first=Ht.prototype.head,Jn&&(Ht.prototype[Jn]=function(){return this}),Ht}();ye?((ye.exports=yt)._=yt,ge._=yt):pe._=yt}).call(l)}(D_,D_.exports);var V_=s(D_.exports);function H_(n){var e=n.layoutTypes,r=n.layoutConfig,o=void 0===r?T_:r,i=n.edges,u=n.nodeOrigin,a=n.nodes,c=n.container,l=e[null==o?void 0:o.type]||R_[null==o?void 0:o.type];return function(n){return n.every((function(n){var e,t;return(null===(e=n.measured)||void 0===e?void 0:e.width)&&(null===(t=n.measured)||void 0===t?void 0:t.height)}))}(a)&&l?function(n){var e=n.layoutConfig,r=void 0===e?T_:e,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=n.layoutFn,l=V_.cloneDeep(u);l.forEach((function(n){n.data&&(n.data.width=n.measured.width,n.data.height=n.measured.height)}));var s=c(l,o,t({nodeOrigin:i,width:a.width,height:a.height},null==r?void 0:r.options)),f=s.nodes,d=s.edges;return{nodes:f,edges:d,layoutComplete:!0}}({layoutConfig:o,container:c,nodeOrigin:u,nodes:a,layoutFn:l,edges:i}):{nodes:a,edges:i,layoutComplete:!1}}function Y_(n){var e=n.centerConfig,t=n.width,r=n.height,o=n.transform,i=n.panZoom,u=n.nodeOrigin,a=n.nodes;if(e&&i){var c=a.find((function(n){return n.id===e.centerNodeId}));return c?(function(n){var e=n.node,t=n.height,r=n.width,o=n.zoom,i=void 0===o?1:o,u=n.panZoom,a=n.nodeOrigin,c=dw(e),l=uw(e,a).positionAbsolute,s={x:r/2-(l.x+c.width/2)*i,y:t/2-(l.y+c.height/2)*i};u.setViewport({x:s.x,y:s.y,zoom:i})}({node:c,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0):(e.centerByBBox&&function(n){var e=n.nodes,t=n.nodeOrigin,r=n.height,o=n.width,i=n.zoom,u=void 0===i?1:i,a=n.panZoom,c=qw(e,{nodeOrigin:t}),l={x:o/2-(c.x+c.width/2)*u,y:r/2-(c.y+c.height/2)*u};a.setViewport({x:l.x,y:l.y,zoom:u})}({nodes:a,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var Z_=function(n){var e,r,o=n.nodes,i=n.edges,l=n.defaultNodes,s=n.defaultEdges,f=n.width,d=n.height,h=n.fitView;return e=function(n,e){return t(t({},B_({nodes:o,edges:i,width:f,height:d,fitView:h,defaultNodes:l,defaultEdges:s})),{setNodes:function(e){n({nodes:e})},setEdges:function(e){n({edges:e})},setDefaultNodesAndEdges:function(t,r){t&&((0,e().onNodesChange)({changes:[],userNodes:t}),n({hasDefaultNodes:!0})),r&&((0,e().onEdgesChange)({userEdges:r}),n({hasDefaultEdges:!0}))},updateNodeInternals:function(r){var o=e(),i=o.triggerNodeChanges,u=o.nodeLookup,l=o.parentLookup,s=o.domNode,f=o.nodeOrigin,d=o.debug,h=function(n,e,r,o,i){var u=null==o?void 0:o.querySelector(".xyflow__viewport"),l=!1;if(!u)return{changes:[],updatedInternals:l};var s=[],f=window.getComputedStyle(u),d=new window.DOMMatrixReadOnly(f.transform).m22,h=[];if(n.forEach((function(n){var r=e.get(n.id);if(null==r?void 0:r.hidden)e.set(r.id,t(t({},r),{internals:t(t({},r.internals),{handleBounds:void 0})})),l=!0;else if(r){var o=Nw(n.nodeElement),u=r.measured.width!==o.width||r.measured.height!==o.height;if(o.width&&o.height&&(u||!r.internals.handleBounds||n.force)){var a=t(t({},r),{measured:o,internals:t(t({},r.internals),{handleBounds:{source:Aw(".source",n.nodeElement,d,r.origin||i),target:Aw(".target",n.nodeElement,d,r.origin||i)}})});e.set(r.id,a),l=!0,u&&(s.push({id:a.id,type:"dimensions",dimensions:o}),a.expandParent&&a.parentId&&h.push({id:a.id,parentId:a.parentId,rect:gw(a,a.origin||i)}))}}})),h.length>0){var v=lw(h,e,r,i);s.push.apply(s,c([],a(v),!1))}return{changes:s,updatedInternals:l}}(r,u,l,s,f),v=h.changes;if(h.updatedInternals){var p=V_.cloneDeep(u);n({nodeLookup:p}),ow(u,{nodeOrigin:f}),(null==v?void 0:v.length)>0&&(d&&console.log("Ink Flow: trigger node changes",v),null==i||i(v))}},updateNodePositions:function(n,r){var o,i;void 0===r&&(r=!1);var l=[],s=[];try{for(var f=u(n),d=f.next();!d.done;d=f.next()){var h=a(d.value,2),v=h[0],p=h[1],g={id:v,type:"position",position:p.position,dragging:r};(null==p?void 0:p.expandParent)&&(null==p?void 0:p.parentId)&&g.position&&(l.push({id:v,parentId:p.parentId,rect:t(t({},p.internals.positionAbsolute),{width:p.measured.width,height:p.measured.height})}),g.position.x=Math.max(0,g.position.x),g.position.y=Math.max(0,g.position.y)),s.push(g)}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(l.length>0){var y=e(),m=lw(l,y.nodeLookup,y.parentLookup);s.push.apply(s,c([],a(m),!1))}e().triggerNodeChanges(s)},triggerNodeChanges:function(n){var t=e(),r=t.onNodesChange,o=t.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger node changes",n),r({changes:n}))},triggerEdgeChanges:function(n){var t=e(),r=t.onEdgesChange,o=t.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger edge changes",n),null==r||r({changes:n}))},addSelectedNodes:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,l=t.triggerEdgeChanges;r?u(n.map((function(n){return Uw(n,!0)}))):(u(Fw(i,new Set(c([],a(n),!1)),!0)),l(Fw(o)))},addSelectedEdges:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,l=t.triggerEdgeChanges;r?l(n.map((function(n){return Uw(n,!0)}))):(l(Fw(o,new Set(c([],a(n),!1)))),u(Fw(i,new Set,!0)))},unselectNodesAndEdges:function(n){var t=void 0===n?{}:n,r=t.nodes,o=t.edges,i=e(),u=i.edges,a=i.nodes,c=i.triggerNodeChanges,l=i.triggerEdgeChanges,s=o||u,f=(r||a).map((function(n){return n.selected=!1,Uw(n.id,!1)})),d=s.map((function(n){return Uw(n.id,!1)}));c(f),l(d)},setMinZoom:function(t){var r=e(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([t,i]),n({minZoom:t})},setMaxZoom:function(t){var r=e(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,t]),n({maxZoom:t})},setTranslateExtent:function(t){var r;null===(r=e().panZoom)||void 0===r||r.setTranslateExtent(t),n({translateExtent:t})},resetSelectedElements:function(){var n=e(),t=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,u=r.reduce((function(n,e){return e.selected?c(c([],a(n),!1),[Uw(e.id,!1)],!1):n}),[]),l=t.reduce((function(n,e){return e.selected?c(c([],a(n),!1),[Uw(e.id,!1)],!1):n}),[]);o(u),i(l)},setNodeExtent:function(r){var o,i,c=e().nodeLookup;try{for(var l=u(c),s=l.next();!s.done;s=l.next()){var f=a(s.value,2)[1],d=fw(f.position,r);c.set(f.id,t(t({},f),{internals:t(t({},f.internals),{positionAbsolute:d})}))}}catch(n){o={error:n}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}n({nodeExtent:r})},panBy:function(n){var t=e(),r=t.transform,o=t.width,i=t.height;return function(n){var e=n.delta,t=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,u=n.height;if(!t||!e.x&&!e.y)return!1;var a=t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[i,u]],o);return!!a&&(a.x!==r[0]||a.y!==r[1]||a.k!==r[2])}({delta:n,panZoom:t.panZoom,transform:r,translateExtent:t.translateExtent,width:o,height:i})},cancelConnection:function(){return n({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(r){var o,i=e().connectionPosition,u=t(t({},r),{connectionPosition:null!==(o=r.connectionPosition)&&void 0!==o?o:i});n(u)},reset:function(){return n(t({},B_()))},updateLayout:function(t){var r,o=t.config,i=t.nodes,u=t.force,a=e(),c=a.width,l=a.height,s=a.edges,f=a.layoutTypes,d=a.layoutConfig,h=a.panZoom,v=a.nodeOrigin,p=a.nodeLookup,g=a.parentLookup,y=a.elevateNodesOnSelect,m=a.nodes,x=a.fitViewOnInit,w=a.minZoom,b=a.maxZoom,_=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,M=a.centered,N=a.layoutAnchorId,O=i||Array.from(p.values());if(O.length){var P=O.find((function(n){return n.id===N})),j=H_({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||T_});if(j.layoutComplete&&(cw(j.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:j.layoutComplete}),h&&j.layoutComplete&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){if(N&&P){var I=j.nodes.find((function(n){return n.id===N}));if(!I)return;return function(n){var e=n.position,t=n.targetPosition,r=n.panZoom,o=n.transform,i=o[2],u=(t.x-e.x)*i,a=(t.y-e.y)*i;r.setViewport({x:o[0]+u,y:o[1]+a,zoom:i})}({targetPosition:uw(P,v).position,panZoom:h,position:uw(I,v).position,transform:E}),void n({layoutAnchorId:void 0})}if(u||!(k||M||C))if(d.offsetConfig){var A=function(n){var e=n.offsetConfig,t=n.width,r=n.height,o=n.panZoom,i=n.nodeOrigin,u=n.nodes,a=n.layoutDirection,c=u.find((function(n){return n.id===(null==e?void 0:e.nodeId)}));if(!a||!c)return!1;var l=Gw(c,i).positionAbsolute,s=dw(c),f=t/2,d=r/2,h={x:0,y:0};switch(a){case"BT":h={x:f-l.x-s.width/2,y:r-l.y-e.offset-s.height};break;case"LR":h={x:e.offset-l.x,y:d-l.y-s.height/2};break;case"RL":h={x:t-l.x-e.offset-s.width,y:d-l.y-s.height/2};break;default:h={x:f-l.x-s.width/2,y:e.offset-l.y}}return o.setViewport({x:h.x,y:h.y,zoom:1}),!0}({offsetConfig:d.offsetConfig,width:c,height:l,nodes:Array.from(p.values()),nodeOrigin:v,transform:E,panZoom:h,layoutDirection:null===(r=d.options)||void 0===r?void 0:r.rankdir});n({offsetDone:A})}else{if(x)return Qw({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:x,minZoom:w,maxZoom:b,fitViewOnInitOptions:_,nodeLookup:p}),void n({fitViewDone:!0});S&&(Y_({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var r=n.changes,o=n.userNodes;if(r||o){var i=e(),u=i.setNodes,a=i.nodeLookup,c=i.parentLookup,l=i.elevateNodesOnSelect,s=i.nodeOrigin,f=i.nodes,d=i.autoLayout,h=i.updateLayout,v=!(null==r?void 0:r.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(r||[]),g=[];g=v?(o||[]).map((function(n){var e=a.get(n.id),r=t(t({},e||{}),n);return(null==e?void 0:e.position)&&(r.position=e.position),r})):function(n,e){return Xw(n,e)}(r,Array.from(a.values())),!v&&p||cw(g,a,c,{nodeOrigin:s,elevateNodesOnSelect:l,checkEquality:!0}),d&&(p||o&&o!==f)&&h({nodes:v?Array.from(a.values()):g}),u(o||f)}},onEdgesChange:function(n){var r=n.changes,o=void 0===r?[]:r,i=n.userEdges,u=e(),a=u.connectionLookup,c=u.edgeLookup,l=u.setEdges,s=u.edges,f=!(null==o?void 0:o.length),d=[];d=f?i.map((function(n){var e=c.get(n.id)||{};return t(t({},e),n)})):function(n,e){return Xw(n,e)}(o,Array.from(c.values())),aw(a,c,d),i&&l(f?i||[]:s)},updateLayoutConfig:function(t){var r=e(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;V_.isEqual(t,u)||(n({layoutConfig:t}),o&&i({config:t,force:!0}))},setLayoutAnchorId:function(e){n({layoutAnchorId:e})}})},r=Object.is,e?I(e,r):I};function X_(e){var t=e.initialNodes,r=e.initialEdges,o=e.defaultNodes,i=e.defaultEdges,u=e.initialWidth,c=e.initialHeight,l=e.fitView,s=e.children,f=a(n.useState((function(){return Z_({nodes:t,edges:r,defaultNodes:o,defaultEdges:i,width:u,height:c,fitView:l})})),1)[0];return p.jsx(z,{value:f,children:p.jsx(db,{children:s})})}function U_(e){var t=e.children,r=e.nodes,o=e.edges,i=e.defaultNodes,u=e.defaultEdges,a=e.width,c=e.height,l=e.fitView;return n.useContext(A)?p.jsx(p.Fragment,{children:t}):p.jsx(X_,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:t})}var F_=c(c([],a(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions","nodeOrigin","autoLayout","centerConfig","layoutTypes"]),!1),["rfId"],!1),W_=function(n){return{setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,onNodesChange:n.onNodesChange,onEdgesChange:n.onEdgesChange,updateLayoutConfig:n.updateLayoutConfig}},$_={translateExtent:yv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function G_(e){var r=tw(W_,Rw),o=r.setMinZoom,i=r.setMaxZoom,a=r.setTranslateExtent,c=r.setNodeExtent,l=r.reset,s=r.setDefaultNodesAndEdges,f=r.onNodesChange,d=r.onEdgesChange,h=r.updateLayoutConfig,v=rw();n.useEffect((function(){return s(e.defaultNodes,e.defaultEdges),function(){p.current=$_,l()}}),[]);var p=n.useRef($_);return n.useEffect((function(){var n,r,l,s;try{for(var g=u(F_),y=g.next();!y.done;y=g.next()){var m=y.value,x=e[m];if(x!==p.current[m]&&void 0!==e[m])if("nodes"===m)f({userNodes:x});else if("edges"===m)d({userEdges:x});else if("minZoom"===m)o(x);else if("maxZoom"===m)i(x);else if("translateExtent"===m)a(x);else if("nodeExtent"===m)c(x);else if("fitView"===m)v.setState({fitViewOnInit:x});else if("fitViewOptions"===m)v.setState({fitViewOnInitOptions:x});else if("layoutConfig"===m){var w=x||{},b=t(t({},w),{options:t(t({},w.options||{}),{rankdir:(null===(s=w.options)||void 0===s?void 0:s.rankdir)||"TB"})});h(b)}else v.setState(((l={})[m]=x,l))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}p.current=e}),F_.map((function(n){return e[n]}))),null}var q_={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var K_=bw((function(n,e){var o=n.nodes,i=n.edges,u=n.translateExtent,a=void 0===u?yv:u,c=n.defaultViewport,l=void 0===c?L_:c,s=n.minZoom,f=void 0===s?.5:s,d=n.maxZoom,h=void 0===d?2:d,v=n.defaultMarkerColor,g=void 0===v?"#b1b1b7":v,y=n.nodeOrigin,m=n.noDragClassName,x=n.noPanClassName,b=n.disableKeyboardA11y,_=n.nodeTypes,E=n.edgeTypes;n.connectionMode;var S=n.connectionLineType,k=void 0===S?exports.ConnectionLineType.Bezier:S,C=n.connectionLineStyle,M=n.connectionLineComponent,N=n.connectionLineContainerStyle,O=n.onNodeClick,P=n.onNodeDoubleClick,j=n.onNodeMouseEnter,I=n.onNodeMouseMove,A=n.onNodeMouseLeave,z=n.onNodeContextMenu,L=n.onEdgeClick,T=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,R=n.onEdgeMouseLeave,D=n.onEdgeContextMenu,V=n.onEdgeDoubleClick,H=n.fitView,Y=n.fitViewOptions,Z=n.nodeExtent,X=n.nodesDraggable,U=n.children,F=n.id,W=n.width,$=n.height,G=n.onPaneClick,q=n.onPaneContextMenu,K=n.onPaneMouseEnter,Q=n.onPaneMouseMove,J=n.onPaneMouseLeave,nn=n.onPaneScroll,en=n.elementsSelectable,tn=void 0===en||en,rn=n.autoLayout,on=void 0===rn||rn,un=n.layoutConfig,an=void 0===un?T_:un,cn=n.centerConfig,ln=void 0===cn?{}:cn,sn=n.layoutTypes,fn=void 0===sn?{}:sn,dn=r(n,["nodes","edges","translateExtent","defaultViewport","minZoom","maxZoom","defaultMarkerColor","nodeOrigin","noDragClassName","noPanClassName","disableKeyboardA11y","nodeTypes","edgeTypes","connectionMode","connectionLineType","connectionLineStyle","connectionLineComponent","connectionLineContainerStyle","onNodeClick","onNodeDoubleClick","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onEdgeClick","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","onEdgeContextMenu","onEdgeDoubleClick","fitView","fitViewOptions","nodeExtent","nodesDraggable","children","id","width","height","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoLayout","layoutConfig","centerConfig","layoutTypes"]),hn=F||"1";return p.jsx("div",t({},dn,{ref:e,style:t({},q_),className:w(["ink-flow"]),"data-testid":"rf__wrapper",id:F,children:p.jsxs(U_,{nodes:o,edges:i,width:W,height:$,fitView:H,children:[p.jsx(z_,{onNodeClick:O,onNodeMouseEnter:j,onNodeMouseMove:I,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:P,onEdgeClick:L,onEdgeMouseEnter:T,onEdgeMouseMove:B,onEdgeMouseLeave:R,onEdgeContextMenu:D,onEdgeDoubleClick:V,rfId:hn,nodeTypes:_,edgeTypes:E,minZoom:f,maxZoom:h,nodeOrigin:y,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,translateExtent:a,defaultMarkerColor:g,connectionLineType:k,connectionLineStyle:C,connectionLineComponent:M,connectionLineContainerStyle:N,defaultViewport:l,onPaneClick:G,onPaneContextMenu:q,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:J,onPaneScroll:nn}),p.jsx(G_,{nodes:o,edges:i,rfId:hn,fitView:H,fitViewOptions:Y,nodeExtent:Z,nodesDraggable:X,elementsSelectable:tn,minZoom:f,maxZoom:h,nodeOrigin:y,autoLayout:on,layoutConfig:an,layoutTypes:fn,centerConfig:ln}),U]})}))}));function Q_(){return p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4.375C10.3452 4.375 10.625 4.65482 10.625 5V9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H10.625V15C10.625 15.3452 10.3452 15.625 10 15.625C9.65482 15.625 9.375 15.3452 9.375 15V10.625H5C4.65482 10.625 4.375 10.3452 4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H9.375V5C9.375 4.65482 9.65482 4.375 10 4.375Z",fill:"#6B7280"})})}function J_(){return p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H5C4.65482 10.625 4.375 10.3452 4.375 10Z",fill:"#6B7280"})})}function nE(){return p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1.875C10.3452 1.875 10.625 2.15482 10.625 2.5V3.57152C13.6929 3.86613 16.1339 6.30708 16.4285 9.375H17.5C17.8452 9.375 18.125 9.65482 18.125 10C18.125 10.3452 17.8452 10.625 17.5 10.625H16.4285C16.1339 13.6929 13.6929 16.1339 10.625 16.4285V17.5C10.625 17.8452 10.3452 18.125 10 18.125C9.65482 18.125 9.375 17.8452 9.375 17.5V16.4285C6.30708 16.1339 3.86613 13.6929 3.57152 10.625H2.5C2.15482 10.625 1.875 10.3452 1.875 10C1.875 9.65482 2.15482 9.375 2.5 9.375H3.57152C3.86613 6.30708 6.30708 3.86613 9.375 3.57152V2.5C9.375 2.15482 9.65482 1.875 10 1.875ZM4.82878 10.625H5.83333C6.17851 10.625 6.45833 10.3452 6.45833 10C6.45833 9.65482 6.17851 9.375 5.83333 9.375H4.82878C5.11304 6.99811 6.99811 5.11304 9.375 4.82878V5.83333C9.375 6.17851 9.65482 6.45833 10 6.45833C10.3452 6.45833 10.625 6.17851 10.625 5.83333V4.82878C13.0019 5.11304 14.887 6.99811 15.1712 9.375H14.1667C13.8215 9.375 13.5417 9.65482 13.5417 10C13.5417 10.3452 13.8215 10.625 14.1667 10.625H15.1712C14.887 13.0019 13.0019 14.887 10.625 15.1712V14.1667C10.625 13.8215 10.3452 13.5417 10 13.5417C9.65482 13.5417 9.375 13.8215 9.375 14.1667V15.1712C6.99811 14.887 5.11304 13.0019 4.82878 10.625Z",fill:"#6B7280"})})}function eE(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function tE(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function rE(n){var e=n.children,o=n.className,i=r(n,["children","className"]);return p.jsx("button",t({type:"button",className:w(["ink-flow__controls-button",o])},i,{children:e}))}var oE=function(n){return n.userSelectionActive?"none":"all"};function iE(n){var e=n.position,o=void 0===e?"top-left":e,i=n.children,u=n.className,l=n.style,s=r(n,["position","children","className","style"]),f=tw(oE),d="".concat(o).split("-");return p.jsx("div",t({className:w(c(["ink-flow__panel",u],a(d),!1)),style:t(t({},l),{pointerEvents:f})},s,{children:i}))}var uE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function aE(n){var e=n.style,t=n.showZoom,r=void 0===t||t,o=n.showFitView,i=void 0===o||o,u=n.showInteractive,a=void 0===u||u,c=n.fitViewOptions,l=n.onZoomIn,s=n.onZoomOut,f=n.onFitView,d=n.onInteractiveChange,h=n.className,v=n.children,g=n.position,y=void 0===g?"bottom-left":g,m=n.orientation,x=void 0===m?"vertical":m,b=n["aria-label"],_=void 0===b?"Ink Flow controls":b,E=rw(),S=tw(uE,Rw),k=S.isInteractive,C=S.minZoomReached,M=S.maxZoomReached,N=pb(),O=N.zoomIn,P=N.zoomOut,j=N.fitView,I="horizontal"===x?"horizontal":"vertical";return p.jsxs(iE,{className:w(["ink-flow__controls",I,h]),position:y,style:e,"data-testid":"rf__controls","aria-label":_,children:[i&&p.jsx(rE,{className:"ink-flow__controls-fitview",onClick:function(){j(c),null==f||f()},"aria-label":"fit view",children:p.jsx(nE,{})}),r&&p.jsxs("div",{className:"ink-flow__controls-zoom",children:[p.jsx(rE,{onClick:function(){O(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:M,children:p.jsx(Q_,{})}),p.jsx(rE,{onClick:function(){P(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:C,children:p.jsx(J_,{})})]}),a&&p.jsx(rE,{className:"ink-flow__controls-interactive",onClick:function(){E.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),null==d||d(!k)},title:"toggle interactivity","aria-label":"toggle interactivity",children:k?p.jsx(tE,{}):p.jsx(eE,{})}),v]})}aE.displayName="Controls";var cE,lE,sE=n.memo(aE);function fE(n){var e=n.dimensions,t=n.lineWidth,r=n.variant,o=n.className;return p.jsx("path",{strokeWidth:t,d:"M".concat(e[0]/2," 0 V").concat(e[1]," M0 ").concat(e[1]/2," H").concat(e[0]),className:w(["react-flow__background-pattern",r,o])})}function dE(n){var e=n.radius,t=n.className;return p.jsx("circle",{cx:e,cy:e,r:e,className:w(["react-flow__background-pattern","dots",t])})}exports.BackgroundVariant=void 0,(cE=exports.BackgroundVariant||(exports.BackgroundVariant={})).Lines="lines",cE.Dots="dots",cE.Cross="cross";var hE=((lE={})[exports.BackgroundVariant.Dots]=1,lE[exports.BackgroundVariant.Lines]=1,lE[exports.BackgroundVariant.Cross]=6,lE),vE=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function pE(e){var r=e.id,o=e.variant,i=void 0===o?exports.BackgroundVariant.Dots:o,u=e.gap,a=void 0===u?20:u,c=e.size,l=e.lineWidth,s=void 0===l?1:l,f=e.offset,d=void 0===f?2:f,h=e.color,v=e.bgColor,g=e.style,y=e.className,m=e.patternClassName,x=n.useRef(null),b=tw(vE,Rw),_=b.transform,E=b.patternId,S=c||hE[i],k=i===exports.BackgroundVariant.Dots,C=i===exports.BackgroundVariant.Cross,M=Array.isArray(a)?a:[a,a],N=[M[0]*_[2]||1,M[1]*_[2]||1],O=S*_[2],P=C?[O,O]:N,j=k?[O/d,O/d]:[P[0]/d,P[1]/d],I="".concat(E).concat(r||"");return p.jsxs("svg",{className:w(["ink-flow__background",y]),style:t(t(t({},g),Dw),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:x,"data-testid":"rf__background",children:[p.jsx("pattern",{id:I,x:_[0]%N[0],y:_[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(j[0],",-").concat(j[1],")"),children:k?p.jsx(dE,{radius:O/d,className:m}):p.jsx(fE,{dimensions:P,lineWidth:s,variant:i,className:m})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(I,")")})]})}pE.displayName="Background";var gE=n.memo(pE),yE=function(n){var e;return null===(e=n.domNode)||void 0===e?void 0:e.querySelector(".ink-flow__edgelabel-renderer")};exports.Background=gE,exports.BaseEdge=Wb,exports.ControlButton=rE,exports.Controls=sE,exports.EdgeLabelRenderer=function(n){var t=n.children,r=tw(yE);return r?e.createPortal(t,r):null},exports.Handle=jb,exports.InkFlowProvider=X_,exports.SmoothStepEdge=n_,exports.StepEdge=r_,exports.addEdge=function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(t=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?L({},n):L(L({},n),{id:$v(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):e;var t},exports.dagreLayout=Jv,exports.default=K_,exports.getBezierEdgeCenter=Yv,exports.getBezierPath=Uv,exports.getConnectedEdges=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))},exports.getEdgeCenter=Fv,exports.getIncomers=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.target===n.id&&r.add(e.source)})),e.filter((function(n){return r.has(n.id)}))},exports.getNodesBounds=Ev,exports.getOutgoers=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.source===n.id&&r.add(e.target)})),e.filter((function(n){return r.has(n.id)}))},exports.getSmoothStepPath=Qv,exports.getStraightPath=function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=B(Fv({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),u,a,c,l]},exports.getViewportForBounds=Lv,exports.updateEdge=function(n,e,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}(n,["id"]);if(!e.source||!e.target)return t;if(!t.find((function(e){return e.id===n.id})))return t;var u=L(L({},i),{id:r.shouldReplaceId?$v(e):o,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle});return t.filter((function(n){return n.id!==o})).concat(u)},exports.useEdgesState=function(e){var t=a(n.useState(e),2);return[t[0],t[1]]},exports.useInkFlow=pb,exports.useNodesState=function(e){var t=a(n.useState(e),2);return[t[0],t[1]]},exports.useStore=tw,exports.useStoreApi=rw;
|
|
24
|
+
*/!function(n,e){(function(){var t,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",u=16,a=32,c=64,s=128,f=256,d=1/0,h=9007199254740991,v=NaN,p=4294967295,g=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",a],["partialRight",c],["rearg",f]],y="[object Arguments]",m="[object Array]",x="[object Boolean]",w="[object Date]",b="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",M="[object Promise]",N="[object RegExp]",O="[object Set]",P="[object String]",j="[object Symbol]",I="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",T="[object Float64Array]",B="[object Int8Array]",R="[object Int16Array]",D="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",Z="[object Uint32Array]",X=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(W.source),q=RegExp($.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,en=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,on=RegExp(rn.source),un=/^\s+/,an=/\s/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,sn=/,? & /,fn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dn=/[()=,{}\[\]\/\s]/,hn=/\\(\\)?/g,vn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pn=/\w*$/,gn=/^[-+]0x[0-9a-f]+$/i,yn=/^0b[01]+$/i,mn=/^\[object .+?Constructor\]$/,xn=/^0o[0-7]+$/i,wn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_n=/($^)/,En=/['\n\r\u2028\u2029\\]/g,Sn="\\ud800-\\udfff",kn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Cn="\\u2700-\\u27bf",Mn="a-z\\xdf-\\xf6\\xf8-\\xff",Nn="A-Z\\xc0-\\xd6\\xd8-\\xde",On="\\ufe0e\\ufe0f",Pn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",jn="['’]",In="["+Sn+"]",An="["+Pn+"]",zn="["+kn+"]",Ln="\\d+",Tn="["+Cn+"]",Bn="["+Mn+"]",Rn="[^"+Sn+Pn+Ln+Cn+Mn+Nn+"]",Dn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+Nn+"]",Xn="\\u200d",Fn="(?:"+Bn+"|"+Rn+")",Un="(?:"+Zn+"|"+Rn+")",Wn="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Dn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Xn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Tn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,In].join("|")+")",ne=RegExp(jn,"g"),ee=RegExp(zn,"g"),te=RegExp(Dn+"(?="+Dn+")|"+Jn+Kn,"g"),re=RegExp([Zn+"?"+Bn+"+"+Wn+"(?="+[An,Zn,"$"].join("|")+")",Un+"+"+$n+"(?="+[An,Zn+Fn,"$"].join("|")+")",Zn+"?"+Fn+"+"+Wn,Zn+"+"+$n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ln,Qn].join("|"),"g"),oe=RegExp("["+Xn+Sn+kn+On+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ue=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,ce={};ce[L]=ce[T]=ce[B]=ce[R]=ce[D]=ce[V]=ce[H]=ce[Y]=ce[Z]=!0,ce[y]=ce[m]=ce[A]=ce[x]=ce[z]=ce[w]=ce[b]=ce[_]=ce[S]=ce[k]=ce[C]=ce[N]=ce[O]=ce[P]=ce[I]=!1;var le={};le[y]=le[m]=le[A]=le[z]=le[x]=le[w]=le[L]=le[T]=le[B]=le[R]=le[D]=le[S]=le[k]=le[C]=le[N]=le[O]=le[P]=le[j]=le[V]=le[H]=le[Y]=le[Z]=!0,le[b]=le[_]=le[I]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,de=parseInt,he="object"==typeof l&&l&&l.Object===Object&&l,ve="object"==typeof self&&self&&self.Object===Object&&self,pe=he||ve||Function("return this")(),ge=e&&!e.nodeType&&e,ye=ge&&n&&!n.nodeType&&n,me=ye&&ye.exports===ge,xe=me&&he.process,we=function(){try{var n=ye&&ye.require&&ye.require("util").types;return n||xe&&xe.binding&&xe.binding("util")}catch(n){}}(),be=we&&we.isArrayBuffer,_e=we&&we.isDate,Ee=we&&we.isMap,Se=we&&we.isRegExp,ke=we&&we.isSet,Ce=we&&we.isTypedArray;function Me(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Ne(n,e,t,r){for(var o=-1,i=null==n?0:n.length;++o<i;){var u=n[o];e(r,u,t(u),n)}return r}function Oe(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}function Pe(n,e){for(var t=null==n?0:n.length;t--&&!1!==e(n[t],t,n););return n}function je(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(!e(n[t],t,n))return!1;return!0}function Ie(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var u=n[t];e(u,t,n)&&(i[o++]=u)}return i}function Ae(n,e){return!!(null==n?0:n.length)&&Ze(n,e,0)>-1}function ze(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}function Le(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}function Te(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}function Be(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}function Re(n,e,t,r){var o=null==n?0:n.length;for(r&&o&&(t=n[--o]);o--;)t=e(t,n[o],o,n);return t}function De(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}var Ve=We("length");function He(n,e,t){var r;return t(n,(function(n,t,o){if(e(n,t,o))return r=t,!1})),r}function Ye(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}function Ze(n,e,t){return e==e?function(n,e,t){var r=t-1,o=n.length;for(;++r<o;)if(n[r]===e)return r;return-1}(n,e,t):Ye(n,Fe,t)}function Xe(n,e,t,r){for(var o=t-1,i=n.length;++o<i;)if(r(n[o],e))return o;return-1}function Fe(n){return n!=n}function Ue(n,e){var t=null==n?0:n.length;return t?qe(n,e)/t:v}function We(n){return function(e){return null==e?t:e[n]}}function $e(n){return function(e){return null==n?t:n[e]}}function Ge(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}function qe(n,e){for(var r,o=-1,i=n.length;++o<i;){var u=e(n[o]);u!==t&&(r=r===t?u:r+u)}return r}function Ke(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}function Qe(n){return n?n.slice(0,pt(n)+1).replace(un,""):n}function Je(n){return function(e){return n(e)}}function nt(n,e){return Le(e,(function(e){return n[e]}))}function et(n,e){return n.has(e)}function tt(n,e){for(var t=-1,r=n.length;++t<r&&Ze(e,n[t],0)>-1;);return t}function rt(n,e){for(var t=n.length;t--&&Ze(e,n[t],0)>-1;);return t}var ot=$e({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),it=$e({"&":"&","<":"<",">":">",'"':""","'":"'"});function ut(n){return"\\"+se[n]}function at(n){return oe.test(n)}function ct(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}function lt(n,e){return function(t){return n(e(t))}}function st(n,e){for(var t=-1,r=n.length,o=0,u=[];++t<r;){var a=n[t];a!==e&&a!==i||(n[t]=i,u[o++]=t)}return u}function ft(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}function dt(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=[n,n]})),t}function ht(n){return at(n)?function(n){var e=te.lastIndex=0;for(;te.test(n);)++e;return e}(n):Ve(n)}function vt(n){return at(n)?function(n){return n.match(te)||[]}(n):function(n){return n.split("")}(n)}function pt(n){for(var e=n.length;e--&&an.test(n.charAt(e)););return e}var gt=$e({"&":"&","<":"<",">":">",""":'"',"'":"'"});var yt=function n(e){var l,an=(e=null==e?pe:yt.defaults(pe.Object(),e,yt.pick(pe,ue))).Array,Sn=e.Date,kn=e.Error,Cn=e.Function,Mn=e.Math,Nn=e.Object,On=e.RegExp,Pn=e.String,jn=e.TypeError,In=an.prototype,An=Cn.prototype,zn=Nn.prototype,Ln=e["__core-js_shared__"],Tn=An.toString,Bn=zn.hasOwnProperty,Rn=0,Dn=(l=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",Vn=zn.toString,Hn=Tn.call(Nn),Yn=pe._,Zn=On("^"+Tn.call(Bn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xn=me?e.Buffer:t,Fn=e.Symbol,Un=e.Uint8Array,Wn=Xn?Xn.allocUnsafe:t,$n=lt(Nn.getPrototypeOf,Nn),Gn=Nn.create,qn=zn.propertyIsEnumerable,Kn=In.splice,Qn=Fn?Fn.isConcatSpreadable:t,Jn=Fn?Fn.iterator:t,te=Fn?Fn.toStringTag:t,oe=function(){try{var n=hi(Nn,"defineProperty");return n({},"",{}),n}catch(n){}}(),se=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=Sn&&Sn.now!==pe.Date.now&&Sn.now,ve=e.setTimeout!==pe.setTimeout&&e.setTimeout,ge=Mn.ceil,ye=Mn.floor,xe=Nn.getOwnPropertySymbols,we=Xn?Xn.isBuffer:t,Ve=e.isFinite,$e=In.join,mt=lt(Nn.keys,Nn),xt=Mn.max,wt=Mn.min,bt=Sn.now,_t=e.parseInt,Et=Mn.random,St=In.reverse,kt=hi(e,"DataView"),Ct=hi(e,"Map"),Mt=hi(e,"Promise"),Nt=hi(e,"Set"),Ot=hi(e,"WeakMap"),Pt=hi(Nn,"create"),jt=Ot&&new Ot,It={},At=Di(kt),zt=Di(Ct),Lt=Di(Mt),Tt=Di(Nt),Bt=Di(Ot),Rt=Fn?Fn.prototype:t,Dt=Rt?Rt.valueOf:t,Vt=Rt?Rt.toString:t;function Ht(n){if(ta(n)&&!Fu(n)&&!(n instanceof Ft)){if(n instanceof Xt)return n;if(Bn.call(n,"__wrapped__"))return Vi(n)}return new Xt(n)}var Yt=function(){function n(){}return function(e){if(!ea(e))return{};if(Gn)return Gn(e);n.prototype=e;var r=new n;return n.prototype=t,r}}();function Zt(){}function Xt(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=t}function Ft(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Ut(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Wt(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function $t(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Gt(n){var e=-1,t=null==n?0:n.length;for(this.__data__=new $t;++e<t;)this.add(n[e])}function qt(n){var e=this.__data__=new Wt(n);this.size=e.size}function Kt(n,e){var t=Fu(n),r=!t&&Xu(n),o=!t&&!r&&Gu(n),i=!t&&!r&&!o&&sa(n),u=t||r||o||i,a=u?Ke(n.length,Pn):[],c=a.length;for(var l in n)!e&&!Bn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||wi(l,c))||a.push(l);return a}function Qt(n){var e=n.length;return e?n[Gr(0,e-1)]:t}function Jt(n,e){return Ti(jo(n),cr(e,0,n.length))}function nr(n){return Ti(jo(n))}function er(n,e,r){(r!==t&&!Hu(n[e],r)||r===t&&!(e in n))&&ur(n,e,r)}function tr(n,e,r){var o=n[e];Bn.call(n,e)&&Hu(o,r)&&(r!==t||e in n)||ur(n,e,r)}function rr(n,e){for(var t=n.length;t--;)if(Hu(n[t][0],e))return t;return-1}function or(n,e,t,r){return hr(n,(function(n,o,i){e(r,n,t(n),i)})),r}function ir(n,e){return n&&Io(e,Ia(e),n)}function ur(n,e,t){"__proto__"==e&&oe?oe(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ar(n,e){for(var r=-1,o=e.length,i=an(o),u=null==n;++r<o;)i[r]=u?t:Ma(n,e[r]);return i}function cr(n,e,r){return n==n&&(r!==t&&(n=n<=r?n:r),e!==t&&(n=n>=e?n:e)),n}function lr(n,e,r,o,i,u){var a,c=1&e,l=2&e,s=4&e;if(r&&(a=i?r(n,o,i,u):r(n)),a!==t)return a;if(!ea(n))return n;var f=Fu(n);if(f){if(a=function(n){var e=n.length,t=new n.constructor(e);e&&"string"==typeof n[0]&&Bn.call(n,"index")&&(t.index=n.index,t.input=n.input);return t}(n),!c)return jo(n,a)}else{var d=gi(n),h=d==_||d==E;if(Gu(n))return ko(n,c);if(d==C||d==y||h&&!i){if(a=l||h?{}:mi(n),!c)return l?function(n,e){return Io(n,pi(n),e)}(n,function(n,e){return n&&Io(e,Aa(e),n)}(a,n)):function(n,e){return Io(n,vi(n),e)}(n,ir(a,n))}else{if(!le[d])return i?n:{};a=function(n,e,t){var r=n.constructor;switch(e){case A:return Co(n);case x:case w:return new r(+n);case z:return function(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}(n,t);case L:case T:case B:case R:case D:case V:case H:case Y:case Z:return Mo(n,t);case S:return new r;case k:case P:return new r(n);case N:return function(n){var e=new n.constructor(n.source,pn.exec(n));return e.lastIndex=n.lastIndex,e}(n);case O:return new r;case j:return o=n,Dt?Nn(Dt.call(o)):{}}var o}(n,d,c)}}u||(u=new qt);var v=u.get(n);if(v)return v;u.set(n,a),aa(n)?n.forEach((function(t){a.add(lr(t,e,r,t,n,u))})):ra(n)&&n.forEach((function(t,o){a.set(o,lr(t,e,r,o,n,u))}));var p=f?t:(s?l?ui:ii:l?Aa:Ia)(n);return Oe(p||n,(function(t,o){p&&(t=n[o=t]),tr(a,o,lr(t,e,r,o,n,u))})),a}function sr(n,e,r){var o=r.length;if(null==n)return!o;for(n=Nn(n);o--;){var i=r[o],u=e[i],a=n[i];if(a===t&&!(i in n)||!u(a))return!1}return!0}function fr(n,e,o){if("function"!=typeof n)throw new jn(r);return Ii((function(){n.apply(t,o)}),e)}function dr(n,e,t,r){var o=-1,i=Ae,u=!0,a=n.length,c=[],l=e.length;if(!a)return c;t&&(e=Le(e,Je(t))),r?(i=ze,u=!1):e.length>=200&&(i=et,u=!1,e=new Gt(e));n:for(;++o<a;){var s=n[o],f=null==t?s:t(s);if(s=r||0!==s?s:0,u&&f==f){for(var d=l;d--;)if(e[d]===f)continue n;c.push(s)}else i(e,f,r)||c.push(s)}return c}Ht.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:Ht}},Ht.prototype=Zt.prototype,Ht.prototype.constructor=Ht,Xt.prototype=Yt(Zt.prototype),Xt.prototype.constructor=Xt,Ft.prototype=Yt(Zt.prototype),Ft.prototype.constructor=Ft,Ut.prototype.clear=function(){this.__data__=Pt?Pt(null):{},this.size=0},Ut.prototype.delete=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e},Ut.prototype.get=function(n){var e=this.__data__;if(Pt){var r=e[n];return r===o?t:r}return Bn.call(e,n)?e[n]:t},Ut.prototype.has=function(n){var e=this.__data__;return Pt?e[n]!==t:Bn.call(e,n)},Ut.prototype.set=function(n,e){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Pt&&e===t?o:e,this},Wt.prototype.clear=function(){this.__data__=[],this.size=0},Wt.prototype.delete=function(n){var e=this.__data__,t=rr(e,n);return!(t<0)&&(t==e.length-1?e.pop():Kn.call(e,t,1),--this.size,!0)},Wt.prototype.get=function(n){var e=this.__data__,r=rr(e,n);return r<0?t:e[r][1]},Wt.prototype.has=function(n){return rr(this.__data__,n)>-1},Wt.prototype.set=function(n,e){var t=this.__data__,r=rr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this},$t.prototype.clear=function(){this.size=0,this.__data__={hash:new Ut,map:new(Ct||Wt),string:new Ut}},$t.prototype.delete=function(n){var e=fi(this,n).delete(n);return this.size-=e?1:0,e},$t.prototype.get=function(n){return fi(this,n).get(n)},$t.prototype.has=function(n){return fi(this,n).has(n)},$t.prototype.set=function(n,e){var t=fi(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this},Gt.prototype.add=Gt.prototype.push=function(n){return this.__data__.set(n,o),this},Gt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.clear=function(){this.__data__=new Wt,this.size=0},qt.prototype.delete=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t},qt.prototype.get=function(n){return this.__data__.get(n)},qt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.set=function(n,e){var t=this.__data__;if(t instanceof Wt){var r=t.__data__;if(!Ct||r.length<199)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $t(r)}return t.set(n,e),this.size=t.size,this};var hr=Lo(br),vr=Lo(_r,!0);function pr(n,e){var t=!0;return hr(n,(function(n,r,o){return t=!!e(n,r,o)})),t}function gr(n,e,r){for(var o=-1,i=n.length;++o<i;){var u=n[o],a=e(u);if(null!=a&&(c===t?a==a&&!la(a):r(a,c)))var c=a,l=u}return l}function yr(n,e){var t=[];return hr(n,(function(n,r,o){e(n,r,o)&&t.push(n)})),t}function mr(n,e,t,r,o){var i=-1,u=n.length;for(t||(t=xi),o||(o=[]);++i<u;){var a=n[i];e>0&&t(a)?e>1?mr(a,e-1,t,r,o):Te(o,a):r||(o[o.length]=a)}return o}var xr=To(),wr=To(!0);function br(n,e){return n&&xr(n,e,Ia)}function _r(n,e){return n&&wr(n,e,Ia)}function Er(n,e){return Ie(e,(function(e){return Qu(n[e])}))}function Sr(n,e){for(var r=0,o=(e=bo(e,n)).length;null!=n&&r<o;)n=n[Ri(e[r++])];return r&&r==o?n:t}function kr(n,e,t){var r=e(n);return Fu(n)?r:Te(r,t(n))}function Cr(n){return null==n?n===t?"[object Undefined]":"[object Null]":te&&te in Nn(n)?function(n){var e=Bn.call(n,te),r=n[te];try{n[te]=t;var o=!0}catch(n){}var i=Vn.call(n);o&&(e?n[te]=r:delete n[te]);return i}(n):function(n){return Vn.call(n)}(n)}function Mr(n,e){return n>e}function Nr(n,e){return null!=n&&Bn.call(n,e)}function Or(n,e){return null!=n&&e in Nn(n)}function Pr(n,e,r){for(var o=r?ze:Ae,i=n[0].length,u=n.length,a=u,c=an(u),l=1/0,s=[];a--;){var f=n[a];a&&e&&(f=Le(f,Je(e))),l=wt(f.length,l),c[a]=!r&&(e||i>=120&&f.length>=120)?new Gt(a&&f):t}f=n[0];var d=-1,h=c[0];n:for(;++d<i&&s.length<l;){var v=f[d],p=e?e(v):v;if(v=r||0!==v?v:0,!(h?et(h,p):o(s,p,r))){for(a=u;--a;){var g=c[a];if(!(g?et(g,p):o(n[a],p,r)))continue n}h&&h.push(p),s.push(v)}}return s}function jr(n,e,r){var o=null==(n=Oi(n,e=bo(e,n)))?n:n[Ri(Ki(e))];return null==o?t:Me(o,n,r)}function Ir(n){return ta(n)&&Cr(n)==y}function Ar(n,e,r,o,i){return n===e||(null==n||null==e||!ta(n)&&!ta(e)?n!=n&&e!=e:function(n,e,r,o,i,u){var a=Fu(n),c=Fu(e),l=a?m:gi(n),s=c?m:gi(e),f=(l=l==y?C:l)==C,d=(s=s==y?C:s)==C,h=l==s;if(h&&Gu(n)){if(!Gu(e))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new qt),a||sa(n)?ri(n,e,r,o,i,u):function(n,e,t,r,o,i,u){switch(t){case z:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case A:return!(n.byteLength!=e.byteLength||!i(new Un(n),new Un(e)));case x:case w:case k:return Hu(+n,+e);case b:return n.name==e.name&&n.message==e.message;case N:case P:return n==e+"";case S:var a=ct;case O:var c=1&r;if(a||(a=ft),n.size!=e.size&&!c)return!1;var l=u.get(n);if(l)return l==e;r|=2,u.set(n,e);var s=ri(a(n),a(e),r,o,i,u);return u.delete(n),s;case j:if(Dt)return Dt.call(n)==Dt.call(e)}return!1}(n,e,l,r,o,i,u);if(!(1&r)){var v=f&&Bn.call(n,"__wrapped__"),p=d&&Bn.call(e,"__wrapped__");if(v||p){var g=v?n.value():n,_=p?e.value():e;return u||(u=new qt),i(g,_,r,o,u)}}if(!h)return!1;return u||(u=new qt),function(n,e,r,o,i,u){var a=1&r,c=ii(n),l=c.length,s=ii(e),f=s.length;if(l!=f&&!a)return!1;var d=l;for(;d--;){var h=c[d];if(!(a?h in e:Bn.call(e,h)))return!1}var v=u.get(n),p=u.get(e);if(v&&p)return v==e&&p==n;var g=!0;u.set(n,e),u.set(e,n);var y=a;for(;++d<l;){var m=n[h=c[d]],x=e[h];if(o)var w=a?o(x,m,h,e,n,u):o(m,x,h,n,e,u);if(!(w===t?m===x||i(m,x,r,o,u):w)){g=!1;break}y||(y="constructor"==h)}if(g&&!y){var b=n.constructor,_=e.constructor;b==_||!("constructor"in n)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(g=!1)}return u.delete(n),u.delete(e),g}(n,e,r,o,i,u)}(n,e,r,o,Ar,i))}function zr(n,e,r,o){var i=r.length,u=i,a=!o;if(null==n)return!u;for(n=Nn(n);i--;){var c=r[i];if(a&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++i<u;){var l=(c=r[i])[0],s=n[l],f=c[1];if(a&&c[2]){if(s===t&&!(l in n))return!1}else{var d=new qt;if(o)var h=o(s,f,l,n,e,d);if(!(h===t?Ar(f,s,3,o,d):h))return!1}}return!0}function Lr(n){return!(!ea(n)||(e=n,Dn&&Dn in e))&&(Qu(n)?Zn:mn).test(Di(n));var e}function Tr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Fu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Br(n){if(!ki(n))return mt(n);var e=[];for(var t in Nn(n))Bn.call(n,t)&&"constructor"!=t&&e.push(t);return e}function Rr(n){if(!ea(n))return function(n){var e=[];if(null!=n)for(var t in Nn(n))e.push(t);return e}(n);var e=ki(n),t=[];for(var r in n)("constructor"!=r||!e&&Bn.call(n,r))&&t.push(r);return t}function Dr(n,e){return n<e}function Vr(n,e){var t=-1,r=Wu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++t]=e(n,o,i)})),r}function Hr(n){var e=di(n);return 1==e.length&&e[0][2]?Mi(e[0][0],e[0][1]):function(t){return t===n||zr(t,n,e)}}function Yr(n,e){return _i(n)&&Ci(e)?Mi(Ri(n),e):function(r){var o=Ma(r,n);return o===t&&o===e?Na(r,n):Ar(e,o,3)}}function Zr(n,e,r,o,i){n!==e&&xr(e,(function(u,a){if(i||(i=new qt),ea(u))!function(n,e,r,o,i,u,a){var c=Pi(n,r),l=Pi(e,r),s=a.get(l);if(s)return void er(n,r,s);var f=u?u(c,l,r+"",n,e,a):t,d=f===t;if(d){var h=Fu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Fu(c)?f=c:$u(c)?f=jo(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=Mo(l,!0)):f=[]:ia(l)||Xu(l)?(f=c,Xu(c)?f=ma(c):ea(c)&&!Qu(c)||(f=mi(l))):d=!1}d&&(a.set(l,f),i(f,l,o,u,a),a.delete(l));er(n,r,f)}(n,e,a,r,Zr,o,i);else{var c=o?o(Pi(n,a),u,a+"",n,e,i):t;c===t&&(c=u),er(n,a,c)}}),Aa)}function Xr(n,e){var r=n.length;if(r)return wi(e+=e<0?r:0,r)?n[e]:t}function Fr(n,e,t){e=e.length?Le(e,(function(n){return Fu(n)?function(e){return Sr(e,1===n.length?n[0]:n)}:n})):[oc];var r=-1;e=Le(e,Je(si()));var o=Vr(n,(function(n,t,o){var i=Le(e,(function(e){return e(n)}));return{criteria:i,index:++r,value:n}}));return function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}(o,(function(n,e){return function(n,e,t){var r=-1,o=n.criteria,i=e.criteria,u=o.length,a=t.length;for(;++r<u;){var c=No(o[r],i[r]);if(c)return r>=a?c:c*("desc"==t[r]?-1:1)}return n.index-e.index}(n,e,t)}))}function Ur(n,e,t){for(var r=-1,o=e.length,i={};++r<o;){var u=e[r],a=Sr(n,u);t(a,u)&&no(i,bo(u,n),a)}return i}function Wr(n,e,t,r){var o=r?Xe:Ze,i=-1,u=e.length,a=n;for(n===e&&(e=jo(e)),t&&(a=Le(n,Je(t)));++i<u;)for(var c=0,l=e[i],s=t?t(l):l;(c=o(a,s,c,r))>-1;)a!==n&&Kn.call(a,c,1),Kn.call(n,c,1);return n}function $r(n,e){for(var t=n?e.length:0,r=t-1;t--;){var o=e[t];if(t==r||o!==i){var i=o;wi(o)?Kn.call(n,o,1):ho(n,o)}}return n}function Gr(n,e){return n+ye(Et()*(e-n+1))}function qr(n,e){var t="";if(!n||e<1||e>h)return t;do{e%2&&(t+=n),(e=ye(e/2))&&(n+=n)}while(e);return t}function Kr(n,e){return Ai(Ni(n,e,oc),n+"")}function Qr(n){return Qt(Ha(n))}function Jr(n,e){var t=Ha(n);return Ti(t,cr(e,0,t.length))}function no(n,e,r,o){if(!ea(n))return n;for(var i=-1,u=(e=bo(e,n)).length,a=u-1,c=n;null!=c&&++i<u;){var l=Ri(e[i]),s=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return n;if(i!=a){var f=c[l];(s=o?o(f,l,c):t)===t&&(s=ea(f)?f:wi(e[i+1])?[]:{})}tr(c,l,s),c=c[l]}return n}var eo=jt?function(n,e){return jt.set(n,e),n}:oc,to=oe?function(n,e){return oe(n,"toString",{configurable:!0,enumerable:!1,value:ec(e),writable:!0})}:oc;function ro(n){return Ti(Ha(n))}function oo(n,e,t){var r=-1,o=n.length;e<0&&(e=-e>o?0:o+e),(t=t>o?o:t)<0&&(t+=o),o=e>t?0:t-e>>>0,e>>>=0;for(var i=an(o);++r<o;)i[r]=n[r+e];return i}function io(n,e){var t;return hr(n,(function(n,r,o){return!(t=e(n,r,o))})),!!t}function uo(n,e,t){var r=0,o=null==n?r:n.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=n[i];null!==u&&!la(u)&&(t?u<=e:u<e)?r=i+1:o=i}return o}return ao(n,e,oc,t)}function ao(n,e,r,o){var i=0,u=null==n?0:n.length;if(0===u)return 0;for(var a=(e=r(e))!=e,c=null===e,l=la(e),s=e===t;i<u;){var f=ye((i+u)/2),d=r(n[f]),h=d!==t,v=null===d,p=d==d,g=la(d);if(a)var y=o||p;else y=s?p&&(o||h):c?p&&h&&(o||!v):l?p&&h&&!v&&(o||!g):!v&&!g&&(o?d<=e:d<e);y?i=f+1:u=f}return wt(u,4294967294)}function co(n,e){for(var t=-1,r=n.length,o=0,i=[];++t<r;){var u=n[t],a=e?e(u):u;if(!t||!Hu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function lo(n){return"number"==typeof n?n:la(n)?v:+n}function so(n){if("string"==typeof n)return n;if(Fu(n))return Le(n,so)+"";if(la(n))return Vt?Vt.call(n):"";var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function fo(n,e,t){var r=-1,o=Ae,i=n.length,u=!0,a=[],c=a;if(t)u=!1,o=ze;else if(i>=200){var l=e?null:Ko(n);if(l)return ft(l);u=!1,o=et,c=new Gt}else c=e?[]:a;n:for(;++r<i;){var s=n[r],f=e?e(s):s;if(s=t||0!==s?s:0,u&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue n;e&&c.push(f),a.push(s)}else o(c,f,t)||(c!==a&&c.push(f),a.push(s))}return a}function ho(n,e){return null==(n=Oi(n,e=bo(e,n)))||delete n[Ri(Ki(e))]}function vo(n,e,t,r){return no(n,e,t(Sr(n,e)),r)}function po(n,e,t,r){for(var o=n.length,i=r?o:-1;(r?i--:++i<o)&&e(n[i],i,n););return t?oo(n,r?0:i,r?i+1:o):oo(n,r?i+1:0,r?o:i)}function go(n,e){var t=n;return t instanceof Ft&&(t=t.value()),Be(e,(function(n,e){return e.func.apply(e.thisArg,Te([n],e.args))}),t)}function yo(n,e,t){var r=n.length;if(r<2)return r?fo(n[0]):[];for(var o=-1,i=an(r);++o<r;)for(var u=n[o],a=-1;++a<r;)a!=o&&(i[o]=dr(i[o]||u,n[a],e,t));return fo(mr(i,1),e,t)}function mo(n,e,r){for(var o=-1,i=n.length,u=e.length,a={};++o<i;){var c=o<u?e[o]:t;r(a,n[o],c)}return a}function xo(n){return $u(n)?n:[]}function wo(n){return"function"==typeof n?n:oc}function bo(n,e){return Fu(n)?n:_i(n,e)?[n]:Bi(xa(n))}var _o=Kr;function Eo(n,e,r){var o=n.length;return r=r===t?o:r,!e&&r>=o?n:oo(n,e,r)}var So=se||function(n){return pe.clearTimeout(n)};function ko(n,e){if(e)return n.slice();var t=n.length,r=Wn?Wn(t):new n.constructor(t);return n.copy(r),r}function Co(n){var e=new n.constructor(n.byteLength);return new Un(e).set(new Un(n)),e}function Mo(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function No(n,e){if(n!==e){var r=n!==t,o=null===n,i=n==n,u=la(n),a=e!==t,c=null===e,l=e==e,s=la(e);if(!c&&!s&&!u&&n>e||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&n<e||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}function Oo(n,e,t,r){for(var o=-1,i=n.length,u=t.length,a=-1,c=e.length,l=xt(i-u,0),s=an(c+l),f=!r;++a<c;)s[a]=e[a];for(;++o<u;)(f||o<i)&&(s[t[o]]=n[o]);for(;l--;)s[a++]=n[o++];return s}function Po(n,e,t,r){for(var o=-1,i=n.length,u=-1,a=t.length,c=-1,l=e.length,s=xt(i-a,0),f=an(s+l),d=!r;++o<s;)f[o]=n[o];for(var h=o;++c<l;)f[h+c]=e[c];for(;++u<a;)(d||o<i)&&(f[h+t[u]]=n[o++]);return f}function jo(n,e){var t=-1,r=n.length;for(e||(e=an(r));++t<r;)e[t]=n[t];return e}function Io(n,e,r,o){var i=!r;r||(r={});for(var u=-1,a=e.length;++u<a;){var c=e[u],l=o?o(r[c],n[c],c,r,n):t;l===t&&(l=n[c]),i?ur(r,c,l):tr(r,c,l)}return r}function Ao(n,e){return function(t,r){var o=Fu(t)?Ne:or,i=e?e():{};return o(t,n,si(r,2),i)}}function zo(n){return Kr((function(e,r){var o=-1,i=r.length,u=i>1?r[i-1]:t,a=i>2?r[2]:t;for(u=n.length>3&&"function"==typeof u?(i--,u):t,a&&bi(r[0],r[1],a)&&(u=i<3?t:u,i=1),e=Nn(e);++o<i;){var c=r[o];c&&n(e,c,o,u)}return e}))}function Lo(n,e){return function(t,r){if(null==t)return t;if(!Wu(t))return n(t,r);for(var o=t.length,i=e?o:-1,u=Nn(t);(e?i--:++i<o)&&!1!==r(u[i],i,u););return t}}function To(n){return function(e,t,r){for(var o=-1,i=Nn(e),u=r(e),a=u.length;a--;){var c=u[n?a:++o];if(!1===t(i[c],c,i))break}return e}}function Bo(n){return function(e){var r=at(e=xa(e))?vt(e):t,o=r?r[0]:e.charAt(0),i=r?Eo(r,1).join(""):e.slice(1);return o[n]()+i}}function Ro(n){return function(e){return Be(Qa(Xa(e).replace(ne,"")),n,"")}}function Do(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Yt(n.prototype),r=n.apply(t,e);return ea(r)?r:t}}function Vo(n){return function(e,r,o){var i=Nn(e);if(!Wu(e)){var u=si(r,3);e=Ia(e),r=function(n){return u(i[n],n,i)}}var a=n(e,r,o);return a>-1?i[u?e[a]:a]:t}}function Ho(n){return oi((function(e){var o=e.length,i=o,u=Xt.prototype.thru;for(n&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new jn(r);if(u&&!c&&"wrapper"==ci(a))var c=new Xt([],!0)}for(i=c?i:o;++i<o;){var l=ci(a=e[i]),s="wrapper"==l?ai(a):t;c=s&&Ei(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[ci(s[0])].apply(c,s[3]):1==a.length&&Ei(a)?c[l]():c.thru(a)}return function(){var n=arguments,t=n[0];if(c&&1==n.length&&Fu(t))return c.plant(t).value();for(var r=0,i=o?e[r].apply(this,n):t;++r<o;)i=e[r].call(this,i);return i}}))}function Yo(n,e,r,o,i,u,a,c,l,f){var d=e&s,h=1&e,v=2&e,p=24&e,g=512&e,y=v?t:Do(n);return function s(){for(var m=arguments.length,x=an(m),w=m;w--;)x[w]=arguments[w];if(p)var b=li(s),_=function(n,e){for(var t=n.length,r=0;t--;)n[t]===e&&++r;return r}(x,b);if(o&&(x=Oo(x,o,i,p)),u&&(x=Po(x,u,a,p)),m-=_,p&&m<f){var E=st(x,b);return Go(n,e,Yo,s.placeholder,r,x,E,c,l,f-m)}var S=h?r:this,k=v?S[n]:n;return m=x.length,c?x=function(n,e){var r=n.length,o=wt(e.length,r),i=jo(n);for(;o--;){var u=e[o];n[o]=wi(u,r)?i[u]:t}return n}(x,c):g&&m>1&&x.reverse(),d&&l<m&&(x.length=l),this&&this!==pe&&this instanceof s&&(k=y||Do(k)),k.apply(S,x)}}function Zo(n,e){return function(t,r){return function(n,e,t,r){return br(n,(function(n,o,i){e(r,t(n),o,i)})),r}(t,n,e(r),{})}}function Xo(n,e){return function(r,o){var i;if(r===t&&o===t)return e;if(r!==t&&(i=r),o!==t){if(i===t)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=lo(r),o=lo(o)),i=n(r,o)}return i}}function Fo(n){return oi((function(e){return e=Le(e,Je(si())),Kr((function(t){var r=this;return n(e,(function(n){return Me(n,r,t)}))}))}))}function Uo(n,e){var r=(e=e===t?" ":so(e)).length;if(r<2)return r?qr(e,n):e;var o=qr(e,ge(n/ht(e)));return at(e)?Eo(vt(o),0,n).join(""):o.slice(0,n)}function Wo(n){return function(e,r,o){return o&&"number"!=typeof o&&bi(e,r,o)&&(r=o=t),e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t,r){for(var o=-1,i=xt(ge((e-n)/(t||1)),0),u=an(i);i--;)u[r?i:++o]=n,n+=t;return u}(e,r,o=o===t?e<r?1:-1:va(o),n)}}function $o(n){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=ya(e),t=ya(t)),n(e,t)}}function Go(n,e,r,o,i,u,l,s,f,d){var h=8&e;e|=h?a:c,4&(e&=~(h?c:a))||(e&=-4);var v=[n,e,i,h?u:t,h?l:t,h?t:u,h?t:l,s,f,d],p=r.apply(t,v);return Ei(n)&&ji(p,v),p.placeholder=o,zi(p,n,e)}function qo(n){var e=Mn[n];return function(n,t){if(n=ya(n),(t=null==t?0:wt(pa(t),292))&&Ve(n)){var r=(xa(n)+"e").split("e");return+((r=(xa(e(r[0]+"e"+(+r[1]+t)))+"e").split("e"))[0]+"e"+(+r[1]-t))}return e(n)}}var Ko=Nt&&1/ft(new Nt([,-0]))[1]==d?function(n){return new Nt(n)}:lc;function Qo(n){return function(e){var t=gi(e);return t==S?ct(e):t==O?dt(e):function(n,e){return Le(e,(function(e){return[e,n[e]]}))}(e,n(e))}}function Jo(n,e,o,l,d,h,v,p){var g=2&e;if(!g&&"function"!=typeof n)throw new jn(r);var y=l?l.length:0;if(y||(e&=-97,l=d=t),v=v===t?v:xt(pa(v),0),p=p===t?p:pa(p),y-=d?d.length:0,e&c){var m=l,x=d;l=d=t}var w=g?t:ai(n),b=[n,e,o,l,d,m,x,h,v,p];if(w&&function(n,e){var t=n[1],r=e[1],o=t|r,u=o<131,a=r==s&&8==t||r==s&&t==f&&n[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==t;if(!u&&!a)return n;1&r&&(n[2]=e[2],o|=1&t?0:4);var c=e[3];if(c){var l=n[3];n[3]=l?Oo(l,c,e[4]):c,n[4]=l?st(n[3],i):e[4]}(c=e[5])&&(l=n[5],n[5]=l?Po(l,c,e[6]):c,n[6]=l?st(n[5],i):e[6]);(c=e[7])&&(n[7]=c);r&s&&(n[8]=null==n[8]?e[8]:wt(n[8],e[8]));null==n[9]&&(n[9]=e[9]);n[0]=e[0],n[1]=o}(b,w),n=b[0],e=b[1],o=b[2],l=b[3],d=b[4],!(p=b[9]=b[9]===t?g?0:n.length:xt(b[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==u?function(n,e,r){var o=Do(n);return function i(){for(var u=arguments.length,a=an(u),c=u,l=li(i);c--;)a[c]=arguments[c];var s=u<3&&a[0]!==l&&a[u-1]!==l?[]:st(a,l);return(u-=s.length)<r?Go(n,e,Yo,i.placeholder,t,a,s,t,t,r-u):Me(this&&this!==pe&&this instanceof i?o:n,this,a)}}(n,e,p):e!=a&&33!=e||d.length?Yo.apply(t,b):function(n,e,t,r){var o=1&e,i=Do(n);return function e(){for(var u=-1,a=arguments.length,c=-1,l=r.length,s=an(l+a),f=this&&this!==pe&&this instanceof e?i:n;++c<l;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Me(f,o?t:this,s)}}(n,e,o,l);else var _=function(n,e,t){var r=1&e,o=Do(n);return function e(){return(this&&this!==pe&&this instanceof e?o:n).apply(r?t:this,arguments)}}(n,e,o);return zi((w?eo:ji)(_,b),n,e)}function ni(n,e,r,o){return n===t||Hu(n,zn[r])&&!Bn.call(o,r)?e:n}function ei(n,e,r,o,i,u){return ea(n)&&ea(e)&&(u.set(e,n),Zr(n,e,t,ei,u),u.delete(e)),n}function ti(n){return ia(n)?t:n}function ri(n,e,r,o,i,u){var a=1&r,c=n.length,l=e.length;if(c!=l&&!(a&&l>c))return!1;var s=u.get(n),f=u.get(e);if(s&&f)return s==e&&f==n;var d=-1,h=!0,v=2&r?new Gt:t;for(u.set(n,e),u.set(e,n);++d<c;){var p=n[d],g=e[d];if(o)var y=a?o(g,p,d,e,n,u):o(p,g,d,n,e,u);if(y!==t){if(y)continue;h=!1;break}if(v){if(!De(e,(function(n,e){if(!et(v,e)&&(p===n||i(p,n,r,o,u)))return v.push(e)}))){h=!1;break}}else if(p!==g&&!i(p,g,r,o,u)){h=!1;break}}return u.delete(n),u.delete(e),h}function oi(n){return Ai(Ni(n,t,Ui),n+"")}function ii(n){return kr(n,Ia,vi)}function ui(n){return kr(n,Aa,pi)}var ai=jt?function(n){return jt.get(n)}:lc;function ci(n){for(var e=n.name+"",t=It[e],r=Bn.call(It,e)?t.length:0;r--;){var o=t[r],i=o.func;if(null==i||i==n)return o.name}return e}function li(n){return(Bn.call(Ht,"placeholder")?Ht:n).placeholder}function si(){var n=Ht.iteratee||ic;return n=n===ic?Tr:n,arguments.length?n(arguments[0],arguments[1]):n}function fi(n,e){var t,r,o=n.__data__;return("string"==(r=typeof(t=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?o["string"==typeof e?"string":"hash"]:o.map}function di(n){for(var e=Ia(n),t=e.length;t--;){var r=e[t],o=n[r];e[t]=[r,o,Ci(o)]}return e}function hi(n,e){var r=function(n,e){return null==n?t:n[e]}(n,e);return Lr(r)?r:t}var vi=xe?function(n){return null==n?[]:(n=Nn(n),Ie(xe(n),(function(e){return qn.call(n,e)})))}:gc,pi=xe?function(n){for(var e=[];n;)Te(e,vi(n)),n=$n(n);return e}:gc,gi=Cr;function yi(n,e,t){for(var r=-1,o=(e=bo(e,n)).length,i=!1;++r<o;){var u=Ri(e[r]);if(!(i=null!=n&&t(n,u)))break;n=n[u]}return i||++r!=o?i:!!(o=null==n?0:n.length)&&na(o)&&wi(u,o)&&(Fu(n)||Xu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Yt($n(n))}function xi(n){return Fu(n)||Xu(n)||!!(Qn&&n&&n[Qn])}function wi(n,e){var t=typeof n;return!!(e=null==e?h:e)&&("number"==t||"symbol"!=t&&wn.test(n))&&n>-1&&n%1==0&&n<e}function bi(n,e,t){if(!ea(t))return!1;var r=typeof e;return!!("number"==r?Wu(t)&&wi(e,t.length):"string"==r&&e in t)&&Hu(t[e],n)}function _i(n,e){if(Fu(n))return!1;var t=typeof n;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=n&&!la(n))||(en.test(n)||!nn.test(n)||null!=e&&n in Nn(e))}function Ei(n){var e=ci(n),t=Ht[e];if("function"!=typeof t||!(e in Ft.prototype))return!1;if(n===t)return!0;var r=ai(t);return!!r&&n===r[0]}(kt&&gi(new kt(new ArrayBuffer(1)))!=z||Ct&&gi(new Ct)!=S||Mt&&gi(Mt.resolve())!=M||Nt&&gi(new Nt)!=O||Ot&&gi(new Ot)!=I)&&(gi=function(n){var e=Cr(n),r=e==C?n.constructor:t,o=r?Di(r):"";if(o)switch(o){case At:return z;case zt:return S;case Lt:return M;case Tt:return O;case Bt:return I}return e});var Si=Ln?Qu:yc;function ki(n){var e=n&&n.constructor;return n===("function"==typeof e&&e.prototype||zn)}function Ci(n){return n==n&&!ea(n)}function Mi(n,e){return function(r){return null!=r&&(r[n]===e&&(e!==t||n in Nn(r)))}}function Ni(n,e,r){return e=xt(e===t?n.length-1:e,0),function(){for(var t=arguments,o=-1,i=xt(t.length-e,0),u=an(i);++o<i;)u[o]=t[e+o];o=-1;for(var a=an(e+1);++o<e;)a[o]=t[o];return a[e]=r(u),Me(n,this,a)}}function Oi(n,e){return e.length<2?n:Sr(n,oo(e,0,-1))}function Pi(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]}var ji=Li(eo),Ii=ve||function(n,e){return pe.setTimeout(n,e)},Ai=Li(to);function zi(n,e,t){var r=e+"";return Ai(n,function(n,e){var t=e.length;if(!t)return n;var r=t-1;return e[r]=(t>1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+e+"] */\n")}(r,function(n,e){return Oe(g,(function(t){var r="_."+t[0];e&t[1]&&!Ae(n,r)&&n.push(r)})),n.sort()}(function(n){var e=n.match(ln);return e?e[1].split(sn):[]}(r),t)))}function Li(n){var e=0,r=0;return function(){var o=bt(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return n.apply(t,arguments)}}function Ti(n,e){var r=-1,o=n.length,i=o-1;for(e=e===t?o:e;++r<e;){var u=Gr(r,i),a=n[u];n[u]=n[r],n[r]=a}return n.length=e,n}var Bi=function(n){var e=Lu(n,(function(n){return 500===t.size&&t.clear(),n})),t=e.cache;return e}((function(n){var e=[];return 46===n.charCodeAt(0)&&e.push(""),n.replace(tn,(function(n,t,r,o){e.push(r?o.replace(hn,"$1"):t||n)})),e}));function Ri(n){if("string"==typeof n||la(n))return n;var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function Di(n){if(null!=n){try{return Tn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Ft)return n.clone();var e=new Xt(n.__wrapped__,n.__chain__);return e.__actions__=jo(n.__actions__),e.__index__=n.__index__,e.__values__=n.__values__,e}var Hi=Kr((function(n,e){return $u(n)?dr(n,mr(e,1,$u,!0)):[]})),Yi=Kr((function(n,e){var r=Ki(e);return $u(r)&&(r=t),$u(n)?dr(n,mr(e,1,$u,!0),si(r,2)):[]})),Zi=Kr((function(n,e){var r=Ki(e);return $u(r)&&(r=t),$u(n)?dr(n,mr(e,1,$u,!0),t,r):[]}));function Xi(n,e,t){var r=null==n?0:n.length;if(!r)return-1;var o=null==t?0:pa(t);return o<0&&(o=xt(r+o,0)),Ye(n,si(e,3),o)}function Fi(n,e,r){var o=null==n?0:n.length;if(!o)return-1;var i=o-1;return r!==t&&(i=pa(r),i=r<0?xt(o+i,0):wt(i,o-1)),Ye(n,si(e,3),i,!0)}function Ui(n){return(null==n?0:n.length)?mr(n,1):[]}function Wi(n){return n&&n.length?n[0]:t}var $i=Kr((function(n){var e=Le(n,xo);return e.length&&e[0]===n[0]?Pr(e):[]})),Gi=Kr((function(n){var e=Ki(n),r=Le(n,xo);return e===Ki(r)?e=t:r.pop(),r.length&&r[0]===n[0]?Pr(r,si(e,2)):[]})),qi=Kr((function(n){var e=Ki(n),r=Le(n,xo);return(e="function"==typeof e?e:t)&&r.pop(),r.length&&r[0]===n[0]?Pr(r,t,e):[]}));function Ki(n){var e=null==n?0:n.length;return e?n[e-1]:t}var Qi=Kr(Ji);function Ji(n,e){return n&&n.length&&e&&e.length?Wr(n,e):n}var nu=oi((function(n,e){var t=null==n?0:n.length,r=ar(n,e);return $r(n,Le(e,(function(n){return wi(n,t)?+n:n})).sort(No)),r}));function eu(n){return null==n?n:St.call(n)}var tu=Kr((function(n){return fo(mr(n,1,$u,!0))})),ru=Kr((function(n){var e=Ki(n);return $u(e)&&(e=t),fo(mr(n,1,$u,!0),si(e,2))})),ou=Kr((function(n){var e=Ki(n);return e="function"==typeof e?e:t,fo(mr(n,1,$u,!0),t,e)}));function iu(n){if(!n||!n.length)return[];var e=0;return n=Ie(n,(function(n){if($u(n))return e=xt(n.length,e),!0})),Ke(e,(function(e){return Le(n,We(e))}))}function uu(n,e){if(!n||!n.length)return[];var r=iu(n);return null==e?r:Le(r,(function(n){return Me(e,t,n)}))}var au=Kr((function(n,e){return $u(n)?dr(n,e):[]})),cu=Kr((function(n){return yo(Ie(n,$u))})),lu=Kr((function(n){var e=Ki(n);return $u(e)&&(e=t),yo(Ie(n,$u),si(e,2))})),su=Kr((function(n){var e=Ki(n);return e="function"==typeof e?e:t,yo(Ie(n,$u),t,e)})),fu=Kr(iu);var du=Kr((function(n){var e=n.length,r=e>1?n[e-1]:t;return r="function"==typeof r?(n.pop(),r):t,uu(n,r)}));function hu(n){var e=Ht(n);return e.__chain__=!0,e}function vu(n,e){return e(n)}var pu=oi((function(n){var e=n.length,r=e?n[0]:0,o=this.__wrapped__,i=function(e){return ar(e,n)};return!(e>1||this.__actions__.length)&&o instanceof Ft&&wi(r)?((o=o.slice(r,+r+(e?1:0))).__actions__.push({func:vu,args:[i],thisArg:t}),new Xt(o,this.__chain__).thru((function(n){return e&&!n.length&&n.push(t),n}))):this.thru(i)}));var gu=Ao((function(n,e,t){Bn.call(n,t)?++n[t]:ur(n,t,1)}));var yu=Vo(Xi),mu=Vo(Fi);function xu(n,e){return(Fu(n)?Oe:hr)(n,si(e,3))}function wu(n,e){return(Fu(n)?Pe:vr)(n,si(e,3))}var bu=Ao((function(n,e,t){Bn.call(n,t)?n[t].push(e):ur(n,t,[e])}));var _u=Kr((function(n,e,t){var r=-1,o="function"==typeof e,i=Wu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Me(e,n,t):jr(n,e,t)})),i})),Eu=Ao((function(n,e,t){ur(n,t,e)}));function Su(n,e){return(Fu(n)?Le:Vr)(n,si(e,3))}var ku=Ao((function(n,e,t){n[t?0:1].push(e)}),(function(){return[[],[]]}));var Cu=Kr((function(n,e){if(null==n)return[];var t=e.length;return t>1&&bi(n,e[0],e[1])?e=[]:t>2&&bi(e[0],e[1],e[2])&&(e=[e[0]]),Fr(n,mr(e,1),[])})),Mu=he||function(){return pe.Date.now()};function Nu(n,e,r){return e=r?t:e,e=n&&null==e?n.length:e,Jo(n,s,t,t,t,t,e)}function Ou(n,e){var o;if("function"!=typeof e)throw new jn(r);return n=pa(n),function(){return--n>0&&(o=e.apply(this,arguments)),n<=1&&(e=t),o}}var Pu=Kr((function(n,e,t){var r=1;if(t.length){var o=st(t,li(Pu));r|=a}return Jo(n,r,e,t,o)})),ju=Kr((function(n,e,t){var r=3;if(t.length){var o=st(t,li(ju));r|=a}return Jo(e,r,n,t,o)}));function Iu(n,e,o){var i,u,a,c,l,s,f=0,d=!1,h=!1,v=!0;if("function"!=typeof n)throw new jn(r);function p(e){var r=i,o=u;return i=u=t,f=e,c=n.apply(o,r)}function g(n){var r=n-s;return s===t||r>=e||r<0||h&&n-f>=a}function y(){var n=Mu();if(g(n))return m(n);l=Ii(y,function(n){var t=e-(n-s);return h?wt(t,a-(n-f)):t}(n))}function m(n){return l=t,v&&i?p(n):(i=u=t,c)}function x(){var n=Mu(),r=g(n);if(i=arguments,u=this,s=n,r){if(l===t)return function(n){return f=n,l=Ii(y,e),d?p(n):c}(s);if(h)return So(l),l=Ii(y,e),p(s)}return l===t&&(l=Ii(y,e)),c}return e=ya(e)||0,ea(o)&&(d=!!o.leading,a=(h="maxWait"in o)?xt(ya(o.maxWait)||0,e):a,v="trailing"in o?!!o.trailing:v),x.cancel=function(){l!==t&&So(l),f=0,i=s=u=l=t},x.flush=function(){return l===t?c:m(Mu())},x}var Au=Kr((function(n,e){return fr(n,1,e)})),zu=Kr((function(n,e,t){return fr(n,ya(e)||0,t)}));function Lu(n,e){if("function"!=typeof n||null!=e&&"function"!=typeof e)throw new jn(r);var t=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=t.cache;if(i.has(o))return i.get(o);var u=n.apply(this,r);return t.cache=i.set(o,u)||i,u};return t.cache=new(Lu.Cache||$t),t}function Tu(n){if("function"!=typeof n)throw new jn(r);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}Lu.Cache=$t;var Bu=_o((function(n,e){var t=(e=1==e.length&&Fu(e[0])?Le(e[0],Je(si())):Le(mr(e,1),Je(si()))).length;return Kr((function(r){for(var o=-1,i=wt(r.length,t);++o<i;)r[o]=e[o].call(this,r[o]);return Me(n,this,r)}))})),Ru=Kr((function(n,e){var r=st(e,li(Ru));return Jo(n,a,t,e,r)})),Du=Kr((function(n,e){var r=st(e,li(Du));return Jo(n,c,t,e,r)})),Vu=oi((function(n,e){return Jo(n,f,t,t,t,e)}));function Hu(n,e){return n===e||n!=n&&e!=e}var Yu=$o(Mr),Zu=$o((function(n,e){return n>=e})),Xu=Ir(function(){return arguments}())?Ir:function(n){return ta(n)&&Bn.call(n,"callee")&&!qn.call(n,"callee")},Fu=an.isArray,Uu=be?Je(be):function(n){return ta(n)&&Cr(n)==A};function Wu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ta(n)&&Wu(n)}var Gu=we||yc,qu=_e?Je(_e):function(n){return ta(n)&&Cr(n)==w};function Ku(n){if(!ta(n))return!1;var e=Cr(n);return e==b||"[object DOMException]"==e||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qu(n){if(!ea(n))return!1;var e=Cr(n);return e==_||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ju(n){return"number"==typeof n&&n==pa(n)}function na(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=h}function ea(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)}function ta(n){return null!=n&&"object"==typeof n}var ra=Ee?Je(Ee):function(n){return ta(n)&&gi(n)==S};function oa(n){return"number"==typeof n||ta(n)&&Cr(n)==k}function ia(n){if(!ta(n)||Cr(n)!=C)return!1;var e=$n(n);if(null===e)return!0;var t=Bn.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&Tn.call(t)==Hn}var ua=Se?Je(Se):function(n){return ta(n)&&Cr(n)==N};var aa=ke?Je(ke):function(n){return ta(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Fu(n)&&ta(n)&&Cr(n)==P}function la(n){return"symbol"==typeof n||ta(n)&&Cr(n)==j}var sa=Ce?Je(Ce):function(n){return ta(n)&&na(n.length)&&!!ce[Cr(n)]};var fa=$o(Dr),da=$o((function(n,e){return n<=e}));function ha(n){if(!n)return[];if(Wu(n))return ca(n)?vt(n):jo(n);if(Jn&&n[Jn])return function(n){for(var e,t=[];!(e=n.next()).done;)t.push(e.value);return t}(n[Jn]());var e=gi(n);return(e==S?ct:e==O?ft:Ha)(n)}function va(n){return n?(n=ya(n))===d||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function pa(n){var e=va(n),t=e%1;return e==e?t?e-t:e:0}function ga(n){return n?cr(pa(n),0,p):0}function ya(n){if("number"==typeof n)return n;if(la(n))return v;if(ea(n)){var e="function"==typeof n.valueOf?n.valueOf():n;n=ea(e)?e+"":e}if("string"!=typeof n)return 0===n?n:+n;n=Qe(n);var t=yn.test(n);return t||xn.test(n)?de(n.slice(2),t?2:8):gn.test(n)?v:+n}function ma(n){return Io(n,Aa(n))}function xa(n){return null==n?"":so(n)}var wa=zo((function(n,e){if(ki(e)||Wu(e))Io(e,Ia(e),n);else for(var t in e)Bn.call(e,t)&&tr(n,t,e[t])})),ba=zo((function(n,e){Io(e,Aa(e),n)})),_a=zo((function(n,e,t,r){Io(e,Aa(e),n,r)})),Ea=zo((function(n,e,t,r){Io(e,Ia(e),n,r)})),Sa=oi(ar);var ka=Kr((function(n,e){n=Nn(n);var r=-1,o=e.length,i=o>2?e[2]:t;for(i&&bi(e[0],e[1],i)&&(o=1);++r<o;)for(var u=e[r],a=Aa(u),c=-1,l=a.length;++c<l;){var s=a[c],f=n[s];(f===t||Hu(f,zn[s])&&!Bn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(t,ei),Me(La,t,n)}));function Ma(n,e,r){var o=null==n?t:Sr(n,e);return o===t?r:o}function Na(n,e){return null!=n&&yi(n,e,Or)}var Oa=Zo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),n[e]=t}),ec(oc)),Pa=Zo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),Bn.call(n,e)?n[e].push(t):n[e]=[t]}),si),ja=Kr(jr);function Ia(n){return Wu(n)?Kt(n):Br(n)}function Aa(n){return Wu(n)?Kt(n,!0):Rr(n)}var za=zo((function(n,e,t){Zr(n,e,t)})),La=zo((function(n,e,t,r){Zr(n,e,t,r)})),Ta=oi((function(n,e){var t={};if(null==n)return t;var r=!1;e=Le(e,(function(e){return e=bo(e,n),r||(r=e.length>1),e})),Io(n,ui(n),t),r&&(t=lr(t,7,ti));for(var o=e.length;o--;)ho(t,e[o]);return t}));var Ba=oi((function(n,e){return null==n?{}:function(n,e){return Ur(n,e,(function(e,t){return Na(n,t)}))}(n,e)}));function Ra(n,e){if(null==n)return{};var t=Le(ui(n),(function(n){return[n]}));return e=si(e),Ur(n,t,(function(n,t){return e(n,t[0])}))}var Da=Qo(Ia),Va=Qo(Aa);function Ha(n){return null==n?[]:nt(n,Ia(n))}var Ya=Ro((function(n,e,t){return e=e.toLowerCase(),n+(t?Za(e):e)}));function Za(n){return Ka(xa(n).toLowerCase())}function Xa(n){return(n=xa(n))&&n.replace(bn,ot).replace(ee,"")}var Fa=Ro((function(n,e,t){return n+(t?"-":"")+e.toLowerCase()})),Ua=Ro((function(n,e,t){return n+(t?" ":"")+e.toLowerCase()})),Wa=Bo("toLowerCase");var $a=Ro((function(n,e,t){return n+(t?"_":"")+e.toLowerCase()}));var Ga=Ro((function(n,e,t){return n+(t?" ":"")+Ka(e)}));var qa=Ro((function(n,e,t){return n+(t?" ":"")+e.toUpperCase()})),Ka=Bo("toUpperCase");function Qa(n,e,r){return n=xa(n),(e=r?t:e)===t?function(n){return ie.test(n)}(n)?function(n){return n.match(re)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(e)||[]}var Ja=Kr((function(n,e){try{return Me(n,t,e)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,e){return Oe(e,(function(e){e=Ri(e),ur(n,e,Pu(n[e],n))})),n}));function ec(n){return function(){return n}}var tc=Ho(),rc=Ho(!0);function oc(n){return n}function ic(n){return Tr("function"==typeof n?n:lr(n,1))}var uc=Kr((function(n,e){return function(t){return jr(t,n,e)}})),ac=Kr((function(n,e){return function(t){return jr(n,t,e)}}));function cc(n,e,t){var r=Ia(e),o=Er(e,r);null!=t||ea(e)&&(o.length||!r.length)||(t=e,e=n,n=this,o=Er(e,Ia(e)));var i=!(ea(t)&&"chain"in t&&!t.chain),u=Qu(n);return Oe(o,(function(t){var r=e[t];n[t]=r,u&&(n.prototype[t]=function(){var e=this.__chain__;if(i||e){var t=n(this.__wrapped__);return(t.__actions__=jo(this.__actions__)).push({func:r,args:arguments,thisArg:n}),t.__chain__=e,t}return r.apply(n,Te([this.value()],arguments))})})),n}function lc(){}var sc=Fo(Le),fc=Fo(je),dc=Fo(De);function hc(n){return _i(n)?We(Ri(n)):function(n){return function(e){return Sr(e,n)}}(n)}var vc=Wo(),pc=Wo(!0);function gc(){return[]}function yc(){return!1}var mc=Xo((function(n,e){return n+e}),0),xc=qo("ceil"),wc=Xo((function(n,e){return n/e}),1),bc=qo("floor");var _c,Ec=Xo((function(n,e){return n*e}),1),Sc=qo("round"),kc=Xo((function(n,e){return n-e}),0);return Ht.after=function(n,e){if("function"!=typeof e)throw new jn(r);return n=pa(n),function(){if(--n<1)return e.apply(this,arguments)}},Ht.ary=Nu,Ht.assign=wa,Ht.assignIn=ba,Ht.assignInWith=_a,Ht.assignWith=Ea,Ht.at=Sa,Ht.before=Ou,Ht.bind=Pu,Ht.bindAll=nc,Ht.bindKey=ju,Ht.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Fu(n)?n:[n]},Ht.chain=hu,Ht.chunk=function(n,e,r){e=(r?bi(n,e,r):e===t)?1:xt(pa(e),0);var o=null==n?0:n.length;if(!o||e<1)return[];for(var i=0,u=0,a=an(ge(o/e));i<o;)a[u++]=oo(n,i,i+=e);return a},Ht.compact=function(n){for(var e=-1,t=null==n?0:n.length,r=0,o=[];++e<t;){var i=n[e];i&&(o[r++]=i)}return o},Ht.concat=function(){var n=arguments.length;if(!n)return[];for(var e=an(n-1),t=arguments[0],r=n;r--;)e[r-1]=arguments[r];return Te(Fu(t)?jo(t):[t],mr(e,1))},Ht.cond=function(n){var e=null==n?0:n.length,t=si();return n=e?Le(n,(function(n){if("function"!=typeof n[1])throw new jn(r);return[t(n[0]),n[1]]})):[],Kr((function(t){for(var r=-1;++r<e;){var o=n[r];if(Me(o[0],this,t))return Me(o[1],this,t)}}))},Ht.conforms=function(n){return function(n){var e=Ia(n);return function(t){return sr(t,n,e)}}(lr(n,1))},Ht.constant=ec,Ht.countBy=gu,Ht.create=function(n,e){var t=Yt(n);return null==e?t:ir(t,e)},Ht.curry=function n(e,r,o){var i=Jo(e,8,t,t,t,t,t,r=o?t:r);return i.placeholder=n.placeholder,i},Ht.curryRight=function n(e,r,o){var i=Jo(e,u,t,t,t,t,t,r=o?t:r);return i.placeholder=n.placeholder,i},Ht.debounce=Iu,Ht.defaults=ka,Ht.defaultsDeep=Ca,Ht.defer=Au,Ht.delay=zu,Ht.difference=Hi,Ht.differenceBy=Yi,Ht.differenceWith=Zi,Ht.drop=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,(e=r||e===t?1:pa(e))<0?0:e,o):[]},Ht.dropRight=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,0,(e=o-(e=r||e===t?1:pa(e)))<0?0:e):[]},Ht.dropRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0,!0):[]},Ht.dropWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0):[]},Ht.fill=function(n,e,r,o){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&bi(n,e,r)&&(r=0,o=i),function(n,e,r,o){var i=n.length;for((r=pa(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:pa(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)n[r++]=e;return n}(n,e,r,o)):[]},Ht.filter=function(n,e){return(Fu(n)?Ie:yr)(n,si(e,3))},Ht.flatMap=function(n,e){return mr(Su(n,e),1)},Ht.flatMapDeep=function(n,e){return mr(Su(n,e),d)},Ht.flatMapDepth=function(n,e,r){return r=r===t?1:pa(r),mr(Su(n,e),r)},Ht.flatten=Ui,Ht.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,d):[]},Ht.flattenDepth=function(n,e){return(null==n?0:n.length)?mr(n,e=e===t?1:pa(e)):[]},Ht.flip=function(n){return Jo(n,512)},Ht.flow=tc,Ht.flowRight=rc,Ht.fromPairs=function(n){for(var e=-1,t=null==n?0:n.length,r={};++e<t;){var o=n[e];r[o[0]]=o[1]}return r},Ht.functions=function(n){return null==n?[]:Er(n,Ia(n))},Ht.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},Ht.groupBy=bu,Ht.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},Ht.intersection=$i,Ht.intersectionBy=Gi,Ht.intersectionWith=qi,Ht.invert=Oa,Ht.invertBy=Pa,Ht.invokeMap=_u,Ht.iteratee=ic,Ht.keyBy=Eu,Ht.keys=Ia,Ht.keysIn=Aa,Ht.map=Su,Ht.mapKeys=function(n,e){var t={};return e=si(e,3),br(n,(function(n,r,o){ur(t,e(n,r,o),n)})),t},Ht.mapValues=function(n,e){var t={};return e=si(e,3),br(n,(function(n,r,o){ur(t,r,e(n,r,o))})),t},Ht.matches=function(n){return Hr(lr(n,1))},Ht.matchesProperty=function(n,e){return Yr(n,lr(e,1))},Ht.memoize=Lu,Ht.merge=za,Ht.mergeWith=La,Ht.method=uc,Ht.methodOf=ac,Ht.mixin=cc,Ht.negate=Tu,Ht.nthArg=function(n){return n=pa(n),Kr((function(e){return Xr(e,n)}))},Ht.omit=Ta,Ht.omitBy=function(n,e){return Ra(n,Tu(si(e)))},Ht.once=function(n){return Ou(2,n)},Ht.orderBy=function(n,e,r,o){return null==n?[]:(Fu(e)||(e=null==e?[]:[e]),Fu(r=o?t:r)||(r=null==r?[]:[r]),Fr(n,e,r))},Ht.over=sc,Ht.overArgs=Bu,Ht.overEvery=fc,Ht.overSome=dc,Ht.partial=Ru,Ht.partialRight=Du,Ht.partition=ku,Ht.pick=Ba,Ht.pickBy=Ra,Ht.property=hc,Ht.propertyOf=function(n){return function(e){return null==n?t:Sr(n,e)}},Ht.pull=Qi,Ht.pullAll=Ji,Ht.pullAllBy=function(n,e,t){return n&&n.length&&e&&e.length?Wr(n,e,si(t,2)):n},Ht.pullAllWith=function(n,e,r){return n&&n.length&&e&&e.length?Wr(n,e,t,r):n},Ht.pullAt=nu,Ht.range=vc,Ht.rangeRight=pc,Ht.rearg=Vu,Ht.reject=function(n,e){return(Fu(n)?Ie:yr)(n,Tu(si(e,3)))},Ht.remove=function(n,e){var t=[];if(!n||!n.length)return t;var r=-1,o=[],i=n.length;for(e=si(e,3);++r<i;){var u=n[r];e(u,r,n)&&(t.push(u),o.push(r))}return $r(n,o),t},Ht.rest=function(n,e){if("function"!=typeof n)throw new jn(r);return Kr(n,e=e===t?e:pa(e))},Ht.reverse=eu,Ht.sampleSize=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),(Fu(n)?Jt:Jr)(n,e)},Ht.set=function(n,e,t){return null==n?n:no(n,e,t)},Ht.setWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:no(n,e,r,o)},Ht.shuffle=function(n){return(Fu(n)?nr:ro)(n)},Ht.slice=function(n,e,r){var o=null==n?0:n.length;return o?(r&&"number"!=typeof r&&bi(n,e,r)?(e=0,r=o):(e=null==e?0:pa(e),r=r===t?o:pa(r)),oo(n,e,r)):[]},Ht.sortBy=Cu,Ht.sortedUniq=function(n){return n&&n.length?co(n):[]},Ht.sortedUniqBy=function(n,e){return n&&n.length?co(n,si(e,2)):[]},Ht.split=function(n,e,r){return r&&"number"!=typeof r&&bi(n,e,r)&&(e=r=t),(r=r===t?p:r>>>0)?(n=xa(n))&&("string"==typeof e||null!=e&&!ua(e))&&!(e=so(e))&&at(n)?Eo(vt(n),0,r):n.split(e,r):[]},Ht.spread=function(n,e){if("function"!=typeof n)throw new jn(r);return e=null==e?0:xt(pa(e),0),Kr((function(t){var r=t[e],o=Eo(t,0,e);return r&&Te(o,r),Me(n,this,o)}))},Ht.tail=function(n){var e=null==n?0:n.length;return e?oo(n,1,e):[]},Ht.take=function(n,e,r){return n&&n.length?oo(n,0,(e=r||e===t?1:pa(e))<0?0:e):[]},Ht.takeRight=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,(e=o-(e=r||e===t?1:pa(e)))<0?0:e,o):[]},Ht.takeRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!1,!0):[]},Ht.takeWhile=function(n,e){return n&&n.length?po(n,si(e,3)):[]},Ht.tap=function(n,e){return e(n),n},Ht.throttle=function(n,e,t){var o=!0,i=!0;if("function"!=typeof n)throw new jn(r);return ea(t)&&(o="leading"in t?!!t.leading:o,i="trailing"in t?!!t.trailing:i),Iu(n,e,{leading:o,maxWait:e,trailing:i})},Ht.thru=vu,Ht.toArray=ha,Ht.toPairs=Da,Ht.toPairsIn=Va,Ht.toPath=function(n){return Fu(n)?Le(n,Ri):la(n)?[n]:jo(Bi(xa(n)))},Ht.toPlainObject=ma,Ht.transform=function(n,e,t){var r=Fu(n),o=r||Gu(n)||sa(n);if(e=si(e,4),null==t){var i=n&&n.constructor;t=o?r?new i:[]:ea(n)&&Qu(i)?Yt($n(n)):{}}return(o?Oe:br)(n,(function(n,r,o){return e(t,n,r,o)})),t},Ht.unary=function(n){return Nu(n,1)},Ht.union=tu,Ht.unionBy=ru,Ht.unionWith=ou,Ht.uniq=function(n){return n&&n.length?fo(n):[]},Ht.uniqBy=function(n,e){return n&&n.length?fo(n,si(e,2)):[]},Ht.uniqWith=function(n,e){return e="function"==typeof e?e:t,n&&n.length?fo(n,t,e):[]},Ht.unset=function(n,e){return null==n||ho(n,e)},Ht.unzip=iu,Ht.unzipWith=uu,Ht.update=function(n,e,t){return null==n?n:vo(n,e,wo(t))},Ht.updateWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:vo(n,e,wo(r),o)},Ht.values=Ha,Ht.valuesIn=function(n){return null==n?[]:nt(n,Aa(n))},Ht.without=au,Ht.words=Qa,Ht.wrap=function(n,e){return Ru(wo(e),n)},Ht.xor=cu,Ht.xorBy=lu,Ht.xorWith=su,Ht.zip=fu,Ht.zipObject=function(n,e){return mo(n||[],e||[],tr)},Ht.zipObjectDeep=function(n,e){return mo(n||[],e||[],no)},Ht.zipWith=du,Ht.entries=Da,Ht.entriesIn=Va,Ht.extend=ba,Ht.extendWith=_a,cc(Ht,Ht),Ht.add=mc,Ht.attempt=Ja,Ht.camelCase=Ya,Ht.capitalize=Za,Ht.ceil=xc,Ht.clamp=function(n,e,r){return r===t&&(r=e,e=t),r!==t&&(r=(r=ya(r))==r?r:0),e!==t&&(e=(e=ya(e))==e?e:0),cr(ya(n),e,r)},Ht.clone=function(n){return lr(n,4)},Ht.cloneDeep=function(n){return lr(n,5)},Ht.cloneDeepWith=function(n,e){return lr(n,5,e="function"==typeof e?e:t)},Ht.cloneWith=function(n,e){return lr(n,4,e="function"==typeof e?e:t)},Ht.conformsTo=function(n,e){return null==e||sr(n,e,Ia(e))},Ht.deburr=Xa,Ht.defaultTo=function(n,e){return null==n||n!=n?e:n},Ht.divide=wc,Ht.endsWith=function(n,e,r){n=xa(n),e=so(e);var o=n.length,i=r=r===t?o:cr(pa(r),0,o);return(r-=e.length)>=0&&n.slice(r,i)==e},Ht.eq=Hu,Ht.escape=function(n){return(n=xa(n))&&q.test(n)?n.replace($,it):n},Ht.escapeRegExp=function(n){return(n=xa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},Ht.every=function(n,e,r){var o=Fu(n)?je:pr;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.find=yu,Ht.findIndex=Xi,Ht.findKey=function(n,e){return He(n,si(e,3),br)},Ht.findLast=mu,Ht.findLastIndex=Fi,Ht.findLastKey=function(n,e){return He(n,si(e,3),_r)},Ht.floor=bc,Ht.forEach=xu,Ht.forEachRight=wu,Ht.forIn=function(n,e){return null==n?n:xr(n,si(e,3),Aa)},Ht.forInRight=function(n,e){return null==n?n:wr(n,si(e,3),Aa)},Ht.forOwn=function(n,e){return n&&br(n,si(e,3))},Ht.forOwnRight=function(n,e){return n&&_r(n,si(e,3))},Ht.get=Ma,Ht.gt=Yu,Ht.gte=Zu,Ht.has=function(n,e){return null!=n&&yi(n,e,Nr)},Ht.hasIn=Na,Ht.head=Wi,Ht.identity=oc,Ht.includes=function(n,e,t,r){n=Wu(n)?n:Ha(n),t=t&&!r?pa(t):0;var o=n.length;return t<0&&(t=xt(o+t,0)),ca(n)?t<=o&&n.indexOf(e,t)>-1:!!o&&Ze(n,e,t)>-1},Ht.indexOf=function(n,e,t){var r=null==n?0:n.length;if(!r)return-1;var o=null==t?0:pa(t);return o<0&&(o=xt(r+o,0)),Ze(n,e,o)},Ht.inRange=function(n,e,r){return e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t){return n>=wt(e,t)&&n<xt(e,t)}(n=ya(n),e,r)},Ht.invoke=ja,Ht.isArguments=Xu,Ht.isArray=Fu,Ht.isArrayBuffer=Uu,Ht.isArrayLike=Wu,Ht.isArrayLikeObject=$u,Ht.isBoolean=function(n){return!0===n||!1===n||ta(n)&&Cr(n)==x},Ht.isBuffer=Gu,Ht.isDate=qu,Ht.isElement=function(n){return ta(n)&&1===n.nodeType&&!ia(n)},Ht.isEmpty=function(n){if(null==n)return!0;if(Wu(n)&&(Fu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Xu(n)))return!n.length;var e=gi(n);if(e==S||e==O)return!n.size;if(ki(n))return!Br(n).length;for(var t in n)if(Bn.call(n,t))return!1;return!0},Ht.isEqual=function(n,e){return Ar(n,e)},Ht.isEqualWith=function(n,e,r){var o=(r="function"==typeof r?r:t)?r(n,e):t;return o===t?Ar(n,e,t,r):!!o},Ht.isError=Ku,Ht.isFinite=function(n){return"number"==typeof n&&Ve(n)},Ht.isFunction=Qu,Ht.isInteger=Ju,Ht.isLength=na,Ht.isMap=ra,Ht.isMatch=function(n,e){return n===e||zr(n,e,di(e))},Ht.isMatchWith=function(n,e,r){return r="function"==typeof r?r:t,zr(n,e,di(e),r)},Ht.isNaN=function(n){return oa(n)&&n!=+n},Ht.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},Ht.isNil=function(n){return null==n},Ht.isNull=function(n){return null===n},Ht.isNumber=oa,Ht.isObject=ea,Ht.isObjectLike=ta,Ht.isPlainObject=ia,Ht.isRegExp=ua,Ht.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=h},Ht.isSet=aa,Ht.isString=ca,Ht.isSymbol=la,Ht.isTypedArray=sa,Ht.isUndefined=function(n){return n===t},Ht.isWeakMap=function(n){return ta(n)&&gi(n)==I},Ht.isWeakSet=function(n){return ta(n)&&"[object WeakSet]"==Cr(n)},Ht.join=function(n,e){return null==n?"":$e.call(n,e)},Ht.kebabCase=Fa,Ht.last=Ki,Ht.lastIndexOf=function(n,e,r){var o=null==n?0:n.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=pa(r))<0?xt(o+i,0):wt(i,o-1)),e==e?function(n,e,t){for(var r=t+1;r--;)if(n[r]===e)return r;return r}(n,e,i):Ye(n,Fe,i,!0)},Ht.lowerCase=Ua,Ht.lowerFirst=Wa,Ht.lt=fa,Ht.lte=da,Ht.max=function(n){return n&&n.length?gr(n,oc,Mr):t},Ht.maxBy=function(n,e){return n&&n.length?gr(n,si(e,2),Mr):t},Ht.mean=function(n){return Ue(n,oc)},Ht.meanBy=function(n,e){return Ue(n,si(e,2))},Ht.min=function(n){return n&&n.length?gr(n,oc,Dr):t},Ht.minBy=function(n,e){return n&&n.length?gr(n,si(e,2),Dr):t},Ht.stubArray=gc,Ht.stubFalse=yc,Ht.stubObject=function(){return{}},Ht.stubString=function(){return""},Ht.stubTrue=function(){return!0},Ht.multiply=Ec,Ht.nth=function(n,e){return n&&n.length?Xr(n,pa(e)):t},Ht.noConflict=function(){return pe._===this&&(pe._=Yn),this},Ht.noop=lc,Ht.now=Mu,Ht.pad=function(n,e,t){n=xa(n);var r=(e=pa(e))?ht(n):0;if(!e||r>=e)return n;var o=(e-r)/2;return Uo(ye(o),t)+n+Uo(ge(o),t)},Ht.padEnd=function(n,e,t){n=xa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?n+Uo(e-r,t):n},Ht.padStart=function(n,e,t){n=xa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?Uo(e-r,t)+n:n},Ht.parseInt=function(n,e,t){return t||null==e?e=0:e&&(e=+e),_t(xa(n).replace(un,""),e||0)},Ht.random=function(n,e,r){if(r&&"boolean"!=typeof r&&bi(n,e,r)&&(e=r=t),r===t&&("boolean"==typeof e?(r=e,e=t):"boolean"==typeof n&&(r=n,n=t)),n===t&&e===t?(n=0,e=1):(n=va(n),e===t?(e=n,n=0):e=va(e)),n>e){var o=n;n=e,e=o}if(r||n%1||e%1){var i=Et();return wt(n+i*(e-n+fe("1e-"+((i+"").length-1))),e)}return Gr(n,e)},Ht.reduce=function(n,e,t){var r=Fu(n)?Be:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,hr)},Ht.reduceRight=function(n,e,t){var r=Fu(n)?Re:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,vr)},Ht.repeat=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),qr(xa(n),e)},Ht.replace=function(){var n=arguments,e=xa(n[0]);return n.length<3?e:e.replace(n[1],n[2])},Ht.result=function(n,e,r){var o=-1,i=(e=bo(e,n)).length;for(i||(i=1,n=t);++o<i;){var u=null==n?t:n[Ri(e[o])];u===t&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},Ht.round=Sc,Ht.runInContext=n,Ht.sample=function(n){return(Fu(n)?Qt:Qr)(n)},Ht.size=function(n){if(null==n)return 0;if(Wu(n))return ca(n)?ht(n):n.length;var e=gi(n);return e==S||e==O?n.size:Br(n).length},Ht.snakeCase=$a,Ht.some=function(n,e,r){var o=Fu(n)?De:io;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.sortedIndex=function(n,e){return uo(n,e)},Ht.sortedIndexBy=function(n,e,t){return ao(n,e,si(t,2))},Ht.sortedIndexOf=function(n,e){var t=null==n?0:n.length;if(t){var r=uo(n,e);if(r<t&&Hu(n[r],e))return r}return-1},Ht.sortedLastIndex=function(n,e){return uo(n,e,!0)},Ht.sortedLastIndexBy=function(n,e,t){return ao(n,e,si(t,2),!0)},Ht.sortedLastIndexOf=function(n,e){if(null==n?0:n.length){var t=uo(n,e,!0)-1;if(Hu(n[t],e))return t}return-1},Ht.startCase=Ga,Ht.startsWith=function(n,e,t){return n=xa(n),t=null==t?0:cr(pa(t),0,n.length),e=so(e),n.slice(t,t+e.length)==e},Ht.subtract=kc,Ht.sum=function(n){return n&&n.length?qe(n,oc):0},Ht.sumBy=function(n,e){return n&&n.length?qe(n,si(e,2)):0},Ht.template=function(n,e,r){var o=Ht.templateSettings;r&&bi(n,e,r)&&(e=t),n=xa(n),e=_a({},e,o,ni);var i,u,a=_a({},e.imports,o.imports,ni),c=Ia(a),l=nt(a,c),s=0,f=e.interpolate||_n,d="__p += '",h=On((e.escape||_n).source+"|"+f.source+"|"+(f===J?vn:_n).source+"|"+(e.evaluate||_n).source+"|$","g"),v="//# sourceURL="+(Bn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ae+"]")+"\n";n.replace(h,(function(e,t,r,o,a,c){return r||(r=o),d+=n.slice(s,c).replace(En,ut),t&&(i=!0,d+="' +\n__e("+t+") +\n'"),a&&(u=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+e.length,e})),d+="';\n";var p=Bn.call(e,"variable")&&e.variable;if(p){if(dn.test(p))throw new kn("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(u?d.replace(X,""):d).replace(F,"$1").replace(U,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Cn(c,v+"return "+d).apply(t,l)}));if(g.source=d,Ku(g))throw g;return g},Ht.times=function(n,e){if((n=pa(n))<1||n>h)return[];var t=p,r=wt(n,p);e=si(e),n-=p;for(var o=Ke(r,e);++t<n;)e(t);return o},Ht.toFinite=va,Ht.toInteger=pa,Ht.toLength=ga,Ht.toLower=function(n){return xa(n).toLowerCase()},Ht.toNumber=ya,Ht.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,h):0===n?n:0},Ht.toString=xa,Ht.toUpper=function(n){return xa(n).toUpperCase()},Ht.trim=function(n,e,r){if((n=xa(n))&&(r||e===t))return Qe(n);if(!n||!(e=so(e)))return n;var o=vt(n),i=vt(e);return Eo(o,tt(o,i),rt(o,i)+1).join("")},Ht.trimEnd=function(n,e,r){if((n=xa(n))&&(r||e===t))return n.slice(0,pt(n)+1);if(!n||!(e=so(e)))return n;var o=vt(n);return Eo(o,0,rt(o,vt(e))+1).join("")},Ht.trimStart=function(n,e,r){if((n=xa(n))&&(r||e===t))return n.replace(un,"");if(!n||!(e=so(e)))return n;var o=vt(n);return Eo(o,tt(o,vt(e))).join("")},Ht.truncate=function(n,e){var r=30,o="...";if(ea(e)){var i="separator"in e?e.separator:i;r="length"in e?pa(e.length):r,o="omission"in e?so(e.omission):o}var u=(n=xa(n)).length;if(at(n)){var a=vt(n);u=a.length}if(r>=u)return n;var c=r-ht(o);if(c<1)return o;var l=a?Eo(a,0,c).join(""):n.slice(0,c);if(i===t)return l+o;if(a&&(c+=l.length-c),ua(i)){if(n.slice(c).search(i)){var s,f=l;for(i.global||(i=On(i.source,xa(pn.exec(i))+"g")),i.lastIndex=0;s=i.exec(f);)var d=s.index;l=l.slice(0,d===t?c:d)}}else if(n.indexOf(so(i),c)!=c){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},Ht.unescape=function(n){return(n=xa(n))&&G.test(n)?n.replace(W,gt):n},Ht.uniqueId=function(n){var e=++Rn;return xa(n)+e},Ht.upperCase=qa,Ht.upperFirst=Ka,Ht.each=xu,Ht.eachRight=wu,Ht.first=Wi,cc(Ht,(_c={},br(Ht,(function(n,e){Bn.call(Ht.prototype,e)||(_c[e]=n)})),_c),{chain:!1}),Ht.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Ht[n].placeholder=Ht})),Oe(["drop","take"],(function(n,e){Ft.prototype[n]=function(r){r=r===t?1:xt(pa(r),0);var o=this.__filtered__&&!e?new Ft(this):this.clone();return o.__filtered__?o.__takeCount__=wt(r,o.__takeCount__):o.__views__.push({size:wt(r,p),type:n+(o.__dir__<0?"Right":"")}),o},Ft.prototype[n+"Right"]=function(e){return this.reverse()[n](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(n,e){var t=e+1,r=1==t||3==t;Ft.prototype[n]=function(n){var e=this.clone();return e.__iteratees__.push({iteratee:si(n,3),type:t}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(n,e){var t="take"+(e?"Right":"");Ft.prototype[n]=function(){return this[t](1).value()[0]}})),Oe(["initial","tail"],(function(n,e){var t="drop"+(e?"":"Right");Ft.prototype[n]=function(){return this.__filtered__?new Ft(this):this[t](1)}})),Ft.prototype.compact=function(){return this.filter(oc)},Ft.prototype.find=function(n){return this.filter(n).head()},Ft.prototype.findLast=function(n){return this.reverse().find(n)},Ft.prototype.invokeMap=Kr((function(n,e){return"function"==typeof n?new Ft(this):this.map((function(t){return jr(t,n,e)}))})),Ft.prototype.reject=function(n){return this.filter(Tu(si(n)))},Ft.prototype.slice=function(n,e){n=pa(n);var r=this;return r.__filtered__&&(n>0||e<0)?new Ft(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==t&&(r=(e=pa(e))<0?r.dropRight(-e):r.take(e-n)),r)},Ft.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ft.prototype.toArray=function(){return this.take(p)},br(Ft.prototype,(function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=Ht[o?"take"+("last"==e?"Right":""):e],u=o||/^find/.test(e);i&&(Ht.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,c=e instanceof Ft,l=a[0],s=c||Fu(e),f=function(n){var e=i.apply(Ht,Te([n],a));return o&&d?e[0]:e};s&&r&&"function"==typeof l&&1!=l.length&&(c=s=!1);var d=this.__chain__,h=!!this.__actions__.length,v=u&&!d,p=c&&!h;if(!u&&s){e=p?e:new Ft(this);var g=n.apply(e,a);return g.__actions__.push({func:vu,args:[f],thisArg:t}),new Xt(g,d)}return v&&p?n.apply(this,a):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(n){var e=In[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);Ht.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Fu(o)?o:[],n)}return this[t]((function(t){return e.apply(Fu(t)?t:[],n)}))}})),br(Ft.prototype,(function(n,e){var t=Ht[e];if(t){var r=t.name+"";Bn.call(It,r)||(It[r]=[]),It[r].push({name:e,func:t})}})),It[Yo(t,2).name]=[{name:"wrapper",func:t}],Ft.prototype.clone=function(){var n=new Ft(this.__wrapped__);return n.__actions__=jo(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=jo(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=jo(this.__views__),n},Ft.prototype.reverse=function(){if(this.__filtered__){var n=new Ft(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ft.prototype.value=function(){var n=this.__wrapped__.value(),e=this.__dir__,t=Fu(n),r=e<0,o=t?n.length:0,i=function(n,e,t){var r=-1,o=t.length;for(;++r<o;){var i=t[r],u=i.size;switch(i.type){case"drop":n+=u;break;case"dropRight":e-=u;break;case"take":e=wt(e,n+u);break;case"takeRight":n=xt(n,e-u)}}return{start:n,end:e}}(0,o,this.__views__),u=i.start,a=i.end,c=a-u,l=r?a:u-1,s=this.__iteratees__,f=s.length,d=0,h=wt(c,this.__takeCount__);if(!t||!r&&o==c&&h==c)return go(n,this.__actions__);var v=[];n:for(;c--&&d<h;){for(var p=-1,g=n[l+=e];++p<f;){var y=s[p],m=y.iteratee,x=y.type,w=m(g);if(2==x)g=w;else if(!w){if(1==x)continue n;break n}}v[d++]=g}return v},Ht.prototype.at=pu,Ht.prototype.chain=function(){return hu(this)},Ht.prototype.commit=function(){return new Xt(this.value(),this.__chain__)},Ht.prototype.next=function(){this.__values__===t&&(this.__values__=ha(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?t:this.__values__[this.__index__++]}},Ht.prototype.plant=function(n){for(var e,r=this;r instanceof Zt;){var o=Vi(r);o.__index__=0,o.__values__=t,e?i.__wrapped__=o:e=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,e},Ht.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ft){var e=n;return this.__actions__.length&&(e=new Ft(this)),(e=e.reverse()).__actions__.push({func:vu,args:[eu],thisArg:t}),new Xt(e,this.__chain__)}return this.thru(eu)},Ht.prototype.toJSON=Ht.prototype.valueOf=Ht.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Ht.prototype.first=Ht.prototype.head,Jn&&(Ht.prototype[Jn]=function(){return this}),Ht}();ye?((ye.exports=yt)._=yt,ge._=yt):pe._=yt}).call(l)}(D_,D_.exports);var V_=s(D_.exports);function H_(n){var e=n.layoutTypes,r=n.layoutConfig,o=void 0===r?T_:r,i=n.edges,u=n.nodeOrigin,a=n.nodes,c=n.container,l=e[null==o?void 0:o.type]||R_[null==o?void 0:o.type];return function(n){return n.every((function(n){var e,t;return(null===(e=n.measured)||void 0===e?void 0:e.width)&&(null===(t=n.measured)||void 0===t?void 0:t.height)}))}(a)&&l?function(n){var e=n.layoutConfig,r=void 0===e?T_:e,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=n.layoutFn,l=V_.cloneDeep(u);l.forEach((function(n){n.data&&(n.data.width=n.measured.width,n.data.height=n.measured.height)}));var s=c(l,o,t({nodeOrigin:i,width:a.width,height:a.height},null==r?void 0:r.options)),f=s.nodes,d=s.edges;return console.log("布局完成"),{nodes:f,edges:d,layoutComplete:!0}}({layoutConfig:o,container:c,nodeOrigin:u,nodes:a,layoutFn:l,edges:i}):{nodes:a,edges:i,layoutComplete:!1}}function Y_(n){var e=n.centerConfig,t=n.width,r=n.height,o=n.transform,i=n.panZoom,u=n.nodeOrigin,a=n.nodes;if(e&&i){var c=a.find((function(n){return n.id===e.centerNodeId}));return c?(function(n){var e=n.node,t=n.height,r=n.width,o=n.zoom,i=void 0===o?1:o,u=n.panZoom,a=n.nodeOrigin,c=dw(e),l=uw(e,a).positionAbsolute,s={x:r/2-(l.x+c.width/2)*i,y:t/2-(l.y+c.height/2)*i};u.setViewport({x:s.x,y:s.y,zoom:i})}({node:c,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0):(e.centerByBBox&&function(n){var e=n.nodes,t=n.nodeOrigin,r=n.height,o=n.width,i=n.zoom,u=void 0===i?1:i,a=n.panZoom,c=qw(e,{nodeOrigin:t}),l={x:o/2-(c.x+c.width/2)*u,y:r/2-(c.y+c.height/2)*u};a.setViewport({x:l.x,y:l.y,zoom:u})}({nodes:a,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var Z_=function(n){var e,r,o=n.nodes,i=n.edges,l=n.defaultNodes,s=n.defaultEdges,f=n.width,d=n.height,h=n.fitView;return e=function(n,e){return t(t({},B_({nodes:o,edges:i,width:f,height:d,fitView:h,defaultNodes:l,defaultEdges:s})),{setNodes:function(e){n({nodes:e})},setEdges:function(e){n({edges:e})},setDefaultNodesAndEdges:function(t,r){t&&((0,e().onNodesChange)({changes:[],userNodes:t}),n({hasDefaultNodes:!0})),r&&((0,e().onEdgesChange)({userEdges:r}),n({hasDefaultEdges:!0}))},updateNodeInternals:function(r){var o=e(),i=o.triggerNodeChanges,u=o.nodeLookup,l=o.parentLookup,s=o.domNode,f=o.nodeOrigin,d=o.debug,h=function(n,e,r,o,i){var u=null==o?void 0:o.querySelector(".xyflow__viewport"),l=!1;if(!u)return{changes:[],updatedInternals:l};var s=[],f=window.getComputedStyle(u),d=new window.DOMMatrixReadOnly(f.transform).m22,h=[];if(n.forEach((function(n){var r=e.get(n.id);if(null==r?void 0:r.hidden)e.set(r.id,t(t({},r),{internals:t(t({},r.internals),{handleBounds:void 0})})),l=!0;else if(r){var o=Nw(n.nodeElement),u=r.measured.width!==o.width||r.measured.height!==o.height;if(o.width&&o.height&&(u||!r.internals.handleBounds||n.force)){var a=t(t({},r),{measured:o,internals:t(t({},r.internals),{handleBounds:{source:Aw(".source",n.nodeElement,d,r.origin||i),target:Aw(".target",n.nodeElement,d,r.origin||i)}})});e.set(r.id,a),l=!0,u&&(s.push({id:a.id,type:"dimensions",dimensions:o}),a.expandParent&&a.parentId&&h.push({id:a.id,parentId:a.parentId,rect:gw(a,a.origin||i)}))}}})),h.length>0){var v=lw(h,e,r,i);s.push.apply(s,c([],a(v),!1))}return{changes:s,updatedInternals:l}}(r,u,l,s,f),v=h.changes;if(h.updatedInternals){var p=V_.cloneDeep(u);n({nodeLookup:p}),ow(u,{nodeOrigin:f}),(null==v?void 0:v.length)>0&&(d&&console.log("Ink Flow: trigger node changes",v),null==i||i(v))}},updateNodePositions:function(n,r){var o,i;void 0===r&&(r=!1);var l=[],s=[];try{for(var f=u(n),d=f.next();!d.done;d=f.next()){var h=a(d.value,2),v=h[0],p=h[1],g={id:v,type:"position",position:p.position,dragging:r};(null==p?void 0:p.expandParent)&&(null==p?void 0:p.parentId)&&g.position&&(l.push({id:v,parentId:p.parentId,rect:t(t({},p.internals.positionAbsolute),{width:p.measured.width,height:p.measured.height})}),g.position.x=Math.max(0,g.position.x),g.position.y=Math.max(0,g.position.y)),s.push(g)}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(l.length>0){var y=e(),m=lw(l,y.nodeLookup,y.parentLookup);s.push.apply(s,c([],a(m),!1))}e().triggerNodeChanges(s)},triggerNodeChanges:function(n){var t=e(),r=t.onNodesChange,o=t.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger node changes",n),r({changes:n}))},triggerEdgeChanges:function(n){var t=e(),r=t.onEdgesChange,o=t.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger edge changes",n),null==r||r({changes:n}))},addSelectedNodes:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,l=t.triggerEdgeChanges;r?u(n.map((function(n){return Fw(n,!0)}))):(u(Uw(i,new Set(c([],a(n),!1)),!0)),l(Uw(o)))},addSelectedEdges:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,l=t.triggerEdgeChanges;r?l(n.map((function(n){return Fw(n,!0)}))):(l(Uw(o,new Set(c([],a(n),!1)))),u(Uw(i,new Set,!0)))},unselectNodesAndEdges:function(n){var t=void 0===n?{}:n,r=t.nodes,o=t.edges,i=e(),u=i.edges,a=i.nodes,c=i.triggerNodeChanges,l=i.triggerEdgeChanges,s=o||u,f=(r||a).map((function(n){return n.selected=!1,Fw(n.id,!1)})),d=s.map((function(n){return Fw(n.id,!1)}));c(f),l(d)},setMinZoom:function(t){var r=e(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([t,i]),n({minZoom:t})},setMaxZoom:function(t){var r=e(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,t]),n({maxZoom:t})},setTranslateExtent:function(t){var r;null===(r=e().panZoom)||void 0===r||r.setTranslateExtent(t),n({translateExtent:t})},resetSelectedElements:function(){var n=e(),t=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,u=r.reduce((function(n,e){return e.selected?c(c([],a(n),!1),[Fw(e.id,!1)],!1):n}),[]),l=t.reduce((function(n,e){return e.selected?c(c([],a(n),!1),[Fw(e.id,!1)],!1):n}),[]);o(u),i(l)},setNodeExtent:function(r){var o,i,c=e().nodeLookup;try{for(var l=u(c),s=l.next();!s.done;s=l.next()){var f=a(s.value,2)[1],d=fw(f.position,r);c.set(f.id,t(t({},f),{internals:t(t({},f.internals),{positionAbsolute:d})}))}}catch(n){o={error:n}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}n({nodeExtent:r})},panBy:function(n){var t=e(),r=t.transform,o=t.width,i=t.height;return function(n){var e=n.delta,t=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,u=n.height;if(!t||!e.x&&!e.y)return!1;var a=t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[i,u]],o);return!!a&&(a.x!==r[0]||a.y!==r[1]||a.k!==r[2])}({delta:n,panZoom:t.panZoom,transform:r,translateExtent:t.translateExtent,width:o,height:i})},cancelConnection:function(){return n({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(r){var o,i=e().connectionPosition,u=t(t({},r),{connectionPosition:null!==(o=r.connectionPosition)&&void 0!==o?o:i});n(u)},reset:function(){return n(t({},B_()))},updateLayout:function(t){var r,o=t.config,i=t.nodes,u=t.force,a=e(),c=a.width,l=a.height,s=a.edges,f=a.layoutTypes,d=a.layoutConfig,h=a.panZoom,v=a.nodeOrigin,p=a.nodeLookup,g=a.parentLookup,y=a.elevateNodesOnSelect,m=a.nodes,x=a.fitViewOnInit,w=a.minZoom,b=a.maxZoom,_=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,M=a.centered,N=a.layoutAnchorId,O=i||Array.from(p.values());if(O.length){var P=O.find((function(n){return n.id===N})),j=H_({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||T_});if(j.layoutComplete&&(cw(j.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:j.layoutComplete}),h&&j.layoutComplete&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){if(N&&P){var I=j.nodes.find((function(n){return n.id===N}));if(!I)return;return function(n){var e=n.position,t=n.targetPosition,r=n.panZoom,o=n.transform,i=o[2],u=(t.x-e.x)*i,a=(t.y-e.y)*i;r.setViewport({x:o[0]+u,y:o[1]+a,zoom:i})}({targetPosition:uw(P,v).position,panZoom:h,position:uw(I,v).position,transform:E}),void n({layoutAnchorId:void 0})}if(u||!(k||M||C))if(d.offsetConfig){var A=function(n){var e=n.offsetConfig,t=n.width,r=n.height,o=n.panZoom,i=n.nodeOrigin,u=n.nodes,a=n.layoutDirection,c=u.find((function(n){return n.id===(null==e?void 0:e.nodeId)}));if(!a||!c)return!1;var l=Gw(c,i).positionAbsolute,s=dw(c),f=t/2,d=r/2,h={x:0,y:0};switch(a){case"BT":h={x:f-l.x-s.width/2,y:r-l.y-e.offset-s.height};break;case"LR":h={x:e.offset-l.x,y:d-l.y-s.height/2};break;case"RL":h={x:t-l.x-e.offset-s.width,y:d-l.y-s.height/2};break;default:h={x:f-l.x-s.width/2,y:e.offset-l.y}}return o.setViewport({x:h.x,y:h.y,zoom:1}),!0}({offsetConfig:d.offsetConfig,width:c,height:l,nodes:Array.from(p.values()),nodeOrigin:v,transform:E,panZoom:h,layoutDirection:null===(r=d.options)||void 0===r?void 0:r.rankdir});n({offsetDone:A})}else{if(x)return Qw({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:x,minZoom:w,maxZoom:b,fitViewOnInitOptions:_,nodeLookup:p}),void n({fitViewDone:!0});S&&(Y_({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var r=n.changes,o=n.userNodes;if(r||o){var i=e(),u=i.setNodes,a=i.nodeLookup,c=i.parentLookup,l=i.elevateNodesOnSelect,s=i.nodeOrigin,f=i.nodes,d=i.autoLayout,h=i.updateLayout,v=!(null==r?void 0:r.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(r||[]),g=[];g=v?(o||[]).map((function(n){var e=a.get(n.id),r=t(t({},e||{}),n);return(null==e?void 0:e.position)&&(r.position=e.position),r})):function(n,e){return Xw(n,e)}(r,Array.from(a.values())),!v&&p||cw(g,a,c,{nodeOrigin:s,elevateNodesOnSelect:l,checkEquality:!0}),d&&(p||o&&o!==f)&&h({nodes:v?Array.from(a.values()):g}),u(o||f)}},onEdgesChange:function(n){var r=n.changes,o=void 0===r?[]:r,i=n.userEdges,u=e(),a=u.connectionLookup,c=u.edgeLookup,l=u.setEdges,s=u.edges,f=!(null==o?void 0:o.length),d=[];d=f?i.map((function(n){var e=c.get(n.id)||{};return t(t({},e),n)})):function(n,e){return Xw(n,e)}(o,Array.from(c.values())),aw(a,c,d),i&&l(f?i||[]:s)},updateLayoutConfig:function(t){var r=e(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;V_.isEqual(t,u)||(n({layoutConfig:t}),o&&i({config:t,force:!0}))},setLayoutAnchorId:function(e){n({layoutAnchorId:e})}})},r=Object.is,e?I(e,r):I};function X_(e){var t=e.initialNodes,r=e.initialEdges,o=e.defaultNodes,i=e.defaultEdges,u=e.initialWidth,c=e.initialHeight,l=e.fitView,s=e.children,f=a(n.useState((function(){return Z_({nodes:t,edges:r,defaultNodes:o,defaultEdges:i,width:u,height:c,fitView:l})})),1)[0];return p.jsx(z,{value:f,children:p.jsx(db,{children:s})})}function F_(e){var t=e.children,r=e.nodes,o=e.edges,i=e.defaultNodes,u=e.defaultEdges,a=e.width,c=e.height,l=e.fitView;return n.useContext(A)?p.jsx(p.Fragment,{children:t}):p.jsx(X_,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:t})}var U_=c(c([],a(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions","nodeOrigin","autoLayout","centerConfig","layoutTypes"]),!1),["rfId"],!1),W_=function(n){return{setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,onNodesChange:n.onNodesChange,onEdgesChange:n.onEdgesChange,updateLayoutConfig:n.updateLayoutConfig}},$_={translateExtent:yv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function G_(e){var r=tw(W_,Rw),o=r.setMinZoom,i=r.setMaxZoom,a=r.setTranslateExtent,c=r.setNodeExtent,l=r.reset,s=r.setDefaultNodesAndEdges,f=r.onNodesChange,d=r.onEdgesChange,h=r.updateLayoutConfig,v=rw();n.useEffect((function(){return s(e.defaultNodes,e.defaultEdges),function(){p.current=$_,l()}}),[]);var p=n.useRef($_);return n.useEffect((function(){var n,r,l,s;try{for(var g=u(U_),y=g.next();!y.done;y=g.next()){var m=y.value,x=e[m];if(x!==p.current[m]&&void 0!==e[m])if("nodes"===m)f({userNodes:x});else if("edges"===m)d({userEdges:x});else if("minZoom"===m)o(x);else if("maxZoom"===m)i(x);else if("translateExtent"===m)a(x);else if("nodeExtent"===m)c(x);else if("fitView"===m)v.setState({fitViewOnInit:x});else if("fitViewOptions"===m)v.setState({fitViewOnInitOptions:x});else if("layoutConfig"===m){var w=x||{},b=t(t({},w),{options:t(t({},w.options||{}),{rankdir:(null===(s=w.options)||void 0===s?void 0:s.rankdir)||"TB"})});h(b)}else v.setState(((l={})[m]=x,l))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}p.current=e}),U_.map((function(n){return e[n]}))),null}var q_={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var K_=bw((function(n,e){var o=n.nodes,i=n.edges,u=n.translateExtent,a=void 0===u?yv:u,c=n.defaultViewport,l=void 0===c?L_:c,s=n.minZoom,f=void 0===s?.5:s,d=n.maxZoom,h=void 0===d?2:d,v=n.defaultMarkerColor,g=void 0===v?"#b1b1b7":v,y=n.nodeOrigin,m=n.noDragClassName,x=n.noPanClassName,b=n.disableKeyboardA11y,_=n.nodeTypes,E=n.edgeTypes;n.connectionMode;var S=n.connectionLineType,k=void 0===S?exports.ConnectionLineType.Bezier:S,C=n.connectionLineStyle,M=n.connectionLineComponent,N=n.connectionLineContainerStyle,O=n.onNodeClick,P=n.onNodeDoubleClick,j=n.onNodeMouseEnter,I=n.onNodeMouseMove,A=n.onNodeMouseLeave,z=n.onNodeContextMenu,L=n.onEdgeClick,T=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,R=n.onEdgeMouseLeave,D=n.onEdgeContextMenu,V=n.onEdgeDoubleClick,H=n.fitView,Y=n.fitViewOptions,Z=n.nodeExtent,X=n.nodesDraggable,F=n.children,U=n.id,W=n.width,$=n.height,G=n.onPaneClick,q=n.onPaneContextMenu,K=n.onPaneMouseEnter,Q=n.onPaneMouseMove,J=n.onPaneMouseLeave,nn=n.onPaneScroll,en=n.elementsSelectable,tn=void 0===en||en,rn=n.autoLayout,on=void 0===rn||rn,un=n.layoutConfig,an=void 0===un?T_:un,cn=n.centerConfig,ln=void 0===cn?{}:cn,sn=n.layoutTypes,fn=void 0===sn?{}:sn,dn=r(n,["nodes","edges","translateExtent","defaultViewport","minZoom","maxZoom","defaultMarkerColor","nodeOrigin","noDragClassName","noPanClassName","disableKeyboardA11y","nodeTypes","edgeTypes","connectionMode","connectionLineType","connectionLineStyle","connectionLineComponent","connectionLineContainerStyle","onNodeClick","onNodeDoubleClick","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onEdgeClick","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","onEdgeContextMenu","onEdgeDoubleClick","fitView","fitViewOptions","nodeExtent","nodesDraggable","children","id","width","height","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoLayout","layoutConfig","centerConfig","layoutTypes"]),hn=U||"1";return p.jsx("div",t({},dn,{ref:e,style:t({},q_),className:w(["ink-flow"]),"data-testid":"rf__wrapper",id:U,children:p.jsxs(F_,{nodes:o,edges:i,width:W,height:$,fitView:H,children:[p.jsx(z_,{onNodeClick:O,onNodeMouseEnter:j,onNodeMouseMove:I,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:P,onEdgeClick:L,onEdgeMouseEnter:T,onEdgeMouseMove:B,onEdgeMouseLeave:R,onEdgeContextMenu:D,onEdgeDoubleClick:V,rfId:hn,nodeTypes:_,edgeTypes:E,minZoom:f,maxZoom:h,nodeOrigin:y,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,translateExtent:a,defaultMarkerColor:g,connectionLineType:k,connectionLineStyle:C,connectionLineComponent:M,connectionLineContainerStyle:N,defaultViewport:l,onPaneClick:G,onPaneContextMenu:q,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:J,onPaneScroll:nn}),p.jsx(G_,{nodes:o,edges:i,rfId:hn,fitView:H,fitViewOptions:Y,nodeExtent:Z,nodesDraggable:X,elementsSelectable:tn,minZoom:f,maxZoom:h,nodeOrigin:y,autoLayout:on,layoutConfig:an,layoutTypes:fn,centerConfig:ln}),F]})}))}));function Q_(){return p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4.375C10.3452 4.375 10.625 4.65482 10.625 5V9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H10.625V15C10.625 15.3452 10.3452 15.625 10 15.625C9.65482 15.625 9.375 15.3452 9.375 15V10.625H5C4.65482 10.625 4.375 10.3452 4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H9.375V5C9.375 4.65482 9.65482 4.375 10 4.375Z",fill:"#6B7280"})})}function J_(){return p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H5C4.65482 10.625 4.375 10.3452 4.375 10Z",fill:"#6B7280"})})}function nE(){return p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1.875C10.3452 1.875 10.625 2.15482 10.625 2.5V3.57152C13.6929 3.86613 16.1339 6.30708 16.4285 9.375H17.5C17.8452 9.375 18.125 9.65482 18.125 10C18.125 10.3452 17.8452 10.625 17.5 10.625H16.4285C16.1339 13.6929 13.6929 16.1339 10.625 16.4285V17.5C10.625 17.8452 10.3452 18.125 10 18.125C9.65482 18.125 9.375 17.8452 9.375 17.5V16.4285C6.30708 16.1339 3.86613 13.6929 3.57152 10.625H2.5C2.15482 10.625 1.875 10.3452 1.875 10C1.875 9.65482 2.15482 9.375 2.5 9.375H3.57152C3.86613 6.30708 6.30708 3.86613 9.375 3.57152V2.5C9.375 2.15482 9.65482 1.875 10 1.875ZM4.82878 10.625H5.83333C6.17851 10.625 6.45833 10.3452 6.45833 10C6.45833 9.65482 6.17851 9.375 5.83333 9.375H4.82878C5.11304 6.99811 6.99811 5.11304 9.375 4.82878V5.83333C9.375 6.17851 9.65482 6.45833 10 6.45833C10.3452 6.45833 10.625 6.17851 10.625 5.83333V4.82878C13.0019 5.11304 14.887 6.99811 15.1712 9.375H14.1667C13.8215 9.375 13.5417 9.65482 13.5417 10C13.5417 10.3452 13.8215 10.625 14.1667 10.625H15.1712C14.887 13.0019 13.0019 14.887 10.625 15.1712V14.1667C10.625 13.8215 10.3452 13.5417 10 13.5417C9.65482 13.5417 9.375 13.8215 9.375 14.1667V15.1712C6.99811 14.887 5.11304 13.0019 4.82878 10.625Z",fill:"#6B7280"})})}function eE(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function tE(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function rE(n){var e=n.children,o=n.className,i=r(n,["children","className"]);return p.jsx("button",t({type:"button",className:w(["ink-flow__controls-button",o])},i,{children:e}))}var oE=function(n){return n.userSelectionActive?"none":"all"};function iE(n){var e=n.position,o=void 0===e?"top-left":e,i=n.children,u=n.className,l=n.style,s=r(n,["position","children","className","style"]),f=tw(oE),d="".concat(o).split("-");return p.jsx("div",t({className:w(c(["ink-flow__panel",u],a(d),!1)),style:t(t({},l),{pointerEvents:f})},s,{children:i}))}var uE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function aE(n){var e=n.style,t=n.showZoom,r=void 0===t||t,o=n.showFitView,i=void 0===o||o,u=n.showInteractive,a=void 0===u||u,c=n.fitViewOptions,l=n.onZoomIn,s=n.onZoomOut,f=n.onFitView,d=n.onInteractiveChange,h=n.className,v=n.children,g=n.position,y=void 0===g?"bottom-left":g,m=n.orientation,x=void 0===m?"vertical":m,b=n["aria-label"],_=void 0===b?"Ink Flow controls":b,E=rw(),S=tw(uE,Rw),k=S.isInteractive,C=S.minZoomReached,M=S.maxZoomReached,N=pb(),O=N.zoomIn,P=N.zoomOut,j=N.fitView,I="horizontal"===x?"horizontal":"vertical";return p.jsxs(iE,{className:w(["ink-flow__controls",I,h]),position:y,style:e,"data-testid":"rf__controls","aria-label":_,children:[i&&p.jsx(rE,{className:"ink-flow__controls-fitview",onClick:function(){j(c),null==f||f()},"aria-label":"fit view",children:p.jsx(nE,{})}),r&&p.jsxs("div",{className:"ink-flow__controls-zoom",children:[p.jsx(rE,{onClick:function(){O(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:M,children:p.jsx(Q_,{})}),p.jsx(rE,{onClick:function(){P(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:C,children:p.jsx(J_,{})})]}),a&&p.jsx(rE,{className:"ink-flow__controls-interactive",onClick:function(){E.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),null==d||d(!k)},title:"toggle interactivity","aria-label":"toggle interactivity",children:k?p.jsx(tE,{}):p.jsx(eE,{})}),v]})}aE.displayName="Controls";var cE,lE,sE=n.memo(aE);function fE(n){var e=n.dimensions,t=n.lineWidth,r=n.variant,o=n.className;return p.jsx("path",{strokeWidth:t,d:"M".concat(e[0]/2," 0 V").concat(e[1]," M0 ").concat(e[1]/2," H").concat(e[0]),className:w(["react-flow__background-pattern",r,o])})}function dE(n){var e=n.radius,t=n.className;return p.jsx("circle",{cx:e,cy:e,r:e,className:w(["react-flow__background-pattern","dots",t])})}exports.BackgroundVariant=void 0,(cE=exports.BackgroundVariant||(exports.BackgroundVariant={})).Lines="lines",cE.Dots="dots",cE.Cross="cross";var hE=((lE={})[exports.BackgroundVariant.Dots]=1,lE[exports.BackgroundVariant.Lines]=1,lE[exports.BackgroundVariant.Cross]=6,lE),vE=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function pE(e){var r=e.id,o=e.variant,i=void 0===o?exports.BackgroundVariant.Dots:o,u=e.gap,a=void 0===u?20:u,c=e.size,l=e.lineWidth,s=void 0===l?1:l,f=e.offset,d=void 0===f?2:f,h=e.color,v=e.bgColor,g=e.style,y=e.className,m=e.patternClassName,x=n.useRef(null),b=tw(vE,Rw),_=b.transform,E=b.patternId,S=c||hE[i],k=i===exports.BackgroundVariant.Dots,C=i===exports.BackgroundVariant.Cross,M=Array.isArray(a)?a:[a,a],N=[M[0]*_[2]||1,M[1]*_[2]||1],O=S*_[2],P=C?[O,O]:N,j=k?[O/d,O/d]:[P[0]/d,P[1]/d],I="".concat(E).concat(r||"");return p.jsxs("svg",{className:w(["ink-flow__background",y]),style:t(t(t({},g),Dw),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:x,"data-testid":"rf__background",children:[p.jsx("pattern",{id:I,x:_[0]%N[0],y:_[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(j[0],",-").concat(j[1],")"),children:k?p.jsx(dE,{radius:O/d,className:m}):p.jsx(fE,{dimensions:P,lineWidth:s,variant:i,className:m})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(I,")")})]})}pE.displayName="Background";var gE=n.memo(pE),yE=function(n){var e;return null===(e=n.domNode)||void 0===e?void 0:e.querySelector(".ink-flow__edgelabel-renderer")};exports.Background=gE,exports.BaseEdge=Wb,exports.ControlButton=rE,exports.Controls=sE,exports.EdgeLabelRenderer=function(n){var t=n.children,r=tw(yE);return r?e.createPortal(t,r):null},exports.Handle=jb,exports.InkFlowProvider=X_,exports.SmoothStepEdge=n_,exports.StepEdge=r_,exports.addEdge=function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(t=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?L({},n):L(L({},n),{id:$v(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):e;var t},exports.dagreLayout=Jv,exports.default=K_,exports.getBezierEdgeCenter=Yv,exports.getBezierPath=Fv,exports.getConnectedEdges=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))},exports.getEdgeCenter=Uv,exports.getIncomers=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.target===n.id&&r.add(e.source)})),e.filter((function(n){return r.has(n.id)}))},exports.getNodesBounds=Ev,exports.getOutgoers=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.source===n.id&&r.add(e.target)})),e.filter((function(n){return r.has(n.id)}))},exports.getSmoothStepPath=Qv,exports.getStraightPath=function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=B(Uv({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),u,a,c,l]},exports.getViewportForBounds=Lv,exports.updateEdge=function(n,e,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}(n,["id"]);if(!e.source||!e.target)return t;if(!t.find((function(e){return e.id===n.id})))return t;var u=L(L({},i),{id:r.shouldReplaceId?$v(e):o,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle});return t.filter((function(n){return n.id!==o})).concat(u)},exports.useEdgesState=function(e){var t=a(n.useState(e),2);return[t[0],t[1]]},exports.useInkFlow=pb,exports.useNodesState=function(e){var t=a(n.useState(e),2);return[t[0],t[1]]},exports.useStore=tw,exports.useStoreApi=rw;
|
|
25
25
|
//# sourceMappingURL=index.cjs.js.map
|