@aloudata/ink-flow 1.0.26 → 1.0.27
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/container/Viewport/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useNodeInView.d.ts +10 -0
- package/dist/hooks/useNodeInView.d.ts.map +1 -0
- package/dist/hooks/useNodesInView.d.ts +12 -0
- package/dist/hooks/useNodesInView.d.ts.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/general.d.ts +7 -0
- package/dist/utils/general.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -13,7 +13,7 @@ S=C,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
|
-
*/j.exports=function(){if(O)return I;O=1;var e=n,t=L(),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 I.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},I}();var R=x(j.exports);const T=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:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&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:D}=n,{useSyncExternalStoreWithSelector:B}=R,V=n=>n;function H(n,e=V,t){const r=B(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return D(r),r}const Y=(n,e)=>{const t=(n=>n?T(n):T)(n),r=(n,r=e)=>H(t,n,r);return Object.assign(r,t),r};var X=e(null),Z=X.Provider,W=function(){return W=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},W.apply(this,arguments)};function F(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}function U(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 $(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 G(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 q,K,Q,J,nn,en,tn,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,wn,xn,bn,_n,En,Sn,kn,Cn,Nn,Mn,On,Pn,jn,In,An,zn,Ln,Rn,Tn,Dn,Bn,Vn,Hn,Yn,Xn,Zn,Wn,Fn,Un,$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,we,xe,be,_e,Ee,Se,ke,Ce,Ne,Me,Oe,Pe,je,Ie,Ae,ze,Le,Re,Te,De,Be,Ve,He,Ye,Xe,Ze,We,Fe,Ue,$e,Ge,qe,Ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Qe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Je(){return J?Q:(J=1,Q=function(n,e){return n===e||n!=n&&e!=e})}function nt(){if(en)return nn;en=1;var n=Je();return nn=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1},nn}function et(){if(dn)return fn;dn=1;var n=K?q:(K=1,q=function(){this.__data__=[],this.size=0}),e=function(){if(rn)return tn;rn=1;var n=nt(),e=Array.prototype.splice;return tn=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(un)return on;un=1;var n=nt();return on=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}}(),r=function(){if(cn)return an;cn=1;var n=nt();return an=function(e){return n(this.__data__,e)>-1}}(),o=function(){if(sn)return ln;sn=1;var n=nt();return ln=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,fn=i}function tt(){if(_n)return bn;_n=1;var n="object"==typeof Ke&&Ke&&Ke.Object===Object&&Ke;return bn=n}function rt(){if(Sn)return En;Sn=1;var n=tt(),e="object"==typeof self&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return En=t}function ot(){if(Cn)return kn;Cn=1;var n=rt().Symbol;return kn=n}function it(){if(In)return jn;In=1;var n=ot(),e=function(){if(Mn)return Nn;Mn=1;var n=ot(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;return Nn=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(Pn)return On;Pn=1;var n=Object.prototype.toString;return On=function(e){return n.call(e)}}(),r=n?n.toStringTag:void 0;return jn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?e(n):t(n)}}function ut(){return zn?An:(zn=1,An=function(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)})}function at(){if(Rn)return Ln;Rn=1;var n=it(),e=ut();return Ln=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 ct(){if(Yn)return Hn;Yn=1;var n=Function.prototype.toString;return Hn=function(e){if(null!=e){try{return n.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function lt(){if($n)return Un;$n=1;var n=function(){if(Zn)return Xn;Zn=1;var n=at(),e=function(){if(Vn)return Bn;Vn=1;var n,e=function(){if(Dn)return Tn;Dn=1;var n=rt()["__core-js_shared__"];return Tn=n}(),t=(n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Bn=function(n){return!!t&&t in n}}(),t=ut(),r=ct(),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 Xn=function(i){return!(!t(i)||e(i))&&(n(i)?l:o).test(r(i))}}(),e=Fn?Wn:(Fn=1,Wn=function(n,e){return null==n?void 0:n[e]});return Un=function(t,r){var o=e(t,r);return n(o)?o:void 0}}function st(){if(qn)return Gn;qn=1;var n=lt()(rt(),"Map");return Gn=n}function ft(){if(Qn)return Kn;Qn=1;var n=lt()(Object,"create");return Kn=n}function dt(){if(ge)return pe;ge=1;var n=ve?he:(ve=1,he=function(n){var e=typeof n;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n});return pe=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}}function ht(){if(Ce)return ke;Ce=1;var n=function(){if(de)return fe;de=1;var n=function(){if(se)return le;se=1;var n=function(){if(ne)return Jn;ne=1;var n=ft();return Jn=function(){this.__data__=n?n(null):{},this.size=0}}(),e=te?ee:(te=1,ee=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}),t=function(){if(oe)return re;oe=1;var n=ft(),e=Object.prototype.hasOwnProperty;return re=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(ue)return ie;ue=1;var n=ft(),e=Object.prototype.hasOwnProperty;return ie=function(t){var r=this.__data__;return n?void 0!==r[t]:e.call(r,t)}}(),o=function(){if(ce)return ae;ce=1;var n=ft();return ae=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,le=i}(),e=et(),t=st();return fe=function(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}}(),e=function(){if(me)return ye;me=1;var n=dt();return ye=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}}(),t=function(){if(xe)return we;xe=1;var n=dt();return we=function(e){return n(this,e).get(e)}}(),r=function(){if(_e)return be;_e=1;var n=dt();return be=function(e){return n(this,e).has(e)}}(),o=function(){if(Se)return Ee;Se=1;var n=dt();return Ee=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,ke=i}function vt(){if(Pe)return Oe;Pe=1;var n=et(),e=function(){if(vn)return hn;vn=1;var n=et();return hn=function(){this.__data__=new n,this.size=0}}(),t=gn?pn:(gn=1,pn=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}),r=mn?yn:(mn=1,yn=function(n){return this.__data__.get(n)}),o=xn?wn:(xn=1,wn=function(n){return this.__data__.has(n)}),i=function(){if(Me)return Ne;Me=1;var n=et(),e=st(),t=ht();return Ne=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,Oe=u}function pt(){return Ie||(Ie=1,je=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}),je}function gt(){if(ze)return Ae;ze=1;var n=lt(),e=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Ae=e}function yt(){if(Re)return Le;Re=1;var n=gt();return Le=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}}function mt(){if(De)return Te;De=1;var n=yt(),e=Je(),t=Object.prototype.hasOwnProperty;return Te=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 wt(){if(Ve)return Be;Ve=1;var n=mt(),e=yt();return Be=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 xt(){return Ze?Xe:(Ze=1,Xe=function(n){return null!=n&&"object"==typeof n})}function bt(){if($e)return Ue;$e=1;var n=function(){if(Fe)return We;Fe=1;var n=it(),e=xt();return We=function(t){return e(t)&&"[object Arguments]"==n(t)}}(),e=xt(),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 Ue=i}function _t(){if(qe)return Ge;qe=1;var n=Array.isArray;return Ge=n}var Et,St,kt,Ct,Nt,Mt,Ot,Pt,jt,It,At,zt={exports:{}};function Lt(){return kt||(kt=1,function(n,e){var t=rt(),r=St?Et:(St=1,Et=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}(zt,zt.exports)),zt.exports}function Rt(){if(Nt)return Ct;Nt=1;var n=/^(?:0|[1-9]\d*)$/;return Ct=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 Tt(){return Ot?Mt:(Ot=1,Mt=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Dt(){return At?It:(At=1,It=function(n){return function(e){return n(e)}})}var Bt,Vt,Ht,Yt,Xt,Zt,Wt,Ft,Ut,$t,Gt,qt,Kt,Qt,Jt,nr,er,tr,rr,or,ir,ur,ar,cr,lr,sr,fr,dr={exports:{}};function hr(){return Bt||(Bt=1,n=dr,e=dr.exports,t=tt(),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),dr.exports;var n,e,t,r,o,i,u}function vr(){if(Ht)return Vt;Ht=1;var n=function(){if(jt)return Pt;jt=1;var n=it(),e=Tt(),t=xt(),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,Pt=function(o){return t(o)&&e(o.length)&&!!r[n(o)]}}(),e=Dt(),t=hr(),r=t&&t.isTypedArray,o=r?e(r):n;return Vt=o}function pr(){if(Xt)return Yt;Xt=1;var n=Ye?He:(Ye=1,He=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}),e=bt(),t=_t(),r=Lt(),o=Rt(),i=vr(),u=Object.prototype.hasOwnProperty;return Yt=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 gr(){if(Wt)return Zt;Wt=1;var n=Object.prototype;return Zt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}}function yr(){return Ut||(Ut=1,Ft=function(n,e){return function(t){return n(e(t))}}),Ft}function mr(){if(Kt)return qt;Kt=1;var n=gr(),e=function(){if(Gt)return $t;Gt=1;var n=yr()(Object.keys,Object);return $t=n}(),t=Object.prototype.hasOwnProperty;return qt=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 wr(){if(Jt)return Qt;Jt=1;var n=at(),e=Tt();return Qt=function(t){return null!=t&&e(t.length)&&!n(t)}}function xr(){if(er)return nr;er=1;var n=pr(),e=mr(),t=wr();return nr=function(r){return t(r)?n(r):e(r)}}function br(){if(lr)return cr;lr=1;var n=pr(),e=function(){if(ar)return ur;ar=1;var n=ut(),e=gr(),t=ir?or:(ir=1,or=function(n){var e=[];if(null!=n)for(var t in Object(n))e.push(t);return e}),r=Object.prototype.hasOwnProperty;return ur=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=wr();return cr=function(r){return t(r)?n(r,!0):e(r)}}var _r,Er,Sr,kr,Cr,Nr,Mr,Or,Pr,jr,Ir,Ar,zr,Lr,Rr,Tr,Dr,Br,Vr,Hr,Yr,Xr,Zr,Wr,Fr,Ur,$r,Gr,qr,Kr,Qr,Jr,no,eo,to,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,xo,bo,_o,Eo,So,ko,Co,No,Mo,Oo,Po,jo,Io,Ao,zo,Lo,Ro,To,Do,Bo,Vo,Ho,Yo,Xo,Zo,Wo,Fo,Uo,$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,wi,xi,bi,_i,Ei,Si,ki,Ci,Ni,Mi,Oi,Pi,ji,Ii,Ai,zi,Li,Ri,Ti,Di,Bi,Vi,Hi,Yi,Xi,Zi,Wi,Fi,Ui,$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,wu,xu,bu,_u,Eu,Su,ku,Cu,Nu,Mu,Ou,Pu,ju,Iu,Au,zu,Lu,Ru,Tu,Du,Bu,Vu,Hu,Yu,Xu,Zu,Wu,Fu,Uu,$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,wa,xa,ba,_a,Ea,Sa,ka,Ca,Na,Ma,Oa,Pa,ja,Ia,Aa,za,La,Ra,Ta,Da,Ba,Va,Ha,Ya,Xa,Za,Wa,Fa,Ua,$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,wc,xc,bc,_c,Ec,Sc,kc,Cc,Nc,Mc,Oc,Pc,jc,Ic,Ac={exports:{}};function zc(){return _r||(_r=1,function(n,e){var t=rt(),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}}(Ac,Ac.exports)),Ac.exports}function Lc(){return Sr||(Sr=1,Er=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}),Er}function Rc(){return Cr||(Cr=1,kr=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}),kr}function Tc(){return Mr?Nr:(Mr=1,Nr=function(){return[]})}function Dc(){if(Pr)return Or;Pr=1;var n=Rc(),e=Tc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Or=r?function(e){return null==e?[]:(e=Object(e),n(r(e),(function(n){return t.call(e,n)})))}:e}function Bc(){return zr||(zr=1,Ar=function(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}),Ar}function Vc(){if(Rr)return Lr;Rr=1;var n=yr()(Object.getPrototypeOf,Object);return Lr=n}function Hc(){if(Dr)return Tr;Dr=1;var n=Bc(),e=Vc(),t=Dc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)n(o,t(r)),r=e(r);return o}:r}function Yc(){if(Yr)return Hr;Yr=1;var n=Bc(),e=_t();return Hr=function(t,r,o){var i=r(t);return e(t)?i:n(i,o(t))}}function Xc(){if(Zr)return Xr;Zr=1;var n=Yc(),e=Dc(),t=xr();return Xr=function(r){return n(r,t,e)}}function Zc(){if(Qr)return Kr;Qr=1;var n=lt()(rt(),"Set");return Kr=n}function Wc(){if(to)return eo;to=1;var n=function(){if($r)return Ur;$r=1;var n=lt()(rt(),"DataView");return Ur=n}(),e=st(),t=function(){if(qr)return Gr;qr=1;var n=lt()(rt(),"Promise");return Gr=n}(),r=Zc(),o=function(){if(no)return Jr;no=1;var n=lt()(rt(),"WeakMap");return Jr=n}(),i=it(),u=ct(),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}),eo=y}function Fc(){if(uo)return io;uo=1;var n=rt().Uint8Array;return io=n}function Uc(){if(co)return ao;co=1;var n=Fc();return ao=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}}function $c(){if(yo)return go;yo=1;var n=Uc();return go=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}}function Gc(){if(bo)return xo;bo=1;var n=ut(),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 xo=t}function qc(){if(Eo)return _o;Eo=1;var n=Gc(),e=Vc(),t=gr();return _o=function(r){return"function"!=typeof r.constructor||t(r)?{}:n(e(r))}}function Kc(){if(Ao)return Io;Ao=1;var n=vt(),e=pt(),t=mt(),r=function(){if(rr)return tr;rr=1;var n=wt(),e=xr();return tr=function(t,r){return t&&n(r,e(r),t)}}(),o=function(){if(fr)return sr;fr=1;var n=wt(),e=br();return sr=function(t,r){return t&&n(r,e(r),t)}}(),i=zc(),u=Lc(),a=function(){if(Ir)return jr;Ir=1;var n=wt(),e=Dc();return jr=function(t,r){return n(t,e(t),r)}}(),c=function(){if(Vr)return Br;Vr=1;var n=wt(),e=Hc();return Br=function(t,r){return n(t,e(t),r)}}(),l=Xc(),s=function(){if(Fr)return Wr;Fr=1;var n=Yc(),e=Hc(),t=br();return Wr=function(r){return n(r,t,e)}}(),f=Wc(),d=function(){if(oo)return ro;oo=1;var n=Object.prototype.hasOwnProperty;return ro=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},ro}(),h=function(){if(wo)return mo;wo=1;var n=Uc(),e=function(){if(so)return lo;so=1;var n=Uc();return lo=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}}(),t=function(){if(ho)return fo;ho=1;var n=/\w*$/;return fo=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}(),r=function(){if(po)return vo;po=1;var n=ot(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;return vo=function(n){return t?Object(t.call(n)):{}}}(),o=$c();return mo=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=qc(),p=_t(),g=Lt(),y=function(){if(No)return Co;No=1;var n=function(){if(ko)return So;ko=1;var n=Wc(),e=xt();return So=function(t){return e(t)&&"[object Map]"==n(t)}}(),e=Dt(),t=hr(),r=t&&t.isMap,o=r?e(r):n;return Co=o}(),m=ut(),w=function(){if(jo)return Po;jo=1;var n=function(){if(Oo)return Mo;Oo=1;var n=Wc(),e=xt();return Mo=function(t){return e(t)&&"[object Set]"==n(t)}}(),e=Dt(),t=hr(),r=t&&t.isSet,o=r?e(r):n;return Po=o}(),x=xr(),b=br(),_="[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,Io=function C(N,M,O,P,j,I){var A,z=1&M,L=2&M,R=4&M;if(O&&(A=j?O(N,P,j,I):O(N)),void 0!==A)return A;if(!m(N))return N;var T=p(N);if(T){if(A=d(N),!z)return u(N,A)}else{var D=f(N),B=D==E||"[object GeneratorFunction]"==D;if(g(N))return i(N,z);if(D==S||D==_||B&&!j){if(A=L||B?{}:v(N),!z)return L?c(N,o(A,N)):a(N,r(A,N))}else{if(!k[D])return j?N:{};A=h(N,D,z)}}I||(I=new n);var V=I.get(N);if(V)return V;I.set(N,A),w(N)?N.forEach((function(n){A.add(C(n,M,O,n,N,I))})):y(N)&&N.forEach((function(n,e){A.set(e,C(n,M,O,e,N,I))}));var H=T?void 0:(R?L?s:l:L?b:x)(N);return e(H||N,(function(n,e){H&&(n=N[e=n]),t(A,e,C(n,M,O,e,N,I))})),A},Io}function Qc(){if(Lo)return zo;Lo=1;var n=Kc();return zo=function(e){return n(e,4)}}function Jc(){return To?Ro:(To=1,Ro=function(n){return function(){return n}})}function nl(){if(Ho)return Vo;Ho=1;var n=(Bo?Do:(Bo=1,Do=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 Vo=n}function el(){if(Xo)return Yo;Xo=1;var n=nl(),e=xr();return Yo=function(t,r){return t&&n(t,r,e)}}function tl(){if(Uo)return Fo;Uo=1;var n=el(),e=function(){if(Wo)return Zo;Wo=1;var n=wr();return Zo=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 Fo=e}function rl(){return Go?$o:(Go=1,$o=function(n){return n})}function ol(){if(Ko)return qo;Ko=1;var n=rl();return qo=function(e){return"function"==typeof e?e:n}}function il(){if(Jo)return Qo;Jo=1;var n=pt(),e=tl(),t=ol(),r=_t();return Qo=function(o,i){return(r(o)?n:e)(o,t(i))}}function ul(){return ei?ni:(ei=1,ni=il())}function al(){if(li)return ci;li=1;var n=ht(),e=ii?oi:(ii=1,oi=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=ai?ui:(ai=1,ui=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,ci=r}function cl(){return hi?di:(hi=1,di=function(n,e){return n.has(e)})}function ll(){if(pi)return vi;pi=1;var n=al(),e=(fi||(fi=1,si=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}),si),t=cl();return vi=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 w=l?u(m,y,v,o,r,c):u(y,m,v,r,o,c);if(void 0!==w){if(w)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},vi}function sl(){return wi||(wi=1,mi=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}),mi}function fl(){if(ki)return Si;ki=1;var n=vt(),e=ll(),t=function(){if(bi)return xi;bi=1;var n=ot(),e=Fc(),t=Je(),r=ll(),o=yi?gi:(yi=1,gi=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}),i=sl(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return xi=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(Ei)return _i;Ei=1;var n=Xc(),e=Object.prototype.hasOwnProperty;return _i=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 w=c?i(m,y,d,r,t,a):i(y,m,d,t,r,a);if(!(void 0===w?y===m||u(y,m,o,i,a):w)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var x=t.constructor,b=r.constructor;x==b||!("constructor"in t)||!("constructor"in r)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(t),a.delete(r),p}}(),o=Wc(),i=_t(),u=Lt(),a=vr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return Si=function(d,h,v,p,g,y){var m=i(d),w=i(h),x=m?l:o(d),b=w?l:o(h),_=(x=x==c?s:x)==s,E=(b=b==c?s:b)==s,S=x==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,x,v,p,g,y);if(!(1&v)){var k=_&&f.call(d,"__wrapped__"),C=E&&f.call(h,"__wrapped__");if(k||C){var N=k?d.value():d,M=C?h.value():h;return y||(y=new n),g(N,M,v,p,y)}}return!!S&&(y||(y=new n),r(d,h,v,p,g,y))}}function dl(){if(Ni)return Ci;Ni=1;var n=fl(),e=xt();return Ci=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))},Ci}function hl(){if(ji)return Pi;ji=1;var n=ut();return Pi=function(e){return e==e&&!n(e)}}function vl(){return Li?zi:(Li=1,zi=function(n,e){return function(t){return null!=t&&t[n]===e&&(void 0!==e||n in Object(t))}})}function pl(){if(Bi)return Di;Bi=1;var n=it(),e=xt();return Di=function(t){return"symbol"==typeof t||e(t)&&"[object Symbol]"==n(t)}}function gl(){if(Hi)return Vi;Hi=1;var n=_t(),e=pl(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Vi=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 yl(){return Gi||(Gi=1,$i=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}),$i}function ml(){if(Ji)return Qi;Ji=1;var n=function(){if(Ki)return qi;Ki=1;var n=ot(),e=yl(),t=_t(),r=pl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return qi=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},qi}();return Qi=function(e){return null==e?"":n(e)}}function wl(){if(eu)return nu;eu=1;var n=_t(),e=gl(),t=function(){if(Ui)return Fi;Ui=1;var n=function(){if(Wi)return Zi;Wi=1;var n=function(){if(Xi)return Yi;Xi=1;var n=ht();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,Yi=e}();return Zi=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 Fi=r}(),r=ml();return nu=function(o,i){return n(o)?o:e(o,i)?[o]:t(r(o))}}function xl(){if(ru)return tu;ru=1;var n=pl();return tu=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}}function bl(){if(iu)return ou;iu=1;var n=wl(),e=xl();return ou=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 _l(){if(fu)return su;fu=1;var n=wl(),e=bt(),t=_t(),r=Rt(),o=Tt(),i=xl();return su=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 El(){if(hu)return du;hu=1;var n=lu?cu:(lu=1,cu=function(n,e){return null!=n&&e in Object(n)}),e=_l();return du=function(t,r){return null!=t&&e(t,r,n)}}function Sl(){return yu?gu:(yu=1,gu=function(n){return function(e){return null==e?void 0:e[n]}})}function kl(){if(Eu)return _u;Eu=1;var n=function(){if(Ti)return Ri;Ti=1;var n=function(){if(Oi)return Mi;Oi=1;var n=vt(),e=dl();return Mi=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(Ai)return Ii;Ai=1;var n=hl(),e=xr();return Ii=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=vl();return Ri=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(pu)return vu;pu=1;var n=dl(),e=function(){if(au)return uu;au=1;var n=bl();return uu=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}}(),t=El(),r=gl(),o=hl(),i=vl(),u=xl();return vu=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=rl(),r=_t(),o=function(){if(bu)return xu;bu=1;var n=Sl(),e=function(){if(wu)return mu;wu=1;var n=bl();return mu=function(e){return function(t){return n(t,e)}}}(),t=gl(),r=xl();return xu=function(o){return t(o)?n(r(o)):e(o)}}();return _u=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 Cl(){if(ku)return Su;ku=1;var n=Rc(),e=function(){if(ri)return ti;ri=1;var n=tl();return ti=function(e,t){var r=[];return n(e,(function(n,e,o){t(n,e,o)&&r.push(n)})),r}}(),t=kl(),r=_t();return Su=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function Nl(){if(Ou)return Mu;Ou=1;var n=function(){if(Nu)return Cu;Nu=1;var n=Object.prototype.hasOwnProperty;return Cu=function(e,t){return null!=e&&n.call(e,t)}}(),e=_l();return Mu=function(t,r){return null!=t&&e(t,r,n)}}function Ml(){if(ju)return Pu;ju=1;var n=mr(),e=Wc(),t=bt(),r=_t(),o=wr(),i=Lt(),u=gr(),a=vr(),c=Object.prototype.hasOwnProperty;return Pu=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 Ol(){return Au?Iu:(Au=1,Iu=function(n){return void 0===n})}function Pl(){if(Lu)return zu;Lu=1;var n=tl(),e=wr();return zu=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 jl(){if(Tu)return Ru;Tu=1;var n=yl(),e=kl(),t=Pl(),r=_t();return Ru=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function Il(){if(Xu)return Yu;Xu=1;var n=(Bu||(Bu=1,Du=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}),Du),e=tl(),t=kl(),r=Hu?Vu:(Hu=1,Vu=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=_t();return Yu=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,t(u,4),a,l,e)},Yu}function Al(){if(ea)return na;ea=1;var n=mr(),e=Wc(),t=wr(),r=function(){if(Wu)return Zu;Wu=1;var n=it(),e=_t(),t=xt();return Zu=function(r){return"string"==typeof r||!e(r)&&t(r)&&"[object String]"==n(r)}}(),o=function(){if(Ju)return Qu;Ju=1;var n=function(){if(Uu)return Fu;Uu=1;var n=Sl()("length");return Fu=n}(),e=function(){if(Gu)return $u;Gu=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return $u=function(e){return n.test(e)}}(),t=function(){if(Ku)return qu;Ku=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 qu=function(n){for(var e=f.lastIndex=0;f.test(n);)++e;return e}}();return Qu=function(r){return e(r)?t(r):n(r)}}();return na=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 zl(){if(ra)return ta;ra=1;var n=pt(),e=Gc(),t=el(),r=kl(),o=Vc(),i=_t(),u=Lt(),a=at(),c=ut(),l=vr();return ta=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 Ll(){if(aa)return ua;aa=1;var n=Bc(),e=function(){if(ia)return oa;ia=1;var n=ot(),e=bt(),t=_t(),r=n?n.isConcatSpreadable:void 0;return oa=function(n){return t(n)||e(n)||!!(r&&n&&n[r])}}();return ua=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},ua}function Rl(){if(fa)return sa;fa=1;var n=la?ca:(la=1,ca=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 sa=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)}},sa}function Tl(){if(ya)return ga;ya=1;var n=function(){if(ha)return da;ha=1;var n=Jc(),e=gt(),t=rl();return da=e?function(t,r){return e(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:t}(),e=function(){if(pa)return va;pa=1;var n=Date.now;return va=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)}},va}(),t=e(n);return ga=t}function Dl(){if(wa)return ma;wa=1;var n=rl(),e=Rl(),t=Tl();return ma=function(r,o){return t(e(r,o,n),r+"")},ma}function Bl(){return ba||(ba=1,xa=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}),xa}function Vl(){if(Ta)return Ra;Ta=1;var n=al(),e=function(){if(Oa)return Ma;Oa=1;var n=function(){if(Na)return Ca;Na=1;var n=Bl(),e=Ea?_a:(Ea=1,_a=function(n){return n!=n}),t=(ka||(ka=1,Sa=function(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}),Sa);return Ca=function(r,o,i){return o==o?t(r,o,i):n(r,e,i)},Ca}();return Ma=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1},Ma}(),t=(ja||(ja=1,Pa=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}),Pa),r=cl(),o=function(){if(La)return za;La=1;var n=Zc(),e=Aa?Ia:(Aa=1,Ia=function(){}),t=sl(),r=n&&1/t(new n([,-0]))[1]==1/0?function(e){return new n(e)}:e;return za=r}(),i=sl();return Ra=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},Ra}function Hl(){if(Ba)return Da;Ba=1;var n=wr(),e=xt();return Da=function(t){return e(t)&&n(t)}}function Yl(){if(Ha)return Va;Ha=1;var n=Ll(),e=Dl(),t=Vl(),r=Hl(),o=e((function(e){return t(n(e,1,r,!0))}));return Va=o}function Xl(){if(Wa)return Za;Wa=1;var n=function(){if(Xa)return Ya;Xa=1;var n=yl();return Ya=function(e,t){return n(t,(function(n){return e[n]}))}}(),e=xr();return Za=function(t){return null==t?[]:n(t,e(t))}}function Zl(){if(Ua)return Fa;var n;Ua=1;try{n={clone:Qc(),constant:Jc(),each:ul(),filter:Cl(),has:Nl(),isArray:_t(),isEmpty:Ml(),isFunction:at(),isUndefined:Ol(),keys:xr(),map:jl(),reduce:Il(),size:Al(),transform:zl(),union:Yl(),values:Xl()}}catch(n){}return n||(n=window._),Fa=n}function Wl(){if(Ga)return $a;Ga=1;var n=Zl();$a=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))},$a}function Fl(){if(ec)return nc;ec=1;var n=Zl(),e=Wl();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 nc={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 Ul(){if(rc)return tc;rc=1;var n=Zl();return tc=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},tc}function $l(){if(ic)return oc;ic=1;var n=Zl();function e(){this._arr=[],this._keyIndices={}}return oc=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},oc}function Gl(){if(ac)return uc;ac=1;var n=Zl(),e=$l();uc=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 uc}function ql(){if(lc)return cc;lc=1;var n=Gl(),e=Zl();return cc=function(t,r,o){return e.transform(t.nodes(),(function(e,i){e[i]=n(t,i,r,o)}),{})}}function Kl(){if(fc)return sc;fc=1;var n=Zl();return sc=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},sc}function Ql(){if(hc)return dc;hc=1;var n=Zl(),e=Kl();return dc=function(t){return n.filter(e(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function Jl(){if(pc)return vc;pc=1;var n=Zl();vc=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 vc}function ns(){if(yc)return gc;yc=1;var n=Zl();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 gc=e,e.CycleException=t,t.prototype=new Error,gc}function es(){if(wc)return mc;wc=1;var n=ns();return mc=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}function ts(){if(bc)return xc;bc=1;var n=Zl();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 xc=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},xc}function rs(){if(Ec)return _c;Ec=1;var n=ts();return _c=function(e,t){return n(e,t,"post")}}function os(){if(kc)return Sc;kc=1;var n=ts();return Sc=function(e,t){return n(e,t,"pre")}}function is(){if(Nc)return Cc;Nc=1;var n=Zl(),e=Wl(),t=$l();return Cc=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},Cc}try{Ic=function(){if(jc)return Pc;jc=1;var n=Ja?Qa:(Ja=1,Qa={Graph:Wl(),version:Ka?qa:(Ka=1,qa="2.1.8")});return Pc={Graph:n.Graph,json:Fl(),alg:Oc?Mc:(Oc=1,Mc={components:Ul(),dijkstra:Gl(),dijkstraAll:ql(),findCycles:Ql(),floydWarshall:Jl(),isAcyclic:es(),postorder:rs(),preorder:os(),prim:is(),tarjan:Kl(),topsort:ns()}),version:n.version}}()}catch(W){}Ic||(Ic=window.graphlib);var us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,ws,xs,bs,_s,Es,Ss,ks,Cs,Ns,Ms,Os,Ps,js,Is,As,zs,Ls,Rs,Ts,Ds,Bs,Vs,Hs,Ys,Xs,Zs,Ws,Fs,Us,$s,Gs,qs,Ks,Qs,Js,nf,ef,tf,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,wf,xf,bf,_f,Ef,Sf,kf,Cf,Nf,Mf,Of,Pf,jf,If,Af,zf,Lf,Rf,Tf,Df,Bf,Vf,Hf,Yf,Xf,Zf,Wf,Ff=Ic;function Uf(){if(ls)return cs;ls=1;var n=Je(),e=wr(),t=Rt(),r=ut();return cs=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 $f(){if(bs)return xs;bs=1;var n=function(){if(ws)return ms;ws=1;var n=function(){if(ys)return gs;ys=1;var n=function(){if(ps)return vs;ps=1;var n=/\s/;return vs=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}}(),e=/^\s+/;return gs=function(t){return t?t.slice(0,n(t)+1).replace(e,""):t}}(),e=ut(),t=pl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return ms=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 xs=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 Gf(){if(Os)return Ms;Os=1;var n=Ll();return Ms=function(e){return null!=e&&e.length?n(e,1):[]},Ms}function qf(){if(Ts)return Rs;Ts=1;var n=pl();return Rs=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},Rs}function Kf(){if(Xs)return Ys;Xs=1;var n=yt(),e=Je();return Ys=function(t,r,o){(void 0!==o&&!e(t[r],o)||void 0===o&&!(r in t))&&n(t,r,o)}}function Qf(){return Us?Fs:(Us=1,Fs=function(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]})}function Jf(){return uf?of:(uf=1,of=function(n,e){return n<e})}function nd(){if(Rf)return Lf;Rf=1;var n=yl(),e=bl(),t=kl(),r=Pl(),o=(Pf||(Pf=1,Of=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}),Of),i=Dt(),u=function(){if(zf)return Af;zf=1;var n=function(){if(If)return jf;If=1;var n=pl();return jf=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 Af=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=rl(),c=_t();return Lf=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{Wf={cloneDeep:function(){if(as)return us;as=1;var n=Kc();return us=function(e){return n(e,5)}}(),constant:Jc(),defaults:function(){if(fs)return ss;fs=1;var n=Dl(),e=Je(),t=Uf(),r=br(),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 ss=u}(),each:ul(),filter:Cl(),find:function(){if(Ns)return Cs;Ns=1;var n=function(){if(hs)return ds;hs=1;var n=kl(),e=wr(),t=xr();return ds=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(ks)return Ss;ks=1;var n=Bl(),e=kl(),t=function(){if(Es)return _s;Es=1;var n=$f();return _s=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return Ss=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)},Ss}());return Cs=n}(),flatten:Gf(),forEach:il(),forIn:function(){if(js)return Ps;js=1;var n=nl(),e=ol(),t=br();return Ps=function(r,o){return null==r?r:n(r,e(o),t)}}(),has:Nl(),isUndefined:Ol(),last:(As||(As=1,Is=function(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}),Is),map:jl(),mapValues:function(){if(Ls)return zs;Ls=1;var n=yt(),e=el(),t=kl();return zs=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(Hs)return Vs;Hs=1;var n=qf(),e=Bs?Ds:(Bs=1,Ds=function(n,e){return n>e}),t=rl();return Vs=function(r){return r&&r.length?n(r,t,e):void 0}}(),merge:function(){if(rf)return tf;rf=1;var n=function(){if(Js)return Qs;Js=1;var n=vt(),e=Kf(),t=nl(),r=function(){if(Ks)return qs;Ks=1;var n=Kf(),e=zc(),t=$c(),r=Lc(),o=qc(),i=bt(),u=_t(),a=Hl(),c=Lt(),l=at(),s=ut(),f=function(){if(Ws)return Zs;Ws=1;var n=it(),e=Vc(),t=xt(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return Zs=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=vr(),h=Qf(),v=function(){if(Gs)return $s;Gs=1;var n=wt(),e=br();return $s=function(t){return n(t,e(t))}}();return qs=function(p,g,y,m,w,x,b){var _=h(p,y),E=h(g,y),S=b.get(E);if(S)n(p,y,S);else{var k=x?x(_,E,y+"",p,g,b):void 0,C=void 0===k;if(C){var N=u(E),M=!N&&c(E),O=!N&&!M&&d(E);k=E,N||M||O?u(_)?k=_:a(_)?k=r(_):M?(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),w(k,E,m,x,b),b.delete(E)),n(p,y,k)}}}(),o=ut(),i=br(),u=Qf();return Qs=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)},Qs}(),e=function(){if(ef)return nf;ef=1;var n=Dl(),e=Uf();return nf=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 tf=e}(),min:function(){if(cf)return af;cf=1;var n=qf(),e=Jf(),t=rl();return af=function(r){return r&&r.length?n(r,t,e):void 0}}(),minBy:function(){if(sf)return lf;sf=1;var n=qf(),e=kl(),t=Jf();return lf=function(r,o){return r&&r.length?n(r,e(o,2),t):void 0},lf}(),now:function(){if(df)return ff;df=1;var n=rt();return ff=function(){return n.Date.now()}}(),pick:function(){if(_f)return bf;_f=1;var n=function(){if(mf)return yf;mf=1;var n=function(){if(gf)return pf;gf=1;var n=bl(),e=function(){if(vf)return hf;vf=1;var n=mt(),e=wl(),t=Rt(),r=ut(),o=xl();return hf=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=wl();return pf=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=El();return yf=function(t,r){return n(t,r,(function(n,r){return e(t,r)}))}}(),e=function(){if(xf)return wf;xf=1;var n=Gf(),e=Rl(),t=Tl();return wf=function(r){return t(e(r,void 0,n),r+"")}}()((function(e,t){return null==e?{}:n(e,t)}));return bf=e}(),range:function(){if(Mf)return Nf;Mf=1;var n=function(){if(Cf)return kf;Cf=1;var n=function(){if(Sf)return Ef;Sf=1;var n=Math.ceil,e=Math.max;return Ef=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},Ef}(),e=Uf(),t=$f();return kf=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)}},kf}()();return Nf=n}(),reduce:Il(),sortBy:function(){if(Df)return Tf;Df=1;var n=Ll(),e=nd(),t=Dl(),r=Uf(),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 Tf=o}(),uniqueId:function(){if(Vf)return Bf;Vf=1;var n=ml(),e=0;return Bf=function(t){var r=++e;return n(t)+r}}(),values:Xl(),zipObject:function(){if(Zf)return Xf;Zf=1;var n=mt(),e=Yf?Hf:(Yf=1,Hf=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 Xf=function(t,r){return e(t||[],r||[],n)}}()}}catch(W){}Wf||(Wf=window._);var ed=Wf,td=rd;function rd(){var n={};n._next=n._prev=n,this._sentinel=n}function od(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function id(n,e){if("_next"!==n&&"_prev"!==n)return e}rd.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return od(e),e},rd.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&od(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},rd.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,id)),t=t._prev;return"["+n.join(", ")+"]"};var ud=ed,ad=Ff.Graph,cd=td,ld=ud.constant(1);function sd(n,e,t,r,o){var i=o?[]:void 0;return ud.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,fd(e,t,a)})),ud.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,fd(e,t,u)})),n.removeNode(r.v),i}function fd(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 dd=ed,hd=function(n,e){if(n.nodeCount()<=1)return[];var t=function(n,e){var t=new ad,r=0,o=0;ud.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),ud.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=ud.range(o+r+3).map((function(){return new cd})),u=r+1;return ud.forEach(t.nodes(),(function(n){fd(i,u,t.node(n))})),{graph:t,buckets:i,zeroIdx:u}}(n,e||ld),r=function(n,e,t){for(var r,o=[],i=e[e.length-1],u=e[0];n.nodeCount();){for(;r=u.dequeue();)sd(n,e,t,r);for(;r=i.dequeue();)sd(n,e,t,r);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(r=e[a].dequeue()){o=o.concat(sd(n,e,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return ud.flatten(ud.map(r,(function(e){return n.outEdges(e.v,e.w)})),!0)},vd={run:function(n){var e="greedy"===n.graph().acyclicer?hd(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],t={},r={};return dd.forEach(n.nodes(),(function o(i){dd.has(r,i)||(r[i]=!0,t[i]=!0,dd.forEach(n.outEdges(i),(function(n){dd.has(t,n.w)?e.push(n):o(n.w)})),delete t[i])})),e}(n);dd.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,dd.uniqueId("rev"))}))},undo:function(n){dd.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)}}))}},pd=ed,gd=Ff.Graph,yd={addDummyNode:md,simplify:function(n){var e=(new gd).setGraph(n.graph());return pd.forEach(n.nodes(),(function(t){e.setNode(t,n.node(t))})),pd.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 gd({multigraph:n.isMultigraph()}).setGraph(n.graph());return pd.forEach(n.nodes(),(function(t){n.children(t).length||e.setNode(t,n.node(t))})),pd.forEach(n.edges(),(function(t){e.setEdge(t,n.edge(t))})),e},successorWeights:function(n){var e=pd.map(n.nodes(),(function(e){var t={};return pd.forEach(n.outEdges(e),(function(e){t[e.w]=(t[e.w]||0)+n.edge(e).weight})),t}));return pd.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=pd.map(n.nodes(),(function(e){var t={};return pd.forEach(n.inEdges(e),(function(e){t[e.v]=(t[e.v]||0)+n.edge(e).weight})),t}));return pd.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=pd.map(pd.range(wd(n)+1),(function(){return[]}));return pd.forEach(n.nodes(),(function(t){var r=n.node(t),o=r.rank;pd.isUndefined(o)||(e[o][r.order]=t)})),e},normalizeRanks:function(n){var e=pd.min(pd.map(n.nodes(),(function(e){return n.node(e).rank})));pd.forEach(n.nodes(),(function(t){var r=n.node(t);pd.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(n){var e=pd.min(pd.map(n.nodes(),(function(e){return n.node(e).rank}))),t=[];pd.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;pd.forEach(t,(function(e,t){pd.isUndefined(e)&&t%o!=0?--r:r&&pd.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),md(n,"border",o,e)},maxRank:wd,partition:function(n,e){var t={lhs:[],rhs:[]};return pd.forEach(n,(function(n){e(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,e){var t=pd.now();try{return e()}finally{console.log(n+" time: "+(pd.now()-t)+"ms")}},notime:function(n,e){return e()}};function md(n,e,t,r){var o;do{o=pd.uniqueId(r)}while(n.hasNode(o));return t.dummy=e,n.setNode(o,t),o}function wd(n){return pd.max(pd.map(n.nodes(),(function(e){var t=n.node(e).rank;if(!pd.isUndefined(t))return t})))}var xd=ed,bd=yd,_d={run:function(n){n.graph().dummyChains=[],xd.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=bd.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){xd.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)}))}},Ed=ed,Sd=function(n){var e={};Ed.forEach(n.sources(),(function t(r){var o=n.node(r);if(Ed.has(e,r))return o.rank;e[r]=!0;var i=Ed.min(Ed.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}))},kd=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},Cd=ed,Nd=Ff.Graph,Md=kd,Od=function(n){var e,t,r=new Nd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Pd(r,n)<i;)e=jd(r,n),t=r.hasNode(e.v)?Md(n,e):-Md(n,e),Id(r,n,t);return r};function Pd(n,e){return Cd.forEach(n.nodes(),(function t(r){Cd.forEach(e.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||Md(e,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),t(u))}))})),n.nodeCount()}function jd(n,e){return Cd.minBy(e.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return Md(e,t)}))}function Id(n,e,t){Cd.forEach(n.nodes(),(function(n){e.node(n).rank+=t}))}var Ad=ed,zd=Od,Ld=kd,Rd=Sd,Td=Ff.alg.preorder,Dd=Ff.alg.postorder,Bd=yd.simplify,Vd=Hd;function Hd(n){n=Bd(n),Rd(n);var e,t=zd(n);for(Zd(t),Yd(t,n);e=Fd(t);)$d(t,n,e,Ud(t,n,e))}function Yd(n,e){var t=Dd(n,n.nodes());t=t.slice(0,t.length-1),Ad.forEach(t,(function(t){!function(n,e,t){var r=n.node(t).parent;n.edge(t,r).cutvalue=Xd(n,e,t)}(n,e,t)}))}function Xd(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,Ad.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 Zd(n,e){arguments.length<2&&(e=n.nodes()[0]),Wd(n,{},1,e)}function Wd(n,e,t,r,o){var i=t,u=n.node(r);return e[r]=!0,Ad.forEach(n.neighbors(r),(function(o){Ad.has(e,o)||(t=Wd(n,e,t,o,r))})),u.low=i,u.lim=t++,o?u.parent=o:delete u.parent,t}function Fd(n){return Ad.find(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function Ud(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=Ad.filter(e.edges(),(function(e){return c===Gd(n,n.node(e.v),a)&&c!==Gd(n,n.node(e.w),a)}));return Ad.minBy(l,(function(n){return Ld(e,n)}))}function $d(n,e,t,r){var o=t.v,i=t.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Zd(n),Yd(n,e),function(n,e){var t=Ad.find(n.nodes(),(function(n){return!e.node(n).parent})),r=Td(n,t);r=r.slice(1),Ad.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 Gd(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}Hd.initLowLimValues=Zd,Hd.initCutValues=Yd,Hd.calcCutValue=Xd,Hd.leaveEdge=Fd,Hd.enterEdge=Ud,Hd.exchangeEdges=$d;var qd=Sd,Kd=Od,Qd=Vd,Jd=qd;var nh=ed,eh=ed,th=yd,rh={run:function(n){var e=th.addDummyNode(n,"root",{},"_root"),t=function(n){var e={};function t(r,o){var i=n.children(r);i&&i.length&&eh.forEach(i,(function(n){t(n,o+1)})),e[r]=o}return eh.forEach(n.children(),(function(n){t(n,1)})),e}(n),r=eh.max(eh.values(t))-1,o=2*r+1;n.graph().nestingRoot=e,eh.forEach(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return eh.reduce(n.edges(),(function(e,t){return e+n.edge(t).weight}),0)}(n)+1;eh.forEach(n.children(),(function(u){oh(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,eh.forEach(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}};function oh(n,e,t,r,o,i,u){var a=n.children(u);if(a.length){var c=th.addBorderNode(n,"_bt"),l=th.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(c,u),s.borderTop=c,n.setParent(l,u),s.borderBottom=l,eh.forEach(a,(function(a){oh(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 ih=ed,uh=yd;function ah(n,e,t,r,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],c=uh.addDummyNode(n,"border",u,t);o[e][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var ch=ed,lh={adjust:function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||sh(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){ch.forEach(n.nodes(),(function(e){dh(n.node(e))})),ch.forEach(n.edges(),(function(e){var t=n.edge(e);ch.forEach(t.points,dh),ch.has(t,"y")&&dh(t)}))}(n),"lr"!==e&&"rl"!==e||(function(n){ch.forEach(n.nodes(),(function(e){hh(n.node(e))})),ch.forEach(n.edges(),(function(e){var t=n.edge(e);ch.forEach(t.points,hh),ch.has(t,"x")&&hh(t)}))}(n),sh(n))}};function sh(n){ch.forEach(n.nodes(),(function(e){fh(n.node(e))})),ch.forEach(n.edges(),(function(e){fh(n.edge(e))}))}function fh(n){var e=n.width;n.width=n.height,n.height=e}function dh(n){n.y=-n.y}function hh(n){var e=n.x;n.x=n.y,n.y=e}var vh=ed,ph=ed;function gh(n,e,t){for(var r=ph.zipObject(t,ph.map(t,(function(n,e){return e}))),o=ph.flatten(ph.map(e,(function(e){return ph.sortBy(ph.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=ph.map(new Array(u),(function(){return 0})),c=0;return ph.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 yh=ed,mh=ed,wh=ed,xh=yd;function bh(n,e,t){for(var r;e.length&&(r=wh.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var _h=ed,Eh=ed,Sh=Ff.Graph,kh=ed,Ch=ed,Nh=function(n){var e={},t=vh.filter(n.nodes(),(function(e){return!n.children(e).length})),r=vh.max(vh.map(t,(function(e){return n.node(e).rank}))),o=vh.map(vh.range(r+1),(function(){return[]}));var i=vh.sortBy(t,(function(e){return n.node(e).rank}));return vh.forEach(i,(function t(r){if(!vh.has(e,r)){e[r]=!0;var i=n.node(r);o[i.rank].push(r),vh.forEach(n.successors(r),t)}})),o},Mh=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=gh(n,e[r-1],e[r]);return t},Oh=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=_h.filter(i,(function(n){return n!==a&&n!==c})));var s=function(n,e){return yh.map(e,(function(e){var t=n.inEdges(e);if(t.length){var r=yh.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);_h.forEach(s,(function(t){if(e.children(t.v).length){var i=n(e,t.v,r,o);l[t.v]=i,_h.has(i,"barycenter")&&(u=t,a=i,_h.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 mh.forEach(n,(function(n,e){var r=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};mh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),mh.forEach(e.edges(),(function(n){var e=t[n.v],r=t[n.w];mh.isUndefined(e)||mh.isUndefined(r)||(r.indegree++,e.out.push(t[n.w]))})),function(n){var e=[];function t(n){return function(e){e.merged||(mh.isUndefined(e.barycenter)||mh.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),mh.forEach(o.in.reverse(),t(o)),mh.forEach(o.out,r(o))}return mh.map(mh.filter(e,(function(n){return!n.merged})),(function(n){return mh.pick(n,["vs","i","barycenter","weight"])}))}(mh.filter(t,(function(n){return!n.indegree})))}(s,r);!function(n,e){_h.forEach(n,(function(n){n.vs=_h.flatten(n.vs.map((function(n){return e[n]?e[n].vs:n})),!0)}))}(f,l);var d=function(n,e){var t,r=xh.partition(n,(function(n){return wh.has(n,"barycenter")})),o=r.lhs,i=wh.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=bh(u,i,l),wh.forEach(o,(function(n){l+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,c+=n.weight,l=bh(u,i,l)}));var s={vs:wh.flatten(u,!0)};return c&&(s.barycenter=a/c,s.weight=c),s}(f,o);if(a&&(d.vs=_h.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]);_h.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},Ph=function(n,e,t){var r=function(n){for(var e;n.hasNode(e=Eh.uniqueId("_root")););return e}(n),o=new Sh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return n.node(e)}));return Eh.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),Eh.forEach(n[t](i),(function(e){var t=e.v===i?e.w:e.v,r=o.edge(t,i),u=Eh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:n.edge(e).weight+u})})),Eh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o},jh=Ff.Graph,Ih=yd;function Ah(n,e,t){return Ch.map(e,(function(e){return Ph(n,e,t)}))}function zh(n,e){var t=new jh;Ch.forEach(n,(function(n){var r=n.graph().root,o=Oh(n,r,t,e);Ch.forEach(o.vs,(function(e,t){n.node(e).order=t})),function(n,e,t){var r,o={};kh.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 Lh(n,e){Ch.forEach(e,(function(e){Ch.forEach(e,(function(e,t){n.node(e).order=t}))}))}var Rh=ed,Th=Ff.Graph,Dh=yd;function Bh(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 Vh(n,e,t){if(e>t){var r=e;e=t,t=r}return Rh.has(n[e],t)}var Hh=ed,Yh=yd,Xh=function(n){var e,t=Dh.buildLayerMatrix(n),r=Rh.merge(function(n,e){var t={};return Rh.reduce(e,(function(e,r){var o=0,i=0,u=e.length,a=Rh.last(r);return Rh.forEach(r,(function(e,c){var l=function(n,e){if(n.node(e).dummy)return Rh.find(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),s=l?n.node(l).order:u;(l||e===a)&&(Rh.forEach(r.slice(i,c+1),(function(e){Rh.forEach(n.predecessors(e),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(e).dummy||Bh(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;Rh.forEach(Rh.range(r,o),(function(r){a=e[r],n.node(a).dummy&&Rh.forEach(n.predecessors(a),(function(e){var r=n.node(e);r.dummy&&(r.order<i||r.order>u)&&Bh(t,e,a)}))}))}return Rh.reduce(e,(function(e,t){var o,i=-1,u=0;return Rh.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={};Rh.forEach(["u","d"],(function(i){e="u"===i?t:Rh.values(t).reverse(),Rh.forEach(["l","r"],(function(t){"r"===t&&(e=Rh.map(e,(function(n){return Rh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,t,r){var o={},i={},u={};return Rh.forEach(e,(function(n){Rh.forEach(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),Rh.forEach(e,(function(n){var e=-1;Rh.forEach(n,(function(n){var a=r(n);if(a.length){a=Rh.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]&&!Vh(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 Th,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,Rh.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,Rh.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 Rh.forEach(e,(function(e){var r;Rh.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)),Rh.forEach(r,(function(n){i[n]=i[t[n]]})),i}(n,e,a.root,a.align,"r"===t);"r"===t&&(c=Rh.mapValues(c,(function(n){return-n}))),o[i+t]=c}))}));var i=function(n,e){return Rh.minBy(Rh.values(e),(function(e){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Rh.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=Rh.values(e),r=Rh.min(t),o=Rh.max(t);Rh.forEach(["u","d"],(function(t){Rh.forEach(["l","r"],(function(i){var u,a=t+i,c=n[a];if(c!==e){var l=Rh.values(c);(u="l"===i?r-Rh.min(l):o-Rh.max(l))&&(n[a]=Rh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return Rh.mapValues(n.ul,(function(t,r){if(e)return n[e.toLowerCase()][r];var o=Rh.sortBy(Rh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Zh=ed,Wh=vd,Fh=_d,Uh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Qd(n)}(n);break;case"tight-tree":!function(n){qd(n),Kd(n)}(n);break;case"longest-path":Jd(n)}},$h=yd.normalizeRanks,Gh=function(n){var e=function(n){var e={},t=0;return nh.forEach(n.children(),(function r(o){var i=t;nh.forEach(n.children(o),r),e[o]={low:i,lim:t++}})),e}(n);nh.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]}}))},qh=yd.removeEmptyRanks,Kh=rh,Qh=function(n){ih.forEach(n.children(),(function e(t){var r=n.children(t),o=n.node(t);if(r.length&&ih.forEach(r,e),ih.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)ah(n,"borderLeft","_bl",t,o,i),ah(n,"borderRight","_br",t,o,i)}}))},Jh=lh,nv=function(n){var e=Ih.maxRank(n),t=Ah(n,Ch.range(1,e+1),"inEdges"),r=Ah(n,Ch.range(e-1,-1,-1),"outEdges"),o=Nh(n);Lh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){zh(a%2?t:r,a%4>=2),o=Ih.buildLayerMatrix(n);var l=Mh(n,o);l<u&&(c=0,i=Ch.cloneDeep(o),u=l)}Lh(n,i)},ev=function(n){(function(n){var e=Yh.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Hh.forEach(e,(function(e){var o=Hh.max(Hh.map(e,(function(e){return n.node(e).height})));Hh.forEach(e,(function(e){n.node(e).y=r+o/2})),r+=o+t}))})(n=Yh.asNonCompoundGraph(n)),Hh.forEach(Xh(n),(function(e,t){n.node(t).x=e}))},tv=yd,rv=Ff.Graph,ov=["nodesep","edgesep","ranksep","marginx","marginy"],iv={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},uv=["acyclicer","ranker","rankdir","align"],av=["width","height"],cv={width:0,height:0},lv=["minlen","weight","width","height","labeloffset"],sv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fv=["labelpos"];function dv(n,e){return Zh.mapValues(Zh.pick(n,e),Number)}function hv(n){var e={};return Zh.forEach(n,(function(n,t){e[t.toLowerCase()]=n})),e}var vv=ed,pv=yd,gv=Ff.Graph,yv={debugOrdering:function(n){var e=pv.buildLayerMatrix(n),t=new gv({compound:!0,multigraph:!0}).setGraph({});return vv.forEach(n.nodes(),(function(e){t.setNode(e,{label:e}),t.setParent(e,"layer"+n.node(e).rank)})),vv.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),vv.forEach(e,(function(n,e){var r="layer"+e;t.setNode(r,{rank:"same"}),vv.reduce(n,(function(n,e){return t.setEdge(n,e,{style:"invis"}),e}))})),t}},mv=Qe({graphlib:Ff,layout:function(n,e){var t=e&&e.debugTiming?tv.time:tv.notime;t("layout",(function(){var e=t(" buildLayoutGraph",(function(){return function(n){var e=new rv({multigraph:!0,compound:!0}),t=hv(n.graph());return e.setGraph(Zh.merge({},iv,dv(t,ov),Zh.pick(t,uv))),Zh.forEach(n.nodes(),(function(t){var r=hv(n.node(t));e.setNode(t,Zh.defaults(dv(r,av),cv)),e.setParent(t,n.parent(t))})),Zh.forEach(n.edges(),(function(t){var r=hv(n.edge(t));e.setEdge(t,Zh.merge({},sv,dv(r,lv),Zh.pick(r,fv)))})),e}(n)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,Zh.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){Zh.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(){Wh.run(n)})),e(" nestingGraph.run",(function(){Kh.run(n)})),e(" rank",(function(){Uh(tv.asNonCompoundGraph(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){Zh.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};tv.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){qh(n)})),e(" nestingGraph.cleanup",(function(){Kh.cleanup(n)})),e(" normalizeRanks",(function(){$h(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;Zh.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=Zh.max(e,r.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){Zh.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(){Fh.run(n)})),e(" parentDummyChains",(function(){Gh(n)})),e(" addBorderSegments",(function(){Qh(n)})),e(" order",(function(){nv(n)})),e(" insertSelfEdges",(function(){!function(n){var e=tv.buildLayerMatrix(n);Zh.forEach(e,(function(e){var t=0;Zh.forEach(e,(function(e,r){var o=n.node(e);o.order=r+t,Zh.forEach(o.selfEdges,(function(e){tv.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(){Jh.adjust(n)})),e(" position",(function(){ev(n)})),e(" positionSelfEdges",(function(){!function(n){Zh.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){Zh.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(Zh.last(t.borderLeft)),u=n.node(Zh.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}})),Zh.forEach(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){Fh.undo(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);if(Zh.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(){Jh.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)}Zh.forEach(n.nodes(),(function(e){c(n.node(e))})),Zh.forEach(n.edges(),(function(e){var t=n.edge(e);Zh.has(t,"x")&&c(t)})),e-=u,r-=a,Zh.forEach(n.nodes(),(function(t){var o=n.node(t);o.x-=e,o.y-=r})),Zh.forEach(n.edges(),(function(t){var o=n.edge(t);Zh.forEach(o.points,(function(n){n.x-=e,n.y-=r})),Zh.has(o,"x")&&(o.x-=e),Zh.has(o,"y")&&(o.y-=r)})),i.width=t-e+u,i.height=o-r+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){Zh.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(tv.intersectRect(i,t)),o.points.push(tv.intersectRect(u,r))}))}(n)})),e(" reversePoints",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);t.reversed&&t.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){Wh.undo(n)}))}(e,t)})),t(" updateInputGraph",(function(){!function(n,e){Zh.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))})),Zh.forEach(n.edges(),(function(t){var r=n.edge(t),o=e.edge(t);r.points=o.points,Zh.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:yv,util:{time:yd.time,notime:yd.notime},version:"0.8.5"}),wv={error001:function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},error002:function(){return"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them."},error003:function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},error004:function(){return"The Ink Flow parent container needs a width and a height to render the graph."},error005:function(){return"Only child nodes can use a parent extent."},error006:function(){return"Can't create edge. An edge needs a source and a target."},error007:function(n){return"The old edge with id=".concat(n," does not exist.")},error009:function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},error008: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,".")},error010:function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},error011:function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},error012: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.')},error013:function(n){return void 0===n&&(n="react"),"It seems that you haven't loaded the styles. Please import '@aloudata/".concat(n,"/dist/style.css' or base.css to make sure everything is working properly.")}},xv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bv=["Enter"," ","Escape"],_v=.5,Ev=2,Sv=[0,0],kv=function(n){return"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n)},Cv=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)}))},Nv=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)}))},Mv=function(n,e){var t;void 0===e&&(e=[0,0]);var r=Gv(n),o=r.width,i=r.height,u=null!==(t=n.origin)&&void 0!==t?t:e,a=o*u[0],c=i*u[1];return{x:n.position.x-a,y:n.position.y-c}},Ov=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=Vv(t,e.nodeOrigin);return Rv(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Dv(t)},Pv=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)}))};function jv(n){var e,t,r,o=n.nodeId,i=n.nextPosition,u=n.nodeLookup,a=n.nodeOrigin,c=void 0===a?[0,0]:a,l=n.nodeExtent,s=n.onError,f=u.get(o),d=f.parentId?u.get(f.parentId):void 0,h=d?d.internals.positionAbsolute:{x:0,y:0},v=h.x,p=h.y,g=null!==(e=f.origin)&&void 0!==e?e:c,y=l;if("parent"!==f.extent||f.expandParent)d&&$v(f.extent)&&(y=[[f.extent[0][0]+v,f.extent[0][1]+p],[f.extent[1][0]+v,f.extent[1][1]+p]]);else if(d){var m=d.measured.width,w=d.measured.height;m&&w&&(y=[[v,p],[v+m,p+w]])}else null==s||s("005",wv.error005());var x=$v(y)?Av(i,y,f.measured):i;return void 0!==f.measured.width&&void 0!==f.measured.height||null==s||s("015",wv.error015()),{position:{x:x.x-v+(null!==(t=f.measured.width)&&void 0!==t?t:0)*g[0],y:x.y-p+(null!==(r=f.measured.height)&&void 0!==r?r:0)*g[1]},positionAbsolute:x}}var Iv=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Av=function(n,e,t){var r,o;return void 0===n&&(n={x:0,y:0}),{x:Iv(n.x,e[0][0],e[1][0]-(null!==(r=null==t?void 0:t.width)&&void 0!==r?r:0)),y:Iv(n.y,e[0][1],e[1][1]-(null!==(o=null==t?void 0:t.height)&&void 0!==o?o:0))}},zv=function(n,e,t){return n<e?Iv(Math.abs(n-e),1,50)/50:n>t?-Iv(Math.abs(n-t),1,50)/50:0},Lv=function(n,e,t,r){return void 0===t&&(t=15),void 0===r&&(r=40),[zv(n.x,r,e.width-r)*t,zv(n.y,r,e.height-r)*t]},Rv=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)}},Tv=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},Dv=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},Bv=function(n,e){var t,r,o,i,u,a,c,l;void 0===e&&(e=[0,0]);var s=kv(n)?n.internals.positionAbsolute:Mv(n,e);return{x:s.x,y:s.y,width:null!==(i=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:n.initialWidth)&&void 0!==i?i:0,height:null!==(l=null!==(c=null!==(a=null===(u=n.measured)||void 0===u?void 0:u.height)&&void 0!==a?a:n.height)&&void 0!==c?c:n.initialHeight)&&void 0!==l?l:0}},Vv=function(n,e){var t,r,o,i,u,a,c,l;void 0===e&&(e=[0,0]);var s=kv(n)?n.internals.positionAbsolute:Mv(n,e),f=s.x,d=s.y;return{x:f,y:d,x2:f+(null!==(i=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:n.initialWidth)&&void 0!==i?i:0),y2:d+(null!==(l=null!==(c=null!==(a=null===(u=n.measured)||void 0===u?void 0:u.height)&&void 0!==a?a:n.height)&&void 0!==c?c:n.initialHeight)&&void 0!==l?l:0)}},Hv=function(n,e){return Dv(Rv(Tv(n),Tv(e)))},Yv=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)},Xv=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])}},Zv=function(n,e,t,r){var o=n.x,i=n.y,u=$(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?Xv(s,r):s},Wv=function(n,e){var t=n.x,r=n.y,o=$(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}},Fv=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=Iv(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}},Uv=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 $v(n){return void 0!==n&&"parent"!==n}function Gv(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}}function qv(n,e,t){var r=Gv(t),o=r.width,i=r.height,u=t.internals.positionAbsolute,a=u.x,c=u.y;return Av(n,[[a,c],[a+o,c+i]],e)}var Kv={x:0,y:0};function Qv(n){return null===n?null:n?"valid":"invalid"}function Jv(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=op(n),c=a.x,l=a.y,s=Zv({x:c,y:l},u),f=i?Xv(s,r):s,d=f.x,h=f.y;return W({xSnapped:d,ySnapped:h},s)}var np,ep,tp,rp=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},op=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)}},ip=function(n,e,t,r,o){var i=e.querySelectorAll(".".concat(n));return i&&i.length?Array.from(i).map((function(e){var i=e.getBoundingClientRect();return W({id:e.getAttribute("data-handleid"),type:n,nodeId:o,position:e.getAttribute("data-handlepos"),x:(i.left-t.left)/r,y:(i.top-t.top)/r},rp(e))})):null};!function(n){n.Strict="strict",n.Loose="loose"}(np||(np={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(ep||(ep={})),function(n){n.Partial="partial",n.Full="full"}(tp||(tp={}));var up,ap,cp,lp,sp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};!function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(up||(up={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(ap||(ap={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(lp||(lp={}));var fp=((cp={})[lp.Left]=lp.Right,cp[lp.Right]=lp.Left,cp[lp.Top]=lp.Bottom,cp[lp.Bottom]=lp.Top,cp);function dp(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 hp(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function vp(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case lp.Left:return[t-hp(t-o,u),r];case lp.Right:return[t+hp(o-t,u),r];case lp.Top:return[t,r-hp(r-i,u)];case lp.Bottom:return[t,r+hp(i-r,u)]}}function pp(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.curvature,s=void 0===l?.25:l,f=$(vp({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=$(vp({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],y=$(dp({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],x=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,w,x,b]}function gp(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 yp,mp=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||"")},wp=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)?W({},n):W(W({},n),{id:mp(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):(wv.error006(),e);var t},xp=function(n,e,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=F(n,["id"]);if(!e.source||!e.target)return wv.error006(),t;if(!t.find((function(e){return e.id===n.id})))return wv.error007(o),t;var u=W(W({},i),{id:r.shouldReplaceId?mp(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)};function bp(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=$(gp({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]}var _p=((yp={})[lp.Left]={x:-1,y:0},yp[lp.Right]={x:1,y:0},yp[lp.Top]={x:0,y:-1},yp[lp.Bottom]={x:0,y:1},yp),Ep=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Sp(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?lp.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?lp.Top:l,f=n.center,d=n.offset,h=_p[a],v=_p[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?lp.Bottom:t,o=n.target;return r===lp.Left||r===lp.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",w=y[m],x=[],b={x:0,y:0},_={x:0,y:0},E=$(gp({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],C=E[2],N=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 M=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];x=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var P=[{x:p.x,y:g.y}],j=[{x:g.x,y:p.y}];if(x="x"===m?h.x===w?j:P:h.y===w?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]===w?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],R=p[z]>g[z],T=p[z]<g[z];(1===h[m]&&(!L&&R||L&&T)||1!==h[m]&&(!L&&T||L&&R))&&(x="x"===m?P:j)}var D={x:p.x+b.x,y:p.y+b.y},B={x:g.x+_.x,y:g.y+_.y};Math.max(Math.abs(D.x-x[0].x),Math.abs(B.x-x[0].x))>=Math.max(Math.abs(D.y-x[0].y),Math.abs(B.y-x[0].y))?(r=(D.x+B.x)/2,o=x[0].y):(r=x[0].x,o=(D.y+B.y)/2)}return[G(G([i,{x:p.x+b.x,y:p.y+b.y}],$(x),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,C,N]}function kp(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=$(Sp({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],w=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(Ep(n,e)/2,Ep(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,w]}function Cp(n,e,t,r){var o,i;void 0===t&&(t=lp.Left);var u=(null!==(o=null==e?void 0:e.x)&&void 0!==o?o:0)+n.internals.positionAbsolute.x,a=(null!==(i=null==e?void 0:e.y)&&void 0!==i?i:0)+n.internals.positionAbsolute.y,c=null!=e?e:Gv(n);return{x:u+c.width/2,y:a+c.height/2}}var Np={nodeOrigin:[0,0],nodeExtent:xv,elevateNodesOnSelect:!0,defaults:{}},Mp=W(W({},Np),{checkEquality:!0});function Op(n,e,t,r){var o,i,u,a,c=Ip(Mp,r),l=new Map(e),s=(null==c?void 0:c.elevateNodesOnSelect)?1e3:0;e.clear(),t.clear();try{for(var f=U(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=l.get(h.id);if(c.checkEquality&&h===(null==v?void 0:v.internals.userNode))e.set(h.id,v);else{var p=Mv(h,c.nodeOrigin),g=$v(h.extent)?h.extent:c.nodeExtent,y=Av(p,g,Gv(h));v=W(W(W({},c.defaults),h),{measured:{width:null===(u=h.measured)||void 0===u?void 0:u.width,height:null===(a=h.measured)||void 0===a?void 0:a.height},internals:{positionAbsolute:y,handleBounds:h.measured?null==v?void 0:v.internals.handleBounds:void 0,z:Ap(h,s),userNode:h}}),e.set(h.id,v)}h.parentId&&jp(v,e,t,r)}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}function Pp(n,e,t,r){var o,i,u,a;void 0===r&&(r=[0,0]);var c=[],l=new Map;try{for(var s=U(n),f=s.next();!f.done;f=s.next()){var d=f.value,h=e.get(d.parentId);if(h){var v=null!==(a=null===(u=l.get(d.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:Bv(h),p=Hv(v,d.rect);l.set(d.parentId,{expandedRect:p,parent:h})}}}catch(n){o={error:n}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return l.size>0&&l.forEach((function(e,o){var i,u,a=e.expandedRect,l=e.parent,s=l.internals.positionAbsolute,f=Gv(l),d=null!==(i=l.origin)&&void 0!==i?i:r,h=a.x<s.x?Math.round(Math.abs(s.x-a.x)):0,v=a.y<s.y?Math.round(Math.abs(s.y-a.y)):0,p=Math.max(f.width,Math.round(a.width)),g=Math.max(f.height,Math.round(a.height)),y=(p-f.width)*d[0],m=(g-f.height)*d[1];(h>0||v>0||y||m)&&(c.push({id:o,type:"position",position:{x:l.position.x-h+y,y:l.position.y-v+m}}),null===(u=t.get(o))||void 0===u||u.forEach((function(e){n.some((function(n){return n.id===e.id}))||c.push({id:e.id,type:"position",position:{x:e.position.x+h,y:e.position.y+v}})}))),(f.width<a.width||f.height<a.height||h||v)&&c.push({id:o,type:"dimensions",setAttributes:!0,dimensions:{width:p+(h?d[0]*h-y:0),height:g+(v?d[1]*v-m:0)}})})),c}function jp(n,e,t,r){var o=Ip(Np,r),i=o.elevateNodesOnSelect,u=o.nodeOrigin,a=o.nodeExtent,c=n.parentId,l=e.get(c);if(l){!function(n,e){if(n.parentId){var t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}}(n,t);var s=function(n,e,t,r,o){var i,u=e.internals.positionAbsolute,a=u.x,c=u.y,l=Gv(n),s=Mv(n,t),f=$v(n.extent)?Av(s,n.extent,l):s,d=Av({x:a+f.x,y:c+f.y},r,l);"parent"===n.extent&&(d=qv(d,l,e));var h=Ap(n,o),v=null!==(i=e.internals.z)&&void 0!==i?i:0;return{x:d.x,y:d.y,z:v>h?v:h}}(n,l,u,a,i?1e3:0),f=s.x,d=s.y,h=s.z,v=n.internals.positionAbsolute,p=f!==v.x||d!==v.y;(p||h!==n.internals.z)&&e.set(n.id,W(W({},n),{internals:W(W({},n.internals),{positionAbsolute:p?{x:f,y:d}:v,z:h})}))}else console.warn("Parent node ".concat(c," not found. Please make sure that parent nodes are in front of their child nodes in the nodes array."))}function Ip(n,e){var t=W({},n);for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function Ap(n,e){return(function(n){return!isNaN(n)&&isFinite(n)}(n.zIndex)?n.zIndex:0)+(n.selected?e:0)}function zp(n,e,t){var r=(null==t?void 0:t.rankdir)||"TB",o=new mv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(W({rankdir:r},t));var i=n.map((function(n){return W({},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)})),mv.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?Sv:c;if(!e&&!u||!r||!i)return Kv;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 Kv;var t=Gv(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 Kv;var t=Ov(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}):Kv}({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?_v:r,i=t.maxZoom,u=void 0===i?Ev:i,a=t.padding,c=void 0===a?.1:a,l=t.nodeOrigin,s=void 0===l?Sv:l,f=t.width,d=t.height,h=Ov(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:Fv(h,f,d,o,u,c),overflowBoundary:v}}(i,W({width:t.width,height:t.height,nodeOrigin:t.nodeOrigin},t.fitViewOptions))),{nodes:i,edges:e,transform:f.transform,overflowBoundary:f.overflowBoundary}}var Lp={assign:Object.assign,getHeight:function(n,e,t,r){return void 0===r&&(r="height"),"center"===t?(n[r]+e[r])/2:n.height}},Rp=Lp,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 Dp(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof Dp)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}Rp.assign(Dp.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 Bp=function(n,e,t){void 0===e&&(e={});var r,o=new Dp(n,e=Rp.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 Dp(u[c],e);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Vp=Bp,Hp=function(){function n(n,e){void 0===e&&(e={}),this.options=e,this.rootNode=Vp(n,e)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),Yp=Hp;function Xp(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 Zp(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach((function(n){Zp(n,e,t)}))}function Wp(n,e){var t=e?n.y:n.x;return n.children.forEach((function(n){t=Math.min(Wp(n,e),t)})),t}function Fp(n,e){Zp(n,-Wp(n,e),e)}function Up(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach((function(n,r){Up(n,e.children[r],t)}))}function $p(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){$p(n,e,t)}))}Xp.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach((function(n){t.push(Xp.fromNode(n,e))})),e?new Xp(n.height,n.width,n.x,t):new Xp(n.width,n.height,n.y,t)};var Gp=Bp,qp=function(n,e){for(var t=Gp(n.data,e,!0),r=Gp(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}},Kp=qp,Qp=["LR","RL","TB","BT","H","V"],Jp=["LR","RL","H"],ng=Qp[0],eg=function(n,e,t){var r=e.direction||ng;if(e.isHorizontal=function(n){return Jp.indexOf(n)>-1}(r),r&&-1===Qp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Qp[0])t(n,e);else if(r===Qp[1])t(n,e),n.right2left();else if(r===Qp[2])t(n,e);else if(r===Qp[3])t(n,e),n.bottom2top();else if(r===Qp[4]||r===Qp[5]){var o=Kp(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 tg(n,e){return tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},tg(n,e)}var rg=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}}$p(n,t);var s=Xp.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),Up(s,n,t),Fp(n,t),n},og=eg,ig=Lp,ug=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,tg(t,r),e.prototype.execute=function(){return og(this.rootNode,this.options,rg)},e}(Yp),ag={},cg=Lp;function lg(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 sg={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function fg(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){fg(n,e.children[r],t)}))}function dg(n,e){return dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},dg(n,e)}var hg=function(n,e){void 0===e&&(e={}),e=cg.assign({},sg,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 lg(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),fg(o,n,e.isHorizontal),n},vg=eg,pg=Lp,gg=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,dg(t,r),e.prototype.execute=function(){var n=this;return n.rootNode.width=0,vg(n.rootNode,n.options,hg)},e}(Yp),yg={},mg=Lp;function wg(n,e){return wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},wg(n,e)}var xg=Yp,bg=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+mg.getHeight(e,n,o),e.parent&&n.parent.id!==e.parent.id){var u=e.parent,a=u.y+mg.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,e,t,r),o=n}))},_g=qp,Eg=Lp,Sg=["LR","RL","H"],kg=Sg[0],Cg=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,wg(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?kg:u,c=n.align;if(a&&-1===Sg.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===Sg[0])bg(e,r,i,c);else if(a===Sg[1])bg(e,r,i,c),e.right2left();else if(a===Sg[2]){var l=_g(e,n),s=l.left,f=l.right;bg(s,r,i,c),s.right2left(),bg(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),e.x=f.x-e.width/2}return e},e}(xg),Ng={},Mg=Lp;function Og(n,e){var t=0;return n.children.length?n.children.forEach((function(n){t+=Og(n,e)})):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function Pg(n){var e=n.children,t=e.length;if(t){e.forEach((function(n){Pg(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 jg={getSubTreeSep:function(){return 0}};function Ig(n,e){return Ig=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Ig(n,e)}var Ag=function(n,e){void 0===e&&(e={}),e=Mg.assign({},jg,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,Og(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}}}})),Pg(n)},zg=eg,Lg=Lp,Rg=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,Ig(t,r),e.prototype.execute=function(){return zg(this.rootNode,this.options,Ag)},e}(Yp),Tg={};Qe({compactBox:function(n,e){return e=ig.assign({},ag,e),new ug(n,e).execute()},dendrogram:function(n,e){return e=pg.assign({},yg,e),new gg(n,e).execute()},indented:function(n,e){return e=Eg.assign({},Ng,e),new Cg(n,e).execute()},mindmap:function(n,e){return e=Lg.assign({},Tg,e),new Rg(n,e).execute()}});var Dg={value:()=>{}};function Bg(){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 Vg(r)}function Vg(n){this._=n}function Hg(n,e){for(var t,r=0,o=n.length;r<o;++r)if((t=n[r]).name===e)return t.value}function Yg(n,e,t){for(var r=0,o=n.length;r<o;++r)if(n[r].name===e){n[r]=Dg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}Vg.prototype=Bg.prototype={constructor:Vg,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]=Yg(o[t],n.name,e);else if(null==e)for(t in o)o[t]=Yg(o[t],n.name,null);return this}for(;++u<a;)if((t=(n=i[u]).type)&&(t=Hg(o[t],n.name)))return t},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new Vg(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 Xg="http://www.w3.org/1999/xhtml",Zg={svg:"http://www.w3.org/2000/svg",xhtml:Xg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wg(n){var e=n+="",t=e.indexOf(":");return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Zg.hasOwnProperty(e)?{space:Zg[e],local:n}:n}function Fg(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Xg&&e.documentElement.namespaceURI===Xg?e.createElement(n):e.createElementNS(t,n)}}function Ug(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function $g(n){var e=Wg(n);return(e.local?Ug:Fg)(e)}function Gg(){}function qg(n){return null==n?Gg:function(){return this.querySelector(n)}}function Kg(){return[]}function Qg(n){return null==n?Kg:function(){return this.querySelectorAll(n)}}function Jg(n){return function(){return this.matches(n)}}function ny(n){return function(e){return e.matches(n)}}var ey=Array.prototype.find;function ty(){return this.firstElementChild}var ry=Array.prototype.filter;function oy(){return Array.from(this.children)}function iy(n){return new Array(n.length)}function uy(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}function ay(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 uy(n,i[a]);for(;a<c;++a)(u=e[a])&&(o[a]=u)}function cy(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 uy(n,i[a]);for(a=0;a<f;++a)(c=e[a])&&s.get(h[a])===c&&(o[a]=c)}function ly(n){return n.__data__}function sy(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function fy(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function dy(n){return function(){this.removeAttribute(n)}}function hy(n){return function(){this.removeAttributeNS(n.space,n.local)}}function vy(n,e){return function(){this.setAttribute(n,e)}}function py(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function gy(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function yy(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 my(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function wy(n){return function(){this.style.removeProperty(n)}}function xy(n,e,t){return function(){this.style.setProperty(n,e,t)}}function by(n,e,t){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function _y(n,e){return n.style.getPropertyValue(e)||my(n).getComputedStyle(n,null).getPropertyValue(e)}function Ey(n){return function(){delete this[n]}}function Sy(n,e){return function(){this[n]=e}}function ky(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function Cy(n){return n.trim().split(/^|\s+/)}function Ny(n){return n.classList||new My(n)}function My(n){this._node=n,this._names=Cy(n.getAttribute("class")||"")}function Oy(n,e){for(var t=Ny(n),r=-1,o=e.length;++r<o;)t.add(e[r])}function Py(n,e){for(var t=Ny(n),r=-1,o=e.length;++r<o;)t.remove(e[r])}function jy(n){return function(){Oy(this,n)}}function Iy(n){return function(){Py(this,n)}}function Ay(n,e){return function(){(e.apply(this,arguments)?Oy:Py)(this,n)}}function zy(){this.textContent=""}function Ly(n){return function(){this.textContent=n}}function Ry(n){return function(){var e=n.apply(this,arguments);this.textContent=null==e?"":e}}function Ty(){this.innerHTML=""}function Dy(n){return function(){this.innerHTML=n}}function By(n){return function(){var e=n.apply(this,arguments);this.innerHTML=null==e?"":e}}function Vy(){this.nextSibling&&this.parentNode.appendChild(this)}function Hy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yy(){return null}function Xy(){var n=this.parentNode;n&&n.removeChild(this)}function Zy(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Wy(){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 Uy(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 $y(n,e,t){var r=my(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 Gy(n,e){return function(){return $y(this,n,e)}}function qy(n,e){return function(){return $y(this,n,e.apply(this,arguments))}}uy.prototype={constructor:uy,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)}},My.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 Ky=[null];function Qy(n,e){this._groups=n,this._parents=e}function Jy(){return new Qy([[document.documentElement]],Ky)}function nm(n){return"string"==typeof n?new Qy([[document.querySelector(n)]],[document.documentElement]):new Qy([[n]],Ky)}function em(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]}Qy.prototype=Jy.prototype={constructor:Qy,select:function(n){"function"!=typeof n&&(n=qg(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 Qy(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):Qg(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 Qy(r,o)},selectChild:function(n){return this.select(null==n?ty:function(n){return function(){return ey.call(this.children,n)}}("function"==typeof n?n:ny(n)))},selectChildren:function(n){return this.selectAll(null==n?oy:function(n){return function(){return ry.call(this.children,n)}}("function"==typeof n?n:ny(n)))},filter:function(n){"function"!=typeof n&&(n=Jg(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 Qy(r,this._parents)},data:function(n,e){if(!arguments.length)return Array.from(this,ly);var t,r=e?cy:ay,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=sy(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,w,x=0,b=0;x<p;++x)if(m=g[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<p;);m._next=w||null}}return(a=new Qy(a,o))._enter=c,a._exit=l,a},enter:function(){return new Qy(this._enter||this._groups.map(iy),this._parents)},exit:function(){return new Qy(this._exit||this._groups.map(iy),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 Qy(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=fy);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 Qy(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=Wg(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?hy:dy:"function"==typeof e?t.local?yy:gy:t.local?py:vy)(t,e))},style:function(n,e,t){return arguments.length>1?this.each((null==e?wy:"function"==typeof e?by:xy)(n,e,null==t?"":t)):_y(this.node(),n)},property:function(n,e){return arguments.length>1?this.each((null==e?Ey:"function"==typeof e?ky:Sy)(n,e)):this.node()[n]},classed:function(n,e){var t=Cy(n+"");if(arguments.length<2){for(var r=Ny(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof e?Ay:e?jy:Iy)(t,e))},text:function(n){return arguments.length?this.each(null==n?zy:("function"==typeof n?Ry:Ly)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Ty:("function"==typeof n?By:Dy)(n)):this.node().innerHTML},raise:function(){return this.each(Vy)},lower:function(){return this.each(Hy)},append:function(n){var e="function"==typeof n?n:$g(n);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(n,e){var t="function"==typeof n?n:$g(n),r=null==e?Yy:"function"==typeof e?e:qg(e);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Xy)},clone:function(n){return this.select(n?Wy:Zy)},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?Uy: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?qy:Gy)(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 tm={passive:!1},rm={capture:!0,passive:!1};function om(n){n.stopImmediatePropagation()}function im(n){n.preventDefault(),n.stopImmediatePropagation()}function um(n){var e=n.document.documentElement,t=nm(n).on("dragstart.drag",im,rm);"onselectstart"in e?t.on("selectstart.drag",im,rm):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function am(n,e){var t=n.document.documentElement,r=nm(n).on("dragstart.drag",null);e&&(r.on("click.drag",im,rm),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 cm=n=>()=>n;function lm(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 sm(n){return!n.ctrlKey&&!n.button}function fm(){return this.parentNode}function dm(n,e){return null==e?{x:n.x,y:n.y}:e}function hm(){return navigator.maxTouchPoints||"ontouchstart"in this}function vm(){var n,e,t,r,o=sm,i=fm,u=dm,a=hm,c={},l=Bg("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,tm).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=w(this,i.call(this,u,a),u,a,"mouse");c&&(nm(u.view).on("mousemove.drag",v,rm).on("mouseup.drag",p,rm),um(u.view),om(u),t=!1,n=u.clientX,e=u.clientY,c("start",u))}}function v(r){if(im(r),!t){var o=r.clientX-n,i=r.clientY-e;t=o*o+i*i>f}c.mouse("drag",r)}function p(n){nm(n.view).on("mousemove.drag mouseup.drag",null),am(n.view,t),im(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=w(this,a,n,e,u[t].identifier,u[t]))&&(om(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])&&(im(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])&&(om(n),t("end",n,o[e]))}function w(n,e,t,r,o,i){var a,f,h,v=l.copy(),p=em(i||t,e);if(null!=(h=u.call(n,new lm("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=em(l||u,e),g=s}v.call(i,n,new lm(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:cm(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:cm(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:cm(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:cm(!!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}function pm(n,e){if(!n.parentId)return!1;var t=e.get(n.parentId);return!!t&&(!!t.selected||pm(t,e))}function gm(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 ym(n){var e,t,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=U(u),s=l.next();!s.done;s=l.next()){var f=$(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(W(W({},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[W(W({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function mm(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 w(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,w=s.onError,x=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=Vv(n,e.nodeOrigin);t=Rv(t,r)}})),Dv(t)}(c,{nodeOrigin:p});_=Tv(E)}try{for(var S=U(c),k=S.next();!k.done;k=S.next()){var C=$(k.value,2),N=C[0],M=C[1],O={x:a-M.distance.x,y:l-M.distance.y};v&&(O=Xv(O,h));var P=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!M.extent){var j=M.internals.positionAbsolute,I=j.x-_.x+d[0][0],A=j.x+M.measured.width-_.x2+d[1][0];P=[[I,j.y-_.y+d[0][1]],[A,j.y+M.measured.height-_.y2+d[1][1]]]}var z=jv({nodeId:N,nextPosition:O,nodeLookup:f,nodeExtent:P,nodeOrigin:p,onError:w}),L=z.position,R=z.positionAbsolute;b=b||M.position.x!==L.x||M.position.y!==L.y,M.position=L,M.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&&(x(c,!0),e&&(o||g||!m&&y))){var T=$(ym({nodeId:m,dragItems:c,nodeLookup:f}),2),D=T[0],B=T[1];null==o||o(e,c,D,B),null==g||g(e,D,B),m||null==y||y(e,B)}}function x(){var n,e;if(f){var r=$(Lv(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})&&w(u,null)}a=requestAnimationFrame(x)}}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,w=i.onSelectionDragStart,x=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||x(),y&&p&&m&&(null==e||e(m));var b=Jv(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=U(n),s=l.next();!s.done;s=l.next()){var f=$(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!pm(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&&w)){var _=$(ym({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==w||w(n.sourceEvent,S)}}h=nm(g);var _=vm().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=Jv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=op(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=Jv(n.sourceEvent,{transform:a,snapGrid:h,snapToGrid:v});if(!l&&i&&d&&(l=!0,x()),!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=op(n.sourceEvent,f),w(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=$(ym({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||!gm(e,".".concat(v),g))&&(!p||gm(e,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function wm(n,e,t,r){var o,i,u,a,c,l,s,f,d,h=[],v=1/0,p=function(n,e,t){var r,o,i=[],u={x:n.x-t,y:n.y-t,width:2*t,height:2*t};try{for(var a=U(e.values()),c=a.next();!c.done;c=a.next()){var l=c.value;Yv(u,Bv(l))>0&&i.push(l)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(n,t,e+250);try{for(var g=U(p),y=g.next();!y.done;y=g.next()){var m=y.value,w=G(G([],$(null!==(l=null===(c=m.internals.handleBounds)||void 0===c?void 0:c.source)&&void 0!==l?l:[]),!1),$(null!==(f=null===(s=m.internals.handleBounds)||void 0===s?void 0:s.target)&&void 0!==f?f:[]),!1);try{for(var x=(u=void 0,U(w)),b=x.next();!b.done;b=x.next()){var _=b.value;if(r.nodeId!==_.nodeId||r.type!==_.type||r.id!==_.id){var E=Cp(m,_,_.position),S=E.x,k=E.y,C=Math.sqrt(Math.pow(S-n.x,2)+Math.pow(k-n.y,2));C>e||(C<v?(h=[W(W({},_),{x:S,y:k})],v=C):C===v&&h.push(W(W({},_),{x:S,y:k})))}}}catch(n){u={error:n}}finally{try{b&&!b.done&&(a=x.return)&&a.call(x)}finally{if(u)throw u.error}}}}catch(n){o={error:n}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}if(!h.length)return null;if(h.length>1){var N="source"===r.type?"target":"source";return null!==(d=h.find((function(n){return n.type===N})))&&void 0!==d?d:h[0]}return h[0]}function xm(n,e,t,r,o,i){var u,a,c,l,s,f;void 0===i&&(i=!1);var d=r.get(n);if(!d)return null;var h="strict"===o?null===(u=d.internals.handleBounds)||void 0===u?void 0:u[e]:G(G([],$(null!==(c=null===(a=d.internals.handleBounds)||void 0===a?void 0:a.source)&&void 0!==c?c:[]),!1),$(null!==(s=null===(l=d.internals.handleBounds)||void 0===l?void 0:l.target)&&void 0!==s?s:[]),!1),v=null!==(f=t?null==h?void 0:h.find((function(n){return n.id===t})):null==h?void 0:h[0])&&void 0!==f?f:null;return v&&i?W(W({},v),Cp(d,v,v.position)):v}function bm(n,e){return n||((null==e?void 0:e.classList.contains("target"))?"target":(null==e?void 0:e.classList.contains("source"))?"source":null)}lm.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var _m=function(){return!0};function Em(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?_m:s,d=e.nodeLookup,h=".".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,'"]'),v="target"===u,p=t?a.querySelector(h):null,g=op(n),y=g.x,m=g.y,w=a.elementFromPoint(y,m),x=(null==w?void 0:w.classList.contains("".concat(c,"-flow__handle")))?w:p,b={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){var _=bm(void 0,x),E=x.getAttribute("data-nodeid"),S=x.getAttribute("data-handleid"),k=x.classList.contains("connectable"),C=x.classList.contains("connectableend");if(!E||!_)return b;var N={source:v?E:o,sourceHandle:v?S:i,target:v?o:E,targetHandle:v?i:S};b.connection=N;var M=k&&C&&(r===np.Strict?v&&"source"===_||!v&&"target"===_:E!==o||S!==i);b.isValid=M&&f(N),b.toHandle=xm(E,_,S,d,r,!1)}return b}var Sm={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,w=e.isValidConnection,x=void 0===w?_m:w,b=e.onReconnectEnd,_=e.updateConnection,E=e.getTransform,S=e.getFromHandle,k=e.autoPanSpeed,C=function(n){var e;return(null===(e=null==n?void 0:n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),N=0,M=op(n),O=M.x,P=M.y,j=null==C?void 0:C.elementFromPoint(O,P),I=bm(a,j),A=null==l?void 0:l.getBoundingClientRect();if(A&&I){var z=xm(u,I,i,s,r);if(z){var L=op(n,A),R=!1,T=null,D=!1,B=null,V=W(W({},z),{nodeId:u,type:I,position:z.position}),H=s.get(u),Y={inProgress:!0,isValid:null,from:Cp(H,V,lp.Left),fromHandle:V,fromPosition:V.position,fromNode:H,to:L,toHandle:null,toPosition:fp[V.position],toNode:null};_(Y);var X=Y;null==g||g(n,{nodeId:u,handleId:i,handleType:I}),C.addEventListener("mousemove",U),C.addEventListener("mouseup",G),C.addEventListener("touchmove",U),C.addEventListener("touchend",G)}}function Z(){if(d&&A){var n=$(Lv(L,A,k),2),e=n[0],t=n[1];v({x:e,y:t}),N=requestAnimationFrame(Z)}}function U(n){if(S()&&V){var e=E();L=op(n,A),t=wm(Zv(L,e,!1,[1,1]),o,s,V),R||(Z(),R=!0);var a=Em(n,{handle:t,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:x,doc:C,lib:f,flowId:h,nodeLookup:s});B=a.handleDomNode,T=a.connection,D=function(n,e){var t=null;return e?t=!0:n&&!e&&(t=!1),t}(!!t,a.isValid);var l=W(W({},X),{isValid:D,to:t&&D?Wv({x:t.x,y:t.y},e):L,toHandle:a.toHandle,toPosition:D&&a.toHandle?a.toHandle.position:fp[V.position],toNode:a.toHandle?s.get(a.toHandle.nodeId):null});D&&t&&X.toHandle&&l.toHandle&&X.toHandle.type===l.toHandle.type&&X.toHandle.nodeId===l.toHandle.nodeId&&X.toHandle.id===l.toHandle.id&&X.to.x===l.to.x&&X.to.y===l.to.y||(_(l),X=l)}else G(n)}function G(n){(t||B)&&T&&D&&(null==y||y(T)),X.inProgress;var e=F(X,["inProgress"]),r=W(W({},e),{toPosition:X.toHandle?X.toPosition:null});null==m||m(n,r),a&&(null==b||b(n,r)),p(),cancelAnimationFrame(N),R=!1,D=!1,T=null,B=null,C.removeEventListener("mousemove",U),C.removeEventListener("mouseup",G),C.removeEventListener("touchmove",U),C.removeEventListener("touchend",G)}},isValid:Em};function km(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Cm(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Nm(){}var Mm=.7,Om=1/Mm,Pm="\\s*([+-]?\\d+)\\s*",jm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Im="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Am=/^#([0-9a-f]{3,8})$/,zm=new RegExp(`^rgb\\(${Pm},${Pm},${Pm}\\)$`),Lm=new RegExp(`^rgb\\(${Im},${Im},${Im}\\)$`),Rm=new RegExp(`^rgba\\(${Pm},${Pm},${Pm},${jm}\\)$`),Tm=new RegExp(`^rgba\\(${Im},${Im},${Im},${jm}\\)$`),Dm=new RegExp(`^hsl\\(${jm},${Im},${Im}\\)$`),Bm=new RegExp(`^hsla\\(${jm},${Im},${Im},${jm}\\)$`),Vm={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 Hm(){return this.rgb().formatHex()}function Ym(){return this.rgb().formatRgb()}function Xm(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Am.exec(n))?(t=e[1].length,e=parseInt(e[1],16),6===t?Zm(e):3===t?new Um(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===t?Wm(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===t?Wm(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=zm.exec(n))?new Um(e[1],e[2],e[3],1):(e=Lm.exec(n))?new Um(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Rm.exec(n))?Wm(e[1],e[2],e[3],e[4]):(e=Tm.exec(n))?Wm(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Dm.exec(n))?Jm(e[1],e[2]/100,e[3]/100,1):(e=Bm.exec(n))?Jm(e[1],e[2]/100,e[3]/100,e[4]):Vm.hasOwnProperty(n)?Zm(Vm[n]):"transparent"===n?new Um(NaN,NaN,NaN,0):null}function Zm(n){return new Um(n>>16&255,n>>8&255,255&n,1)}function Wm(n,e,t,r){return r<=0&&(n=e=t=NaN),new Um(n,e,t,r)}function Fm(n,e,t,r){return 1===arguments.length?((o=n)instanceof Nm||(o=Xm(o)),o?new Um((o=o.rgb()).r,o.g,o.b,o.opacity):new Um):new Um(n,e,t,null==r?1:r);var o}function Um(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}function $m(){return`#${Qm(this.r)}${Qm(this.g)}${Qm(this.b)}`}function Gm(){const n=qm(this.opacity);return`${1===n?"rgb(":"rgba("}${Km(this.r)}, ${Km(this.g)}, ${Km(this.b)}${1===n?")":`, ${n})`}`}function qm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Km(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Qm(n){return((n=Km(n))<16?"0":"")+n.toString(16)}function Jm(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new ew(n,e,t,r)}function nw(n){if(n instanceof ew)return new ew(n.h,n.s,n.l,n.opacity);if(n instanceof Nm||(n=Xm(n)),!n)return new ew;if(n instanceof ew)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 ew(u,a,c,n.opacity)}function ew(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}function tw(n){return(n=(n||0)%360)<0?n+360:n}function rw(n){return Math.max(0,Math.min(1,n||0))}function ow(n,e,t){return 255*(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)}km(Nm,Xm,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Hm,formatHex:Hm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return nw(this).formatHsl()},formatRgb:Ym,toString:Ym}),km(Um,Fm,Cm(Nm,{brighter(n){return n=null==n?Om:Math.pow(Om,n),new Um(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?Mm:Math.pow(Mm,n),new Um(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Um(Km(this.r),Km(this.g),Km(this.b),qm(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:$m,formatHex:$m,formatHex8:function(){return`#${Qm(this.r)}${Qm(this.g)}${Qm(this.b)}${Qm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gm,toString:Gm})),km(ew,(function(n,e,t,r){return 1===arguments.length?nw(n):new ew(n,e,t,null==r?1:r)}),Cm(Nm,{brighter(n){return n=null==n?Om:Math.pow(Om,n),new ew(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?Mm:Math.pow(Mm,n),new ew(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 Um(ow(n>=240?n-240:n+120,o,r),ow(n,o,r),ow(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new ew(tw(this.h),rw(this.s),rw(this.l),qm(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=qm(this.opacity);return`${1===n?"hsl(":"hsla("}${tw(this.h)}, ${100*rw(this.s)}%, ${100*rw(this.l)}%${1===n?")":`, ${n})`}`}}));var iw=n=>()=>n;function uw(n,e){var t=e-n;return t?function(n,e){return function(t){return n+t*e}}(n,t):iw(isNaN(n)?e:n)}var aw=function n(e){var t=function(n){return 1==(n=+n)?uw: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):iw(isNaN(e)?t:e)}}(e);function r(n,e){var r=t((n=Fm(n)).r,(e=Fm(e)).r),o=t(n.g,e.g),i=t(n.b,e.b),u=uw(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 cw(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var lw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sw=new RegExp(lw.source,"g");function fw(n,e){var t,r,o,i=lw.lastIndex=sw.lastIndex=0,u=-1,a=[],c=[];for(n+="",e+="";(t=lw.exec(n))&&(r=sw.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:cw(t,r)})),i=sw.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 dw,hw=180/Math.PI,vw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pw(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)*hw,skewX:Math.atan(c)*hw,scaleX:u,scaleY:a}}function gw(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:cw(n,o)},{i:c-2,x:cw(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:cw(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:cw(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:cw(n,t)},{i:a-2,x:cw(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 yw=gw((function(n){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?vw:pw(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),mw=gw((function(n){return null==n?vw:(dw||(dw=document.createElementNS("http://www.w3.org/2000/svg","g")),dw.setAttribute("transform",n),(n=dw.transform.baseVal.consolidate())?pw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):vw)}),", ",")",")");function ww(n){return((n=Math.exp(n))+1/n)/2}var xw,bw,_w=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),w=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(m*m+1)-m);u=(x-w)/e,i=function(n){var r,o=n*u,i=ww(w),s=l/(t*g)*(i*(r=e*o+w,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(w));return[a+s*h,c+s*v,l*i/ww(e*o+w)]}}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),Ew=0,Sw=0,kw=0,Cw=0,Nw=0,Mw=0,Ow="object"==typeof performance&&performance.now?performance:Date,Pw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function jw(){return Nw||(Pw(Iw),Nw=Ow.now()+Mw)}function Iw(){Nw=0}function Aw(){this._call=this._time=this._next=null}function zw(n,e,t){var r=new Aw;return r.restart(n,e,t),r}function Lw(){Nw=(Cw=Ow.now())+Mw,Ew=Sw=0;try{!function(){jw(),++Ew;for(var n,e=xw;e;)(n=Nw-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Ew}()}finally{Ew=0,function(){for(var n,e,t=xw,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:xw=e);bw=n,Tw(r)}(),Nw=0}}function Rw(){var n=Ow.now(),e=n-Cw;e>1e3&&(Mw-=e,Cw=n)}function Tw(n){Ew||(Sw&&(Sw=clearTimeout(Sw)),n-Nw>24?(n<1/0&&(Sw=setTimeout(Lw,n-Ow.now()-Mw)),kw&&(kw=clearInterval(kw))):(kw||(Cw=Ow.now(),kw=setInterval(Rw,1e3)),Ew=1,Pw(Lw)))}function Dw(n,e,t){var r=new Aw;return e=null==e?0:+e,r.restart((t=>{r.stop(),n(t+e)}),e,t),r}Aw.prototype=zw.prototype={constructor:Aw,restart:function(n,e,t){if("function"!=typeof n)throw new TypeError("callback is not a function");t=(null==t?jw():+t)+(null==e?0:+e),this._next||bw===this||(bw?bw._next=this:xw=this,bw=this),this._call=n,this._time=t,Tw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tw())}};var Bw=Bg("start","end","cancel","interrupt"),Vw=[];function Hw(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 Dw(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(Dw((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=zw((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:Bw,tween:Vw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Yw(n,e){var t=Zw(n,e);if(t.state>0)throw new Error("too late; already scheduled");return t}function Xw(n,e){var t=Zw(n,e);if(t.state>3)throw new Error("too late; already running");return t}function Zw(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Ww(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 Fw(n,e){var t,r;return function(){var o=Xw(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 Uw(n,e,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=Xw(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 $w(n,e,t){var r=n._id;return n.each((function(){var n=Xw(this,r);(n.value||(n.value={}))[e]=t.apply(this,arguments)})),function(n){return Zw(n,r).value[e]}}function Gw(n,e){var t;return("number"==typeof e?cw:e instanceof Xm?aw:(t=Xm(e))?(e=t,aw):fw)(n,e)}function qw(n){return function(){this.removeAttribute(n)}}function Kw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Qw(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 Jw(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 nx(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 ex(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 tx(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 rx(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 ox(n,e){return function(){Yw(this,n).delay=+e.apply(this,arguments)}}function ix(n,e){return e=+e,function(){Yw(this,n).delay=e}}function ux(n,e){return function(){Xw(this,n).duration=+e.apply(this,arguments)}}function ax(n,e){return e=+e,function(){Xw(this,n).duration=e}}var cx=Jy.prototype.constructor;function lx(n){return function(){this.style.removeProperty(n)}}var sx=0;function fx(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function dx(){return++sx}var hx=Jy.prototype;fx.prototype={constructor:fx,select:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=qg(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,Hw(f[d],e,t,d,f,Zw(a,t)));return new fx(i,this._parents,e,t)},selectAll:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=Qg(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=Zw(c,t),p=0,g=h.length;p<g;++p)(d=h[p])&&Hw(d,e,t,p,h,v);i.push(h),u.push(c)}return new fx(i,u,e,t)},selectChild:hx.selectChild,selectChildren:hx.selectChildren,filter:function(n){"function"!=typeof n&&(n=Jg(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 fx(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 fx(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=dx(),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=Zw(u,e);Hw(u,n,t,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new fx(r,this._parents,n,t)},call:hx.call,nodes:hx.nodes,node:hx.node,size:hx.size,empty:hx.empty,each:hx.each,on:function(n,e){var t=this._id;return arguments.length<2?Zw(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)?Yw:Xw;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=Wg(n),r="transform"===t?mw:Gw;return this.attrTween(n,"function"==typeof e?(t.local?ex:nx)(t,r,$w(this,"attr."+n,e)):null==e?(t.local?Kw:qw)(t):(t.local?Jw:Qw)(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=Wg(n);return this.tween(t,(r.local?tx:rx)(r,e))},style:function(n,e,t){var r="transform"==(n+="")?yw:Gw;return null==e?this.styleTween(n,function(n,e){var t,r,o;return function(){var i=_y(this,n),u=(this.style.removeProperty(n),_y(this,n));return i===u?null:i===t&&u===r?o:o=e(t=i,r=u)}}(n,r)).on("end.style."+n,lx(n)):"function"==typeof e?this.styleTween(n,function(n,e,t){var r,o,i;return function(){var u=_y(this,n),a=t(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=_y(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=e(r=u,a))}}(n,r,$w(this,"style."+n,e))).each(function(n,e){var t,r,o,i,u="style."+e,a="end."+u;return function(){var c=Xw(this,n),l=c.on,s=null==c.value[u]?i||(i=lx(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=_y(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}}($w(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=Zw(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?Fw:Uw)(t,n,e))},delay:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?ox:ix)(e,n)):Zw(this.node(),e).delay},duration:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?ux:ax)(e,n)):Zw(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(){Xw(this,n).ease=e}}(e,n)):Zw(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;Xw(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=Xw(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]:hx[Symbol.iterator]};var vx={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function px(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}Jy.prototype.interrupt=function(n){return this.each((function(){Ww(this,n)}))},Jy.prototype.transition=function(n){var e,t;n instanceof fx?(e=n._id,n=n._name):(e=dx(),(t=vx).time=jw(),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])&&Hw(u,n,e,l,a,t||px(u,e));return new fx(r,this._parents,n,e)};var gx=n=>()=>n;function yx(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 mx(n,e,t){this.k=n,this.x=e,this.y=t}mx.prototype={constructor:mx,scale:function(n){return 1===n?this:new mx(this.k*n,this.x,this.y)},translate:function(n,e){return 0===n&0===e?this:new mx(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 wx=new mx(1,0,0);function xx(n){for(;!n.__zoom;)if(!(n=n.parentNode))return wx;return n.__zoom}function bx(n){n.stopImmediatePropagation()}function _x(n){n.preventDefault(),n.stopImmediatePropagation()}function Ex(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function Sx(){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 kx(){return this.__zoom||wx}function Cx(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Nx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mx(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))}xx.prototype=mx.prototype;var Ox,Px=function(n){return{x:n.x,y:n.y,zoom:n.k}},jx=function(n){var e=n.x,t=n.y,r=n.zoom;return wx.translate(e,t).scale(r)},Ix=function(n,e){return n.target.closest(".".concat(e))},Ax=function(n,e){return 2===e&&Array.isArray(n)&&n.includes(2)},zx=function(n,e,t){void 0===e&&(e=0),void 0===t&&(t=function(){});var r="number"==typeof e&&e>0;return r||t(),r?n.transition().duration(e).on("end",t):n},Lx=function(n){var e=n.ctrlKey&&Uv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*e};function Rx(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=Ex,o=Sx,i=Mx,u=Cx,a=Nx,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_w,d=Bg("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",kx).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",N).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 mx(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 mx(n.k,r,o)}function m(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function w(n,e,t,r){n.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=x(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 mx(t,c[0]-e[0]*t,c[1]-e[1]*t)}u.zoom(null,n)}}))}function x(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=x(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=em(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)],Ww(this),t.start()}_x(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=x(this,e,!0).event(n),a=nm(n.view).on("mousemove.zoom",(function(n){if(_x(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]=em(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),am(n.view,u.moved),_x(n),u.event(n).end()}),!0),c=em(n,o),s=n.clientX,f=n.clientY;um(n.view),bx(n),u.mouse=[c,this.__zoom.invert(c)],Ww(this),u.start()}}function S(n,...e){if(r.apply(this,arguments)){var t=this.__zoom,u=em(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);_x(n),s>0?nm(this).transition().duration(s).call(w,f,u,n):nm(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=x(this,o,t.changedTouches.length===s).event(t);for(bx(t),u=0;u<s;++u)c=[c=em(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)),Ww(this),f.start())}}function C(n,...e){if(this.__zooming){var t,r,o,u,a=x(this,e).event(n),c=n.changedTouches,s=c.length;for(_x(n),t=0;t<s;++t)o=em(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 N(n,...r){if(this.__zooming){var o,i,u=x(this,r).event(n),a=n.changedTouches,c=a.length;for(bx(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=em(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var l=nm(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",kx),n!==o?w(n,e,t,r):o.interrupt().each((function(){x(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(wx.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=nm(this.that).datum();d.call(n,this.that,new yx(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:gx(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:gx(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:gx(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:gx([[+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=nm(e).call(h);w({x:i.x,y:i.y,zoom:Iv(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(zx(v,null==e?void 0:e.duration),n))}function m(){h.on("zoom",null)}function w(n,e,t){var r=jx(n),o=null==h?void 0:h.constrain()(r,e,t);return o&&y(o),o}return h.wheelDelta(Lx),{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,w=n.panOnScrollSpeed,x=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||Ix(n,e))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:e,preventScrolling:x,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(Ix(n,t))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=em(n),h=Lx(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===ep.Vertical?0:n.deltaX*p,y=i===ep.Horizontal?0:n.deltaY*p;!Uv()&&n.shiftKey&&i!==ep.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=Px(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:w,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var N=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=Px(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",N);var M=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||!Ax(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,Px(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",M);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&&Ax(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=Px(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&&(Ix(n,"".concat(s,"-flow__node"))||Ix(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(Ix(n,c)&&"wheel"===n.type)return!1;if(Ix(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=jx(n);return y(t,e),t},setViewportConstrained:w,getViewport:function(){var n=v?xx(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,e){return v?new Promise((function(t){null==h||h.scaleTo(zx(v,null==e?void 0:e.duration,(function(){return t(!0)})),n)})):Promise.resolve(!1)},scaleBy:function(n,e){return v?new Promise((function(t){null==h||h.scaleBy(zx(v,null==e?void 0:e.duration,(function(){return t(!0)})),n)})):Promise.resolve(!1)},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var e=jx(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"}(Ox||(Ox={}));var Tx=["top-left","top-right","bottom-left","bottom-right"],Dx=["top","right","bottom","left"];function Bx(n,e){return Math.max(0,e-n)}function Vx(n,e){return Math.max(0,n-e)}function Hx(n,e,t){return Math.max(0,e-n,n-t)}function Yx(n,e){return n?!e:e}var Xx={width:0,height:0,x:0,y:0},Zx=W(W({},Xx),{pointerX:0,pointerY:0,aspectRatio:1});function Wx(n,e,t){var r,o,i=e.position.x+n.position.x,u=e.position.y+n.position.y,a=null!==(r=n.measured.width)&&void 0!==r?r:0,c=null!==(o=n.measured.height)&&void 0!==o?o:0,l=t[0]*a,s=t[1]*c;return[[i-l,u-s],[i+a-l,u+c-s]]}var Fx=wv.error001();function Ux(n,e){var r=t(X);if(null===r)throw new Error(Fx);return H(r,n,e)}function $x(){var n=t(X);if(null===n)throw new Error(Fx);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}var Gx=function(n,e){void 0===e&&(e=[0,0]);var t=Jx(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 qx(n,e,t){var r,o;n.clear(),e.clear();try{for(var i=g(t),u=i.next();!u.done;u=i.next()){var a=u.value,c=a.source,l=a.target,s=a.sourceHandle,f=void 0===s?null:s,d=a.targetHandle,h=void 0===d?null:d,v="".concat(c,"-source-").concat(f),p="".concat(l,"-target-").concat(h),y=n.get(v)||new Map,m=n.get(p)||new Map,w={edgeId:a.id,source:c,target:l,sourceHandle:f,targetHandle:h};e.set(a.id,a),n.set(v,y.set("".concat(l,"-").concat(h),w)),n.set(p,m.set("".concat(c,"-").concat(f),w))}}catch(n){r={error:n}}finally{try{u&&!u.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}var Kx=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Qx=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:Kx(n.x,e[0][0],e[1][0]),y:Kx(n.y,e[0][1],e[1][1])}};function Jx(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 nb=function(n){return!isNaN(n)&&isFinite(n)},eb=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])}},tb=function(n,e,t,r){var o=n.x,i=n.y,u=y(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?eb(s,r):s},rb=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=Gx(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}},ob=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)}},ib=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},ub=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},ab=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=Gx(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)}},cb=function(n,e){return ub(ob(ib(n),ib(e)))};function lb(n){return o(n)}var sb=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)},fb=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=Kx(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 db(n){return void 0!==n&&"parent"!==n}var hb=function(n){return vb(n)},vb=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};function pb(n,e,t,r,o){var i,u;void 0===r&&(r=[0,0]),void 0===o&&(o={width:0,height:0});for(var a=e,c=d({},n);a;){var l=t.get(e);if(a=null==l?void 0:l.parentId,l){var s=l.origin||r;c.x+=l.internals.positionAbsolute.x-(null!==(i=o.width)&&void 0!==i?i:0)*s[0],c.y+=l.internals.positionAbsolute.y-(null!==(u=o.height)&&void 0!==u?u:0)*s[1]}}return c}var gb=function(n){return nb(n.width)&&nb(n.height)&&nb(n.x)&&nb(n.y)},yb=["INPUT","SELECT","TEXTAREA"];function mb(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 yb.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var wb=function(n){return"clientX"in n},xb=function(n,e){var t,r,o,i,u=wb(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)}},bb="undefined"!=typeof document?document:null;function _b(n,e){void 0===n&&(n=null),void 0===e&&(e={target:bb,actInsideInputWithModifier:!0});var t=y(i(!1),2),o=t[0],c=t[1],l=u(!1),s=u(new Set([])),f=y(r((function(){if(null!==n){var e=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),t=e.reduce((function(n,e){return n.concat.apply(n,m([],y(e),!1))}),[]);return[e,t]}return[[],[]]}),[n]),2),d=f[0],h=f[1];return a((function(){var t=(null==e?void 0:e.target)||bb;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!e.actInsideInputWithModifier)&&mb(n))return!1;var t=Sb(n.code,h);s.current.add(n[t]),Eb(d,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!e.actInsideInputWithModifier)&&mb(n))return!1;var t=Sb(n.code,h);Eb(d,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[t]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==t||t.addEventListener("keydown",r),null==t||t.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==t||t.removeEventListener("keydown",r),null==t||t.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function Eb(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 Sb(n,e){return e.includes(n)?"code":"key"}function kb(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 Cb={position:"absolute",width:"100%",height:"100%",top:0,left:0};var Nb=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function Mb(n){var e=n.onPaneContextMenu,t=n.zoomOnScroll,r=void 0===t||t,o=n.zoomOnPinch,i=void 0===o||o,c=n.panOnScroll,l=void 0!==c&&c,s=n.panOnScrollSpeed,f=void 0===s?.5:s,d=n.panOnScrollMode,h=void 0===d?ep.Free:d,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,x=n.zoomActivationKeyCode,b=n.preventScrolling,_=void 0===b||b,E=n.children,S=n.noWheelClassName,C=n.noPanClassName,N=n.onViewportChange,M=n.isControlledViewport,O=$x(),P=u(null),j=Ux(Nb,kb),I=j.userSelectionActive,A=j.lib,z=_b(x),L=u();return function(n){var e=$x();a((function(){var t=function(){var t,r;if(!n.current)return!1;var o,i={width:(o=n.current).offsetWidth,height:o.offsetHeight};0!==i.height&&0!==i.width||null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"004",wv.error004()),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);var r=new ResizeObserver((function(){return t()}));return r.observe(n.current),function(){window.removeEventListener("resize",t),r&&n.current&&r.unobserve(n.current)}}}),[])}(P),a((function(){if(P.current){var n=O.getState();L.current=Rx({domNode:P.current,minZoom:n.minZoom,maxZoom:n.maxZoom,translateExtent:w,viewport:m,onTransformChange:function(n){null==N||N({x:n[0],y:n[1],zoom:n[2]}),M||O.setState({transform:n})},onDraggingChange:function(n){return O.setState({paneDragging:n})},onPanZoomStart:function(n,e){var t=O.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(n,e),null==r||r(e)},onPanZoom:function(n,e){var t=O.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(n,e),null==r||r(e)},onPanZoomEnd:function(n,e){var t=O.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(n,e),null==r||r(e)}});var e=L.current.getViewport(),t=e.x,r=e.y,o=e.zoom;return O.setState({panZoom:L.current,transform:[t,r,o],domNode:P.current.closest(".ink-flow")}),function(){var n;null===(n=L.current)||void 0===n||n.destroy()}}}),[]),a((function(){var n;null===(n=L.current)||void 0===n||n.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:f,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:_,noPanClassName:C,userSelectionActive:I,noWheelClassName:S,lib:A})}),[e,r,i,l,f,h,p,y,z,_,C,I,S,A]),k.jsx("div",{className:"ink-flow__renderer",ref:P,style:Cb,children:E})}var Ob="undefined"!=typeof window?c:a;function Pb(n){var e=y(i(!1),2),t=e[0],r=e[1],o=y(i((function(){return function(n){var e=[];return{get:function(){return e},reset:function(){e=[]},push:function(t){e.push(t),n()}}}((function(){return r(!0)}))})),1),u=o[0];return Ob((function(){if(t){var e=u.get();e.length&&(n(e),u.reset()),r(!1)}else u.reset()}),[t]),u}function jb(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 Ib(n,e){var t,r,o,i,u,a,c=[],l=new Map;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){if("add"!==(_=f.value).type)if("remove"===_.type||"replace"===_.type)l.set(_.id,[_]);else{var h=l.get(_.id);h?h.push(_):l.set(_.id,[_])}else c.push(_.item)}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}try{for(var v=g(e),p=v.next();!p.done;p=v.next()){var y=p.value,m=l.get(y.id);if(m){if("remove"!==m[0].type)if("replace"!==m[0].type){var w=d({},y);try{for(var x=(u=void 0,g(m)),b=x.next();!b.done;b=x.next()){var _;jb(_=b.value,w)}}catch(n){u={error:n}}finally{try{b&&!b.done&&(a=x.return)&&a.call(x)}finally{if(u)throw u.error}}c.push(w)}else c.push(d({},m[0].item))}else c.push(y)}}catch(n){o={error:n}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return c}function Ab(n,e){return{id:n,type:"select",selected:e}}function zb(n,e,t){var r,o;void 0===e&&(e=new Set),void 0===t&&(t=!1);var i=[];try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2),l=c[0],s=c[1],f=e.has(l);void 0===s.selected&&!f||s.selected===f||(t&&(s.selected=f),i.push(Ab(s.id,f)))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i}function Lb(n){var e,t,r,o,i,u,a=n.items,c=void 0===a?[]:a,l=n.lookup,s=[],f=new Map(c.map((function(n){return[n.id,n]})));try{for(var d=g(c),h=d.next();!h.done;h=d.next()){var v=h.value,p=l.get(v.id),m=null!==(u=null===(i=null==p?void 0:p.internals)||void 0===i?void 0:i.userNode)&&void 0!==u?u:p;void 0!==m&&m!==v&&s.push({id:v.id,item:v,type:"replace"}),void 0===m&&s.push({item:v,type:"add"})}}catch(n){e={error:n}}finally{try{h&&!h.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var w=g(l),x=w.next();!x.done;x=w.next()){var b=y(x.value,1)[0];void 0===f.get(b)&&s.push({id:b,type:"remove"})}}catch(n){r={error:n}}finally{try{x&&!x.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}var Rb=e(null);function Tb(n){var e=n.children,t=$x(),o=l((function(n){var e,r,o=t.getState(),i=o.nodes,u=void 0===i?[]:i,a=o.onNodesChange,c=o.nodeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}a&&a({changes:Lb({items:l,lookup:c}),userNodes:l})}),[]),i=Pb(o),u=l((function(n){var e,r,o=t.getState(),i=o.edges,u=void 0===i?[]:i,a=o.onEdgesChange,c=o.edgeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}a&&a({changes:Lb({items:l,lookup:c}),userEdges:l})}),[]),a=Pb(u),c=r((function(){return{nodeQueue:i,edgeQueue:a}}),[]);return k.jsx(Rb.Provider,{value:c,children:e})}var Db=function(n,e){void 0===e&&(e=[0,0]);var t=Jx(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}}},Bb=function(n,e,t,r,o){var i,u,a,c,l,s,f,h,v=y(void 0===t?[0,0,1]:t,3),p=v[0],m=v[1],w=v[2];void 0===r&&(r=!1),void 0===o&&(o=!1);var x=d(d({},tb(e,[p,m,w])),{width:e.width/w,height:e.height/w}),b=[];try{for(var _=g(n.values()),E=_.next();!E.done;E=_.next()){var S=E.value,k=S.measured,C=S.selectable,N=void 0===C||C,M=S.hidden;if(!(o&&!N||void 0!==M&&M)){var O=null!==(l=null!==(c=null!==(a=k.width)&&void 0!==a?a:S.width)&&void 0!==c?c:S.initialWidth)&&void 0!==l?l:null,P=null!==(h=null!==(f=null!==(s=k.height)&&void 0!==s?s:S.height)&&void 0!==f?f:S.initialHeight)&&void 0!==h?h:null,j=sb(x,rb(S)),I=(null!=O?O:0)*(null!=P?P:0),A=r&&j>0;(!S.internals.handleBounds||A||j>=I||S.dragging)&&b.push(S)}}}catch(n){i={error:n}}finally{try{E&&!E.done&&(u=_.return)&&u.call(_)}finally{if(i)throw i.error}}return b};function Vb(n,e){return v(this,arguments,void 0,(function(n,e){var t,r,o,i,u,a=n.nodes,c=n.width,l=n.height,s=n.panZoom,f=n.minZoom,d=n.maxZoom;return p(this,(function(n){switch(n.label){case 0:return 0===a.size?[2,Promise.resolve(!1)]:(t=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=ab(n,e.nodeOrigin);t=ob(t,r)}})),ub(t)}(a),r=fb(t,c,l,null!==(o=null==e?void 0:e.minZoom)&&void 0!==o?o:f,null!==(i=null==e?void 0:e.maxZoom)&&void 0!==i?i:d,null!==(u=null==e?void 0:e.padding)&&void 0!==u?u:.1),[4,s.setViewport(r,{duration:null==e?void 0:e.duration})]);case 1:return n.sent(),[2,Promise.resolve(!0)]}}))}))}function Hb(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?Db(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&&db(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,w=f+v*m[0],x=d+p*m[1];h=[[w,x],[w+g-v,x+y-p]]}}else null==a||a("005",wv.error005());var b=db(h)?Qx(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}function Yb(n){return v(this,arguments,void 0,(function(n){var e,t,r,o,i,u,a,c,l,s,f,d,h,v,y,m,w,x,b,_=n.nodesToRemove,E=void 0===_?[]:_,S=n.edgesToRemove,k=void 0===S?[]:S,C=n.nodes,N=n.edges,M=n.onBeforeDelete;return p(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=g(C),i=o.next();!i.done;i=o.next())u=i.value,r(u)}catch(n){m={error:n}}finally{try{i&&!i.done&&(w=o.return)&&w.call(o)}finally{if(m)throw m.error}}a=new Set(k.map((function(n){return n.id}))),c=N.filter((function(n){return!1!==n.deletable})),l=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,c),s=l,f=function(n){a.has(n.id)&&!s.find((function(e){return e.id===n.id}))&&s.push(n)};try{for(d=g(c),h=d.next();!h.done;h=d.next())v=h.value,f(v)}catch(n){x={error:n}}finally{try{h&&!h.done&&(b=d.return)&&b.call(d)}finally{if(x)throw x.error}}return M?[4,M({nodes:t,edges:s})]:[2,{edges:s,nodes:t}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var Xb=function(){var n=$x();return r((function(){return{zoomIn:function(e){var t=n.getState().panZoom;return t?t.scaleBy(1.2,{duration:null==e?void 0:e.duration}):Promise.resolve(!1)},zoomOut:function(e){var t=n.getState().panZoom;return t?t.scaleBy(1/1.2,{duration:null==e?void 0:e.duration}):Promise.resolve(!1)},zoomTo:function(e,t){var r=n.getState().panZoom;return r?r.scaleTo(e,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},getZoom:function(){return n.getState().transform[2]},setViewport:function(e,t){return v(void 0,void 0,void 0,(function(){var r,o,i,u,a,c,l,s,f;return p(this,(function(d){switch(d.label){case 0:return r=n.getState(),o=y(r.transform,3),i=o[0],u=o[1],a=o[2],(c=r.panZoom)?[4,c.setViewport({x:null!==(l=e.x)&&void 0!==l?l:i,y:null!==(s=e.y)&&void 0!==s?s:u,zoom:null!==(f=e.zoom)&&void 0!==f?f:a},{duration:null==t?void 0:t.duration})]:[2,Promise.resolve(!1)];case 1:return d.sent(),[2,Promise.resolve(!0)]}}))}))},getViewport:function(){var e=y(n.getState().transform,3);return{x:e[0],y:e[1],zoom:e[2]}},fitView:function(e){var t=n.getState(),r=t.nodeLookup,o=t.minZoom,i=t.maxZoom,u=t.panZoom,a=t.domNode;if(!u||!a)return Promise.resolve(!1);var c=function(n,e){var t=new Map,r=(null==e?void 0:e.nodes)?new Set(e.nodes.map((function(n){return n.id}))):null;return n.forEach((function(n){!n.measured.width||!n.measured.height||!(null==e?void 0:e.includeHiddenNodes)&&n.hidden||r&&!r.has(n.id)||t.set(n.id,n)})),t}(r,e),l=rp(a);return Vb({nodes:c,width:l.width,height:l.height,minZoom:o,maxZoom:i,panZoom:u},e)},setCenter:function(e,t,r){return v(void 0,void 0,void 0,(function(){var o,i,u,a,c,l,s,f;return p(this,(function(d){switch(d.label){case 0:return o=n.getState(),i=o.width,u=o.height,a=o.maxZoom,c=o.panZoom,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:a,s=i/2-e*l,f=u/2-t*l,c?[4,c.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})]:[2,Promise.resolve(!1)];case 1:return d.sent(),[2,Promise.resolve(!0)]}}))}))},fitBounds:function(e,t){return v(void 0,void 0,void 0,(function(){var r,o,i,u,a,c,l,s;return p(this,(function(f){switch(f.label){case 0:return r=n.getState(),o=r.width,i=r.height,u=r.minZoom,a=r.maxZoom,c=r.panZoom,l=fb(e,o,i,u,a,null!==(s=null==t?void 0:t.padding)&&void 0!==s?s:.1),c?[4,c.setViewport(l,{duration:null==t?void 0:t.duration})]:[2,Promise.resolve(!1)];case 1:return f.sent(),[2,Promise.resolve(!0)]}}))}))},screenToFlowPosition:function(e,t){var r,o;void 0===t&&(t={});var i=n.getState(),u=i.transform,a=i.snapGrid,c=i.snapToGrid,l=i.domNode;if(!l)return e;var s=l.getBoundingClientRect(),f=s.x,d=s.y,h={x:e.x-f,y:e.y-d},v=null!==(r=t.snapGrid)&&void 0!==r?r:a,p=null!==(o=t.snapToGrid)&&void 0!==o?o:c;return tb(h,u,p,v)},flowToScreenPosition:function(e){var t=n.getState(),r=t.transform,o=t.domNode;if(!o)return e;var i=o.getBoundingClientRect(),u=i.x,a=i.y,c=function(n,e){var t=n.x,r=n.y,o=y(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}}(e,r);return{x:c.x+u,y:c.y+a}}}}),[])},Zb=function(n){return!!n.panZoom};function Wb(){var n=this,e=Xb(),o=$x(),i=function(){var n=t(Rb);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),u=Ux(Zb);a((function(){window.inkFlowStoreState=o.getState()}),[o]);var c=r((function(){var e=function(n){return o.getState().nodeLookup.get(n)},t=function(n){i.nodeQueue.push(n)},r=function(n){var e,t,r,i,u=o.getState(),a=u.nodeLookup,c=u.nodeOrigin,l=hb(n)?n:a.get(n.id),s=l.parentId?pb(l.position,l.parentId,a,c):l.position,f={id:l.id,position:s,width:null!==(t=null===(e=l.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:l.width,height:null!==(i=null===(r=l.measured)||void 0===r?void 0:r.height)&&void 0!==i?i:l.height,data:l.data};return rb(f)},u=function(n,e,r){void 0===r&&(r={replace:!1}),t((function(t){return t.map((function(t){if(t.id===n){var o="function"==typeof e?e(t):e;return r.replace&&hb(o)?o:d(d({},t),o)}return t}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var t;return null===(t=e(n))||void 0===t?void 0:t.internals.userNode},getInternalNode:e,getEdges:function(){var n=o.getState().edges;return(void 0===n?[]:n).map((function(n){return d({},n)}))},getEdge:function(n){return o.getState().edgeLookup.get(n)},setNodes:t,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var e=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return m(m([],y(n),!1),y(e),!1)}))},addEdges:function(n){var e=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return m(m([],y(n),!1),y(e),!1)}))},toObject:function(){var n=o.getState(),e=n.nodes,t=void 0===e?[]:e,r=n.edges,i=void 0===r?[]:r,u=y(n.transform,3),a=u[0],c=u[1],l=u[2];return{nodes:t.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:a,y:c,zoom:l}}},deleteElements:function(e){return v(n,[e],void 0,(function(n){var e,t,r,i,u,a,c,l,s,f,d,h,v=n.nodes,g=void 0===v?[]:v,y=n.edges,m=void 0===y?[]:y;return p(this,(function(n){switch(n.label){case 0:return e=o.getState(),t=e.nodes,r=e.edges,i=e.onNodesDelete,u=e.onEdgesDelete,a=e.onDelete,c=e.onBeforeDelete,[4,Yb({nodesToRemove:g,edgesToRemove:m,nodes:t,edges:r,onBeforeDelete:c})];case 1:return l=n.sent(),s=l.nodes,f=l.edges,d=f.length>0,h=s.length>0,d&&(null==u||u(f)),h&&(null==i||i(s)),(h||d)&&(null==a||a({nodes:s,edges:f})),[2,{deletedNodes:s,deletedEdges:f}]}}))}))},getIntersectingNodes:function(n,e,t){void 0===e&&(e=!0);var i=gb(n),u=i?n:r(n),a=void 0!==t;return u?(t||o.getState().nodes).filter((function(t){var r=o.getState().nodeLookup.get(t.id);if(r&&!i&&(t.id===n.id||!r.internals.positionAbsolute))return!1;var c=rb(a?t:r),l=sb(c,u);return e&&l>0||l>=u.width*u.height})):[]},isNodeIntersecting:function(n,e,t){void 0===t&&(t=!0);var o=gb(n)?n:r(n);if(!o)return!1;var i=sb(o,e);return t&&i>0||i>=o.width*o.height},updateNode:u,updateNodeData:function(n,e,t){void 0===t&&(t={replace:!1}),u(n,(function(n){var r="function"==typeof e?e(n):e;return t.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),t)},setLayoutAnchorId:function(n){o.getState().setLayoutAnchorId(n)}}}),[]);return r((function(){return d(d(d({},c),e),{viewportInitialized:u})}),[u])}var Fb=function(n){return n.selected},Ub={actInsideInputWithModifier:!1};var $b=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function Gb(){var n=Ux($b,kb),e=n.userSelectionActive,t=n.userSelectionRect;return e&&t?k.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 qb=function(n,e){return function(t){t.target===e.current&&(null==n||n(t))}},Kb=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function Qb(n){var e=n.isSelecting,t=n.selectionKeyPressed,r=n.selectionMode,o=void 0===r?tp.Full:r,i=n.selectionOnDrag,a=n.panOnDrag,c=n.onSelectionStart,l=n.onSelectionEnd,s=n.onPaneClick,f=n.onPaneContextMenu,d=n.onPaneScroll,h=n.onPaneMouseEnter,v=n.onPaneMouseMove,p=n.onPaneMouseLeave,m=n.children,w=u(null),x=$x(),b=u(0),_=u(0),E=u(),S=u(new Map),C=Ux(Kb,kb),N=C.userSelectionActive,M=C.elementsSelectable,O=C.dragging,j=M&&(e||N),I=u(!1),A=u(!1),z=function(n){I.current?I.current=!1:(null==s||s(n),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1}))},L=d?function(n){return d(n)}:void 0,R=!0===a||Array.isArray(a)&&a.includes(0);return k.jsxs("div",{className:P(["ink-flow__pane",{draggable:R,dragging:O,selection:e}]),onClick:j?void 0:qb(z,w),onContextMenu:qb((function(n){Array.isArray(a)&&(null==a?void 0:a.includes(2))?n.preventDefault():null==f||f(n)}),w),onWheel:qb(L,w),onPointerEnter:j?void 0:h,onPointerDown:j?function(n){var t,r,o,i,u,a,l=x.getState(),s=l.resetSelectedElements,f=l.domNode,d=l.edgeLookup;if(E.current=null==f?void 0:f.getBoundingClientRect(),M&&e&&0===n.button&&n.target===w.current&&E.current){null===(i=null===(o=n.target)||void 0===o?void 0:o.setPointerCapture)||void 0===i||i.call(o,n.pointerId),A.current=!0,I.current=!1,S.current=new Map;try{for(var h=g(d),v=h.next();!v.done;v=h.next()){var p=y(v.value,2),m=p[0],b=p[1];S.current.set(b.source,(null===(u=S.current.get(b.source))||void 0===u?void 0:u.add(m))||new Set([m])),S.current.set(b.target,(null===(a=S.current.get(b.target))||void 0===a?void 0:a.add(m))||new Set([m]))}}catch(n){t={error:n}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}var _=xb(n.nativeEvent,E.current),k=_.x,C=_.y;s(),x.setState({userSelectionRect:{width:0,height:0,startX:k,startY:C,x:k,y:C}}),null==c||c(n)}}:v,onPointerMove:j?function(n){var e,t,r,i,u=x.getState(),a=u.userSelectionRect,c=u.edgeLookup,l=u.transform,s=u.nodeLookup,f=u.triggerNodeChanges,d=u.triggerEdgeChanges;if(E.current&&a){I.current=!0;var h=xb(n.nativeEvent,E.current),v=h.x,p=h.y,y=a.startX,m=a.startY,w={startX:y,startY:m,x:v<y?v:y,y:p<m?p:m,width:Math.abs(v-y),height:Math.abs(p-m)},k=Bb(s,w,l,o===tp.Partial,!0),C=new Set,N=new Set;try{for(var M=g(k),O=M.next();!O.done;O=M.next()){var P=O.value;N.add(P.id);var j=S.current.get(P.id);if(j)try{for(var A=(r=void 0,g(j)),z=A.next();!z.done;z=A.next()){var L=z.value;C.add(L)}}catch(n){r={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(r)throw r.error}}}}catch(n){e={error:n}}finally{try{O&&!O.done&&(t=M.return)&&t.call(M)}finally{if(e)throw e.error}}if(b.current!==N.size)b.current=N.size,f(zb(s,N,!0));if(_.current!==C.size)_.current=C.size,d(zb(c,C));x.setState({userSelectionRect:w,userSelectionActive:!0,nodesSelectionActive:!1})}}:v,onPointerUp:j?function(n){var e,r;if(0===n.button&&A.current){null===(r=null===(e=n.target)||void 0===e?void 0:e.releasePointerCapture)||void 0===r||r.call(e,n.pointerId);var o=x.getState().userSelectionRect;!N&&o&&n.target===w.current&&(null==z||z(n)),b.current>0&&x.setState({nodesSelectionActive:!0}),x.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,_.current=0,null==l||l(n),(t||i)&&(I.current=!1),A.current=!1}}:void 0,onPointerLeave:p,ref:w,style:Cb,children:[m,k.jsx(Gb,{})]})}var Jb=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function n_(n){var e=n.children,t=n.onPaneClick,r=n.onPaneMouseEnter,o=n.onPaneMouseMove,i=n.onPaneMouseLeave,u=n.onPaneContextMenu,c=n.onPaneScroll,l=n.deleteKeyCode,s=n.selectionKeyCode,f=n.selectionOnDrag,d=n.selectionMode,h=n.onSelectionStart,v=n.onSelectionEnd,p=n.multiSelectionKeyCode,g=n.panActivationKeyCode,y=n.zoomActivationKeyCode,m=n.elementsSelectable,w=n.zoomOnScroll,x=n.zoomOnPinch,b=n.panOnScroll,_=n.panOnScrollSpeed,E=n.panOnScrollMode,S=n.zoomOnDoubleClick,C=n.panOnDrag,N=n.defaultViewport,M=n.translateExtent,O=n.minZoom,P=n.maxZoom,j=n.preventScrolling;n.onSelectionContextMenu;var I=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,L=n.isControlledViewport,R=n.paneClickDistance,T=n.nodeClickDistance,D=Ux(Jb);D.nodesSelectionActive;var B=D.userSelectionActive,V=_b(s),H=_b(g),Y=H||C,X=H||b,Z=V||B||f&&!0!==Y;return function(n){var e=n.deleteKeyCode,t=n.multiSelectionKeyCode,r=$x(),o=Wb().deleteElements,i=_b(e,Ub),u=_b(t);a((function(){if(i){var n=r.getState(),e=n.edgeLookup,t=n.nodeLookup;o({nodes:Array.from(t.values()).filter(Fb),edges:Array.from(e.values()).filter(Fb)}),r.setState({nodesSelectionActive:!1})}}),[i]),a((function(){r.setState({multiSelectionActive:u})}),[u])}({deleteKeyCode:l,multiSelectionKeyCode:p}),k.jsx(Mb,{onPaneContextMenu:u,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:X,panOnScrollSpeed:_,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!V&&Y,defaultViewport:N,translateExtent:M,minZoom:O,maxZoom:P,zoomActivationKeyCode:y,preventScrolling:j,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:L,paneClickDistance:R,nodeClickDistance:T,children:k.jsx(Qb,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:Y,isSelecting:!!Z,selectionMode:d,selectionKeyPressed:V,children:e})})}n_.displayName="FlowRenderer";var e_=s(n_);function t_(n){var e=y(i(n),2);return[e[0],e[1]]}function r_(n){var e=y(i(n),2);return[e[0],e[1]]}var o_=function(n){return n.updateNodeInternals};function i_(n){var e=Ux(l(function(n){return function(e){return n?Bb(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())}}(n),[n]),kb);return e}var u_=e(null),a_=u_.Provider;u_.Consumer;var c_=function(){return t(u_)};function l_(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 s_(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function f_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case lp.Left:return[t-s_(t-o,u),r];case lp.Right:return[t+s_(o-t,u),r];case lp.Top:return[t,r-s_(r-i,u)];case lp.Bottom:return[t,r+s_(i-r,u)]}}function d_(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 h_(n){var e=n.sourceNode,t=n.targetNode,r=n.width,o=n.height,i=n.transform,u=ob(ab(e),ab(t));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);var a={x:-i[0]/i[2],y:-i[1]/i[2],width:r/i[2],height:o/i[2]};return sb(a,ub(u))>0}var v_,p_=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 g_=((v_={})[lp.Left]={x:-1,y:0},v_[lp.Right]={x:1,y:0},v_[lp.Top]={x:0,y:-1},v_[lp.Bottom]={x:0,y:1},v_),y_=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function m_(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?lp.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?lp.Top:l,f=n.center,d=n.offset,h=g_[a],v=g_[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},w=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?lp.Bottom:t,o=n.target;return r===lp.Left||r===lp.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}),x=0!==w.x?"x":"y",b=w[x],_=[],E={x:0,y:0},S={x:0,y:0},k=y(d_({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),C=k[0],N=k[1],M=k[2],O=k[3];if(h[x]*v[x]==-1){r=null!==(e=f.x)&&void 0!==e?e:C,o=null!==(t=f.y)&&void 0!==t?t:N;var P=[{x:r,y:p.y},{x:r,y:g.y}],j=[{x:p.x,y:o},{x:g.x,y:o}];_=h[x]===b?"x"===x?P:j:"x"===x?j:P}else{var I=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(_="x"===x?h.x===b?A:I:h.y===b?I:A,a===s){var z=Math.abs(i[x]-c[x]);if(z<=d){var L=Math.min(d-1,d-z);h[x]===b?E[x]=(p[x]>i[x]?-1:1)*L:S[x]=(g[x]>c[x]?-1:1)*L}}if(a!==s){var R="x"===x?"y":"x",T=h[x]===v[R],D=p[R]>g[R],B=p[R]<g[R];(1===h[x]&&(!T&&D||T&&B)||1!==h[x]&&(!T&&B||T&&D))&&(_="x"===x?I:A)}var V={x:p.x+E.x,y:p.y+E.y},H={x:g.x+S.x,y:g.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[m(m([i,{x:p.x+E.x,y:p.y+E.y}],y(_),!1),[{x:g.x+S.x,y:g.y+S.y},c],!1),r,o,M,O]}function w_(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=y(m_({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],m=v[2],w=v[3],x=v[4],b=p.reduce((function(n,e,t){var r="";return r=t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(y_(n,e)/2,y_(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),n+=r}),"");return[b,g,m,w,x]}var x_=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var b_=s(lb((function(n,e){var t,r,o=n.type,i=void 0===o?"source":o,u=n.position,a=void 0===u?lp.Top:u,c=n.isValidConnection,l=n.isConnectable,s=void 0===l||l,f=n.isConnectableStart,v=void 0===f||f,p=n.isConnectableEnd,g=void 0===p||p,y=n.id,m=n.onConnect,w=n.children,x=n.className,b=n.onMouseDown,_=n.onTouchStart,E=h(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),S=y||null,C="target"===i,N=$x(),M=c_(),O=Ux(x_,kb),j=O.connectOnClick,I=O.noPanClassName,A=O.rfId,z=Ux(function(n,e,t){return function(r){var o=r.connectionClickStartHandle,i=r.connectionMode,u=r.connection,a=u.fromHandle,c=u.toHandle,l=u.isValid,s=(null==c?void 0:c.nodeId)===n&&(null==c?void 0:c.id)===e&&(null==c?void 0:c.type)===t;return{connectingFrom:(null==a?void 0:a.nodeId)===n&&(null==a?void 0:a.id)===e&&(null==a?void 0:a.type)===t,connectingTo:s,clickConnecting:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.id)===e&&(null==o?void 0:o.type)===t,isPossibleEndHandle:i===np.Strict?(null==a?void 0:a.type)!==t:n!==(null==a?void 0:a.nodeId)||e!==(null==a?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:s&&l}}}(M,S,i),kb),L=z.connectingFrom,R=z.connectingTo,T=z.clickConnecting,D=z.isPossibleEndHandle,B=z.connectionInProcess,V=z.clickConnectionInProcess,H=z.valid;M||null===(r=(t=N.getState()).onError)||void 0===r||r.call(t,"010",wv.error010());var Y=function(n){var e=N.getState(),t=e.defaultEdgeOptions,r=e.onConnect,o=e.hasDefaultEdges,i=d(d({},t),n);if(o){var u=N.getState(),a=u.edges;(0,u.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))}))}(t="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:p_(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):(wv.error006(),e);var t,r}(i,a))}null==r||r(i),null==m||m(i)},X=function(n){if(M){var e=wb(n.nativeEvent);if(v&&(e&&0===n.button||!e)){var t=N.getState();Sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:C,handleId:S,nodeId:M,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:Y,isValidConnection:c||t.isValidConnection,getTransform:function(){return N.getState().transform},getFromHandle:function(){return N.getState().connection.fromHandle},autoPanSpeed:t.autoPanSpeed})}e?null==b||b(n):null==_||_(n)}};return k.jsx("div",d({"data-handleid":S,"data-nodeid":M,"data-handlepos":a,"data-id":"".concat(A,"-").concat(M,"-").concat(S,"-").concat(i),className:P(["ink-flow__handle","ink-flow__handle-".concat(a),"nodrag",I,x,{source:!C,target:C,connectable:s,connectablestart:v,connectableend:g,clickconnecting:T,connectingfrom:L,connectingto:R,valid:H,connectionindicator:s&&(!B||D)&&(B||V?g:v)}]),onMouseDown:X,onTouchStart:X,onClick:j?function(n){var e=N.getState(),t=e.onClickConnectStart,r=e.onClickConnectEnd,o=e.connectionClickStartHandle,u=e.connectionMode,a=e.isValidConnection,l=e.lib,s=e.rfId,f=e.nodeLookup,d=e.connection;if(M&&(o||v)){if(!o)return null==t||t(n.nativeEvent,{nodeId:M,handleId:S,handleType:i}),void N.setState({connectionClickStartHandle:{nodeId:M,type:i,id:S}});var h=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),p=c||a,g=Sm.isValid(n.nativeEvent,{handle:{nodeId:M,id:S,type:i},connectionMode:u,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:p,flowId:s,doc:h,lib:l,nodeLookup:f}),y=g.connection;g.isValid&&y&&Y(y);var m=structuredClone(d);delete m.inProgress,m.toPosition=m.toHandle?m.toHandle.position:null,null==r||r(n,m),N.setState({connectionClickStartHandle:null})}}:void 0,ref:e},E,{children:w}))})));var __={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},E_={input:function(n){var e=n.data,t=n.isConnectable,r=n.sourcePosition,o=void 0===r?lp.Bottom:r;return k.jsxs(k.Fragment,{children:[null==e?void 0:e.label,k.jsx(b_,{type:"source",position:o,isConnectable:t})]})},default:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?lp.Top:r,i=n.sourcePosition,u=void 0===i?lp.Bottom:i;return k.jsxs(k.Fragment,{children:[k.jsx(b_,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label,k.jsx(b_,{type:"source",position:u,isConnectable:t})]})},output:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?lp.Top:r;return k.jsxs(k.Fragment,{children:[k.jsx(b_,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};function S_(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",wv.error012(e))}function k_(n){var e,t,r=n.id,o=n.onClick,c=n.onMouseEnter,s=n.onMouseMove,f=n.onMouseLeave,h=n.onContextMenu,v=n.onDoubleClick,p=n.nodesDraggable,m=n.elementsSelectable,w=n.nodesConnectable,x=n.nodesFocusable,b=n.resizeObserver,_=n.noDragClassName,E=n.noPanClassName,S=n.disableKeyboardA11y,C=n.rfId,N=n.nodeTypes,M=n.nodeExtent,O=n.nodeOrigin,j=n.onError,I=Ux((function(n){var e=n.nodeLookup.get(r),t=n.parentLookup.has(r);return{node:e,internals:e.internals,isParent:t}}),kb),A=I.node,z=I.internals,L=I.isParent,R=A.type||"default",T=(null==N?void 0:N[R])||E_[R];void 0===T&&(null==j||j("003",wv.error003(R)),R="default",T=E_.default);var D=!!(A.draggable||p&&void 0===A.draggable),B=!!(A.selectable||m&&void 0===A.selectable),V=!!(A.connectable||w&&void 0===A.connectable),H=!!(A.focusable||x&&void 0===A.focusable),Y=$x(),X=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)}(A),Z=function(n){var e=n.node,t=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=$x(),c=u(null),l=u(null),s=u(e.sourcePosition),f=u(e.targetPosition),d=u(t),h=r&&!!e.internals.handleBounds&&!e.hidden;return a((function(){!c.current||h&&l.current===c.current||(l.current&&(null==o||o.unobserve(l.current)),null==o||o.observe(c.current),l.current=c.current)}),[h]),a((function(){return function(){l.current&&(null==o||o.unobserve(l.current),l.current=null)}}),[]),a((function(){if(c.current){var n=d.current!==t,r=s.current!==e.sourcePosition,o=f.current!==e.targetPosition;(n||r||o)&&(d.current=t,s.current=e.sourcePosition,f.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}}),[e.id,t,e.sourcePosition,e.targetPosition]),c}({node:A,nodeType:R,hasDimensions:X,resizeObserver:b}),W=function(n){var e=n.nodeRef,t=n.disabled,r=void 0!==t&&t,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,f=$x(),d=y(i(!1),2),h=d[0],v=d[1],p=u();return a((function(){p.current=mm({getStoreItems:function(){return f.getState()},onNodeMouseDown:function(n){S_({id:n,store:f,nodeRef:e})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),a((function(){var n,t;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(e.current)return null===(t=p.current)||void 0===t||t.update({noDragClassName:o,handleSelector:c,domNode:e.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,e,l]),h}({nodeRef:Z,disabled:A.hidden||!D,noDragClassName:_,handleSelector:A.dragHandle,nodeId:r,isSelectable:B}),F=function(){var n=$x(),e=l((function(e){var t,r,o=n.getState(),i=o.nodeExtent,u=o.snapToGrid,a=o.snapGrid,c=o.nodesDraggable,l=o.onError,s=o.updateNodePositions,f=o.nodeLookup,d=o.nodeOrigin,h=new Map,v=function(n){return function(e){return e.selected&&(e.draggable||n&&void 0===e.draggable)}}(c),p=u?a[0]:5,m=u?a[1]:5,w=e.direction.x*p*e.factor,x=e.direction.y*m*e.factor;try{for(var b=g(f),_=b.next();!_.done;_=b.next()){var E=y(_.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+x};u&&(S=eb(S,a));var k=Hb({nodeId:E.id,nextPosition:S,nodeLookup:f,nodeExtent:i,nodeOrigin:d,onError:l}),C=k.position,N=k.positionAbsolute;E.position=C,E.internals.positionAbsolute=N,h.set(E.id,E)}}}catch(n){t={error:n}}finally{try{_&&!_.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}s(h)}),[]);return e}();if(A.hidden)return null;var U=Jx(A),$=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}}(A),G=(M?Qx(z.positionAbsolute,M):z.positionAbsolute)||{x:0,y:0},q=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]}}(d(d(d({},G),U),{origin:A.origin||O})),K=B||D||o||c||s||f,Q=c?function(n){return c(n,d({},z.userNode))}:void 0,J=s?function(n){return s(n,d({},z.userNode))}:void 0,nn=f?function(n){return f(n,d({},z.userNode))}:void 0,en=h?function(n){return h(n,d({},z.userNode))}:void 0,tn=v?function(n){return v(n,d({},z.userNode))}:void 0;return k.jsx("div",{className:P(["ink-flow__node","ink-flow__node-".concat(R),(e={},e[E]=D,e),A.className,{selected:A.selected,selectable:B,parent:L,draggable:D,dragging:W}]),ref:Z,style:d(d({zIndex:z.z,transform:"translate(".concat(q.x,"px,").concat(q.y,"px)"),pointerEvents:K?"all":"none",visibility:X?"visible":"hidden"},A.style),$),"data-id":r,"data-testid":"rf__node-".concat(r),onMouseEnter:Q,onMouseMove:J,onMouseLeave:nn,onContextMenu:en,onClick:function(n){var e=Y.getState(),t=e.selectNodesOnDrag,i=e.nodeDragThreshold;B&&(!t||!D||i>0)&&S_({id:r,store:Y,nodeRef:Z}),o&&o(n,d({},z.userNode))},onDoubleClick:tn,onKeyDown:H?function(n){if(!mb(n.nativeEvent)&&!S)if(bv.includes(n.key)&&B){var e="Escape"===n.key;S_({id:r,store:Y,unselect:e,nodeRef:Z})}else D&&A.selected&&Object.prototype.hasOwnProperty.call(__,n.key)&&(Y.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~G.x,", y: ").concat(~~G.y)}),F({direction:__[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:H?0:void 0,role:H?"button":void 0,"aria-describedby":S?void 0:"".concat("ink-flow__node-desc","-").concat(C),"aria-label":A.ariaLabel,children:k.jsx(a_,{value:r,children:k.jsx(T,d({id:r,data:A.data,type:R,positionAbsoluteX:G.x,positionAbsoluteY:G.y,selected:A.selected,isConnectable:V,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:W,draggable:D,dragHandle:A.dragHandle,zIndex:z.z,selectable:B,deletable:null===(t=A.deletable)||void 0===t||t},U))})})}var C_=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function N_(n){var e=Ux(C_,kb),t=e.nodesDraggable,r=e.nodesConnectable,o=e.nodesFocusable,u=e.elementsSelectable,c=e.onError,l=i_(!1),s=function(){var n=Ux(o_),e=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(e){var t=new Map;e.forEach((function(n){var e=n.target.getAttribute("data-id");t.set(e,{id:e,nodeElement:n.target})})),n(t)}))})),1),t=e[0];return a((function(){return function(){null==t||t.disconnect()}}),[t]),t}();return k.jsx("div",{className:"ink-flow__nodes",style:Cb,children:l.map((function(e){return k.jsx(k_,{id:e,nodeTypes:n.nodeTypes,nodeOrigin:n.nodeOrigin,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:u,onError:c},e)}))})}N_.displayName="NodeRenderer";var M_,O_=s(N_),P_=((M_={})[ap.Arrow]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},M_[ap.ArrowClosed]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},M_);function j_(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 I_=function(n){var e=n.id,t=n.type,o=n.color,i=n.width,u=void 0===i?12.5:i,a=n.height,c=void 0===a?12.5:a,l=n.markerUnits,s=void 0===l?"strokeWidth":l,f=n.strokeWidth,d=n.orient,h=void 0===d?"auto-start-reverse":d,v=function(n){var e=$x(),t=r((function(){var t,r;return Object.prototype.hasOwnProperty.call(P_,n)?P_[n]:(null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"009",wv.error009(n)),null)}),[n]);return t}(t);return v?k.jsx("marker",{className:"ink-flow__arrowhead",id:e,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:k.jsx(v,{color:o,strokeWidth:f})}):null},A_=function(n){var e=n.defaultColor,t=n.rfId,o=Ux((function(n){return n.edges})),i=Ux((function(n){return n.defaultEdgeOptions})),u=r((function(){var n=function(n,e){var t=e.id,r=e.defaultColor,o=e.defaultMarkerStart,i=e.defaultMarkerEnd,u=new Set;return n.reduce((function(n,e){return[e.markerStart||o,e.markerEnd||i].forEach((function(e){if(e&&"object"==typeof e){var o=j_(e,t);u.has(o)||(n.push(d({id:o,color:e.color||r},e)),u.add(o))}})),n}),[]).sort((function(n,e){return n.id.localeCompare(e.id)}))}(o,{id:t,defaultColor:e,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,t,e]);return u.length?k.jsx("svg",{className:"ink-flow__marker",children:k.jsx("defs",{children:u.map((function(n){return k.jsx(I_,{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};A_.displayName="MarkerDefinitions";var z_=s(A_);function L_(n){var e=n.x,t=n.y,r=n.label,o=n.labelStyle,u=void 0===o?{}:o,a=n.labelShowBg,c=void 0===a||a,s=n.labelBgStyle,f=void 0===s?{}:s,v=n.labelBgPadding,p=void 0===v?[2,4]:v,g=n.labelBgBorderRadius,m=void 0===g?2:g,w=n.children,x=n.className,b=h(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),_=y(i({x:1,y:0,width:0,height:0}),2),E=_[0],S=_[1],C=P(["ink-flow__edge-textwrapper",x]),N=l((function(n){if(null!==n){var e=n.getBBox();S({x:e.x,y:e.y,width:e.width,height:e.height})}}),[]);return void 0!==r&&r?k.jsxs("g",d({transform:"translate(".concat(e-E.width/2," ").concat(t-E.height/2,")"),className:C,visibility:E.width?"visible":"hidden"},b,{children:[c&&k.jsx("rect",{width:E.width+2*p[0],x:-p[0],y:-p[1],height:E.height+2*p[1],className:"ink-flow__edge-textbg",style:f,rx:m,ry:m}),k.jsx("text",{className:"ink-flow__edge-text",y:E.height/2,dy:"0.3em",ref:N,style:u,children:r}),w]})):null}L_.displayName="EdgeText";var R_=s(L_);function T_(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,p=n.interactionWidth,g=void 0===p?20:p;return k.jsxs(k.Fragment,{children:[k.jsx("path",{id:e,style:f,d:t,fill:"none",className:P(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),g&&k.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&nb(r)&&nb(o)?k.jsx(R_,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function D_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2;return e===lp.Left||e===lp.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function B_(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=y(D_({pos:o,x1:e,y1:t,x2:i,y2:u}),2),s=l[0],f=l[1],d=y(D_({pos:c,x1:i,y1:u,x2:e,y2:t}),2),h=d[0],v=d[1],p=y(l_({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:s,sourceControlY:f,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],x=p[3];return["M".concat(e,",").concat(t," C").concat(s,",").concat(f," ").concat(h,",").concat(v," ").concat(i,",").concat(u),g,m,w,x]}function V_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.sourcePosition,c=void 0===a?lp.Bottom:a,l=e.targetPosition,s=void 0===l?lp.Top:l,f=e.label,d=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,g=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,x=e.markerStart,b=e.interactionWidth,_=y(B_({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s}),3),E=_[0],S=_[1],C=_[2],N=n.isInternal?void 0:t;return k.jsx(T_,{id:N,path:E,labelX:S,labelY:C,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:x,interactionWidth:b})}))}var H_=V_({isInternal:!1}),Y_=V_({isInternal:!0});function X_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,f=e.labelBgPadding,d=e.labelBgBorderRadius,h=e.style,v=e.sourcePosition,p=void 0===v?lp.Bottom:v,g=e.targetPosition,m=void 0===g?lp.Top:g,w=e.markerEnd,x=e.markerStart,b=e.pathOptions,_=e.interactionWidth,E=y(w_({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:u,targetPosition:m,borderRadius:null==b?void 0:b.borderRadius,offset:null==b?void 0:b.offset}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:t;return k.jsx(T_,{id:M,path:S,labelX:C,labelY:N,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:w,markerStart:x,interactionWidth:_})}))}H_.displayName="SimpleBezierEdge",Y_.displayName="SimpleBezierEdgeInternal";var Z_=X_({isInternal:!1}),W_=X_({isInternal:!0});function F_(n){return s((function(e){var t,o=e.id,i=h(e,["id"]),u=n.isInternal?void 0:o;return k.jsx(Z_,d({},i,{id:u,pathOptions:r((function(){var n;return{borderRadius:0,offset:null===(n=i.pathOptions)||void 0===n?void 0:n.offset}}),[null===(t=i.pathOptions)||void 0===t?void 0:t.offset])}))}))}Z_.displayName="SmoothStepEdge",W_.displayName="SmoothStepEdgeInternal";var U_=F_({isInternal:!1}),$_=F_({isInternal:!0});function G_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,f=e.labelBgPadding,d=e.labelBgBorderRadius,h=e.style,v=e.markerEnd,p=e.markerStart,g=e.interactionWidth,m=y(function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=y(d_({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]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=m[0],x=m[1],b=m[2],_=n.isInternal?void 0:t;return k.jsx(T_,{id:_,path:w,labelX:x,labelY:b,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}U_.displayName="StepEdge",$_.displayName="StepEdgeInternal";var q_=G_({isInternal:!1}),K_=G_({isInternal:!0});function Q_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.sourcePosition,c=void 0===a?lp.Bottom:a,l=e.targetPosition,s=void 0===l?lp.Top:l,f=e.label,d=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,g=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,x=e.markerStart,b=e.pathOptions,_=e.interactionWidth,E=y(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.curvature,s=void 0===l?.25:l,f=y(f_({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=y(f_({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],m=y(l_({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],x=m[1],b=m[2],_=m[3];return["M".concat(e,",").concat(t," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),w,x,b,_]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s,curvature:null==b?void 0:b.curvature}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:t;return k.jsx(T_,{id:M,path:S,labelX:C,labelY:N,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:x,interactionWidth:_})}))}q_.displayName="StraightEdge",K_.displayName="StraightEdgeInternal";var J_=Q_({isInternal:!1}),nE=Q_({isInternal:!0});J_.displayName="BezierEdge",nE.displayName="BezierEdgeInternal";var eE={default:nE,straight:K_,step:$_,smoothstep:W_,simplebezier:Y_},tE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},rE=function(n,e,t){return t===lp.Left?n-e:t===lp.Right?n+e:n},oE=function(n,e,t){return t===lp.Top?n-e:t===lp.Bottom?n+e:n},iE="ink-flow__edgeupdater";function uE(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 k.jsx("circle",{onMouseDown:u,onMouseEnter:a,onMouseOut:c,className:P([iE,"".concat(iE,"-").concat(l)]),cx:rE(t,i,e),cy:oE(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function aE(n){var e=n.isReconnectable,t=n.reconnectRadius,r=n.edge,o=n.sourceX,i=n.sourceY,u=n.targetX,a=n.targetY,c=n.sourcePosition,l=n.targetPosition,s=n.onReconnect,f=n.onReconnectStart,d=n.onReconnectEnd,h=n.setReconnecting,v=n.setUpdateHover,p=$x(),g=function(n,e){if(0===n.button){var t=p.getState(),o=t.autoPanOnConnect,i=t.domNode,u=t.isValidConnection,a=t.connectionMode,c=t.connectionRadius,l=t.lib,v=t.onConnectStart,g=t.onConnectEnd,y=t.cancelConnection,m=t.nodeLookup,w=t.rfId,x=t.panBy,b=t.updateConnection,_="target"===e.type;h(!0),null==f||f(n,r,e.type);Sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:o,connectionMode:a,connectionRadius:c,domNode:i,handleId:e.id,nodeId:e.nodeId,nodeLookup:m,isTarget:_,edgeUpdaterType:e.type,lib:l,flowId:w,cancelConnection:y,panBy:x,isValidConnection:u,onConnect:function(n){return null==s?void 0:s(r,n)},onConnectStart:v,onConnectEnd:g,onReconnectEnd:function(n,t){h(!1),null==d||d(n,r,e.type,t)},updateConnection:b,getTransform:function(){return p.getState().transform},getFromHandle:function(){return p.getState().connection.fromHandle}})}},y=function(){return v(!0)},m=function(){return v(!1)};return k.jsxs(k.Fragment,{children:[(!0===e||"source"===e)&&k.jsx(uE,{position:c,centerX:o,centerY:i,radius:t,onMouseDown:function(n){var e;return g(n,{nodeId:r.target,id:null!==(e=r.targetHandle)&&void 0!==e?e:null,type:"target"})},onMouseEnter:y,onMouseOut:m,type:"source"}),(!0===e||"target"===e)&&k.jsx(uE,{position:l,centerX:u,centerY:a,radius:t,onMouseDown:function(n){var e;return g(n,{nodeId:r.source,id:null!==(e=r.sourceHandle)&&void 0!==e?e:null,type:"source"})},onMouseEnter:y,onMouseOut:m,type:"target"})]})}function cE(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 lE(n){var e,t,r,o;if(!n)return null;var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.width=null!==(r=l.width)&&void 0!==r?r:1,l.height=null!==(o=l.height)&&void 0!==o?o:1,"source"===l.type?i.push(l):"target"===l.type&&u.push(l)}}catch(n){e={error:n}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return{source:i,target:u}}function sE(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:Jx(e),c=a.width,l=a.height;switch(n){case lp.Top:return[i+c/2,u];case lp.Right:return[i+c,u+l/2];case lp.Bottom:return[i+c/2,u+l];case lp.Left:return[i,u+l/2]}}function fE(n,e){return n&&(e?n.find((function(n){return n.id===e})):n[0])||null}function dE(n){var e,t=n.id,o=n.edgesFocusable,a=n.edgesReconnectable,c=n.elementsSelectable,s=n.onClick,f=n.onDoubleClick,h=n.onContextMenu,v=n.onMouseEnter,p=n.onMouseMove,g=n.onMouseLeave,m=n.reconnectRadius,w=n.onReconnect,x=n.onReconnectStart,b=n.onReconnectEnd,_=n.rfId,E=n.edgeTypes,S=n.noPanClassName,C=n.onError,N=n.disableKeyboardA11y,M=Ux((function(n){return n.edgeLookup.get(t)})),O=Ux((function(n){return n.defaultEdgeOptions})),j=(M=O?d(d({},O),M):M).type||"default",I=(null==E?void 0:E[j])||eE[j];void 0===I&&(null==C||C("011",wv.error011(j)),j="default",I=eE.default);var A=!!(M.focusable||o&&void 0===M.focusable),z=void 0!==w&&(M.reconnectable||a&&void 0===M.reconnectable),L=!!(M.selectable||c&&void 0===M.selectable),R=u(null),T=y(i(!1),2),D=T[0],B=T[1],V=y(i(!1),2),H=V[0],Y=V[1],X=$x(),Z=Ux(l((function(n){var e=n.nodeLookup.get(M.source),r=n.nodeLookup.get(M.target);if(!e||!r)return d({zIndex:M.zIndex},tE);var o=function(n){var e,t,r,o,i,u=n.sourceNode,a=n.targetNode;if(!cE(u)||!cE(a))return null;var c=u.internals.handleBounds||lE(u.handles),l=a.internals.handleBounds||lE(a.handles),s=fE(null!==(e=null==c?void 0:c.source)&&void 0!==e?e:[],n.sourceHandle),f=fE(n.connectionMode===np.Strict?null!==(t=null==l?void 0:l.target)&&void 0!==t?t:[]:(null!==(r=null==l?void 0:l.target)&&void 0!==r?r:[]).concat(null!==(o=null==l?void 0:l.source)&&void 0!==o?o:[]),n.targetHandle),d=(null==s?void 0:s.position)||lp.Bottom,h=(null==f?void 0:f.position)||lp.Top;if(!s||!f)return null===(i=n.onError)||void 0===i||i.call(n,"008",wv.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=y(sE(d,u,s),2),p=v[0],g=v[1],m=y(sE(h,a,f),2);return{sourceX:p,sourceY:g,targetX:m[0],targetY:m[1],sourcePosition:d,targetPosition:h}}({id:t,sourceNode:e,targetNode:r,sourceHandle:M.sourceHandle||null,targetHandle:M.targetHandle||null,connectionMode:n.connectionMode,onError:C}),i=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:M.selected,zIndex:M.zIndex,sourceNode:e,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||tE)}),[M.source,M.target,M.sourceHandle,M.targetHandle,M.selected,M.zIndex]),kb),W=Z.zIndex,F=Z.sourceX,U=Z.sourceY,$=Z.targetX,G=Z.targetY,q=Z.sourcePosition,K=Z.targetPosition,Q=r((function(){return M.markerStart?"url('#".concat(j_(M.markerStart,_),"')"):void 0}),[M.markerStart,_]),J=r((function(){return M.markerEnd?"url('#".concat(j_(M.markerEnd,_),"')"):void 0}),[M.markerEnd,_]);if(M.hidden||null===F||null===U||null===$||null===G)return null;var nn=f?function(n){f(n,d({},M))}:void 0,en=h?function(n){h(n,d({},M))}:void 0,tn=v?function(n){v(n,d({},M))}:void 0,rn=p?function(n){p(n,d({},M))}:void 0,on=g?function(n){g(n,d({},M))}:void 0;return k.jsx("svg",{style:{zIndex:W},children:k.jsxs("g",{className:P(["ink-flow__edge","ink-flow__edge-".concat(j),M.className,S,{selected:M.selected,animated:M.animated,inactive:!L&&!s,updating:D,selectable:L}]),onClick:function(n){var e,r=X.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,u=r.multiSelectionActive;L&&(X.setState({nodesSelectionActive:!1}),M.selected&&u?(i({nodes:[],edges:[M]}),null===(e=R.current)||void 0===e||e.blur()):o([t])),s&&s(n,M)},onDoubleClick:nn,onContextMenu:en,onMouseEnter:tn,onMouseMove:rn,onMouseLeave:on,onKeyDown:A?function(n){var e;if(!N&&bv.includes(n.key)&&L){var r=X.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(e=R.current)||void 0===e||e.blur(),o({edges:[M]})):i([t])}}:void 0,tabIndex:A?0:void 0,role:A?"button":"img","data-id":t,"data-testid":"rf__edge-".concat(t),"aria-label":null===M.ariaLabel?void 0:M.ariaLabel||"Edge from ".concat(M.source," to ").concat(M.target),"aria-describedby":A?"".concat("ink-flow__edge-desc","-").concat(_):void 0,ref:R,children:[!H&&k.jsx(I,{id:t,source:M.source,target:M.target,type:M.type,selected:M.selected,animated:M.animated,selectable:L,deletable:null===(e=M.deletable)||void 0===e||e,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,sourceX:F,sourceY:U,targetX:$,targetY:G,sourcePosition:q,targetPosition:K,data:M.data,style:M.style,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerStart:Q,markerEnd:J,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth}),z&&k.jsx(aE,{edge:M,isReconnectable:z,reconnectRadius:m,onReconnect:w,onReconnectStart:x,onReconnectEnd:b,sourceX:F,sourceY:U,targetX:$,targetY:G,sourcePosition:q,targetPosition:K,setUpdateHover:B,setReconnecting:Y})]})})}var hE=function(n){return{edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function vE(n){var e=n.defaultMarkerColor,t=n.onlyRenderVisibleElements,r=n.rfId,o=n.edgeTypes,i=n.noPanClassName,u=n.onReconnect,a=n.onEdgeContextMenu,c=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeClick,h=n.reconnectRadius,v=n.onEdgeDoubleClick,p=n.onReconnectStart,y=n.onReconnectEnd,m=n.disableKeyboardA11y,w=Ux(hE,kb),x=w.edgesFocusable,b=w.edgesReconnectable,_=w.elementsSelectable,E=w.onError,S=function(n){var e=Ux(l((function(e){var t,r;if(!n)return e.edges.map((function(n){return n.id}));var o=[];if(e.width&&e.height)try{for(var i=g(e.edges),u=i.next();!u.done;u=i.next()){var a=u.value,c=e.nodeLookup.get(a.source),l=e.nodeLookup.get(a.target);c&&l&&h_({sourceNode:c,targetNode:l,width:e.width,height:e.height,transform:e.transform})&&o.push(a.id)}}catch(n){t={error:n}}finally{try{u&&!u.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}),[n]),kb);return e}(t);return k.jsxs("div",{className:"ink-flow__edges",children:[k.jsx(z_,{defaultColor:e,rfId:r}),S.map((function(n){return k.jsx(dE,{id:n,edgesFocusable:x,edgesReconnectable:b,elementsSelectable:_,noPanClassName:i,onReconnect:u,onContextMenu:a,onMouseEnter:c,onMouseMove:s,onMouseLeave:f,onClick:d,reconnectRadius:h,onDoubleClick:v,onReconnectStart:p,onReconnectEnd:y,rfId:r,onError:E,edgeTypes:o,disableKeyboardA11y:m},n)}))]})}vE.displayName="EdgeRenderer";var pE=s(vE),gE=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function yE(n){var e=n.children,t=Ux(gE);return k.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:e})}function mE(n){return n.connection.inProgress?d(d({},n.connection),{to:Zv(n.connection.to,n.transform)}):d({},n.connection)}function wE(n){return Ux(mE,kb)}var xE=function(n){var e=n.style,t=n.type,r=void 0===t?up.Bezier:t,o=n.CustomComponent,i=n.isValid,u=wE(),a=u.inProgress,c=u.from,l=u.fromNode,s=u.fromHandle,f=u.fromPosition,h=u.to,v=u.toNode,p=u.toHandle,g=u.toPosition;if(a){if(o)return k.jsx(o,{connectionLineType:r,connectionLineStyle:e,fromNode:l,fromHandle:s,fromX:c.x,fromY:c.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:g,connectionStatus:Qv(i),toNode:v,toHandle:p});var m="",w={sourceX:c.x,sourceY:c.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:g};switch(r){case up.Bezier:m=y(pp(w),1)[0];break;case up.SimpleBezier:m=y(B_(w),1)[0];break;case up.Step:m=y(kp(d(d({},w),{borderRadius:0})),1)[0];break;case up.SmoothStep:m=y(kp(w),1)[0];break;default:m=y(bp(w),1)[0]}return k.jsx("path",{d:m,fill:"none",className:"ink-flow__connection-path",style:e})}};xE.displayName="ConnectionLine";var bE=function(n){return{nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height}};function _E(n){var e=n.containerStyle,t=n.style,r=n.type,o=n.component,i=Ux(bE,kb),u=i.nodesConnectable,a=i.width,c=i.height,l=i.isValid,s=i.inProgress;return!!(a&&u&&s)?k.jsx("svg",{style:e,width:a,height:c,className:"ink-flow__connectionline ink-flow__container",children:k.jsx("g",{className:P(["ink-flow__connection",Qv(l)]),children:k.jsx(xE,{style:t,type:r,CustomComponent:o,isValid:l})})}):null}function EE(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,p=n.maxZoom,g=n.noPanClassName,y=n.noDragClassName,m=n.nodeOrigin,w=n.viewport,x=n.disableKeyboardA11y,b=n.translateExtent,_=n.defaultViewport,E=n.nodeTypes,S=n.edgeTypes,C=n.elementsSelectable,N=n.defaultMarkerColor,M=n.connectionLineType,O=n.connectionLineStyle,P=n.connectionLineComponent,j=n.connectionLineContainerStyle,I=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,R=n.onPaneMouseLeave,T=n.onPaneScroll,D=n.panOnDrag,B=n.selectionOnDrag,V=n.selectionMode,H=n.onlyRenderVisibleElements,Y=n.paneClickDistance,X=n.nodeClickDistance,Z=n.onReconnect,W=n.onReconnectStart,F=n.onReconnectEnd,U=n.reconnectRadius,$=n.deleteKeyCode,G=n.selectionKeyCode,q=n.multiSelectionKeyCode,K=n.noWheelClassName;return k.jsx(e_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:x,translateExtent:b,defaultViewport:_,elementsSelectable:C,onPaneClick:I,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:R,onPaneScroll:T,panOnDrag:D,selectionOnDrag:B,selectionMode:V,paneClickDistance:Y,nodeClickDistance:X,deleteKeyCode:$,selectionKeyCode:G,multiSelectionKeyCode:q,noWheelClassName:K,children:k.jsxs(yE,{children:[k.jsx(pE,{edgeTypes:S,onEdgeClick:a,onEdgeDoubleClick:c,onReconnect:Z,onReconnectStart:W,onReconnectEnd:F,onlyRenderVisibleElements:H,onEdgeContextMenu:d,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,reconnectRadius:U,defaultMarkerColor:N,noPanClassName:g,disableKeyboardA11y:x,rfId:h}),k.jsx(_E,{style:O,type:M,component:P,containerStyle:j}),k.jsx("div",{className:"ink-flow__edgelabel-renderer"}),k.jsx(O_,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:e,onNodeDoubleClick:t,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),k.jsx("div",{className:"ink-flow__viewport-portal"})]})})}EE.displayName="GraphView";var SE=s(EE),kE={x:0,y:0,zoom:1},CE={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},NE=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,h=null!==(e=null!=a?a:i)&&void 0!==e?e:[],v=null!==(t=null!=u?u:o)&&void 0!==t?t:[];qx(s,f,h),Op(v,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:v,nodeLookup:c,parentLookup:l,edges:h,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:xv,nodeExtent:xv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:d({},sp),connectionClickStartHandle:null,connectOnClick:!0,connectionMode:np.Strict,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:CE,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"ink",debug:!1}},ME={dagre:zp};function OE(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=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=ab(t,e.nodeOrigin);return ob(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ub(t)}(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})}var PE={exports:{}};
|
|
16
|
+
*/j.exports=function(){if(O)return I;O=1;var e=n,t=L(),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 I.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},I}();var R=x(j.exports);const T=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:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&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:D}=n,{useSyncExternalStoreWithSelector:B}=R,H=n=>n;function V(n,e=H,t){const r=B(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return D(r),r}const Y=(n,e)=>{const t=(n=>n?T(n):T)(n),r=(n,r=e)=>V(t,n,r);return Object.assign(r,t),r};var X=e(null),Z=X.Provider,W=function(){return W=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},W.apply(this,arguments)};function F(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}function U(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 $(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 G(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 q,K,Q,J,nn,en,tn,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,wn,xn,bn,_n,En,Sn,kn,Cn,Nn,Mn,On,Pn,jn,In,An,zn,Ln,Rn,Tn,Dn,Bn,Hn,Vn,Yn,Xn,Zn,Wn,Fn,Un,$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,we,xe,be,_e,Ee,Se,ke,Ce,Ne,Me,Oe,Pe,je,Ie,Ae,ze,Le,Re,Te,De,Be,He,Ve,Ye,Xe,Ze,We,Fe,Ue,$e,Ge,qe,Ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Qe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Je(){return J?Q:(J=1,Q=function(n,e){return n===e||n!=n&&e!=e})}function nt(){if(en)return nn;en=1;var n=Je();return nn=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1},nn}function et(){if(dn)return fn;dn=1;var n=K?q:(K=1,q=function(){this.__data__=[],this.size=0}),e=function(){if(rn)return tn;rn=1;var n=nt(),e=Array.prototype.splice;return tn=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(un)return on;un=1;var n=nt();return on=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}}(),r=function(){if(cn)return an;cn=1;var n=nt();return an=function(e){return n(this.__data__,e)>-1}}(),o=function(){if(sn)return ln;sn=1;var n=nt();return ln=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,fn=i}function tt(){if(_n)return bn;_n=1;var n="object"==typeof Ke&&Ke&&Ke.Object===Object&&Ke;return bn=n}function rt(){if(Sn)return En;Sn=1;var n=tt(),e="object"==typeof self&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return En=t}function ot(){if(Cn)return kn;Cn=1;var n=rt().Symbol;return kn=n}function it(){if(In)return jn;In=1;var n=ot(),e=function(){if(Mn)return Nn;Mn=1;var n=ot(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;return Nn=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(Pn)return On;Pn=1;var n=Object.prototype.toString;return On=function(e){return n.call(e)}}(),r=n?n.toStringTag:void 0;return jn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?e(n):t(n)}}function ut(){return zn?An:(zn=1,An=function(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)})}function at(){if(Rn)return Ln;Rn=1;var n=it(),e=ut();return Ln=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 ct(){if(Yn)return Vn;Yn=1;var n=Function.prototype.toString;return Vn=function(e){if(null!=e){try{return n.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function lt(){if($n)return Un;$n=1;var n=function(){if(Zn)return Xn;Zn=1;var n=at(),e=function(){if(Hn)return Bn;Hn=1;var n,e=function(){if(Dn)return Tn;Dn=1;var n=rt()["__core-js_shared__"];return Tn=n}(),t=(n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Bn=function(n){return!!t&&t in n}}(),t=ut(),r=ct(),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 Xn=function(i){return!(!t(i)||e(i))&&(n(i)?l:o).test(r(i))}}(),e=Fn?Wn:(Fn=1,Wn=function(n,e){return null==n?void 0:n[e]});return Un=function(t,r){var o=e(t,r);return n(o)?o:void 0}}function st(){if(qn)return Gn;qn=1;var n=lt()(rt(),"Map");return Gn=n}function ft(){if(Qn)return Kn;Qn=1;var n=lt()(Object,"create");return Kn=n}function dt(){if(ge)return pe;ge=1;var n=ve?he:(ve=1,he=function(n){var e=typeof n;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n});return pe=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}}function ht(){if(Ce)return ke;Ce=1;var n=function(){if(de)return fe;de=1;var n=function(){if(se)return le;se=1;var n=function(){if(ne)return Jn;ne=1;var n=ft();return Jn=function(){this.__data__=n?n(null):{},this.size=0}}(),e=te?ee:(te=1,ee=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}),t=function(){if(oe)return re;oe=1;var n=ft(),e=Object.prototype.hasOwnProperty;return re=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(ue)return ie;ue=1;var n=ft(),e=Object.prototype.hasOwnProperty;return ie=function(t){var r=this.__data__;return n?void 0!==r[t]:e.call(r,t)}}(),o=function(){if(ce)return ae;ce=1;var n=ft();return ae=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,le=i}(),e=et(),t=st();return fe=function(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}}(),e=function(){if(me)return ye;me=1;var n=dt();return ye=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}}(),t=function(){if(xe)return we;xe=1;var n=dt();return we=function(e){return n(this,e).get(e)}}(),r=function(){if(_e)return be;_e=1;var n=dt();return be=function(e){return n(this,e).has(e)}}(),o=function(){if(Se)return Ee;Se=1;var n=dt();return Ee=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,ke=i}function vt(){if(Pe)return Oe;Pe=1;var n=et(),e=function(){if(vn)return hn;vn=1;var n=et();return hn=function(){this.__data__=new n,this.size=0}}(),t=gn?pn:(gn=1,pn=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}),r=mn?yn:(mn=1,yn=function(n){return this.__data__.get(n)}),o=xn?wn:(xn=1,wn=function(n){return this.__data__.has(n)}),i=function(){if(Me)return Ne;Me=1;var n=et(),e=st(),t=ht();return Ne=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,Oe=u}function pt(){return Ie||(Ie=1,je=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}),je}function gt(){if(ze)return Ae;ze=1;var n=lt(),e=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Ae=e}function yt(){if(Re)return Le;Re=1;var n=gt();return Le=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}}function mt(){if(De)return Te;De=1;var n=yt(),e=Je(),t=Object.prototype.hasOwnProperty;return Te=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 wt(){if(He)return Be;He=1;var n=mt(),e=yt();return Be=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 xt(){return Ze?Xe:(Ze=1,Xe=function(n){return null!=n&&"object"==typeof n})}function bt(){if($e)return Ue;$e=1;var n=function(){if(Fe)return We;Fe=1;var n=it(),e=xt();return We=function(t){return e(t)&&"[object Arguments]"==n(t)}}(),e=xt(),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 Ue=i}function _t(){if(qe)return Ge;qe=1;var n=Array.isArray;return Ge=n}var Et,St,kt,Ct,Nt,Mt,Ot,Pt,jt,It,At,zt={exports:{}};function Lt(){return kt||(kt=1,function(n,e){var t=rt(),r=St?Et:(St=1,Et=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}(zt,zt.exports)),zt.exports}function Rt(){if(Nt)return Ct;Nt=1;var n=/^(?:0|[1-9]\d*)$/;return Ct=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 Tt(){return Ot?Mt:(Ot=1,Mt=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Dt(){return At?It:(At=1,It=function(n){return function(e){return n(e)}})}var Bt,Ht,Vt,Yt,Xt,Zt,Wt,Ft,Ut,$t,Gt,qt,Kt,Qt,Jt,nr,er,tr,rr,or,ir,ur,ar,cr,lr,sr,fr,dr={exports:{}};function hr(){return Bt||(Bt=1,n=dr,e=dr.exports,t=tt(),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),dr.exports;var n,e,t,r,o,i,u}function vr(){if(Vt)return Ht;Vt=1;var n=function(){if(jt)return Pt;jt=1;var n=it(),e=Tt(),t=xt(),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,Pt=function(o){return t(o)&&e(o.length)&&!!r[n(o)]}}(),e=Dt(),t=hr(),r=t&&t.isTypedArray,o=r?e(r):n;return Ht=o}function pr(){if(Xt)return Yt;Xt=1;var n=Ye?Ve:(Ye=1,Ve=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}),e=bt(),t=_t(),r=Lt(),o=Rt(),i=vr(),u=Object.prototype.hasOwnProperty;return Yt=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 gr(){if(Wt)return Zt;Wt=1;var n=Object.prototype;return Zt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}}function yr(){return Ut||(Ut=1,Ft=function(n,e){return function(t){return n(e(t))}}),Ft}function mr(){if(Kt)return qt;Kt=1;var n=gr(),e=function(){if(Gt)return $t;Gt=1;var n=yr()(Object.keys,Object);return $t=n}(),t=Object.prototype.hasOwnProperty;return qt=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 wr(){if(Jt)return Qt;Jt=1;var n=at(),e=Tt();return Qt=function(t){return null!=t&&e(t.length)&&!n(t)}}function xr(){if(er)return nr;er=1;var n=pr(),e=mr(),t=wr();return nr=function(r){return t(r)?n(r):e(r)}}function br(){if(lr)return cr;lr=1;var n=pr(),e=function(){if(ar)return ur;ar=1;var n=ut(),e=gr(),t=ir?or:(ir=1,or=function(n){var e=[];if(null!=n)for(var t in Object(n))e.push(t);return e}),r=Object.prototype.hasOwnProperty;return ur=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=wr();return cr=function(r){return t(r)?n(r,!0):e(r)}}var _r,Er,Sr,kr,Cr,Nr,Mr,Or,Pr,jr,Ir,Ar,zr,Lr,Rr,Tr,Dr,Br,Hr,Vr,Yr,Xr,Zr,Wr,Fr,Ur,$r,Gr,qr,Kr,Qr,Jr,no,eo,to,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,xo,bo,_o,Eo,So,ko,Co,No,Mo,Oo,Po,jo,Io,Ao,zo,Lo,Ro,To,Do,Bo,Ho,Vo,Yo,Xo,Zo,Wo,Fo,Uo,$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,wi,xi,bi,_i,Ei,Si,ki,Ci,Ni,Mi,Oi,Pi,ji,Ii,Ai,zi,Li,Ri,Ti,Di,Bi,Hi,Vi,Yi,Xi,Zi,Wi,Fi,Ui,$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,wu,xu,bu,_u,Eu,Su,ku,Cu,Nu,Mu,Ou,Pu,ju,Iu,Au,zu,Lu,Ru,Tu,Du,Bu,Hu,Vu,Yu,Xu,Zu,Wu,Fu,Uu,$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,wa,xa,ba,_a,Ea,Sa,ka,Ca,Na,Ma,Oa,Pa,ja,Ia,Aa,za,La,Ra,Ta,Da,Ba,Ha,Va,Ya,Xa,Za,Wa,Fa,Ua,$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,wc,xc,bc,_c,Ec,Sc,kc,Cc,Nc,Mc,Oc,Pc,jc,Ic,Ac={exports:{}};function zc(){return _r||(_r=1,function(n,e){var t=rt(),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}}(Ac,Ac.exports)),Ac.exports}function Lc(){return Sr||(Sr=1,Er=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}),Er}function Rc(){return Cr||(Cr=1,kr=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}),kr}function Tc(){return Mr?Nr:(Mr=1,Nr=function(){return[]})}function Dc(){if(Pr)return Or;Pr=1;var n=Rc(),e=Tc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Or=r?function(e){return null==e?[]:(e=Object(e),n(r(e),(function(n){return t.call(e,n)})))}:e}function Bc(){return zr||(zr=1,Ar=function(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}),Ar}function Hc(){if(Rr)return Lr;Rr=1;var n=yr()(Object.getPrototypeOf,Object);return Lr=n}function Vc(){if(Dr)return Tr;Dr=1;var n=Bc(),e=Hc(),t=Dc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)n(o,t(r)),r=e(r);return o}:r}function Yc(){if(Yr)return Vr;Yr=1;var n=Bc(),e=_t();return Vr=function(t,r,o){var i=r(t);return e(t)?i:n(i,o(t))}}function Xc(){if(Zr)return Xr;Zr=1;var n=Yc(),e=Dc(),t=xr();return Xr=function(r){return n(r,t,e)}}function Zc(){if(Qr)return Kr;Qr=1;var n=lt()(rt(),"Set");return Kr=n}function Wc(){if(to)return eo;to=1;var n=function(){if($r)return Ur;$r=1;var n=lt()(rt(),"DataView");return Ur=n}(),e=st(),t=function(){if(qr)return Gr;qr=1;var n=lt()(rt(),"Promise");return Gr=n}(),r=Zc(),o=function(){if(no)return Jr;no=1;var n=lt()(rt(),"WeakMap");return Jr=n}(),i=it(),u=ct(),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}),eo=y}function Fc(){if(uo)return io;uo=1;var n=rt().Uint8Array;return io=n}function Uc(){if(co)return ao;co=1;var n=Fc();return ao=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}}function $c(){if(yo)return go;yo=1;var n=Uc();return go=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}}function Gc(){if(bo)return xo;bo=1;var n=ut(),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 xo=t}function qc(){if(Eo)return _o;Eo=1;var n=Gc(),e=Hc(),t=gr();return _o=function(r){return"function"!=typeof r.constructor||t(r)?{}:n(e(r))}}function Kc(){if(Ao)return Io;Ao=1;var n=vt(),e=pt(),t=mt(),r=function(){if(rr)return tr;rr=1;var n=wt(),e=xr();return tr=function(t,r){return t&&n(r,e(r),t)}}(),o=function(){if(fr)return sr;fr=1;var n=wt(),e=br();return sr=function(t,r){return t&&n(r,e(r),t)}}(),i=zc(),u=Lc(),a=function(){if(Ir)return jr;Ir=1;var n=wt(),e=Dc();return jr=function(t,r){return n(t,e(t),r)}}(),c=function(){if(Hr)return Br;Hr=1;var n=wt(),e=Vc();return Br=function(t,r){return n(t,e(t),r)}}(),l=Xc(),s=function(){if(Fr)return Wr;Fr=1;var n=Yc(),e=Vc(),t=br();return Wr=function(r){return n(r,t,e)}}(),f=Wc(),d=function(){if(oo)return ro;oo=1;var n=Object.prototype.hasOwnProperty;return ro=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},ro}(),h=function(){if(wo)return mo;wo=1;var n=Uc(),e=function(){if(so)return lo;so=1;var n=Uc();return lo=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}}(),t=function(){if(ho)return fo;ho=1;var n=/\w*$/;return fo=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}(),r=function(){if(po)return vo;po=1;var n=ot(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;return vo=function(n){return t?Object(t.call(n)):{}}}(),o=$c();return mo=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=qc(),p=_t(),g=Lt(),y=function(){if(No)return Co;No=1;var n=function(){if(ko)return So;ko=1;var n=Wc(),e=xt();return So=function(t){return e(t)&&"[object Map]"==n(t)}}(),e=Dt(),t=hr(),r=t&&t.isMap,o=r?e(r):n;return Co=o}(),m=ut(),w=function(){if(jo)return Po;jo=1;var n=function(){if(Oo)return Mo;Oo=1;var n=Wc(),e=xt();return Mo=function(t){return e(t)&&"[object Set]"==n(t)}}(),e=Dt(),t=hr(),r=t&&t.isSet,o=r?e(r):n;return Po=o}(),x=xr(),b=br(),_="[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,Io=function C(N,M,O,P,j,I){var A,z=1&M,L=2&M,R=4&M;if(O&&(A=j?O(N,P,j,I):O(N)),void 0!==A)return A;if(!m(N))return N;var T=p(N);if(T){if(A=d(N),!z)return u(N,A)}else{var D=f(N),B=D==E||"[object GeneratorFunction]"==D;if(g(N))return i(N,z);if(D==S||D==_||B&&!j){if(A=L||B?{}:v(N),!z)return L?c(N,o(A,N)):a(N,r(A,N))}else{if(!k[D])return j?N:{};A=h(N,D,z)}}I||(I=new n);var H=I.get(N);if(H)return H;I.set(N,A),w(N)?N.forEach((function(n){A.add(C(n,M,O,n,N,I))})):y(N)&&N.forEach((function(n,e){A.set(e,C(n,M,O,e,N,I))}));var V=T?void 0:(R?L?s:l:L?b:x)(N);return e(V||N,(function(n,e){V&&(n=N[e=n]),t(A,e,C(n,M,O,e,N,I))})),A},Io}function Qc(){if(Lo)return zo;Lo=1;var n=Kc();return zo=function(e){return n(e,4)}}function Jc(){return To?Ro:(To=1,Ro=function(n){return function(){return n}})}function nl(){if(Vo)return Ho;Vo=1;var n=(Bo?Do:(Bo=1,Do=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 Ho=n}function el(){if(Xo)return Yo;Xo=1;var n=nl(),e=xr();return Yo=function(t,r){return t&&n(t,r,e)}}function tl(){if(Uo)return Fo;Uo=1;var n=el(),e=function(){if(Wo)return Zo;Wo=1;var n=wr();return Zo=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 Fo=e}function rl(){return Go?$o:(Go=1,$o=function(n){return n})}function ol(){if(Ko)return qo;Ko=1;var n=rl();return qo=function(e){return"function"==typeof e?e:n}}function il(){if(Jo)return Qo;Jo=1;var n=pt(),e=tl(),t=ol(),r=_t();return Qo=function(o,i){return(r(o)?n:e)(o,t(i))}}function ul(){return ei?ni:(ei=1,ni=il())}function al(){if(li)return ci;li=1;var n=ht(),e=ii?oi:(ii=1,oi=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=ai?ui:(ai=1,ui=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,ci=r}function cl(){return hi?di:(hi=1,di=function(n,e){return n.has(e)})}function ll(){if(pi)return vi;pi=1;var n=al(),e=(fi||(fi=1,si=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}),si),t=cl();return vi=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 w=l?u(m,y,v,o,r,c):u(y,m,v,r,o,c);if(void 0!==w){if(w)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},vi}function sl(){return wi||(wi=1,mi=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}),mi}function fl(){if(ki)return Si;ki=1;var n=vt(),e=ll(),t=function(){if(bi)return xi;bi=1;var n=ot(),e=Fc(),t=Je(),r=ll(),o=yi?gi:(yi=1,gi=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}),i=sl(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return xi=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(Ei)return _i;Ei=1;var n=Xc(),e=Object.prototype.hasOwnProperty;return _i=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 w=c?i(m,y,d,r,t,a):i(y,m,d,t,r,a);if(!(void 0===w?y===m||u(y,m,o,i,a):w)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var x=t.constructor,b=r.constructor;x==b||!("constructor"in t)||!("constructor"in r)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(t),a.delete(r),p}}(),o=Wc(),i=_t(),u=Lt(),a=vr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return Si=function(d,h,v,p,g,y){var m=i(d),w=i(h),x=m?l:o(d),b=w?l:o(h),_=(x=x==c?s:x)==s,E=(b=b==c?s:b)==s,S=x==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,x,v,p,g,y);if(!(1&v)){var k=_&&f.call(d,"__wrapped__"),C=E&&f.call(h,"__wrapped__");if(k||C){var N=k?d.value():d,M=C?h.value():h;return y||(y=new n),g(N,M,v,p,y)}}return!!S&&(y||(y=new n),r(d,h,v,p,g,y))}}function dl(){if(Ni)return Ci;Ni=1;var n=fl(),e=xt();return Ci=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))},Ci}function hl(){if(ji)return Pi;ji=1;var n=ut();return Pi=function(e){return e==e&&!n(e)}}function vl(){return Li?zi:(Li=1,zi=function(n,e){return function(t){return null!=t&&t[n]===e&&(void 0!==e||n in Object(t))}})}function pl(){if(Bi)return Di;Bi=1;var n=it(),e=xt();return Di=function(t){return"symbol"==typeof t||e(t)&&"[object Symbol]"==n(t)}}function gl(){if(Vi)return Hi;Vi=1;var n=_t(),e=pl(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Hi=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 yl(){return Gi||(Gi=1,$i=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}),$i}function ml(){if(Ji)return Qi;Ji=1;var n=function(){if(Ki)return qi;Ki=1;var n=ot(),e=yl(),t=_t(),r=pl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return qi=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},qi}();return Qi=function(e){return null==e?"":n(e)}}function wl(){if(eu)return nu;eu=1;var n=_t(),e=gl(),t=function(){if(Ui)return Fi;Ui=1;var n=function(){if(Wi)return Zi;Wi=1;var n=function(){if(Xi)return Yi;Xi=1;var n=ht();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,Yi=e}();return Zi=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 Fi=r}(),r=ml();return nu=function(o,i){return n(o)?o:e(o,i)?[o]:t(r(o))}}function xl(){if(ru)return tu;ru=1;var n=pl();return tu=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}}function bl(){if(iu)return ou;iu=1;var n=wl(),e=xl();return ou=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 _l(){if(fu)return su;fu=1;var n=wl(),e=bt(),t=_t(),r=Rt(),o=Tt(),i=xl();return su=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 El(){if(hu)return du;hu=1;var n=lu?cu:(lu=1,cu=function(n,e){return null!=n&&e in Object(n)}),e=_l();return du=function(t,r){return null!=t&&e(t,r,n)}}function Sl(){return yu?gu:(yu=1,gu=function(n){return function(e){return null==e?void 0:e[n]}})}function kl(){if(Eu)return _u;Eu=1;var n=function(){if(Ti)return Ri;Ti=1;var n=function(){if(Oi)return Mi;Oi=1;var n=vt(),e=dl();return Mi=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(Ai)return Ii;Ai=1;var n=hl(),e=xr();return Ii=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=vl();return Ri=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(pu)return vu;pu=1;var n=dl(),e=function(){if(au)return uu;au=1;var n=bl();return uu=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}}(),t=El(),r=gl(),o=hl(),i=vl(),u=xl();return vu=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=rl(),r=_t(),o=function(){if(bu)return xu;bu=1;var n=Sl(),e=function(){if(wu)return mu;wu=1;var n=bl();return mu=function(e){return function(t){return n(t,e)}}}(),t=gl(),r=xl();return xu=function(o){return t(o)?n(r(o)):e(o)}}();return _u=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 Cl(){if(ku)return Su;ku=1;var n=Rc(),e=function(){if(ri)return ti;ri=1;var n=tl();return ti=function(e,t){var r=[];return n(e,(function(n,e,o){t(n,e,o)&&r.push(n)})),r}}(),t=kl(),r=_t();return Su=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function Nl(){if(Ou)return Mu;Ou=1;var n=function(){if(Nu)return Cu;Nu=1;var n=Object.prototype.hasOwnProperty;return Cu=function(e,t){return null!=e&&n.call(e,t)}}(),e=_l();return Mu=function(t,r){return null!=t&&e(t,r,n)}}function Ml(){if(ju)return Pu;ju=1;var n=mr(),e=Wc(),t=bt(),r=_t(),o=wr(),i=Lt(),u=gr(),a=vr(),c=Object.prototype.hasOwnProperty;return Pu=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 Ol(){return Au?Iu:(Au=1,Iu=function(n){return void 0===n})}function Pl(){if(Lu)return zu;Lu=1;var n=tl(),e=wr();return zu=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 jl(){if(Tu)return Ru;Tu=1;var n=yl(),e=kl(),t=Pl(),r=_t();return Ru=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function Il(){if(Xu)return Yu;Xu=1;var n=(Bu||(Bu=1,Du=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}),Du),e=tl(),t=kl(),r=Vu?Hu:(Vu=1,Hu=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=_t();return Yu=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,t(u,4),a,l,e)},Yu}function Al(){if(ea)return na;ea=1;var n=mr(),e=Wc(),t=wr(),r=function(){if(Wu)return Zu;Wu=1;var n=it(),e=_t(),t=xt();return Zu=function(r){return"string"==typeof r||!e(r)&&t(r)&&"[object String]"==n(r)}}(),o=function(){if(Ju)return Qu;Ju=1;var n=function(){if(Uu)return Fu;Uu=1;var n=Sl()("length");return Fu=n}(),e=function(){if(Gu)return $u;Gu=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return $u=function(e){return n.test(e)}}(),t=function(){if(Ku)return qu;Ku=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 qu=function(n){for(var e=f.lastIndex=0;f.test(n);)++e;return e}}();return Qu=function(r){return e(r)?t(r):n(r)}}();return na=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 zl(){if(ra)return ta;ra=1;var n=pt(),e=Gc(),t=el(),r=kl(),o=Hc(),i=_t(),u=Lt(),a=at(),c=ut(),l=vr();return ta=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 Ll(){if(aa)return ua;aa=1;var n=Bc(),e=function(){if(ia)return oa;ia=1;var n=ot(),e=bt(),t=_t(),r=n?n.isConcatSpreadable:void 0;return oa=function(n){return t(n)||e(n)||!!(r&&n&&n[r])}}();return ua=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},ua}function Rl(){if(fa)return sa;fa=1;var n=la?ca:(la=1,ca=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 sa=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)}},sa}function Tl(){if(ya)return ga;ya=1;var n=function(){if(ha)return da;ha=1;var n=Jc(),e=gt(),t=rl();return da=e?function(t,r){return e(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:t}(),e=function(){if(pa)return va;pa=1;var n=Date.now;return va=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)}},va}(),t=e(n);return ga=t}function Dl(){if(wa)return ma;wa=1;var n=rl(),e=Rl(),t=Tl();return ma=function(r,o){return t(e(r,o,n),r+"")},ma}function Bl(){return ba||(ba=1,xa=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}),xa}function Hl(){if(Ta)return Ra;Ta=1;var n=al(),e=function(){if(Oa)return Ma;Oa=1;var n=function(){if(Na)return Ca;Na=1;var n=Bl(),e=Ea?_a:(Ea=1,_a=function(n){return n!=n}),t=(ka||(ka=1,Sa=function(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}),Sa);return Ca=function(r,o,i){return o==o?t(r,o,i):n(r,e,i)},Ca}();return Ma=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1},Ma}(),t=(ja||(ja=1,Pa=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}),Pa),r=cl(),o=function(){if(La)return za;La=1;var n=Zc(),e=Aa?Ia:(Aa=1,Ia=function(){}),t=sl(),r=n&&1/t(new n([,-0]))[1]==1/0?function(e){return new n(e)}:e;return za=r}(),i=sl();return Ra=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},Ra}function Vl(){if(Ba)return Da;Ba=1;var n=wr(),e=xt();return Da=function(t){return e(t)&&n(t)}}function Yl(){if(Va)return Ha;Va=1;var n=Ll(),e=Dl(),t=Hl(),r=Vl(),o=e((function(e){return t(n(e,1,r,!0))}));return Ha=o}function Xl(){if(Wa)return Za;Wa=1;var n=function(){if(Xa)return Ya;Xa=1;var n=yl();return Ya=function(e,t){return n(t,(function(n){return e[n]}))}}(),e=xr();return Za=function(t){return null==t?[]:n(t,e(t))}}function Zl(){if(Ua)return Fa;var n;Ua=1;try{n={clone:Qc(),constant:Jc(),each:ul(),filter:Cl(),has:Nl(),isArray:_t(),isEmpty:Ml(),isFunction:at(),isUndefined:Ol(),keys:xr(),map:jl(),reduce:Il(),size:Al(),transform:zl(),union:Yl(),values:Xl()}}catch(n){}return n||(n=window._),Fa=n}function Wl(){if(Ga)return $a;Ga=1;var n=Zl();$a=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))},$a}function Fl(){if(ec)return nc;ec=1;var n=Zl(),e=Wl();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 nc={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 Ul(){if(rc)return tc;rc=1;var n=Zl();return tc=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},tc}function $l(){if(ic)return oc;ic=1;var n=Zl();function e(){this._arr=[],this._keyIndices={}}return oc=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},oc}function Gl(){if(ac)return uc;ac=1;var n=Zl(),e=$l();uc=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 uc}function ql(){if(lc)return cc;lc=1;var n=Gl(),e=Zl();return cc=function(t,r,o){return e.transform(t.nodes(),(function(e,i){e[i]=n(t,i,r,o)}),{})}}function Kl(){if(fc)return sc;fc=1;var n=Zl();return sc=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},sc}function Ql(){if(hc)return dc;hc=1;var n=Zl(),e=Kl();return dc=function(t){return n.filter(e(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function Jl(){if(pc)return vc;pc=1;var n=Zl();vc=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 vc}function ns(){if(yc)return gc;yc=1;var n=Zl();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 gc=e,e.CycleException=t,t.prototype=new Error,gc}function es(){if(wc)return mc;wc=1;var n=ns();return mc=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}function ts(){if(bc)return xc;bc=1;var n=Zl();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 xc=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},xc}function rs(){if(Ec)return _c;Ec=1;var n=ts();return _c=function(e,t){return n(e,t,"post")}}function os(){if(kc)return Sc;kc=1;var n=ts();return Sc=function(e,t){return n(e,t,"pre")}}function is(){if(Nc)return Cc;Nc=1;var n=Zl(),e=Wl(),t=$l();return Cc=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},Cc}try{Ic=function(){if(jc)return Pc;jc=1;var n=Ja?Qa:(Ja=1,Qa={Graph:Wl(),version:Ka?qa:(Ka=1,qa="2.1.8")});return Pc={Graph:n.Graph,json:Fl(),alg:Oc?Mc:(Oc=1,Mc={components:Ul(),dijkstra:Gl(),dijkstraAll:ql(),findCycles:Ql(),floydWarshall:Jl(),isAcyclic:es(),postorder:rs(),preorder:os(),prim:is(),tarjan:Kl(),topsort:ns()}),version:n.version}}()}catch(W){}Ic||(Ic=window.graphlib);var us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,ws,xs,bs,_s,Es,Ss,ks,Cs,Ns,Ms,Os,Ps,js,Is,As,zs,Ls,Rs,Ts,Ds,Bs,Hs,Vs,Ys,Xs,Zs,Ws,Fs,Us,$s,Gs,qs,Ks,Qs,Js,nf,ef,tf,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,wf,xf,bf,_f,Ef,Sf,kf,Cf,Nf,Mf,Of,Pf,jf,If,Af,zf,Lf,Rf,Tf,Df,Bf,Hf,Vf,Yf,Xf,Zf,Wf,Ff=Ic;function Uf(){if(ls)return cs;ls=1;var n=Je(),e=wr(),t=Rt(),r=ut();return cs=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 $f(){if(bs)return xs;bs=1;var n=function(){if(ws)return ms;ws=1;var n=function(){if(ys)return gs;ys=1;var n=function(){if(ps)return vs;ps=1;var n=/\s/;return vs=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}}(),e=/^\s+/;return gs=function(t){return t?t.slice(0,n(t)+1).replace(e,""):t}}(),e=ut(),t=pl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return ms=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 xs=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 Gf(){if(Os)return Ms;Os=1;var n=Ll();return Ms=function(e){return null!=e&&e.length?n(e,1):[]},Ms}function qf(){if(Ts)return Rs;Ts=1;var n=pl();return Rs=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},Rs}function Kf(){if(Xs)return Ys;Xs=1;var n=yt(),e=Je();return Ys=function(t,r,o){(void 0!==o&&!e(t[r],o)||void 0===o&&!(r in t))&&n(t,r,o)}}function Qf(){return Us?Fs:(Us=1,Fs=function(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]})}function Jf(){return uf?of:(uf=1,of=function(n,e){return n<e})}function nd(){if(Rf)return Lf;Rf=1;var n=yl(),e=bl(),t=kl(),r=Pl(),o=(Pf||(Pf=1,Of=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}),Of),i=Dt(),u=function(){if(zf)return Af;zf=1;var n=function(){if(If)return jf;If=1;var n=pl();return jf=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 Af=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=rl(),c=_t();return Lf=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{Wf={cloneDeep:function(){if(as)return us;as=1;var n=Kc();return us=function(e){return n(e,5)}}(),constant:Jc(),defaults:function(){if(fs)return ss;fs=1;var n=Dl(),e=Je(),t=Uf(),r=br(),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 ss=u}(),each:ul(),filter:Cl(),find:function(){if(Ns)return Cs;Ns=1;var n=function(){if(hs)return ds;hs=1;var n=kl(),e=wr(),t=xr();return ds=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(ks)return Ss;ks=1;var n=Bl(),e=kl(),t=function(){if(Es)return _s;Es=1;var n=$f();return _s=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return Ss=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)},Ss}());return Cs=n}(),flatten:Gf(),forEach:il(),forIn:function(){if(js)return Ps;js=1;var n=nl(),e=ol(),t=br();return Ps=function(r,o){return null==r?r:n(r,e(o),t)}}(),has:Nl(),isUndefined:Ol(),last:(As||(As=1,Is=function(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}),Is),map:jl(),mapValues:function(){if(Ls)return zs;Ls=1;var n=yt(),e=el(),t=kl();return zs=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(Vs)return Hs;Vs=1;var n=qf(),e=Bs?Ds:(Bs=1,Ds=function(n,e){return n>e}),t=rl();return Hs=function(r){return r&&r.length?n(r,t,e):void 0}}(),merge:function(){if(rf)return tf;rf=1;var n=function(){if(Js)return Qs;Js=1;var n=vt(),e=Kf(),t=nl(),r=function(){if(Ks)return qs;Ks=1;var n=Kf(),e=zc(),t=$c(),r=Lc(),o=qc(),i=bt(),u=_t(),a=Vl(),c=Lt(),l=at(),s=ut(),f=function(){if(Ws)return Zs;Ws=1;var n=it(),e=Hc(),t=xt(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return Zs=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=vr(),h=Qf(),v=function(){if(Gs)return $s;Gs=1;var n=wt(),e=br();return $s=function(t){return n(t,e(t))}}();return qs=function(p,g,y,m,w,x,b){var _=h(p,y),E=h(g,y),S=b.get(E);if(S)n(p,y,S);else{var k=x?x(_,E,y+"",p,g,b):void 0,C=void 0===k;if(C){var N=u(E),M=!N&&c(E),O=!N&&!M&&d(E);k=E,N||M||O?u(_)?k=_:a(_)?k=r(_):M?(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),w(k,E,m,x,b),b.delete(E)),n(p,y,k)}}}(),o=ut(),i=br(),u=Qf();return Qs=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)},Qs}(),e=function(){if(ef)return nf;ef=1;var n=Dl(),e=Uf();return nf=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 tf=e}(),min:function(){if(cf)return af;cf=1;var n=qf(),e=Jf(),t=rl();return af=function(r){return r&&r.length?n(r,t,e):void 0}}(),minBy:function(){if(sf)return lf;sf=1;var n=qf(),e=kl(),t=Jf();return lf=function(r,o){return r&&r.length?n(r,e(o,2),t):void 0},lf}(),now:function(){if(df)return ff;df=1;var n=rt();return ff=function(){return n.Date.now()}}(),pick:function(){if(_f)return bf;_f=1;var n=function(){if(mf)return yf;mf=1;var n=function(){if(gf)return pf;gf=1;var n=bl(),e=function(){if(vf)return hf;vf=1;var n=mt(),e=wl(),t=Rt(),r=ut(),o=xl();return hf=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=wl();return pf=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=El();return yf=function(t,r){return n(t,r,(function(n,r){return e(t,r)}))}}(),e=function(){if(xf)return wf;xf=1;var n=Gf(),e=Rl(),t=Tl();return wf=function(r){return t(e(r,void 0,n),r+"")}}()((function(e,t){return null==e?{}:n(e,t)}));return bf=e}(),range:function(){if(Mf)return Nf;Mf=1;var n=function(){if(Cf)return kf;Cf=1;var n=function(){if(Sf)return Ef;Sf=1;var n=Math.ceil,e=Math.max;return Ef=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},Ef}(),e=Uf(),t=$f();return kf=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)}},kf}()();return Nf=n}(),reduce:Il(),sortBy:function(){if(Df)return Tf;Df=1;var n=Ll(),e=nd(),t=Dl(),r=Uf(),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 Tf=o}(),uniqueId:function(){if(Hf)return Bf;Hf=1;var n=ml(),e=0;return Bf=function(t){var r=++e;return n(t)+r}}(),values:Xl(),zipObject:function(){if(Zf)return Xf;Zf=1;var n=mt(),e=Yf?Vf:(Yf=1,Vf=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 Xf=function(t,r){return e(t||[],r||[],n)}}()}}catch(W){}Wf||(Wf=window._);var ed=Wf,td=rd;function rd(){var n={};n._next=n._prev=n,this._sentinel=n}function od(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function id(n,e){if("_next"!==n&&"_prev"!==n)return e}rd.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return od(e),e},rd.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&od(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},rd.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,id)),t=t._prev;return"["+n.join(", ")+"]"};var ud=ed,ad=Ff.Graph,cd=td,ld=ud.constant(1);function sd(n,e,t,r,o){var i=o?[]:void 0;return ud.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,fd(e,t,a)})),ud.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,fd(e,t,u)})),n.removeNode(r.v),i}function fd(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 dd=ed,hd=function(n,e){if(n.nodeCount()<=1)return[];var t=function(n,e){var t=new ad,r=0,o=0;ud.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),ud.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=ud.range(o+r+3).map((function(){return new cd})),u=r+1;return ud.forEach(t.nodes(),(function(n){fd(i,u,t.node(n))})),{graph:t,buckets:i,zeroIdx:u}}(n,e||ld),r=function(n,e,t){for(var r,o=[],i=e[e.length-1],u=e[0];n.nodeCount();){for(;r=u.dequeue();)sd(n,e,t,r);for(;r=i.dequeue();)sd(n,e,t,r);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(r=e[a].dequeue()){o=o.concat(sd(n,e,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return ud.flatten(ud.map(r,(function(e){return n.outEdges(e.v,e.w)})),!0)},vd={run:function(n){var e="greedy"===n.graph().acyclicer?hd(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],t={},r={};return dd.forEach(n.nodes(),(function o(i){dd.has(r,i)||(r[i]=!0,t[i]=!0,dd.forEach(n.outEdges(i),(function(n){dd.has(t,n.w)?e.push(n):o(n.w)})),delete t[i])})),e}(n);dd.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,dd.uniqueId("rev"))}))},undo:function(n){dd.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)}}))}},pd=ed,gd=Ff.Graph,yd={addDummyNode:md,simplify:function(n){var e=(new gd).setGraph(n.graph());return pd.forEach(n.nodes(),(function(t){e.setNode(t,n.node(t))})),pd.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 gd({multigraph:n.isMultigraph()}).setGraph(n.graph());return pd.forEach(n.nodes(),(function(t){n.children(t).length||e.setNode(t,n.node(t))})),pd.forEach(n.edges(),(function(t){e.setEdge(t,n.edge(t))})),e},successorWeights:function(n){var e=pd.map(n.nodes(),(function(e){var t={};return pd.forEach(n.outEdges(e),(function(e){t[e.w]=(t[e.w]||0)+n.edge(e).weight})),t}));return pd.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=pd.map(n.nodes(),(function(e){var t={};return pd.forEach(n.inEdges(e),(function(e){t[e.v]=(t[e.v]||0)+n.edge(e).weight})),t}));return pd.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=pd.map(pd.range(wd(n)+1),(function(){return[]}));return pd.forEach(n.nodes(),(function(t){var r=n.node(t),o=r.rank;pd.isUndefined(o)||(e[o][r.order]=t)})),e},normalizeRanks:function(n){var e=pd.min(pd.map(n.nodes(),(function(e){return n.node(e).rank})));pd.forEach(n.nodes(),(function(t){var r=n.node(t);pd.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(n){var e=pd.min(pd.map(n.nodes(),(function(e){return n.node(e).rank}))),t=[];pd.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;pd.forEach(t,(function(e,t){pd.isUndefined(e)&&t%o!=0?--r:r&&pd.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),md(n,"border",o,e)},maxRank:wd,partition:function(n,e){var t={lhs:[],rhs:[]};return pd.forEach(n,(function(n){e(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,e){var t=pd.now();try{return e()}finally{console.log(n+" time: "+(pd.now()-t)+"ms")}},notime:function(n,e){return e()}};function md(n,e,t,r){var o;do{o=pd.uniqueId(r)}while(n.hasNode(o));return t.dummy=e,n.setNode(o,t),o}function wd(n){return pd.max(pd.map(n.nodes(),(function(e){var t=n.node(e).rank;if(!pd.isUndefined(t))return t})))}var xd=ed,bd=yd,_d={run:function(n){n.graph().dummyChains=[],xd.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=bd.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){xd.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)}))}},Ed=ed,Sd=function(n){var e={};Ed.forEach(n.sources(),(function t(r){var o=n.node(r);if(Ed.has(e,r))return o.rank;e[r]=!0;var i=Ed.min(Ed.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}))},kd=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},Cd=ed,Nd=Ff.Graph,Md=kd,Od=function(n){var e,t,r=new Nd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Pd(r,n)<i;)e=jd(r,n),t=r.hasNode(e.v)?Md(n,e):-Md(n,e),Id(r,n,t);return r};function Pd(n,e){return Cd.forEach(n.nodes(),(function t(r){Cd.forEach(e.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||Md(e,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),t(u))}))})),n.nodeCount()}function jd(n,e){return Cd.minBy(e.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return Md(e,t)}))}function Id(n,e,t){Cd.forEach(n.nodes(),(function(n){e.node(n).rank+=t}))}var Ad=ed,zd=Od,Ld=kd,Rd=Sd,Td=Ff.alg.preorder,Dd=Ff.alg.postorder,Bd=yd.simplify,Hd=Vd;function Vd(n){n=Bd(n),Rd(n);var e,t=zd(n);for(Zd(t),Yd(t,n);e=Fd(t);)$d(t,n,e,Ud(t,n,e))}function Yd(n,e){var t=Dd(n,n.nodes());t=t.slice(0,t.length-1),Ad.forEach(t,(function(t){!function(n,e,t){var r=n.node(t).parent;n.edge(t,r).cutvalue=Xd(n,e,t)}(n,e,t)}))}function Xd(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,Ad.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 Zd(n,e){arguments.length<2&&(e=n.nodes()[0]),Wd(n,{},1,e)}function Wd(n,e,t,r,o){var i=t,u=n.node(r);return e[r]=!0,Ad.forEach(n.neighbors(r),(function(o){Ad.has(e,o)||(t=Wd(n,e,t,o,r))})),u.low=i,u.lim=t++,o?u.parent=o:delete u.parent,t}function Fd(n){return Ad.find(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function Ud(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=Ad.filter(e.edges(),(function(e){return c===Gd(n,n.node(e.v),a)&&c!==Gd(n,n.node(e.w),a)}));return Ad.minBy(l,(function(n){return Ld(e,n)}))}function $d(n,e,t,r){var o=t.v,i=t.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Zd(n),Yd(n,e),function(n,e){var t=Ad.find(n.nodes(),(function(n){return!e.node(n).parent})),r=Td(n,t);r=r.slice(1),Ad.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 Gd(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}Vd.initLowLimValues=Zd,Vd.initCutValues=Yd,Vd.calcCutValue=Xd,Vd.leaveEdge=Fd,Vd.enterEdge=Ud,Vd.exchangeEdges=$d;var qd=Sd,Kd=Od,Qd=Hd,Jd=qd;var nh=ed,eh=ed,th=yd,rh={run:function(n){var e=th.addDummyNode(n,"root",{},"_root"),t=function(n){var e={};function t(r,o){var i=n.children(r);i&&i.length&&eh.forEach(i,(function(n){t(n,o+1)})),e[r]=o}return eh.forEach(n.children(),(function(n){t(n,1)})),e}(n),r=eh.max(eh.values(t))-1,o=2*r+1;n.graph().nestingRoot=e,eh.forEach(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return eh.reduce(n.edges(),(function(e,t){return e+n.edge(t).weight}),0)}(n)+1;eh.forEach(n.children(),(function(u){oh(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,eh.forEach(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}};function oh(n,e,t,r,o,i,u){var a=n.children(u);if(a.length){var c=th.addBorderNode(n,"_bt"),l=th.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(c,u),s.borderTop=c,n.setParent(l,u),s.borderBottom=l,eh.forEach(a,(function(a){oh(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 ih=ed,uh=yd;function ah(n,e,t,r,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],c=uh.addDummyNode(n,"border",u,t);o[e][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var ch=ed,lh={adjust:function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||sh(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){ch.forEach(n.nodes(),(function(e){dh(n.node(e))})),ch.forEach(n.edges(),(function(e){var t=n.edge(e);ch.forEach(t.points,dh),ch.has(t,"y")&&dh(t)}))}(n),"lr"!==e&&"rl"!==e||(function(n){ch.forEach(n.nodes(),(function(e){hh(n.node(e))})),ch.forEach(n.edges(),(function(e){var t=n.edge(e);ch.forEach(t.points,hh),ch.has(t,"x")&&hh(t)}))}(n),sh(n))}};function sh(n){ch.forEach(n.nodes(),(function(e){fh(n.node(e))})),ch.forEach(n.edges(),(function(e){fh(n.edge(e))}))}function fh(n){var e=n.width;n.width=n.height,n.height=e}function dh(n){n.y=-n.y}function hh(n){var e=n.x;n.x=n.y,n.y=e}var vh=ed,ph=ed;function gh(n,e,t){for(var r=ph.zipObject(t,ph.map(t,(function(n,e){return e}))),o=ph.flatten(ph.map(e,(function(e){return ph.sortBy(ph.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=ph.map(new Array(u),(function(){return 0})),c=0;return ph.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 yh=ed,mh=ed,wh=ed,xh=yd;function bh(n,e,t){for(var r;e.length&&(r=wh.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var _h=ed,Eh=ed,Sh=Ff.Graph,kh=ed,Ch=ed,Nh=function(n){var e={},t=vh.filter(n.nodes(),(function(e){return!n.children(e).length})),r=vh.max(vh.map(t,(function(e){return n.node(e).rank}))),o=vh.map(vh.range(r+1),(function(){return[]}));var i=vh.sortBy(t,(function(e){return n.node(e).rank}));return vh.forEach(i,(function t(r){if(!vh.has(e,r)){e[r]=!0;var i=n.node(r);o[i.rank].push(r),vh.forEach(n.successors(r),t)}})),o},Mh=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=gh(n,e[r-1],e[r]);return t},Oh=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=_h.filter(i,(function(n){return n!==a&&n!==c})));var s=function(n,e){return yh.map(e,(function(e){var t=n.inEdges(e);if(t.length){var r=yh.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);_h.forEach(s,(function(t){if(e.children(t.v).length){var i=n(e,t.v,r,o);l[t.v]=i,_h.has(i,"barycenter")&&(u=t,a=i,_h.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 mh.forEach(n,(function(n,e){var r=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};mh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),mh.forEach(e.edges(),(function(n){var e=t[n.v],r=t[n.w];mh.isUndefined(e)||mh.isUndefined(r)||(r.indegree++,e.out.push(t[n.w]))})),function(n){var e=[];function t(n){return function(e){e.merged||(mh.isUndefined(e.barycenter)||mh.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),mh.forEach(o.in.reverse(),t(o)),mh.forEach(o.out,r(o))}return mh.map(mh.filter(e,(function(n){return!n.merged})),(function(n){return mh.pick(n,["vs","i","barycenter","weight"])}))}(mh.filter(t,(function(n){return!n.indegree})))}(s,r);!function(n,e){_h.forEach(n,(function(n){n.vs=_h.flatten(n.vs.map((function(n){return e[n]?e[n].vs:n})),!0)}))}(f,l);var d=function(n,e){var t,r=xh.partition(n,(function(n){return wh.has(n,"barycenter")})),o=r.lhs,i=wh.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=bh(u,i,l),wh.forEach(o,(function(n){l+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,c+=n.weight,l=bh(u,i,l)}));var s={vs:wh.flatten(u,!0)};return c&&(s.barycenter=a/c,s.weight=c),s}(f,o);if(a&&(d.vs=_h.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]);_h.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},Ph=function(n,e,t){var r=function(n){for(var e;n.hasNode(e=Eh.uniqueId("_root")););return e}(n),o=new Sh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return n.node(e)}));return Eh.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),Eh.forEach(n[t](i),(function(e){var t=e.v===i?e.w:e.v,r=o.edge(t,i),u=Eh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:n.edge(e).weight+u})})),Eh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o},jh=Ff.Graph,Ih=yd;function Ah(n,e,t){return Ch.map(e,(function(e){return Ph(n,e,t)}))}function zh(n,e){var t=new jh;Ch.forEach(n,(function(n){var r=n.graph().root,o=Oh(n,r,t,e);Ch.forEach(o.vs,(function(e,t){n.node(e).order=t})),function(n,e,t){var r,o={};kh.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 Lh(n,e){Ch.forEach(e,(function(e){Ch.forEach(e,(function(e,t){n.node(e).order=t}))}))}var Rh=ed,Th=Ff.Graph,Dh=yd;function Bh(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 Hh(n,e,t){if(e>t){var r=e;e=t,t=r}return Rh.has(n[e],t)}var Vh=ed,Yh=yd,Xh=function(n){var e,t=Dh.buildLayerMatrix(n),r=Rh.merge(function(n,e){var t={};return Rh.reduce(e,(function(e,r){var o=0,i=0,u=e.length,a=Rh.last(r);return Rh.forEach(r,(function(e,c){var l=function(n,e){if(n.node(e).dummy)return Rh.find(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),s=l?n.node(l).order:u;(l||e===a)&&(Rh.forEach(r.slice(i,c+1),(function(e){Rh.forEach(n.predecessors(e),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(e).dummy||Bh(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;Rh.forEach(Rh.range(r,o),(function(r){a=e[r],n.node(a).dummy&&Rh.forEach(n.predecessors(a),(function(e){var r=n.node(e);r.dummy&&(r.order<i||r.order>u)&&Bh(t,e,a)}))}))}return Rh.reduce(e,(function(e,t){var o,i=-1,u=0;return Rh.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={};Rh.forEach(["u","d"],(function(i){e="u"===i?t:Rh.values(t).reverse(),Rh.forEach(["l","r"],(function(t){"r"===t&&(e=Rh.map(e,(function(n){return Rh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,t,r){var o={},i={},u={};return Rh.forEach(e,(function(n){Rh.forEach(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),Rh.forEach(e,(function(n){var e=-1;Rh.forEach(n,(function(n){var a=r(n);if(a.length){a=Rh.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]&&!Hh(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 Th,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,Rh.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,Rh.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 Rh.forEach(e,(function(e){var r;Rh.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)),Rh.forEach(r,(function(n){i[n]=i[t[n]]})),i}(n,e,a.root,a.align,"r"===t);"r"===t&&(c=Rh.mapValues(c,(function(n){return-n}))),o[i+t]=c}))}));var i=function(n,e){return Rh.minBy(Rh.values(e),(function(e){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Rh.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=Rh.values(e),r=Rh.min(t),o=Rh.max(t);Rh.forEach(["u","d"],(function(t){Rh.forEach(["l","r"],(function(i){var u,a=t+i,c=n[a];if(c!==e){var l=Rh.values(c);(u="l"===i?r-Rh.min(l):o-Rh.max(l))&&(n[a]=Rh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return Rh.mapValues(n.ul,(function(t,r){if(e)return n[e.toLowerCase()][r];var o=Rh.sortBy(Rh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Zh=ed,Wh=vd,Fh=_d,Uh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Qd(n)}(n);break;case"tight-tree":!function(n){qd(n),Kd(n)}(n);break;case"longest-path":Jd(n)}},$h=yd.normalizeRanks,Gh=function(n){var e=function(n){var e={},t=0;return nh.forEach(n.children(),(function r(o){var i=t;nh.forEach(n.children(o),r),e[o]={low:i,lim:t++}})),e}(n);nh.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]}}))},qh=yd.removeEmptyRanks,Kh=rh,Qh=function(n){ih.forEach(n.children(),(function e(t){var r=n.children(t),o=n.node(t);if(r.length&&ih.forEach(r,e),ih.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)ah(n,"borderLeft","_bl",t,o,i),ah(n,"borderRight","_br",t,o,i)}}))},Jh=lh,nv=function(n){var e=Ih.maxRank(n),t=Ah(n,Ch.range(1,e+1),"inEdges"),r=Ah(n,Ch.range(e-1,-1,-1),"outEdges"),o=Nh(n);Lh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){zh(a%2?t:r,a%4>=2),o=Ih.buildLayerMatrix(n);var l=Mh(n,o);l<u&&(c=0,i=Ch.cloneDeep(o),u=l)}Lh(n,i)},ev=function(n){(function(n){var e=Yh.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Vh.forEach(e,(function(e){var o=Vh.max(Vh.map(e,(function(e){return n.node(e).height})));Vh.forEach(e,(function(e){n.node(e).y=r+o/2})),r+=o+t}))})(n=Yh.asNonCompoundGraph(n)),Vh.forEach(Xh(n),(function(e,t){n.node(t).x=e}))},tv=yd,rv=Ff.Graph,ov=["nodesep","edgesep","ranksep","marginx","marginy"],iv={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},uv=["acyclicer","ranker","rankdir","align"],av=["width","height"],cv={width:0,height:0},lv=["minlen","weight","width","height","labeloffset"],sv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fv=["labelpos"];function dv(n,e){return Zh.mapValues(Zh.pick(n,e),Number)}function hv(n){var e={};return Zh.forEach(n,(function(n,t){e[t.toLowerCase()]=n})),e}var vv=ed,pv=yd,gv=Ff.Graph,yv={debugOrdering:function(n){var e=pv.buildLayerMatrix(n),t=new gv({compound:!0,multigraph:!0}).setGraph({});return vv.forEach(n.nodes(),(function(e){t.setNode(e,{label:e}),t.setParent(e,"layer"+n.node(e).rank)})),vv.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),vv.forEach(e,(function(n,e){var r="layer"+e;t.setNode(r,{rank:"same"}),vv.reduce(n,(function(n,e){return t.setEdge(n,e,{style:"invis"}),e}))})),t}},mv=Qe({graphlib:Ff,layout:function(n,e){var t=e&&e.debugTiming?tv.time:tv.notime;t("layout",(function(){var e=t(" buildLayoutGraph",(function(){return function(n){var e=new rv({multigraph:!0,compound:!0}),t=hv(n.graph());return e.setGraph(Zh.merge({},iv,dv(t,ov),Zh.pick(t,uv))),Zh.forEach(n.nodes(),(function(t){var r=hv(n.node(t));e.setNode(t,Zh.defaults(dv(r,av),cv)),e.setParent(t,n.parent(t))})),Zh.forEach(n.edges(),(function(t){var r=hv(n.edge(t));e.setEdge(t,Zh.merge({},sv,dv(r,lv),Zh.pick(r,fv)))})),e}(n)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,Zh.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){Zh.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(){Wh.run(n)})),e(" nestingGraph.run",(function(){Kh.run(n)})),e(" rank",(function(){Uh(tv.asNonCompoundGraph(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){Zh.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};tv.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){qh(n)})),e(" nestingGraph.cleanup",(function(){Kh.cleanup(n)})),e(" normalizeRanks",(function(){$h(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;Zh.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=Zh.max(e,r.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){Zh.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(){Fh.run(n)})),e(" parentDummyChains",(function(){Gh(n)})),e(" addBorderSegments",(function(){Qh(n)})),e(" order",(function(){nv(n)})),e(" insertSelfEdges",(function(){!function(n){var e=tv.buildLayerMatrix(n);Zh.forEach(e,(function(e){var t=0;Zh.forEach(e,(function(e,r){var o=n.node(e);o.order=r+t,Zh.forEach(o.selfEdges,(function(e){tv.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(){Jh.adjust(n)})),e(" position",(function(){ev(n)})),e(" positionSelfEdges",(function(){!function(n){Zh.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){Zh.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(Zh.last(t.borderLeft)),u=n.node(Zh.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}})),Zh.forEach(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){Fh.undo(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);if(Zh.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(){Jh.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)}Zh.forEach(n.nodes(),(function(e){c(n.node(e))})),Zh.forEach(n.edges(),(function(e){var t=n.edge(e);Zh.has(t,"x")&&c(t)})),e-=u,r-=a,Zh.forEach(n.nodes(),(function(t){var o=n.node(t);o.x-=e,o.y-=r})),Zh.forEach(n.edges(),(function(t){var o=n.edge(t);Zh.forEach(o.points,(function(n){n.x-=e,n.y-=r})),Zh.has(o,"x")&&(o.x-=e),Zh.has(o,"y")&&(o.y-=r)})),i.width=t-e+u,i.height=o-r+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){Zh.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(tv.intersectRect(i,t)),o.points.push(tv.intersectRect(u,r))}))}(n)})),e(" reversePoints",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);t.reversed&&t.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){Wh.undo(n)}))}(e,t)})),t(" updateInputGraph",(function(){!function(n,e){Zh.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))})),Zh.forEach(n.edges(),(function(t){var r=n.edge(t),o=e.edge(t);r.points=o.points,Zh.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:yv,util:{time:yd.time,notime:yd.notime},version:"0.8.5"}),wv={error001:function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},error002:function(){return"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them."},error003:function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},error004:function(){return"The Ink Flow parent container needs a width and a height to render the graph."},error005:function(){return"Only child nodes can use a parent extent."},error006:function(){return"Can't create edge. An edge needs a source and a target."},error007:function(n){return"The old edge with id=".concat(n," does not exist.")},error009:function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},error008: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,".")},error010:function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},error011:function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},error012: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.')},error013:function(n){return void 0===n&&(n="react"),"It seems that you haven't loaded the styles. Please import '@aloudata/".concat(n,"/dist/style.css' or base.css to make sure everything is working properly.")}},xv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bv=["Enter"," ","Escape"],_v=.5,Ev=2,Sv=[0,0],kv=function(n){return"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n)},Cv=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)}))},Nv=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)}))},Mv=function(n,e){var t;void 0===e&&(e=[0,0]);var r=Gv(n),o=r.width,i=r.height,u=null!==(t=n.origin)&&void 0!==t?t:e,a=o*u[0],c=i*u[1];return{x:n.position.x-a,y:n.position.y-c}},Ov=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=Hv(t,e.nodeOrigin);return Rv(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Dv(t)},Pv=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)}))};function jv(n){var e,t,r,o=n.nodeId,i=n.nextPosition,u=n.nodeLookup,a=n.nodeOrigin,c=void 0===a?[0,0]:a,l=n.nodeExtent,s=n.onError,f=u.get(o),d=f.parentId?u.get(f.parentId):void 0,h=d?d.internals.positionAbsolute:{x:0,y:0},v=h.x,p=h.y,g=null!==(e=f.origin)&&void 0!==e?e:c,y=l;if("parent"!==f.extent||f.expandParent)d&&$v(f.extent)&&(y=[[f.extent[0][0]+v,f.extent[0][1]+p],[f.extent[1][0]+v,f.extent[1][1]+p]]);else if(d){var m=d.measured.width,w=d.measured.height;m&&w&&(y=[[v,p],[v+m,p+w]])}else null==s||s("005",wv.error005());var x=$v(y)?Av(i,y,f.measured):i;return void 0!==f.measured.width&&void 0!==f.measured.height||null==s||s("015",wv.error015()),{position:{x:x.x-v+(null!==(t=f.measured.width)&&void 0!==t?t:0)*g[0],y:x.y-p+(null!==(r=f.measured.height)&&void 0!==r?r:0)*g[1]},positionAbsolute:x}}var Iv=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Av=function(n,e,t){var r,o;return void 0===n&&(n={x:0,y:0}),{x:Iv(n.x,e[0][0],e[1][0]-(null!==(r=null==t?void 0:t.width)&&void 0!==r?r:0)),y:Iv(n.y,e[0][1],e[1][1]-(null!==(o=null==t?void 0:t.height)&&void 0!==o?o:0))}},zv=function(n,e,t){return n<e?Iv(Math.abs(n-e),1,50)/50:n>t?-Iv(Math.abs(n-t),1,50)/50:0},Lv=function(n,e,t,r){return void 0===t&&(t=15),void 0===r&&(r=40),[zv(n.x,r,e.width-r)*t,zv(n.y,r,e.height-r)*t]},Rv=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)}},Tv=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},Dv=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},Bv=function(n,e){var t,r,o,i,u,a,c,l;void 0===e&&(e=[0,0]);var s=kv(n)?n.internals.positionAbsolute:Mv(n,e);return{x:s.x,y:s.y,width:null!==(i=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:n.initialWidth)&&void 0!==i?i:0,height:null!==(l=null!==(c=null!==(a=null===(u=n.measured)||void 0===u?void 0:u.height)&&void 0!==a?a:n.height)&&void 0!==c?c:n.initialHeight)&&void 0!==l?l:0}},Hv=function(n,e){var t,r,o,i,u,a,c,l;void 0===e&&(e=[0,0]);var s=kv(n)?n.internals.positionAbsolute:Mv(n,e),f=s.x,d=s.y;return{x:f,y:d,x2:f+(null!==(i=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:n.initialWidth)&&void 0!==i?i:0),y2:d+(null!==(l=null!==(c=null!==(a=null===(u=n.measured)||void 0===u?void 0:u.height)&&void 0!==a?a:n.height)&&void 0!==c?c:n.initialHeight)&&void 0!==l?l:0)}},Vv=function(n,e){return Dv(Rv(Tv(n),Tv(e)))},Yv=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)},Xv=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])}},Zv=function(n,e,t,r){var o=n.x,i=n.y,u=$(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?Xv(s,r):s},Wv=function(n,e){var t=n.x,r=n.y,o=$(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}},Fv=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=Iv(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}},Uv=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 $v(n){return void 0!==n&&"parent"!==n}function Gv(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}}function qv(n,e,t){var r=Gv(t),o=r.width,i=r.height,u=t.internals.positionAbsolute,a=u.x,c=u.y;return Av(n,[[a,c],[a+o,c+i]],e)}var Kv={x:0,y:0};function Qv(n){return null===n?null:n?"valid":"invalid"}function Jv(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=op(n),c=a.x,l=a.y,s=Zv({x:c,y:l},u),f=i?Xv(s,r):s,d=f.x,h=f.y;return W({xSnapped:d,ySnapped:h},s)}var np,ep,tp,rp=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},op=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)}},ip=function(n,e,t,r,o){var i=e.querySelectorAll(".".concat(n));return i&&i.length?Array.from(i).map((function(e){var i=e.getBoundingClientRect();return W({id:e.getAttribute("data-handleid"),type:n,nodeId:o,position:e.getAttribute("data-handlepos"),x:(i.left-t.left)/r,y:(i.top-t.top)/r},rp(e))})):null};!function(n){n.Strict="strict",n.Loose="loose"}(np||(np={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(ep||(ep={})),function(n){n.Partial="partial",n.Full="full"}(tp||(tp={}));var up,ap,cp,lp,sp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};!function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(up||(up={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(ap||(ap={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(lp||(lp={}));var fp=((cp={})[lp.Left]=lp.Right,cp[lp.Right]=lp.Left,cp[lp.Top]=lp.Bottom,cp[lp.Bottom]=lp.Top,cp);function dp(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 hp(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function vp(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case lp.Left:return[t-hp(t-o,u),r];case lp.Right:return[t+hp(o-t,u),r];case lp.Top:return[t,r-hp(r-i,u)];case lp.Bottom:return[t,r+hp(i-r,u)]}}function pp(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.curvature,s=void 0===l?.25:l,f=$(vp({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=$(vp({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],y=$(dp({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],x=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,w,x,b]}function gp(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 yp,mp=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||"")},wp=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)?W({},n):W(W({},n),{id:mp(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):(wv.error006(),e);var t},xp=function(n,e,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=F(n,["id"]);if(!e.source||!e.target)return wv.error006(),t;if(!t.find((function(e){return e.id===n.id})))return wv.error007(o),t;var u=W(W({},i),{id:r.shouldReplaceId?mp(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)};function bp(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=$(gp({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]}var _p=((yp={})[lp.Left]={x:-1,y:0},yp[lp.Right]={x:1,y:0},yp[lp.Top]={x:0,y:-1},yp[lp.Bottom]={x:0,y:1},yp),Ep=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Sp(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?lp.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?lp.Top:l,f=n.center,d=n.offset,h=_p[a],v=_p[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?lp.Bottom:t,o=n.target;return r===lp.Left||r===lp.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",w=y[m],x=[],b={x:0,y:0},_={x:0,y:0},E=$(gp({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],C=E[2],N=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 M=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];x=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var P=[{x:p.x,y:g.y}],j=[{x:g.x,y:p.y}];if(x="x"===m?h.x===w?j:P:h.y===w?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]===w?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],R=p[z]>g[z],T=p[z]<g[z];(1===h[m]&&(!L&&R||L&&T)||1!==h[m]&&(!L&&T||L&&R))&&(x="x"===m?P:j)}var D={x:p.x+b.x,y:p.y+b.y},B={x:g.x+_.x,y:g.y+_.y};Math.max(Math.abs(D.x-x[0].x),Math.abs(B.x-x[0].x))>=Math.max(Math.abs(D.y-x[0].y),Math.abs(B.y-x[0].y))?(r=(D.x+B.x)/2,o=x[0].y):(r=x[0].x,o=(D.y+B.y)/2)}return[G(G([i,{x:p.x+b.x,y:p.y+b.y}],$(x),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,C,N]}function kp(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=$(Sp({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],w=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(Ep(n,e)/2,Ep(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,w]}function Cp(n,e,t,r){var o,i;void 0===t&&(t=lp.Left);var u=(null!==(o=null==e?void 0:e.x)&&void 0!==o?o:0)+n.internals.positionAbsolute.x,a=(null!==(i=null==e?void 0:e.y)&&void 0!==i?i:0)+n.internals.positionAbsolute.y,c=null!=e?e:Gv(n);return{x:u+c.width/2,y:a+c.height/2}}var Np={nodeOrigin:[0,0],nodeExtent:xv,elevateNodesOnSelect:!0,defaults:{}},Mp=W(W({},Np),{checkEquality:!0});function Op(n,e,t,r){var o,i,u,a,c=Ip(Mp,r),l=new Map(e),s=(null==c?void 0:c.elevateNodesOnSelect)?1e3:0;e.clear(),t.clear();try{for(var f=U(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=l.get(h.id);if(c.checkEquality&&h===(null==v?void 0:v.internals.userNode))e.set(h.id,v);else{var p=Mv(h,c.nodeOrigin),g=$v(h.extent)?h.extent:c.nodeExtent,y=Av(p,g,Gv(h));v=W(W(W({},c.defaults),h),{measured:{width:null===(u=h.measured)||void 0===u?void 0:u.width,height:null===(a=h.measured)||void 0===a?void 0:a.height},internals:{positionAbsolute:y,handleBounds:h.measured?null==v?void 0:v.internals.handleBounds:void 0,z:Ap(h,s),userNode:h}}),e.set(h.id,v)}h.parentId&&jp(v,e,t,r)}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}function Pp(n,e,t,r){var o,i,u,a;void 0===r&&(r=[0,0]);var c=[],l=new Map;try{for(var s=U(n),f=s.next();!f.done;f=s.next()){var d=f.value,h=e.get(d.parentId);if(h){var v=null!==(a=null===(u=l.get(d.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:Bv(h),p=Vv(v,d.rect);l.set(d.parentId,{expandedRect:p,parent:h})}}}catch(n){o={error:n}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return l.size>0&&l.forEach((function(e,o){var i,u,a=e.expandedRect,l=e.parent,s=l.internals.positionAbsolute,f=Gv(l),d=null!==(i=l.origin)&&void 0!==i?i:r,h=a.x<s.x?Math.round(Math.abs(s.x-a.x)):0,v=a.y<s.y?Math.round(Math.abs(s.y-a.y)):0,p=Math.max(f.width,Math.round(a.width)),g=Math.max(f.height,Math.round(a.height)),y=(p-f.width)*d[0],m=(g-f.height)*d[1];(h>0||v>0||y||m)&&(c.push({id:o,type:"position",position:{x:l.position.x-h+y,y:l.position.y-v+m}}),null===(u=t.get(o))||void 0===u||u.forEach((function(e){n.some((function(n){return n.id===e.id}))||c.push({id:e.id,type:"position",position:{x:e.position.x+h,y:e.position.y+v}})}))),(f.width<a.width||f.height<a.height||h||v)&&c.push({id:o,type:"dimensions",setAttributes:!0,dimensions:{width:p+(h?d[0]*h-y:0),height:g+(v?d[1]*v-m:0)}})})),c}function jp(n,e,t,r){var o=Ip(Np,r),i=o.elevateNodesOnSelect,u=o.nodeOrigin,a=o.nodeExtent,c=n.parentId,l=e.get(c);if(l){!function(n,e){if(n.parentId){var t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}}(n,t);var s=function(n,e,t,r,o){var i,u=e.internals.positionAbsolute,a=u.x,c=u.y,l=Gv(n),s=Mv(n,t),f=$v(n.extent)?Av(s,n.extent,l):s,d=Av({x:a+f.x,y:c+f.y},r,l);"parent"===n.extent&&(d=qv(d,l,e));var h=Ap(n,o),v=null!==(i=e.internals.z)&&void 0!==i?i:0;return{x:d.x,y:d.y,z:v>h?v:h}}(n,l,u,a,i?1e3:0),f=s.x,d=s.y,h=s.z,v=n.internals.positionAbsolute,p=f!==v.x||d!==v.y;(p||h!==n.internals.z)&&e.set(n.id,W(W({},n),{internals:W(W({},n.internals),{positionAbsolute:p?{x:f,y:d}:v,z:h})}))}else console.warn("Parent node ".concat(c," not found. Please make sure that parent nodes are in front of their child nodes in the nodes array."))}function Ip(n,e){var t=W({},n);for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function Ap(n,e){return(function(n){return!isNaN(n)&&isFinite(n)}(n.zIndex)?n.zIndex:0)+(n.selected?e:0)}function zp(n,e,t){var r=(null==t?void 0:t.rankdir)||"TB",o=new mv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(W({rankdir:r},t));var i=n.map((function(n){return W({},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)})),mv.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?Sv:c;if(!e&&!u||!r||!i)return Kv;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 Kv;var t=Gv(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 Kv;var t=Ov(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}):Kv}({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?_v:r,i=t.maxZoom,u=void 0===i?Ev:i,a=t.padding,c=void 0===a?.1:a,l=t.nodeOrigin,s=void 0===l?Sv:l,f=t.width,d=t.height,h=Ov(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:Fv(h,f,d,o,u,c),overflowBoundary:v}}(i,W({width:t.width,height:t.height,nodeOrigin:t.nodeOrigin},t.fitViewOptions))),{nodes:i,edges:e,transform:f.transform,overflowBoundary:f.overflowBoundary}}var Lp={assign:Object.assign,getHeight:function(n,e,t,r){return void 0===r&&(r="height"),"center"===t?(n[r]+e[r])/2:n.height}},Rp=Lp,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 Dp(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof Dp)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}Rp.assign(Dp.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 Bp=function(n,e,t){void 0===e&&(e={});var r,o=new Dp(n,e=Rp.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 Dp(u[c],e);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Hp=Bp,Vp=function(){function n(n,e){void 0===e&&(e={}),this.options=e,this.rootNode=Hp(n,e)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),Yp=Vp;function Xp(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 Zp(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach((function(n){Zp(n,e,t)}))}function Wp(n,e){var t=e?n.y:n.x;return n.children.forEach((function(n){t=Math.min(Wp(n,e),t)})),t}function Fp(n,e){Zp(n,-Wp(n,e),e)}function Up(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach((function(n,r){Up(n,e.children[r],t)}))}function $p(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){$p(n,e,t)}))}Xp.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach((function(n){t.push(Xp.fromNode(n,e))})),e?new Xp(n.height,n.width,n.x,t):new Xp(n.width,n.height,n.y,t)};var Gp=Bp,qp=function(n,e){for(var t=Gp(n.data,e,!0),r=Gp(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}},Kp=qp,Qp=["LR","RL","TB","BT","H","V"],Jp=["LR","RL","H"],ng=Qp[0],eg=function(n,e,t){var r=e.direction||ng;if(e.isHorizontal=function(n){return Jp.indexOf(n)>-1}(r),r&&-1===Qp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Qp[0])t(n,e);else if(r===Qp[1])t(n,e),n.right2left();else if(r===Qp[2])t(n,e);else if(r===Qp[3])t(n,e),n.bottom2top();else if(r===Qp[4]||r===Qp[5]){var o=Kp(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 tg(n,e){return tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},tg(n,e)}var rg=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}}$p(n,t);var s=Xp.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),Up(s,n,t),Fp(n,t),n},og=eg,ig=Lp,ug=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,tg(t,r),e.prototype.execute=function(){return og(this.rootNode,this.options,rg)},e}(Yp),ag={},cg=Lp;function lg(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 sg={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function fg(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){fg(n,e.children[r],t)}))}function dg(n,e){return dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},dg(n,e)}var hg=function(n,e){void 0===e&&(e={}),e=cg.assign({},sg,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 lg(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),fg(o,n,e.isHorizontal),n},vg=eg,pg=Lp,gg=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,dg(t,r),e.prototype.execute=function(){var n=this;return n.rootNode.width=0,vg(n.rootNode,n.options,hg)},e}(Yp),yg={},mg=Lp;function wg(n,e){return wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},wg(n,e)}var xg=Yp,bg=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+mg.getHeight(e,n,o),e.parent&&n.parent.id!==e.parent.id){var u=e.parent,a=u.y+mg.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,e,t,r),o=n}))},_g=qp,Eg=Lp,Sg=["LR","RL","H"],kg=Sg[0],Cg=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,wg(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?kg:u,c=n.align;if(a&&-1===Sg.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===Sg[0])bg(e,r,i,c);else if(a===Sg[1])bg(e,r,i,c),e.right2left();else if(a===Sg[2]){var l=_g(e,n),s=l.left,f=l.right;bg(s,r,i,c),s.right2left(),bg(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),e.x=f.x-e.width/2}return e},e}(xg),Ng={},Mg=Lp;function Og(n,e){var t=0;return n.children.length?n.children.forEach((function(n){t+=Og(n,e)})):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function Pg(n){var e=n.children,t=e.length;if(t){e.forEach((function(n){Pg(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 jg={getSubTreeSep:function(){return 0}};function Ig(n,e){return Ig=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Ig(n,e)}var Ag=function(n,e){void 0===e&&(e={}),e=Mg.assign({},jg,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,Og(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}}}})),Pg(n)},zg=eg,Lg=Lp,Rg=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,Ig(t,r),e.prototype.execute=function(){return zg(this.rootNode,this.options,Ag)},e}(Yp),Tg={};Qe({compactBox:function(n,e){return e=ig.assign({},ag,e),new ug(n,e).execute()},dendrogram:function(n,e){return e=pg.assign({},yg,e),new gg(n,e).execute()},indented:function(n,e){return e=Eg.assign({},Ng,e),new Cg(n,e).execute()},mindmap:function(n,e){return e=Lg.assign({},Tg,e),new Rg(n,e).execute()}});var Dg={value:()=>{}};function Bg(){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 Hg(r)}function Hg(n){this._=n}function Vg(n,e){for(var t,r=0,o=n.length;r<o;++r)if((t=n[r]).name===e)return t.value}function Yg(n,e,t){for(var r=0,o=n.length;r<o;++r)if(n[r].name===e){n[r]=Dg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}Hg.prototype=Bg.prototype={constructor:Hg,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]=Yg(o[t],n.name,e);else if(null==e)for(t in o)o[t]=Yg(o[t],n.name,null);return this}for(;++u<a;)if((t=(n=i[u]).type)&&(t=Vg(o[t],n.name)))return t},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new Hg(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 Xg="http://www.w3.org/1999/xhtml",Zg={svg:"http://www.w3.org/2000/svg",xhtml:Xg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wg(n){var e=n+="",t=e.indexOf(":");return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Zg.hasOwnProperty(e)?{space:Zg[e],local:n}:n}function Fg(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Xg&&e.documentElement.namespaceURI===Xg?e.createElement(n):e.createElementNS(t,n)}}function Ug(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function $g(n){var e=Wg(n);return(e.local?Ug:Fg)(e)}function Gg(){}function qg(n){return null==n?Gg:function(){return this.querySelector(n)}}function Kg(){return[]}function Qg(n){return null==n?Kg:function(){return this.querySelectorAll(n)}}function Jg(n){return function(){return this.matches(n)}}function ny(n){return function(e){return e.matches(n)}}var ey=Array.prototype.find;function ty(){return this.firstElementChild}var ry=Array.prototype.filter;function oy(){return Array.from(this.children)}function iy(n){return new Array(n.length)}function uy(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}function ay(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 uy(n,i[a]);for(;a<c;++a)(u=e[a])&&(o[a]=u)}function cy(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 uy(n,i[a]);for(a=0;a<f;++a)(c=e[a])&&s.get(h[a])===c&&(o[a]=c)}function ly(n){return n.__data__}function sy(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function fy(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function dy(n){return function(){this.removeAttribute(n)}}function hy(n){return function(){this.removeAttributeNS(n.space,n.local)}}function vy(n,e){return function(){this.setAttribute(n,e)}}function py(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function gy(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function yy(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 my(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function wy(n){return function(){this.style.removeProperty(n)}}function xy(n,e,t){return function(){this.style.setProperty(n,e,t)}}function by(n,e,t){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function _y(n,e){return n.style.getPropertyValue(e)||my(n).getComputedStyle(n,null).getPropertyValue(e)}function Ey(n){return function(){delete this[n]}}function Sy(n,e){return function(){this[n]=e}}function ky(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function Cy(n){return n.trim().split(/^|\s+/)}function Ny(n){return n.classList||new My(n)}function My(n){this._node=n,this._names=Cy(n.getAttribute("class")||"")}function Oy(n,e){for(var t=Ny(n),r=-1,o=e.length;++r<o;)t.add(e[r])}function Py(n,e){for(var t=Ny(n),r=-1,o=e.length;++r<o;)t.remove(e[r])}function jy(n){return function(){Oy(this,n)}}function Iy(n){return function(){Py(this,n)}}function Ay(n,e){return function(){(e.apply(this,arguments)?Oy:Py)(this,n)}}function zy(){this.textContent=""}function Ly(n){return function(){this.textContent=n}}function Ry(n){return function(){var e=n.apply(this,arguments);this.textContent=null==e?"":e}}function Ty(){this.innerHTML=""}function Dy(n){return function(){this.innerHTML=n}}function By(n){return function(){var e=n.apply(this,arguments);this.innerHTML=null==e?"":e}}function Hy(){this.nextSibling&&this.parentNode.appendChild(this)}function Vy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yy(){return null}function Xy(){var n=this.parentNode;n&&n.removeChild(this)}function Zy(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Wy(){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 Uy(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 $y(n,e,t){var r=my(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 Gy(n,e){return function(){return $y(this,n,e)}}function qy(n,e){return function(){return $y(this,n,e.apply(this,arguments))}}uy.prototype={constructor:uy,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)}},My.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 Ky=[null];function Qy(n,e){this._groups=n,this._parents=e}function Jy(){return new Qy([[document.documentElement]],Ky)}function nm(n){return"string"==typeof n?new Qy([[document.querySelector(n)]],[document.documentElement]):new Qy([[n]],Ky)}function em(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]}Qy.prototype=Jy.prototype={constructor:Qy,select:function(n){"function"!=typeof n&&(n=qg(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 Qy(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):Qg(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 Qy(r,o)},selectChild:function(n){return this.select(null==n?ty:function(n){return function(){return ey.call(this.children,n)}}("function"==typeof n?n:ny(n)))},selectChildren:function(n){return this.selectAll(null==n?oy:function(n){return function(){return ry.call(this.children,n)}}("function"==typeof n?n:ny(n)))},filter:function(n){"function"!=typeof n&&(n=Jg(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 Qy(r,this._parents)},data:function(n,e){if(!arguments.length)return Array.from(this,ly);var t,r=e?cy:ay,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=sy(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,w,x=0,b=0;x<p;++x)if(m=g[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<p;);m._next=w||null}}return(a=new Qy(a,o))._enter=c,a._exit=l,a},enter:function(){return new Qy(this._enter||this._groups.map(iy),this._parents)},exit:function(){return new Qy(this._exit||this._groups.map(iy),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 Qy(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=fy);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 Qy(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=Wg(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?hy:dy:"function"==typeof e?t.local?yy:gy:t.local?py:vy)(t,e))},style:function(n,e,t){return arguments.length>1?this.each((null==e?wy:"function"==typeof e?by:xy)(n,e,null==t?"":t)):_y(this.node(),n)},property:function(n,e){return arguments.length>1?this.each((null==e?Ey:"function"==typeof e?ky:Sy)(n,e)):this.node()[n]},classed:function(n,e){var t=Cy(n+"");if(arguments.length<2){for(var r=Ny(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof e?Ay:e?jy:Iy)(t,e))},text:function(n){return arguments.length?this.each(null==n?zy:("function"==typeof n?Ry:Ly)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Ty:("function"==typeof n?By:Dy)(n)):this.node().innerHTML},raise:function(){return this.each(Hy)},lower:function(){return this.each(Vy)},append:function(n){var e="function"==typeof n?n:$g(n);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(n,e){var t="function"==typeof n?n:$g(n),r=null==e?Yy:"function"==typeof e?e:qg(e);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Xy)},clone:function(n){return this.select(n?Wy:Zy)},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?Uy: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?qy:Gy)(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 tm={passive:!1},rm={capture:!0,passive:!1};function om(n){n.stopImmediatePropagation()}function im(n){n.preventDefault(),n.stopImmediatePropagation()}function um(n){var e=n.document.documentElement,t=nm(n).on("dragstart.drag",im,rm);"onselectstart"in e?t.on("selectstart.drag",im,rm):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function am(n,e){var t=n.document.documentElement,r=nm(n).on("dragstart.drag",null);e&&(r.on("click.drag",im,rm),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 cm=n=>()=>n;function lm(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 sm(n){return!n.ctrlKey&&!n.button}function fm(){return this.parentNode}function dm(n,e){return null==e?{x:n.x,y:n.y}:e}function hm(){return navigator.maxTouchPoints||"ontouchstart"in this}function vm(){var n,e,t,r,o=sm,i=fm,u=dm,a=hm,c={},l=Bg("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,tm).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=w(this,i.call(this,u,a),u,a,"mouse");c&&(nm(u.view).on("mousemove.drag",v,rm).on("mouseup.drag",p,rm),um(u.view),om(u),t=!1,n=u.clientX,e=u.clientY,c("start",u))}}function v(r){if(im(r),!t){var o=r.clientX-n,i=r.clientY-e;t=o*o+i*i>f}c.mouse("drag",r)}function p(n){nm(n.view).on("mousemove.drag mouseup.drag",null),am(n.view,t),im(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=w(this,a,n,e,u[t].identifier,u[t]))&&(om(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])&&(im(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])&&(om(n),t("end",n,o[e]))}function w(n,e,t,r,o,i){var a,f,h,v=l.copy(),p=em(i||t,e);if(null!=(h=u.call(n,new lm("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=em(l||u,e),g=s}v.call(i,n,new lm(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:cm(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:cm(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:cm(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:cm(!!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}function pm(n,e){if(!n.parentId)return!1;var t=e.get(n.parentId);return!!t&&(!!t.selected||pm(t,e))}function gm(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 ym(n){var e,t,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=U(u),s=l.next();!s.done;s=l.next()){var f=$(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(W(W({},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[W(W({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function mm(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 w(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,w=s.onError,x=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=Hv(n,e.nodeOrigin);t=Rv(t,r)}})),Dv(t)}(c,{nodeOrigin:p});_=Tv(E)}try{for(var S=U(c),k=S.next();!k.done;k=S.next()){var C=$(k.value,2),N=C[0],M=C[1],O={x:a-M.distance.x,y:l-M.distance.y};v&&(O=Xv(O,h));var P=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!M.extent){var j=M.internals.positionAbsolute,I=j.x-_.x+d[0][0],A=j.x+M.measured.width-_.x2+d[1][0];P=[[I,j.y-_.y+d[0][1]],[A,j.y+M.measured.height-_.y2+d[1][1]]]}var z=jv({nodeId:N,nextPosition:O,nodeLookup:f,nodeExtent:P,nodeOrigin:p,onError:w}),L=z.position,R=z.positionAbsolute;b=b||M.position.x!==L.x||M.position.y!==L.y,M.position=L,M.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&&(x(c,!0),e&&(o||g||!m&&y))){var T=$(ym({nodeId:m,dragItems:c,nodeLookup:f}),2),D=T[0],B=T[1];null==o||o(e,c,D,B),null==g||g(e,D,B),m||null==y||y(e,B)}}function x(){var n,e;if(f){var r=$(Lv(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})&&w(u,null)}a=requestAnimationFrame(x)}}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,w=i.onSelectionDragStart,x=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||x(),y&&p&&m&&(null==e||e(m));var b=Jv(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=U(n),s=l.next();!s.done;s=l.next()){var f=$(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!pm(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&&w)){var _=$(ym({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==w||w(n.sourceEvent,S)}}h=nm(g);var _=vm().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=Jv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=op(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=Jv(n.sourceEvent,{transform:a,snapGrid:h,snapToGrid:v});if(!l&&i&&d&&(l=!0,x()),!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=op(n.sourceEvent,f),w(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=$(ym({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||!gm(e,".".concat(v),g))&&(!p||gm(e,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function wm(n,e,t,r){var o,i,u,a,c,l,s,f,d,h=[],v=1/0,p=function(n,e,t){var r,o,i=[],u={x:n.x-t,y:n.y-t,width:2*t,height:2*t};try{for(var a=U(e.values()),c=a.next();!c.done;c=a.next()){var l=c.value;Yv(u,Bv(l))>0&&i.push(l)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(n,t,e+250);try{for(var g=U(p),y=g.next();!y.done;y=g.next()){var m=y.value,w=G(G([],$(null!==(l=null===(c=m.internals.handleBounds)||void 0===c?void 0:c.source)&&void 0!==l?l:[]),!1),$(null!==(f=null===(s=m.internals.handleBounds)||void 0===s?void 0:s.target)&&void 0!==f?f:[]),!1);try{for(var x=(u=void 0,U(w)),b=x.next();!b.done;b=x.next()){var _=b.value;if(r.nodeId!==_.nodeId||r.type!==_.type||r.id!==_.id){var E=Cp(m,_,_.position),S=E.x,k=E.y,C=Math.sqrt(Math.pow(S-n.x,2)+Math.pow(k-n.y,2));C>e||(C<v?(h=[W(W({},_),{x:S,y:k})],v=C):C===v&&h.push(W(W({},_),{x:S,y:k})))}}}catch(n){u={error:n}}finally{try{b&&!b.done&&(a=x.return)&&a.call(x)}finally{if(u)throw u.error}}}}catch(n){o={error:n}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}if(!h.length)return null;if(h.length>1){var N="source"===r.type?"target":"source";return null!==(d=h.find((function(n){return n.type===N})))&&void 0!==d?d:h[0]}return h[0]}function xm(n,e,t,r,o,i){var u,a,c,l,s,f;void 0===i&&(i=!1);var d=r.get(n);if(!d)return null;var h="strict"===o?null===(u=d.internals.handleBounds)||void 0===u?void 0:u[e]:G(G([],$(null!==(c=null===(a=d.internals.handleBounds)||void 0===a?void 0:a.source)&&void 0!==c?c:[]),!1),$(null!==(s=null===(l=d.internals.handleBounds)||void 0===l?void 0:l.target)&&void 0!==s?s:[]),!1),v=null!==(f=t?null==h?void 0:h.find((function(n){return n.id===t})):null==h?void 0:h[0])&&void 0!==f?f:null;return v&&i?W(W({},v),Cp(d,v,v.position)):v}function bm(n,e){return n||((null==e?void 0:e.classList.contains("target"))?"target":(null==e?void 0:e.classList.contains("source"))?"source":null)}lm.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var _m=function(){return!0};function Em(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?_m:s,d=e.nodeLookup,h=".".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,'"]'),v="target"===u,p=t?a.querySelector(h):null,g=op(n),y=g.x,m=g.y,w=a.elementFromPoint(y,m),x=(null==w?void 0:w.classList.contains("".concat(c,"-flow__handle")))?w:p,b={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){var _=bm(void 0,x),E=x.getAttribute("data-nodeid"),S=x.getAttribute("data-handleid"),k=x.classList.contains("connectable"),C=x.classList.contains("connectableend");if(!E||!_)return b;var N={source:v?E:o,sourceHandle:v?S:i,target:v?o:E,targetHandle:v?i:S};b.connection=N;var M=k&&C&&(r===np.Strict?v&&"source"===_||!v&&"target"===_:E!==o||S!==i);b.isValid=M&&f(N),b.toHandle=xm(E,_,S,d,r,!1)}return b}var Sm={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,w=e.isValidConnection,x=void 0===w?_m:w,b=e.onReconnectEnd,_=e.updateConnection,E=e.getTransform,S=e.getFromHandle,k=e.autoPanSpeed,C=function(n){var e;return(null===(e=null==n?void 0:n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),N=0,M=op(n),O=M.x,P=M.y,j=null==C?void 0:C.elementFromPoint(O,P),I=bm(a,j),A=null==l?void 0:l.getBoundingClientRect();if(A&&I){var z=xm(u,I,i,s,r);if(z){var L=op(n,A),R=!1,T=null,D=!1,B=null,H=W(W({},z),{nodeId:u,type:I,position:z.position}),V=s.get(u),Y={inProgress:!0,isValid:null,from:Cp(V,H,lp.Left),fromHandle:H,fromPosition:H.position,fromNode:V,to:L,toHandle:null,toPosition:fp[H.position],toNode:null};_(Y);var X=Y;null==g||g(n,{nodeId:u,handleId:i,handleType:I}),C.addEventListener("mousemove",U),C.addEventListener("mouseup",G),C.addEventListener("touchmove",U),C.addEventListener("touchend",G)}}function Z(){if(d&&A){var n=$(Lv(L,A,k),2),e=n[0],t=n[1];v({x:e,y:t}),N=requestAnimationFrame(Z)}}function U(n){if(S()&&H){var e=E();L=op(n,A),t=wm(Zv(L,e,!1,[1,1]),o,s,H),R||(Z(),R=!0);var a=Em(n,{handle:t,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:x,doc:C,lib:f,flowId:h,nodeLookup:s});B=a.handleDomNode,T=a.connection,D=function(n,e){var t=null;return e?t=!0:n&&!e&&(t=!1),t}(!!t,a.isValid);var l=W(W({},X),{isValid:D,to:t&&D?Wv({x:t.x,y:t.y},e):L,toHandle:a.toHandle,toPosition:D&&a.toHandle?a.toHandle.position:fp[H.position],toNode:a.toHandle?s.get(a.toHandle.nodeId):null});D&&t&&X.toHandle&&l.toHandle&&X.toHandle.type===l.toHandle.type&&X.toHandle.nodeId===l.toHandle.nodeId&&X.toHandle.id===l.toHandle.id&&X.to.x===l.to.x&&X.to.y===l.to.y||(_(l),X=l)}else G(n)}function G(n){(t||B)&&T&&D&&(null==y||y(T)),X.inProgress;var e=F(X,["inProgress"]),r=W(W({},e),{toPosition:X.toHandle?X.toPosition:null});null==m||m(n,r),a&&(null==b||b(n,r)),p(),cancelAnimationFrame(N),R=!1,D=!1,T=null,B=null,C.removeEventListener("mousemove",U),C.removeEventListener("mouseup",G),C.removeEventListener("touchmove",U),C.removeEventListener("touchend",G)}},isValid:Em};function km(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Cm(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Nm(){}var Mm=.7,Om=1/Mm,Pm="\\s*([+-]?\\d+)\\s*",jm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Im="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Am=/^#([0-9a-f]{3,8})$/,zm=new RegExp(`^rgb\\(${Pm},${Pm},${Pm}\\)$`),Lm=new RegExp(`^rgb\\(${Im},${Im},${Im}\\)$`),Rm=new RegExp(`^rgba\\(${Pm},${Pm},${Pm},${jm}\\)$`),Tm=new RegExp(`^rgba\\(${Im},${Im},${Im},${jm}\\)$`),Dm=new RegExp(`^hsl\\(${jm},${Im},${Im}\\)$`),Bm=new RegExp(`^hsla\\(${jm},${Im},${Im},${jm}\\)$`),Hm={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 Vm(){return this.rgb().formatHex()}function Ym(){return this.rgb().formatRgb()}function Xm(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Am.exec(n))?(t=e[1].length,e=parseInt(e[1],16),6===t?Zm(e):3===t?new Um(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===t?Wm(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===t?Wm(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=zm.exec(n))?new Um(e[1],e[2],e[3],1):(e=Lm.exec(n))?new Um(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Rm.exec(n))?Wm(e[1],e[2],e[3],e[4]):(e=Tm.exec(n))?Wm(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Dm.exec(n))?Jm(e[1],e[2]/100,e[3]/100,1):(e=Bm.exec(n))?Jm(e[1],e[2]/100,e[3]/100,e[4]):Hm.hasOwnProperty(n)?Zm(Hm[n]):"transparent"===n?new Um(NaN,NaN,NaN,0):null}function Zm(n){return new Um(n>>16&255,n>>8&255,255&n,1)}function Wm(n,e,t,r){return r<=0&&(n=e=t=NaN),new Um(n,e,t,r)}function Fm(n,e,t,r){return 1===arguments.length?((o=n)instanceof Nm||(o=Xm(o)),o?new Um((o=o.rgb()).r,o.g,o.b,o.opacity):new Um):new Um(n,e,t,null==r?1:r);var o}function Um(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}function $m(){return`#${Qm(this.r)}${Qm(this.g)}${Qm(this.b)}`}function Gm(){const n=qm(this.opacity);return`${1===n?"rgb(":"rgba("}${Km(this.r)}, ${Km(this.g)}, ${Km(this.b)}${1===n?")":`, ${n})`}`}function qm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Km(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Qm(n){return((n=Km(n))<16?"0":"")+n.toString(16)}function Jm(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new ew(n,e,t,r)}function nw(n){if(n instanceof ew)return new ew(n.h,n.s,n.l,n.opacity);if(n instanceof Nm||(n=Xm(n)),!n)return new ew;if(n instanceof ew)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 ew(u,a,c,n.opacity)}function ew(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}function tw(n){return(n=(n||0)%360)<0?n+360:n}function rw(n){return Math.max(0,Math.min(1,n||0))}function ow(n,e,t){return 255*(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)}km(Nm,Xm,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Vm,formatHex:Vm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return nw(this).formatHsl()},formatRgb:Ym,toString:Ym}),km(Um,Fm,Cm(Nm,{brighter(n){return n=null==n?Om:Math.pow(Om,n),new Um(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?Mm:Math.pow(Mm,n),new Um(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Um(Km(this.r),Km(this.g),Km(this.b),qm(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:$m,formatHex:$m,formatHex8:function(){return`#${Qm(this.r)}${Qm(this.g)}${Qm(this.b)}${Qm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gm,toString:Gm})),km(ew,(function(n,e,t,r){return 1===arguments.length?nw(n):new ew(n,e,t,null==r?1:r)}),Cm(Nm,{brighter(n){return n=null==n?Om:Math.pow(Om,n),new ew(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?Mm:Math.pow(Mm,n),new ew(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 Um(ow(n>=240?n-240:n+120,o,r),ow(n,o,r),ow(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new ew(tw(this.h),rw(this.s),rw(this.l),qm(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=qm(this.opacity);return`${1===n?"hsl(":"hsla("}${tw(this.h)}, ${100*rw(this.s)}%, ${100*rw(this.l)}%${1===n?")":`, ${n})`}`}}));var iw=n=>()=>n;function uw(n,e){var t=e-n;return t?function(n,e){return function(t){return n+t*e}}(n,t):iw(isNaN(n)?e:n)}var aw=function n(e){var t=function(n){return 1==(n=+n)?uw: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):iw(isNaN(e)?t:e)}}(e);function r(n,e){var r=t((n=Fm(n)).r,(e=Fm(e)).r),o=t(n.g,e.g),i=t(n.b,e.b),u=uw(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 cw(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var lw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sw=new RegExp(lw.source,"g");function fw(n,e){var t,r,o,i=lw.lastIndex=sw.lastIndex=0,u=-1,a=[],c=[];for(n+="",e+="";(t=lw.exec(n))&&(r=sw.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:cw(t,r)})),i=sw.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 dw,hw=180/Math.PI,vw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pw(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)*hw,skewX:Math.atan(c)*hw,scaleX:u,scaleY:a}}function gw(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:cw(n,o)},{i:c-2,x:cw(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:cw(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:cw(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:cw(n,t)},{i:a-2,x:cw(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 yw=gw((function(n){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?vw:pw(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),mw=gw((function(n){return null==n?vw:(dw||(dw=document.createElementNS("http://www.w3.org/2000/svg","g")),dw.setAttribute("transform",n),(n=dw.transform.baseVal.consolidate())?pw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):vw)}),", ",")",")");function ww(n){return((n=Math.exp(n))+1/n)/2}var xw,bw,_w=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),w=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(m*m+1)-m);u=(x-w)/e,i=function(n){var r,o=n*u,i=ww(w),s=l/(t*g)*(i*(r=e*o+w,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(w));return[a+s*h,c+s*v,l*i/ww(e*o+w)]}}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),Ew=0,Sw=0,kw=0,Cw=0,Nw=0,Mw=0,Ow="object"==typeof performance&&performance.now?performance:Date,Pw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function jw(){return Nw||(Pw(Iw),Nw=Ow.now()+Mw)}function Iw(){Nw=0}function Aw(){this._call=this._time=this._next=null}function zw(n,e,t){var r=new Aw;return r.restart(n,e,t),r}function Lw(){Nw=(Cw=Ow.now())+Mw,Ew=Sw=0;try{!function(){jw(),++Ew;for(var n,e=xw;e;)(n=Nw-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Ew}()}finally{Ew=0,function(){for(var n,e,t=xw,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:xw=e);bw=n,Tw(r)}(),Nw=0}}function Rw(){var n=Ow.now(),e=n-Cw;e>1e3&&(Mw-=e,Cw=n)}function Tw(n){Ew||(Sw&&(Sw=clearTimeout(Sw)),n-Nw>24?(n<1/0&&(Sw=setTimeout(Lw,n-Ow.now()-Mw)),kw&&(kw=clearInterval(kw))):(kw||(Cw=Ow.now(),kw=setInterval(Rw,1e3)),Ew=1,Pw(Lw)))}function Dw(n,e,t){var r=new Aw;return e=null==e?0:+e,r.restart((t=>{r.stop(),n(t+e)}),e,t),r}Aw.prototype=zw.prototype={constructor:Aw,restart:function(n,e,t){if("function"!=typeof n)throw new TypeError("callback is not a function");t=(null==t?jw():+t)+(null==e?0:+e),this._next||bw===this||(bw?bw._next=this:xw=this,bw=this),this._call=n,this._time=t,Tw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tw())}};var Bw=Bg("start","end","cancel","interrupt"),Hw=[];function Vw(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 Dw(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(Dw((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=zw((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:Bw,tween:Hw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Yw(n,e){var t=Zw(n,e);if(t.state>0)throw new Error("too late; already scheduled");return t}function Xw(n,e){var t=Zw(n,e);if(t.state>3)throw new Error("too late; already running");return t}function Zw(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Ww(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 Fw(n,e){var t,r;return function(){var o=Xw(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 Uw(n,e,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=Xw(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 $w(n,e,t){var r=n._id;return n.each((function(){var n=Xw(this,r);(n.value||(n.value={}))[e]=t.apply(this,arguments)})),function(n){return Zw(n,r).value[e]}}function Gw(n,e){var t;return("number"==typeof e?cw:e instanceof Xm?aw:(t=Xm(e))?(e=t,aw):fw)(n,e)}function qw(n){return function(){this.removeAttribute(n)}}function Kw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Qw(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 Jw(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 nx(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 ex(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 tx(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 rx(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 ox(n,e){return function(){Yw(this,n).delay=+e.apply(this,arguments)}}function ix(n,e){return e=+e,function(){Yw(this,n).delay=e}}function ux(n,e){return function(){Xw(this,n).duration=+e.apply(this,arguments)}}function ax(n,e){return e=+e,function(){Xw(this,n).duration=e}}var cx=Jy.prototype.constructor;function lx(n){return function(){this.style.removeProperty(n)}}var sx=0;function fx(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function dx(){return++sx}var hx=Jy.prototype;fx.prototype={constructor:fx,select:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=qg(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,Vw(f[d],e,t,d,f,Zw(a,t)));return new fx(i,this._parents,e,t)},selectAll:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=Qg(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=Zw(c,t),p=0,g=h.length;p<g;++p)(d=h[p])&&Vw(d,e,t,p,h,v);i.push(h),u.push(c)}return new fx(i,u,e,t)},selectChild:hx.selectChild,selectChildren:hx.selectChildren,filter:function(n){"function"!=typeof n&&(n=Jg(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 fx(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 fx(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=dx(),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=Zw(u,e);Vw(u,n,t,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new fx(r,this._parents,n,t)},call:hx.call,nodes:hx.nodes,node:hx.node,size:hx.size,empty:hx.empty,each:hx.each,on:function(n,e){var t=this._id;return arguments.length<2?Zw(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)?Yw:Xw;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=Wg(n),r="transform"===t?mw:Gw;return this.attrTween(n,"function"==typeof e?(t.local?ex:nx)(t,r,$w(this,"attr."+n,e)):null==e?(t.local?Kw:qw)(t):(t.local?Jw:Qw)(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=Wg(n);return this.tween(t,(r.local?tx:rx)(r,e))},style:function(n,e,t){var r="transform"==(n+="")?yw:Gw;return null==e?this.styleTween(n,function(n,e){var t,r,o;return function(){var i=_y(this,n),u=(this.style.removeProperty(n),_y(this,n));return i===u?null:i===t&&u===r?o:o=e(t=i,r=u)}}(n,r)).on("end.style."+n,lx(n)):"function"==typeof e?this.styleTween(n,function(n,e,t){var r,o,i;return function(){var u=_y(this,n),a=t(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=_y(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=e(r=u,a))}}(n,r,$w(this,"style."+n,e))).each(function(n,e){var t,r,o,i,u="style."+e,a="end."+u;return function(){var c=Xw(this,n),l=c.on,s=null==c.value[u]?i||(i=lx(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=_y(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}}($w(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=Zw(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?Fw:Uw)(t,n,e))},delay:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?ox:ix)(e,n)):Zw(this.node(),e).delay},duration:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?ux:ax)(e,n)):Zw(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(){Xw(this,n).ease=e}}(e,n)):Zw(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;Xw(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=Xw(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]:hx[Symbol.iterator]};var vx={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function px(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}Jy.prototype.interrupt=function(n){return this.each((function(){Ww(this,n)}))},Jy.prototype.transition=function(n){var e,t;n instanceof fx?(e=n._id,n=n._name):(e=dx(),(t=vx).time=jw(),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])&&Vw(u,n,e,l,a,t||px(u,e));return new fx(r,this._parents,n,e)};var gx=n=>()=>n;function yx(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 mx(n,e,t){this.k=n,this.x=e,this.y=t}mx.prototype={constructor:mx,scale:function(n){return 1===n?this:new mx(this.k*n,this.x,this.y)},translate:function(n,e){return 0===n&0===e?this:new mx(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 wx=new mx(1,0,0);function xx(n){for(;!n.__zoom;)if(!(n=n.parentNode))return wx;return n.__zoom}function bx(n){n.stopImmediatePropagation()}function _x(n){n.preventDefault(),n.stopImmediatePropagation()}function Ex(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function Sx(){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 kx(){return this.__zoom||wx}function Cx(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Nx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mx(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))}xx.prototype=mx.prototype;var Ox,Px=function(n){return{x:n.x,y:n.y,zoom:n.k}},jx=function(n){var e=n.x,t=n.y,r=n.zoom;return wx.translate(e,t).scale(r)},Ix=function(n,e){return n.target.closest(".".concat(e))},Ax=function(n,e){return 2===e&&Array.isArray(n)&&n.includes(2)},zx=function(n,e,t){void 0===e&&(e=0),void 0===t&&(t=function(){});var r="number"==typeof e&&e>0;return r||t(),r?n.transition().duration(e).on("end",t):n},Lx=function(n){var e=n.ctrlKey&&Uv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*e};function Rx(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=Ex,o=Sx,i=Mx,u=Cx,a=Nx,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_w,d=Bg("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",kx).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",N).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 mx(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 mx(n.k,r,o)}function m(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function w(n,e,t,r){n.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=x(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 mx(t,c[0]-e[0]*t,c[1]-e[1]*t)}u.zoom(null,n)}}))}function x(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=x(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=em(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)],Ww(this),t.start()}_x(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=x(this,e,!0).event(n),a=nm(n.view).on("mousemove.zoom",(function(n){if(_x(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]=em(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),am(n.view,u.moved),_x(n),u.event(n).end()}),!0),c=em(n,o),s=n.clientX,f=n.clientY;um(n.view),bx(n),u.mouse=[c,this.__zoom.invert(c)],Ww(this),u.start()}}function S(n,...e){if(r.apply(this,arguments)){var t=this.__zoom,u=em(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);_x(n),s>0?nm(this).transition().duration(s).call(w,f,u,n):nm(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=x(this,o,t.changedTouches.length===s).event(t);for(bx(t),u=0;u<s;++u)c=[c=em(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)),Ww(this),f.start())}}function C(n,...e){if(this.__zooming){var t,r,o,u,a=x(this,e).event(n),c=n.changedTouches,s=c.length;for(_x(n),t=0;t<s;++t)o=em(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 N(n,...r){if(this.__zooming){var o,i,u=x(this,r).event(n),a=n.changedTouches,c=a.length;for(bx(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=em(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var l=nm(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",kx),n!==o?w(n,e,t,r):o.interrupt().each((function(){x(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(wx.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=nm(this.that).datum();d.call(n,this.that,new yx(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:gx(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:gx(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:gx(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:gx([[+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=nm(e).call(h);w({x:i.x,y:i.y,zoom:Iv(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(zx(v,null==e?void 0:e.duration),n))}function m(){h.on("zoom",null)}function w(n,e,t){var r=jx(n),o=null==h?void 0:h.constrain()(r,e,t);return o&&y(o),o}return h.wheelDelta(Lx),{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,w=n.panOnScrollSpeed,x=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||Ix(n,e))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:e,preventScrolling:x,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(Ix(n,t))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=em(n),h=Lx(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===ep.Vertical?0:n.deltaX*p,y=i===ep.Horizontal?0:n.deltaY*p;!Uv()&&n.shiftKey&&i!==ep.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=Px(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:w,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var N=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=Px(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",N);var M=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||!Ax(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,Px(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",M);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&&Ax(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=Px(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&&(Ix(n,"".concat(s,"-flow__node"))||Ix(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(Ix(n,c)&&"wheel"===n.type)return!1;if(Ix(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=jx(n);return y(t,e),t},setViewportConstrained:w,getViewport:function(){var n=v?xx(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,e){return v?new Promise((function(t){null==h||h.scaleTo(zx(v,null==e?void 0:e.duration,(function(){return t(!0)})),n)})):Promise.resolve(!1)},scaleBy:function(n,e){return v?new Promise((function(t){null==h||h.scaleBy(zx(v,null==e?void 0:e.duration,(function(){return t(!0)})),n)})):Promise.resolve(!1)},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var e=jx(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"}(Ox||(Ox={}));var Tx=["top-left","top-right","bottom-left","bottom-right"],Dx=["top","right","bottom","left"];function Bx(n,e){return Math.max(0,e-n)}function Hx(n,e){return Math.max(0,n-e)}function Vx(n,e,t){return Math.max(0,e-n,n-t)}function Yx(n,e){return n?!e:e}var Xx={width:0,height:0,x:0,y:0},Zx=W(W({},Xx),{pointerX:0,pointerY:0,aspectRatio:1});function Wx(n,e,t){var r,o,i=e.position.x+n.position.x,u=e.position.y+n.position.y,a=null!==(r=n.measured.width)&&void 0!==r?r:0,c=null!==(o=n.measured.height)&&void 0!==o?o:0,l=t[0]*a,s=t[1]*c;return[[i-l,u-s],[i+a-l,u+c-s]]}var Fx=wv.error001();function Ux(n,e){var r=t(X);if(null===r)throw new Error(Fx);return V(r,n,e)}function $x(){var n=t(X);if(null===n)throw new Error(Fx);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}var Gx=function(n,e){void 0===e&&(e=[0,0]);var t=Jx(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 qx(n,e,t){var r,o;n.clear(),e.clear();try{for(var i=g(t),u=i.next();!u.done;u=i.next()){var a=u.value,c=a.source,l=a.target,s=a.sourceHandle,f=void 0===s?null:s,d=a.targetHandle,h=void 0===d?null:d,v="".concat(c,"-source-").concat(f),p="".concat(l,"-target-").concat(h),y=n.get(v)||new Map,m=n.get(p)||new Map,w={edgeId:a.id,source:c,target:l,sourceHandle:f,targetHandle:h};e.set(a.id,a),n.set(v,y.set("".concat(l,"-").concat(h),w)),n.set(p,m.set("".concat(c,"-").concat(f),w))}}catch(n){r={error:n}}finally{try{u&&!u.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}var Kx=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Qx=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:Kx(n.x,e[0][0],e[1][0]),y:Kx(n.y,e[0][1],e[1][1])}};function Jx(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 nb=function(n){return!isNaN(n)&&isFinite(n)},eb=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])}},tb=function(n,e,t,r){var o=n.x,i=n.y,u=y(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?eb(s,r):s},rb=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=Gx(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}},ob=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)}},ib=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},ub=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},ab=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=Gx(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)}},cb=function(n,e){return ub(ob(ib(n),ib(e)))};function lb(n){return o(n)}var sb=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)};function fb(n,e){var t,r,o,i,u,a;if(n.hidden)return!1;var c=n.measured,l=null!==(o=null!==(r=null!==(t=c.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,s=null!==(a=null!==(u=null!==(i=c.height)&&void 0!==i?i:n.height)&&void 0!==u?u:n.initialHeight)&&void 0!==a?a:0;if(!c.width||!c.height)return!1;var f=rb(n),d=sb(e,f);return d>0||d>=l*s||!!n.dragging}var db=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=Kx(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 hb(n){return void 0!==n&&"parent"!==n}var vb=function(n){return pb(n)},pb=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};function gb(n,e,t,r,o){var i,u;void 0===r&&(r=[0,0]),void 0===o&&(o={width:0,height:0});for(var a=e,c=d({},n);a;){var l=t.get(e);if(a=null==l?void 0:l.parentId,l){var s=l.origin||r;c.x+=l.internals.positionAbsolute.x-(null!==(i=o.width)&&void 0!==i?i:0)*s[0],c.y+=l.internals.positionAbsolute.y-(null!==(u=o.height)&&void 0!==u?u:0)*s[1]}}return c}var yb=function(n){return nb(n.width)&&nb(n.height)&&nb(n.x)&&nb(n.y)},mb=["INPUT","SELECT","TEXTAREA"];function wb(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 mb.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var xb=function(n){return"clientX"in n},bb=function(n,e){var t,r,o,i,u=xb(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)}},_b="undefined"!=typeof document?document:null;function Eb(n,e){void 0===n&&(n=null),void 0===e&&(e={target:_b,actInsideInputWithModifier:!0});var t=y(i(!1),2),o=t[0],c=t[1],l=u(!1),s=u(new Set([])),f=y(r((function(){if(null!==n){var e=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),t=e.reduce((function(n,e){return n.concat.apply(n,m([],y(e),!1))}),[]);return[e,t]}return[[],[]]}),[n]),2),d=f[0],h=f[1];return a((function(){var t=(null==e?void 0:e.target)||_b;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!e.actInsideInputWithModifier)&&wb(n))return!1;var t=kb(n.code,h);s.current.add(n[t]),Sb(d,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!e.actInsideInputWithModifier)&&wb(n))return!1;var t=kb(n.code,h);Sb(d,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[t]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==t||t.addEventListener("keydown",r),null==t||t.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==t||t.removeEventListener("keydown",r),null==t||t.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function Sb(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 kb(n,e){return e.includes(n)?"code":"key"}function Cb(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 Nb={position:"absolute",width:"100%",height:"100%",top:0,left:0};var Mb=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function Ob(n){var e=n.onPaneContextMenu,t=n.zoomOnScroll,r=void 0===t||t,o=n.zoomOnPinch,i=void 0===o||o,c=n.panOnScroll,l=void 0!==c&&c,s=n.panOnScrollSpeed,f=void 0===s?.5:s,d=n.panOnScrollMode,h=void 0===d?ep.Free:d,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,x=n.zoomActivationKeyCode,b=n.preventScrolling,_=void 0===b||b,E=n.children,S=n.noWheelClassName,C=n.noPanClassName,N=n.onViewportChange,M=n.isControlledViewport,O=$x(),P=u(null),j=Ux(Mb,Cb),I=j.userSelectionActive,A=j.lib,z=Eb(x),L=u();return function(n){var e=$x();a((function(){var t=function(){var t,r;if(!n.current)return!1;var o,i={width:(o=n.current).offsetWidth,height:o.offsetHeight};0!==i.height&&0!==i.width||null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"004",wv.error004()),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);var r=new ResizeObserver((function(){return t()}));return r.observe(n.current),function(){window.removeEventListener("resize",t),r&&n.current&&r.unobserve(n.current)}}}),[])}(P),a((function(){if(P.current){var n=O.getState();L.current=Rx({domNode:P.current,minZoom:n.minZoom,maxZoom:n.maxZoom,translateExtent:w,viewport:m,onTransformChange:function(n){null==N||N({x:n[0],y:n[1],zoom:n[2]}),M||O.setState({transform:n})},onDraggingChange:function(n){return O.setState({paneDragging:n})},onPanZoomStart:function(n,e){var t=O.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(n,e),null==r||r(e)},onPanZoom:function(n,e){var t=O.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(n,e),null==r||r(e)},onPanZoomEnd:function(n,e){var t=O.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(n,e),null==r||r(e)}});var e=L.current.getViewport(),t=e.x,r=e.y,o=e.zoom;return O.setState({panZoom:L.current,transform:[t,r,o],domNode:P.current.closest(".ink-flow")}),function(){var n;null===(n=L.current)||void 0===n||n.destroy()}}}),[]),a((function(){var n;null===(n=L.current)||void 0===n||n.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:f,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:_,noPanClassName:C,userSelectionActive:I,noWheelClassName:S,lib:A})}),[e,r,i,l,f,h,p,y,z,_,C,I,S,A]),k.jsx("div",{className:"ink-flow__renderer",ref:P,style:Nb,children:E})}var Pb="undefined"!=typeof window?c:a;function jb(n){var e=y(i(!1),2),t=e[0],r=e[1],o=y(i((function(){return function(n){var e=[];return{get:function(){return e},reset:function(){e=[]},push:function(t){e.push(t),n()}}}((function(){return r(!0)}))})),1),u=o[0];return Pb((function(){if(t){var e=u.get();e.length&&(n(e),u.reset()),r(!1)}else u.reset()}),[t]),u}function Ib(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 Ab(n,e){var t,r,o,i,u,a,c=[],l=new Map;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){if("add"!==(_=f.value).type)if("remove"===_.type||"replace"===_.type)l.set(_.id,[_]);else{var h=l.get(_.id);h?h.push(_):l.set(_.id,[_])}else c.push(_.item)}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}try{for(var v=g(e),p=v.next();!p.done;p=v.next()){var y=p.value,m=l.get(y.id);if(m){if("remove"!==m[0].type)if("replace"!==m[0].type){var w=d({},y);try{for(var x=(u=void 0,g(m)),b=x.next();!b.done;b=x.next()){var _;Ib(_=b.value,w)}}catch(n){u={error:n}}finally{try{b&&!b.done&&(a=x.return)&&a.call(x)}finally{if(u)throw u.error}}c.push(w)}else c.push(d({},m[0].item))}else c.push(y)}}catch(n){o={error:n}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return c}function zb(n,e){return{id:n,type:"select",selected:e}}function Lb(n,e,t){var r,o;void 0===e&&(e=new Set),void 0===t&&(t=!1);var i=[];try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2),l=c[0],s=c[1],f=e.has(l);void 0===s.selected&&!f||s.selected===f||(t&&(s.selected=f),i.push(zb(s.id,f)))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i}function Rb(n){var e,t,r,o,i,u,a=n.items,c=void 0===a?[]:a,l=n.lookup,s=[],f=new Map(c.map((function(n){return[n.id,n]})));try{for(var d=g(c),h=d.next();!h.done;h=d.next()){var v=h.value,p=l.get(v.id),m=null!==(u=null===(i=null==p?void 0:p.internals)||void 0===i?void 0:i.userNode)&&void 0!==u?u:p;void 0!==m&&m!==v&&s.push({id:v.id,item:v,type:"replace"}),void 0===m&&s.push({item:v,type:"add"})}}catch(n){e={error:n}}finally{try{h&&!h.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var w=g(l),x=w.next();!x.done;x=w.next()){var b=y(x.value,1)[0];void 0===f.get(b)&&s.push({id:b,type:"remove"})}}catch(n){r={error:n}}finally{try{x&&!x.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}var Tb=e(null);function Db(n){var e=n.children,t=$x(),o=l((function(n){var e,r,o=t.getState(),i=o.nodes,u=void 0===i?[]:i,a=o.onNodesChange,c=o.nodeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}a&&a({changes:Rb({items:l,lookup:c}),userNodes:l})}),[]),i=jb(o),u=l((function(n){var e,r,o=t.getState(),i=o.edges,u=void 0===i?[]:i,a=o.onEdgesChange,c=o.edgeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}a&&a({changes:Rb({items:l,lookup:c}),userEdges:l})}),[]),a=jb(u),c=r((function(){return{nodeQueue:i,edgeQueue:a}}),[]);return k.jsx(Tb.Provider,{value:c,children:e})}var Bb=function(n,e){void 0===e&&(e=[0,0]);var t=Jx(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}}},Hb=function(n,e,t,r,o){var i,u,a,c,l,s,f,h,v=y(void 0===t?[0,0,1]:t,3),p=v[0],m=v[1],w=v[2];void 0===r&&(r=!1),void 0===o&&(o=!1);var x=d(d({},tb(e,[p,m,w])),{width:e.width/w,height:e.height/w}),b=[];try{for(var _=g(n.values()),E=_.next();!E.done;E=_.next()){var S=E.value,k=S.measured,C=S.selectable,N=void 0===C||C,M=S.hidden;if(!(o&&!N||void 0!==M&&M)){var O=null!==(l=null!==(c=null!==(a=k.width)&&void 0!==a?a:S.width)&&void 0!==c?c:S.initialWidth)&&void 0!==l?l:null,P=null!==(h=null!==(f=null!==(s=k.height)&&void 0!==s?s:S.height)&&void 0!==f?f:S.initialHeight)&&void 0!==h?h:null,j=sb(x,rb(S)),I=(null!=O?O:0)*(null!=P?P:0),A=r&&j>0;(!S.internals.handleBounds||A||j>=I||S.dragging)&&b.push(S)}}}catch(n){i={error:n}}finally{try{E&&!E.done&&(u=_.return)&&u.call(_)}finally{if(i)throw i.error}}return b};function Vb(n,e){return v(this,arguments,void 0,(function(n,e){var t,r,o,i,u,a=n.nodes,c=n.width,l=n.height,s=n.panZoom,f=n.minZoom,d=n.maxZoom;return p(this,(function(n){switch(n.label){case 0:return 0===a.size?[2,Promise.resolve(!1)]:(t=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=ab(n,e.nodeOrigin);t=ob(t,r)}})),ub(t)}(a),r=db(t,c,l,null!==(o=null==e?void 0:e.minZoom)&&void 0!==o?o:f,null!==(i=null==e?void 0:e.maxZoom)&&void 0!==i?i:d,null!==(u=null==e?void 0:e.padding)&&void 0!==u?u:.1),[4,s.setViewport(r,{duration:null==e?void 0:e.duration})]);case 1:return n.sent(),[2,Promise.resolve(!0)]}}))}))}function Yb(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?Bb(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&&hb(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,w=f+v*m[0],x=d+p*m[1];h=[[w,x],[w+g-v,x+y-p]]}}else null==a||a("005",wv.error005());var b=hb(h)?Qx(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}function Xb(n){return v(this,arguments,void 0,(function(n){var e,t,r,o,i,u,a,c,l,s,f,d,h,v,y,m,w,x,b,_=n.nodesToRemove,E=void 0===_?[]:_,S=n.edgesToRemove,k=void 0===S?[]:S,C=n.nodes,N=n.edges,M=n.onBeforeDelete;return p(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=g(C),i=o.next();!i.done;i=o.next())u=i.value,r(u)}catch(n){m={error:n}}finally{try{i&&!i.done&&(w=o.return)&&w.call(o)}finally{if(m)throw m.error}}a=new Set(k.map((function(n){return n.id}))),c=N.filter((function(n){return!1!==n.deletable})),l=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,c),s=l,f=function(n){a.has(n.id)&&!s.find((function(e){return e.id===n.id}))&&s.push(n)};try{for(d=g(c),h=d.next();!h.done;h=d.next())v=h.value,f(v)}catch(n){x={error:n}}finally{try{h&&!h.done&&(b=d.return)&&b.call(d)}finally{if(x)throw x.error}}return M?[4,M({nodes:t,edges:s})]:[2,{edges:s,nodes:t}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var Zb=function(){var n=$x();return r((function(){return{zoomIn:function(e){var t=n.getState().panZoom;return t?t.scaleBy(1.2,{duration:null==e?void 0:e.duration}):Promise.resolve(!1)},zoomOut:function(e){var t=n.getState().panZoom;return t?t.scaleBy(1/1.2,{duration:null==e?void 0:e.duration}):Promise.resolve(!1)},zoomTo:function(e,t){var r=n.getState().panZoom;return r?r.scaleTo(e,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},getZoom:function(){return n.getState().transform[2]},setViewport:function(e,t){return v(void 0,void 0,void 0,(function(){var r,o,i,u,a,c,l,s,f;return p(this,(function(d){switch(d.label){case 0:return r=n.getState(),o=y(r.transform,3),i=o[0],u=o[1],a=o[2],(c=r.panZoom)?[4,c.setViewport({x:null!==(l=e.x)&&void 0!==l?l:i,y:null!==(s=e.y)&&void 0!==s?s:u,zoom:null!==(f=e.zoom)&&void 0!==f?f:a},{duration:null==t?void 0:t.duration})]:[2,Promise.resolve(!1)];case 1:return d.sent(),[2,Promise.resolve(!0)]}}))}))},getViewport:function(){var e=y(n.getState().transform,3);return{x:e[0],y:e[1],zoom:e[2]}},fitView:function(e){var t=n.getState(),r=t.nodeLookup,o=t.minZoom,i=t.maxZoom,u=t.panZoom,a=t.domNode;if(!u||!a)return Promise.resolve(!1);var c=function(n,e){var t=new Map,r=(null==e?void 0:e.nodes)?new Set(e.nodes.map((function(n){return n.id}))):null;return n.forEach((function(n){!n.measured.width||!n.measured.height||!(null==e?void 0:e.includeHiddenNodes)&&n.hidden||r&&!r.has(n.id)||t.set(n.id,n)})),t}(r,e),l=rp(a);return Vb({nodes:c,width:l.width,height:l.height,minZoom:o,maxZoom:i,panZoom:u},e)},setCenter:function(e,t,r){return v(void 0,void 0,void 0,(function(){var o,i,u,a,c,l,s,f;return p(this,(function(d){switch(d.label){case 0:return o=n.getState(),i=o.width,u=o.height,a=o.maxZoom,c=o.panZoom,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:a,s=i/2-e*l,f=u/2-t*l,c?[4,c.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})]:[2,Promise.resolve(!1)];case 1:return d.sent(),[2,Promise.resolve(!0)]}}))}))},fitBounds:function(e,t){return v(void 0,void 0,void 0,(function(){var r,o,i,u,a,c,l,s;return p(this,(function(f){switch(f.label){case 0:return r=n.getState(),o=r.width,i=r.height,u=r.minZoom,a=r.maxZoom,c=r.panZoom,l=db(e,o,i,u,a,null!==(s=null==t?void 0:t.padding)&&void 0!==s?s:.1),c?[4,c.setViewport(l,{duration:null==t?void 0:t.duration})]:[2,Promise.resolve(!1)];case 1:return f.sent(),[2,Promise.resolve(!0)]}}))}))},screenToFlowPosition:function(e,t){var r,o;void 0===t&&(t={});var i=n.getState(),u=i.transform,a=i.snapGrid,c=i.snapToGrid,l=i.domNode;if(!l)return e;var s=l.getBoundingClientRect(),f=s.x,d=s.y,h={x:e.x-f,y:e.y-d},v=null!==(r=t.snapGrid)&&void 0!==r?r:a,p=null!==(o=t.snapToGrid)&&void 0!==o?o:c;return tb(h,u,p,v)},flowToScreenPosition:function(e){var t=n.getState(),r=t.transform,o=t.domNode;if(!o)return e;var i=o.getBoundingClientRect(),u=i.x,a=i.y,c=function(n,e){var t=n.x,r=n.y,o=y(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}}(e,r);return{x:c.x+u,y:c.y+a}}}}),[])},Wb=function(n){return!!n.panZoom};function Fb(){var n=this,e=Zb(),o=$x(),i=function(){var n=t(Tb);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),u=Ux(Wb);a((function(){window.inkFlowStoreState=o.getState()}),[o]);var c=r((function(){var e=function(n){return o.getState().nodeLookup.get(n)},t=function(n){i.nodeQueue.push(n)},r=function(n){var e,t,r,i,u=o.getState(),a=u.nodeLookup,c=u.nodeOrigin,l=vb(n)?n:a.get(n.id),s=l.parentId?gb(l.position,l.parentId,a,c):l.position,f={id:l.id,position:s,width:null!==(t=null===(e=l.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:l.width,height:null!==(i=null===(r=l.measured)||void 0===r?void 0:r.height)&&void 0!==i?i:l.height,data:l.data};return rb(f)},u=function(n,e,r){void 0===r&&(r={replace:!1}),t((function(t){return t.map((function(t){if(t.id===n){var o="function"==typeof e?e(t):e;return r.replace&&vb(o)?o:d(d({},t),o)}return t}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var t;return null===(t=e(n))||void 0===t?void 0:t.internals.userNode},getInternalNode:e,getEdges:function(){var n=o.getState().edges;return(void 0===n?[]:n).map((function(n){return d({},n)}))},getEdge:function(n){return o.getState().edgeLookup.get(n)},setNodes:t,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var e=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return m(m([],y(n),!1),y(e),!1)}))},addEdges:function(n){var e=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return m(m([],y(n),!1),y(e),!1)}))},toObject:function(){var n=o.getState(),e=n.nodes,t=void 0===e?[]:e,r=n.edges,i=void 0===r?[]:r,u=y(n.transform,3),a=u[0],c=u[1],l=u[2];return{nodes:t.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:a,y:c,zoom:l}}},deleteElements:function(e){return v(n,[e],void 0,(function(n){var e,t,r,i,u,a,c,l,s,f,d,h,v=n.nodes,g=void 0===v?[]:v,y=n.edges,m=void 0===y?[]:y;return p(this,(function(n){switch(n.label){case 0:return e=o.getState(),t=e.nodes,r=e.edges,i=e.onNodesDelete,u=e.onEdgesDelete,a=e.onDelete,c=e.onBeforeDelete,[4,Xb({nodesToRemove:g,edgesToRemove:m,nodes:t,edges:r,onBeforeDelete:c})];case 1:return l=n.sent(),s=l.nodes,f=l.edges,d=f.length>0,h=s.length>0,d&&(null==u||u(f)),h&&(null==i||i(s)),(h||d)&&(null==a||a({nodes:s,edges:f})),[2,{deletedNodes:s,deletedEdges:f}]}}))}))},getIntersectingNodes:function(n,e,t){void 0===e&&(e=!0);var i=yb(n),u=i?n:r(n),a=void 0!==t;return u?(t||o.getState().nodes).filter((function(t){var r=o.getState().nodeLookup.get(t.id);if(r&&!i&&(t.id===n.id||!r.internals.positionAbsolute))return!1;var c=rb(a?t:r),l=sb(c,u);return e&&l>0||l>=u.width*u.height})):[]},isNodeIntersecting:function(n,e,t){void 0===t&&(t=!0);var o=yb(n)?n:r(n);if(!o)return!1;var i=sb(o,e);return t&&i>0||i>=o.width*o.height},updateNode:u,updateNodeData:function(n,e,t){void 0===t&&(t={replace:!1}),u(n,(function(n){var r="function"==typeof e?e(n):e;return t.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),t)},setLayoutAnchorId:function(n){o.getState().setLayoutAnchorId(n)}}}),[]);return r((function(){return d(d(d({},c),e),{viewportInitialized:u})}),[u])}var Ub=function(n){return n.selected},$b={actInsideInputWithModifier:!1};var Gb=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function qb(){var n=Ux(Gb,Cb),e=n.userSelectionActive,t=n.userSelectionRect;return e&&t?k.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 Kb=function(n,e){return function(t){t.target===e.current&&(null==n||n(t))}},Qb=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function Jb(n){var e=n.isSelecting,t=n.selectionKeyPressed,r=n.selectionMode,o=void 0===r?tp.Full:r,i=n.selectionOnDrag,a=n.panOnDrag,c=n.onSelectionStart,l=n.onSelectionEnd,s=n.onPaneClick,f=n.onPaneContextMenu,d=n.onPaneScroll,h=n.onPaneMouseEnter,v=n.onPaneMouseMove,p=n.onPaneMouseLeave,m=n.children,w=u(null),x=$x(),b=u(0),_=u(0),E=u(),S=u(new Map),C=Ux(Qb,Cb),N=C.userSelectionActive,M=C.elementsSelectable,O=C.dragging,j=M&&(e||N),I=u(!1),A=u(!1),z=function(n){I.current?I.current=!1:(null==s||s(n),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1}))},L=d?function(n){return d(n)}:void 0,R=!0===a||Array.isArray(a)&&a.includes(0);return k.jsxs("div",{className:P(["ink-flow__pane",{draggable:R,dragging:O,selection:e}]),onClick:j?void 0:Kb(z,w),onContextMenu:Kb((function(n){Array.isArray(a)&&(null==a?void 0:a.includes(2))?n.preventDefault():null==f||f(n)}),w),onWheel:Kb(L,w),onPointerEnter:j?void 0:h,onPointerDown:j?function(n){var t,r,o,i,u,a,l=x.getState(),s=l.resetSelectedElements,f=l.domNode,d=l.edgeLookup;if(E.current=null==f?void 0:f.getBoundingClientRect(),M&&e&&0===n.button&&n.target===w.current&&E.current){null===(i=null===(o=n.target)||void 0===o?void 0:o.setPointerCapture)||void 0===i||i.call(o,n.pointerId),A.current=!0,I.current=!1,S.current=new Map;try{for(var h=g(d),v=h.next();!v.done;v=h.next()){var p=y(v.value,2),m=p[0],b=p[1];S.current.set(b.source,(null===(u=S.current.get(b.source))||void 0===u?void 0:u.add(m))||new Set([m])),S.current.set(b.target,(null===(a=S.current.get(b.target))||void 0===a?void 0:a.add(m))||new Set([m]))}}catch(n){t={error:n}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}var _=bb(n.nativeEvent,E.current),k=_.x,C=_.y;s(),x.setState({userSelectionRect:{width:0,height:0,startX:k,startY:C,x:k,y:C}}),null==c||c(n)}}:v,onPointerMove:j?function(n){var e,t,r,i,u=x.getState(),a=u.userSelectionRect,c=u.edgeLookup,l=u.transform,s=u.nodeLookup,f=u.triggerNodeChanges,d=u.triggerEdgeChanges;if(E.current&&a){I.current=!0;var h=bb(n.nativeEvent,E.current),v=h.x,p=h.y,y=a.startX,m=a.startY,w={startX:y,startY:m,x:v<y?v:y,y:p<m?p:m,width:Math.abs(v-y),height:Math.abs(p-m)},k=Hb(s,w,l,o===tp.Partial,!0),C=new Set,N=new Set;try{for(var M=g(k),O=M.next();!O.done;O=M.next()){var P=O.value;N.add(P.id);var j=S.current.get(P.id);if(j)try{for(var A=(r=void 0,g(j)),z=A.next();!z.done;z=A.next()){var L=z.value;C.add(L)}}catch(n){r={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(r)throw r.error}}}}catch(n){e={error:n}}finally{try{O&&!O.done&&(t=M.return)&&t.call(M)}finally{if(e)throw e.error}}if(b.current!==N.size)b.current=N.size,f(Lb(s,N,!0));if(_.current!==C.size)_.current=C.size,d(Lb(c,C));x.setState({userSelectionRect:w,userSelectionActive:!0,nodesSelectionActive:!1})}}:v,onPointerUp:j?function(n){var e,r;if(0===n.button&&A.current){null===(r=null===(e=n.target)||void 0===e?void 0:e.releasePointerCapture)||void 0===r||r.call(e,n.pointerId);var o=x.getState().userSelectionRect;!N&&o&&n.target===w.current&&(null==z||z(n)),b.current>0&&x.setState({nodesSelectionActive:!0}),x.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,_.current=0,null==l||l(n),(t||i)&&(I.current=!1),A.current=!1}}:void 0,onPointerLeave:p,ref:w,style:Nb,children:[m,k.jsx(qb,{})]})}var n_=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function e_(n){var e=n.children,t=n.onPaneClick,r=n.onPaneMouseEnter,o=n.onPaneMouseMove,i=n.onPaneMouseLeave,u=n.onPaneContextMenu,c=n.onPaneScroll,l=n.deleteKeyCode,s=n.selectionKeyCode,f=n.selectionOnDrag,d=n.selectionMode,h=n.onSelectionStart,v=n.onSelectionEnd,p=n.multiSelectionKeyCode,g=n.panActivationKeyCode,y=n.zoomActivationKeyCode,m=n.elementsSelectable,w=n.zoomOnScroll,x=n.zoomOnPinch,b=n.panOnScroll,_=n.panOnScrollSpeed,E=n.panOnScrollMode,S=n.zoomOnDoubleClick,C=n.panOnDrag,N=n.defaultViewport,M=n.translateExtent,O=n.minZoom,P=n.maxZoom,j=n.preventScrolling;n.onSelectionContextMenu;var I=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,L=n.isControlledViewport,R=n.paneClickDistance,T=n.nodeClickDistance,D=Ux(n_);D.nodesSelectionActive;var B=D.userSelectionActive,H=Eb(s),V=Eb(g),Y=V||C,X=V||b,Z=H||B||f&&!0!==Y;return function(n){var e=n.deleteKeyCode,t=n.multiSelectionKeyCode,r=$x(),o=Fb().deleteElements,i=Eb(e,$b),u=Eb(t);a((function(){if(i){var n=r.getState(),e=n.edgeLookup,t=n.nodeLookup;o({nodes:Array.from(t.values()).filter(Ub),edges:Array.from(e.values()).filter(Ub)}),r.setState({nodesSelectionActive:!1})}}),[i]),a((function(){r.setState({multiSelectionActive:u})}),[u])}({deleteKeyCode:l,multiSelectionKeyCode:p}),k.jsx(Ob,{onPaneContextMenu:u,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:X,panOnScrollSpeed:_,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!H&&Y,defaultViewport:N,translateExtent:M,minZoom:O,maxZoom:P,zoomActivationKeyCode:y,preventScrolling:j,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:L,paneClickDistance:R,nodeClickDistance:T,children:k.jsx(Jb,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:Y,isSelecting:!!Z,selectionMode:d,selectionKeyPressed:H,children:e})})}e_.displayName="FlowRenderer";var t_=s(e_);function r_(n){var e=y(i(n),2);return[e[0],e[1]]}function o_(n){var e=y(i(n),2);return[e[0],e[1]]}function i_(){var n=Ux(l((function(n){var e,t;if(!n.width||!n.height)return[];if(n.autoLayout&&!n.layoutComplete)return[];var r=y(n.transform,3),o=r[0],i=r[1],u=r[2],a=tb({x:0,y:0},[o,i,u]),c={x:a.x,y:a.y,width:n.width/u,height:n.height/u},l=[];try{for(var s=g(n.nodeLookup.values()),f=s.next();!f.done;f=s.next()){var d=f.value;fb(d,c)&&l.push(d.internals.userNode)}}catch(n){e={error:n}}finally{try{f&&!f.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return l}),[]),Cb);return n}function u_(n){var e=Ux(l((function(e){if(!e.width||!e.height)return!1;if(e.autoLayout&&!e.layoutComplete)return!1;var t=e.nodeLookup.get(n);if(!t)return!1;var r=y(e.transform,3),o=r[0],i=r[1],u=r[2],a=tb({x:0,y:0},[o,i,u]);return fb(t,{x:a.x,y:a.y,width:e.width/u,height:e.height/u})}),[n]));return e}var a_=function(n){return n.updateNodeInternals};function c_(n){var e=Ux(l(function(n){return function(e){return n?Hb(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())}}(n),[n]),Cb);return e}var l_=e(null),s_=l_.Provider;l_.Consumer;var f_=function(){return t(l_)};function d_(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 h_(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function v_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case lp.Left:return[t-h_(t-o,u),r];case lp.Right:return[t+h_(o-t,u),r];case lp.Top:return[t,r-h_(r-i,u)];case lp.Bottom:return[t,r+h_(i-r,u)]}}function p_(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 g_(n){var e=n.sourceNode,t=n.targetNode,r=n.width,o=n.height,i=n.transform,u=ob(ab(e),ab(t));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);var a={x:-i[0]/i[2],y:-i[1]/i[2],width:r/i[2],height:o/i[2]};return sb(a,ub(u))>0}var y_,m_=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 w_=((y_={})[lp.Left]={x:-1,y:0},y_[lp.Right]={x:1,y:0},y_[lp.Top]={x:0,y:-1},y_[lp.Bottom]={x:0,y:1},y_),x_=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function b_(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?lp.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?lp.Top:l,f=n.center,d=n.offset,h=w_[a],v=w_[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},w=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?lp.Bottom:t,o=n.target;return r===lp.Left||r===lp.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}),x=0!==w.x?"x":"y",b=w[x],_=[],E={x:0,y:0},S={x:0,y:0},k=y(p_({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),C=k[0],N=k[1],M=k[2],O=k[3];if(h[x]*v[x]==-1){r=null!==(e=f.x)&&void 0!==e?e:C,o=null!==(t=f.y)&&void 0!==t?t:N;var P=[{x:r,y:p.y},{x:r,y:g.y}],j=[{x:p.x,y:o},{x:g.x,y:o}];_=h[x]===b?"x"===x?P:j:"x"===x?j:P}else{var I=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(_="x"===x?h.x===b?A:I:h.y===b?I:A,a===s){var z=Math.abs(i[x]-c[x]);if(z<=d){var L=Math.min(d-1,d-z);h[x]===b?E[x]=(p[x]>i[x]?-1:1)*L:S[x]=(g[x]>c[x]?-1:1)*L}}if(a!==s){var R="x"===x?"y":"x",T=h[x]===v[R],D=p[R]>g[R],B=p[R]<g[R];(1===h[x]&&(!T&&D||T&&B)||1!==h[x]&&(!T&&B||T&&D))&&(_="x"===x?I:A)}var H={x:p.x+E.x,y:p.y+E.y},V={x:g.x+S.x,y:g.y+S.y};Math.max(Math.abs(H.x-_[0].x),Math.abs(V.x-_[0].x))>=Math.max(Math.abs(H.y-_[0].y),Math.abs(V.y-_[0].y))?(r=(H.x+V.x)/2,o=_[0].y):(r=_[0].x,o=(H.y+V.y)/2)}return[m(m([i,{x:p.x+E.x,y:p.y+E.y}],y(_),!1),[{x:g.x+S.x,y:g.y+S.y},c],!1),r,o,M,O]}function __(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=y(b_({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],m=v[2],w=v[3],x=v[4],b=p.reduce((function(n,e,t){var r="";return r=t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(x_(n,e)/2,x_(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),n+=r}),"");return[b,g,m,w,x]}var E_=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var S_=s(lb((function(n,e){var t,r,o=n.type,i=void 0===o?"source":o,u=n.position,a=void 0===u?lp.Top:u,c=n.isValidConnection,l=n.isConnectable,s=void 0===l||l,f=n.isConnectableStart,v=void 0===f||f,p=n.isConnectableEnd,g=void 0===p||p,y=n.id,m=n.onConnect,w=n.children,x=n.className,b=n.onMouseDown,_=n.onTouchStart,E=h(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),S=y||null,C="target"===i,N=$x(),M=f_(),O=Ux(E_,Cb),j=O.connectOnClick,I=O.noPanClassName,A=O.rfId,z=Ux(function(n,e,t){return function(r){var o=r.connectionClickStartHandle,i=r.connectionMode,u=r.connection,a=u.fromHandle,c=u.toHandle,l=u.isValid,s=(null==c?void 0:c.nodeId)===n&&(null==c?void 0:c.id)===e&&(null==c?void 0:c.type)===t;return{connectingFrom:(null==a?void 0:a.nodeId)===n&&(null==a?void 0:a.id)===e&&(null==a?void 0:a.type)===t,connectingTo:s,clickConnecting:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.id)===e&&(null==o?void 0:o.type)===t,isPossibleEndHandle:i===np.Strict?(null==a?void 0:a.type)!==t:n!==(null==a?void 0:a.nodeId)||e!==(null==a?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:s&&l}}}(M,S,i),Cb),L=z.connectingFrom,R=z.connectingTo,T=z.clickConnecting,D=z.isPossibleEndHandle,B=z.connectionInProcess,H=z.clickConnectionInProcess,V=z.valid;M||null===(r=(t=N.getState()).onError)||void 0===r||r.call(t,"010",wv.error010());var Y=function(n){var e=N.getState(),t=e.defaultEdgeOptions,r=e.onConnect,o=e.hasDefaultEdges,i=d(d({},t),n);if(o){var u=N.getState(),a=u.edges;(0,u.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))}))}(t="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:m_(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):(wv.error006(),e);var t,r}(i,a))}null==r||r(i),null==m||m(i)},X=function(n){if(M){var e=xb(n.nativeEvent);if(v&&(e&&0===n.button||!e)){var t=N.getState();Sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:C,handleId:S,nodeId:M,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:Y,isValidConnection:c||t.isValidConnection,getTransform:function(){return N.getState().transform},getFromHandle:function(){return N.getState().connection.fromHandle},autoPanSpeed:t.autoPanSpeed})}e?null==b||b(n):null==_||_(n)}};return k.jsx("div",d({"data-handleid":S,"data-nodeid":M,"data-handlepos":a,"data-id":"".concat(A,"-").concat(M,"-").concat(S,"-").concat(i),className:P(["ink-flow__handle","ink-flow__handle-".concat(a),"nodrag",I,x,{source:!C,target:C,connectable:s,connectablestart:v,connectableend:g,clickconnecting:T,connectingfrom:L,connectingto:R,valid:V,connectionindicator:s&&(!B||D)&&(B||H?g:v)}]),onMouseDown:X,onTouchStart:X,onClick:j?function(n){var e=N.getState(),t=e.onClickConnectStart,r=e.onClickConnectEnd,o=e.connectionClickStartHandle,u=e.connectionMode,a=e.isValidConnection,l=e.lib,s=e.rfId,f=e.nodeLookup,d=e.connection;if(M&&(o||v)){if(!o)return null==t||t(n.nativeEvent,{nodeId:M,handleId:S,handleType:i}),void N.setState({connectionClickStartHandle:{nodeId:M,type:i,id:S}});var h=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),p=c||a,g=Sm.isValid(n.nativeEvent,{handle:{nodeId:M,id:S,type:i},connectionMode:u,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:p,flowId:s,doc:h,lib:l,nodeLookup:f}),y=g.connection;g.isValid&&y&&Y(y);var m=structuredClone(d);delete m.inProgress,m.toPosition=m.toHandle?m.toHandle.position:null,null==r||r(n,m),N.setState({connectionClickStartHandle:null})}}:void 0,ref:e},E,{children:w}))})));var k_={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},C_={input:function(n){var e=n.data,t=n.isConnectable,r=n.sourcePosition,o=void 0===r?lp.Bottom:r;return k.jsxs(k.Fragment,{children:[null==e?void 0:e.label,k.jsx(S_,{type:"source",position:o,isConnectable:t})]})},default:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?lp.Top:r,i=n.sourcePosition,u=void 0===i?lp.Bottom:i;return k.jsxs(k.Fragment,{children:[k.jsx(S_,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label,k.jsx(S_,{type:"source",position:u,isConnectable:t})]})},output:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?lp.Top:r;return k.jsxs(k.Fragment,{children:[k.jsx(S_,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};function N_(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",wv.error012(e))}function M_(n){var e,t,r=n.id,o=n.onClick,c=n.onMouseEnter,s=n.onMouseMove,f=n.onMouseLeave,h=n.onContextMenu,v=n.onDoubleClick,p=n.nodesDraggable,m=n.elementsSelectable,w=n.nodesConnectable,x=n.nodesFocusable,b=n.resizeObserver,_=n.noDragClassName,E=n.noPanClassName,S=n.disableKeyboardA11y,C=n.rfId,N=n.nodeTypes,M=n.nodeExtent,O=n.nodeOrigin,j=n.onError,I=Ux((function(n){var e=n.nodeLookup.get(r),t=n.parentLookup.has(r);return{node:e,internals:e.internals,isParent:t}}),Cb),A=I.node,z=I.internals,L=I.isParent,R=A.type||"default",T=(null==N?void 0:N[R])||C_[R];void 0===T&&(null==j||j("003",wv.error003(R)),R="default",T=C_.default);var D=!!(A.draggable||p&&void 0===A.draggable),B=!!(A.selectable||m&&void 0===A.selectable),H=!!(A.connectable||w&&void 0===A.connectable),V=!!(A.focusable||x&&void 0===A.focusable),Y=$x(),X=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)}(A),Z=function(n){var e=n.node,t=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=$x(),c=u(null),l=u(null),s=u(e.sourcePosition),f=u(e.targetPosition),d=u(t),h=r&&!!e.internals.handleBounds&&!e.hidden;return a((function(){!c.current||h&&l.current===c.current||(l.current&&(null==o||o.unobserve(l.current)),null==o||o.observe(c.current),l.current=c.current)}),[h]),a((function(){return function(){l.current&&(null==o||o.unobserve(l.current),l.current=null)}}),[]),a((function(){if(c.current){var n=d.current!==t,r=s.current!==e.sourcePosition,o=f.current!==e.targetPosition;(n||r||o)&&(d.current=t,s.current=e.sourcePosition,f.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}}),[e.id,t,e.sourcePosition,e.targetPosition]),c}({node:A,nodeType:R,hasDimensions:X,resizeObserver:b}),W=function(n){var e=n.nodeRef,t=n.disabled,r=void 0!==t&&t,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,f=$x(),d=y(i(!1),2),h=d[0],v=d[1],p=u();return a((function(){p.current=mm({getStoreItems:function(){return f.getState()},onNodeMouseDown:function(n){N_({id:n,store:f,nodeRef:e})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),a((function(){var n,t;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(e.current)return null===(t=p.current)||void 0===t||t.update({noDragClassName:o,handleSelector:c,domNode:e.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,e,l]),h}({nodeRef:Z,disabled:A.hidden||!D,noDragClassName:_,handleSelector:A.dragHandle,nodeId:r,isSelectable:B}),F=function(){var n=$x(),e=l((function(e){var t,r,o=n.getState(),i=o.nodeExtent,u=o.snapToGrid,a=o.snapGrid,c=o.nodesDraggable,l=o.onError,s=o.updateNodePositions,f=o.nodeLookup,d=o.nodeOrigin,h=new Map,v=function(n){return function(e){return e.selected&&(e.draggable||n&&void 0===e.draggable)}}(c),p=u?a[0]:5,m=u?a[1]:5,w=e.direction.x*p*e.factor,x=e.direction.y*m*e.factor;try{for(var b=g(f),_=b.next();!_.done;_=b.next()){var E=y(_.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+x};u&&(S=eb(S,a));var k=Yb({nodeId:E.id,nextPosition:S,nodeLookup:f,nodeExtent:i,nodeOrigin:d,onError:l}),C=k.position,N=k.positionAbsolute;E.position=C,E.internals.positionAbsolute=N,h.set(E.id,E)}}}catch(n){t={error:n}}finally{try{_&&!_.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}s(h)}),[]);return e}();if(A.hidden)return null;var U=Jx(A),$=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}}(A),G=(M?Qx(z.positionAbsolute,M):z.positionAbsolute)||{x:0,y:0},q=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]}}(d(d(d({},G),U),{origin:A.origin||O})),K=B||D||o||c||s||f,Q=c?function(n){return c(n,d({},z.userNode))}:void 0,J=s?function(n){return s(n,d({},z.userNode))}:void 0,nn=f?function(n){return f(n,d({},z.userNode))}:void 0,en=h?function(n){return h(n,d({},z.userNode))}:void 0,tn=v?function(n){return v(n,d({},z.userNode))}:void 0;return k.jsx("div",{className:P(["ink-flow__node","ink-flow__node-".concat(R),(e={},e[E]=D,e),A.className,{selected:A.selected,selectable:B,parent:L,draggable:D,dragging:W}]),ref:Z,style:d(d({zIndex:z.z,transform:"translate(".concat(q.x,"px,").concat(q.y,"px)"),pointerEvents:K?"all":"none",visibility:X?"visible":"hidden"},A.style),$),"data-id":r,"data-testid":"rf__node-".concat(r),onMouseEnter:Q,onMouseMove:J,onMouseLeave:nn,onContextMenu:en,onClick:function(n){var e=Y.getState(),t=e.selectNodesOnDrag,i=e.nodeDragThreshold;B&&(!t||!D||i>0)&&N_({id:r,store:Y,nodeRef:Z}),o&&o(n,d({},z.userNode))},onDoubleClick:tn,onKeyDown:V?function(n){if(!wb(n.nativeEvent)&&!S)if(bv.includes(n.key)&&B){var e="Escape"===n.key;N_({id:r,store:Y,unselect:e,nodeRef:Z})}else D&&A.selected&&Object.prototype.hasOwnProperty.call(k_,n.key)&&(Y.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~G.x,", y: ").concat(~~G.y)}),F({direction:k_[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:V?0:void 0,role:V?"button":void 0,"aria-describedby":S?void 0:"".concat("ink-flow__node-desc","-").concat(C),"aria-label":A.ariaLabel,children:k.jsx(s_,{value:r,children:k.jsx(T,d({id:r,data:A.data,type:R,positionAbsoluteX:G.x,positionAbsoluteY:G.y,selected:A.selected,isConnectable:H,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:W,draggable:D,dragHandle:A.dragHandle,zIndex:z.z,selectable:B,deletable:null===(t=A.deletable)||void 0===t||t},U))})})}var O_=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function P_(n){var e=Ux(O_,Cb),t=e.nodesDraggable,r=e.nodesConnectable,o=e.nodesFocusable,u=e.elementsSelectable,c=e.onError,l=c_(!1),s=function(){var n=Ux(a_),e=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(e){var t=new Map;e.forEach((function(n){var e=n.target.getAttribute("data-id");t.set(e,{id:e,nodeElement:n.target})})),n(t)}))})),1),t=e[0];return a((function(){return function(){null==t||t.disconnect()}}),[t]),t}();return k.jsx("div",{className:"ink-flow__nodes",style:Nb,children:l.map((function(e){return k.jsx(M_,{id:e,nodeTypes:n.nodeTypes,nodeOrigin:n.nodeOrigin,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:u,onError:c},e)}))})}P_.displayName="NodeRenderer";var j_,I_=s(P_),A_=((j_={})[ap.Arrow]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},j_[ap.ArrowClosed]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},j_);function z_(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 L_=function(n){var e=n.id,t=n.type,o=n.color,i=n.width,u=void 0===i?12.5:i,a=n.height,c=void 0===a?12.5:a,l=n.markerUnits,s=void 0===l?"strokeWidth":l,f=n.strokeWidth,d=n.orient,h=void 0===d?"auto-start-reverse":d,v=function(n){var e=$x(),t=r((function(){var t,r;return Object.prototype.hasOwnProperty.call(A_,n)?A_[n]:(null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"009",wv.error009(n)),null)}),[n]);return t}(t);return v?k.jsx("marker",{className:"ink-flow__arrowhead",id:e,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:k.jsx(v,{color:o,strokeWidth:f})}):null},R_=function(n){var e=n.defaultColor,t=n.rfId,o=Ux((function(n){return n.edges})),i=Ux((function(n){return n.defaultEdgeOptions})),u=r((function(){var n=function(n,e){var t=e.id,r=e.defaultColor,o=e.defaultMarkerStart,i=e.defaultMarkerEnd,u=new Set;return n.reduce((function(n,e){return[e.markerStart||o,e.markerEnd||i].forEach((function(e){if(e&&"object"==typeof e){var o=z_(e,t);u.has(o)||(n.push(d({id:o,color:e.color||r},e)),u.add(o))}})),n}),[]).sort((function(n,e){return n.id.localeCompare(e.id)}))}(o,{id:t,defaultColor:e,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,t,e]);return u.length?k.jsx("svg",{className:"ink-flow__marker",children:k.jsx("defs",{children:u.map((function(n){return k.jsx(L_,{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};R_.displayName="MarkerDefinitions";var T_=s(R_);function D_(n){var e=n.x,t=n.y,r=n.label,o=n.labelStyle,u=void 0===o?{}:o,a=n.labelShowBg,c=void 0===a||a,s=n.labelBgStyle,f=void 0===s?{}:s,v=n.labelBgPadding,p=void 0===v?[2,4]:v,g=n.labelBgBorderRadius,m=void 0===g?2:g,w=n.children,x=n.className,b=h(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),_=y(i({x:1,y:0,width:0,height:0}),2),E=_[0],S=_[1],C=P(["ink-flow__edge-textwrapper",x]),N=l((function(n){if(null!==n){var e=n.getBBox();S({x:e.x,y:e.y,width:e.width,height:e.height})}}),[]);return void 0!==r&&r?k.jsxs("g",d({transform:"translate(".concat(e-E.width/2," ").concat(t-E.height/2,")"),className:C,visibility:E.width?"visible":"hidden"},b,{children:[c&&k.jsx("rect",{width:E.width+2*p[0],x:-p[0],y:-p[1],height:E.height+2*p[1],className:"ink-flow__edge-textbg",style:f,rx:m,ry:m}),k.jsx("text",{className:"ink-flow__edge-text",y:E.height/2,dy:"0.3em",ref:N,style:u,children:r}),w]})):null}D_.displayName="EdgeText";var B_=s(D_);function H_(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,p=n.interactionWidth,g=void 0===p?20:p;return k.jsxs(k.Fragment,{children:[k.jsx("path",{id:e,style:f,d:t,fill:"none",className:P(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),g&&k.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&nb(r)&&nb(o)?k.jsx(B_,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function V_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2;return e===lp.Left||e===lp.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function Y_(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=y(V_({pos:o,x1:e,y1:t,x2:i,y2:u}),2),s=l[0],f=l[1],d=y(V_({pos:c,x1:i,y1:u,x2:e,y2:t}),2),h=d[0],v=d[1],p=y(d_({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:s,sourceControlY:f,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],x=p[3];return["M".concat(e,",").concat(t," C").concat(s,",").concat(f," ").concat(h,",").concat(v," ").concat(i,",").concat(u),g,m,w,x]}function X_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.sourcePosition,c=void 0===a?lp.Bottom:a,l=e.targetPosition,s=void 0===l?lp.Top:l,f=e.label,d=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,g=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,x=e.markerStart,b=e.interactionWidth,_=y(Y_({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s}),3),E=_[0],S=_[1],C=_[2],N=n.isInternal?void 0:t;return k.jsx(H_,{id:N,path:E,labelX:S,labelY:C,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:x,interactionWidth:b})}))}var Z_=X_({isInternal:!1}),W_=X_({isInternal:!0});function F_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,f=e.labelBgPadding,d=e.labelBgBorderRadius,h=e.style,v=e.sourcePosition,p=void 0===v?lp.Bottom:v,g=e.targetPosition,m=void 0===g?lp.Top:g,w=e.markerEnd,x=e.markerStart,b=e.pathOptions,_=e.interactionWidth,E=y(__({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:u,targetPosition:m,borderRadius:null==b?void 0:b.borderRadius,offset:null==b?void 0:b.offset}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:t;return k.jsx(H_,{id:M,path:S,labelX:C,labelY:N,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:w,markerStart:x,interactionWidth:_})}))}Z_.displayName="SimpleBezierEdge",W_.displayName="SimpleBezierEdgeInternal";var U_=F_({isInternal:!1}),$_=F_({isInternal:!0});function G_(n){return s((function(e){var t,o=e.id,i=h(e,["id"]),u=n.isInternal?void 0:o;return k.jsx(U_,d({},i,{id:u,pathOptions:r((function(){var n;return{borderRadius:0,offset:null===(n=i.pathOptions)||void 0===n?void 0:n.offset}}),[null===(t=i.pathOptions)||void 0===t?void 0:t.offset])}))}))}U_.displayName="SmoothStepEdge",$_.displayName="SmoothStepEdgeInternal";var q_=G_({isInternal:!1}),K_=G_({isInternal:!0});function Q_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,f=e.labelBgPadding,d=e.labelBgBorderRadius,h=e.style,v=e.markerEnd,p=e.markerStart,g=e.interactionWidth,m=y(function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=y(p_({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]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=m[0],x=m[1],b=m[2],_=n.isInternal?void 0:t;return k.jsx(H_,{id:_,path:w,labelX:x,labelY:b,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}q_.displayName="StepEdge",K_.displayName="StepEdgeInternal";var J_=Q_({isInternal:!1}),nE=Q_({isInternal:!0});function eE(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.sourcePosition,c=void 0===a?lp.Bottom:a,l=e.targetPosition,s=void 0===l?lp.Top:l,f=e.label,d=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,g=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,x=e.markerStart,b=e.pathOptions,_=e.interactionWidth,E=y(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.curvature,s=void 0===l?.25:l,f=y(v_({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=y(v_({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],m=y(d_({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],x=m[1],b=m[2],_=m[3];return["M".concat(e,",").concat(t," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),w,x,b,_]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s,curvature:null==b?void 0:b.curvature}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:t;return k.jsx(H_,{id:M,path:S,labelX:C,labelY:N,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:x,interactionWidth:_})}))}J_.displayName="StraightEdge",nE.displayName="StraightEdgeInternal";var tE=eE({isInternal:!1}),rE=eE({isInternal:!0});tE.displayName="BezierEdge",rE.displayName="BezierEdgeInternal";var oE={default:rE,straight:nE,step:K_,smoothstep:$_,simplebezier:W_},iE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},uE=function(n,e,t){return t===lp.Left?n-e:t===lp.Right?n+e:n},aE=function(n,e,t){return t===lp.Top?n-e:t===lp.Bottom?n+e:n},cE="ink-flow__edgeupdater";function lE(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 k.jsx("circle",{onMouseDown:u,onMouseEnter:a,onMouseOut:c,className:P([cE,"".concat(cE,"-").concat(l)]),cx:uE(t,i,e),cy:aE(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function sE(n){var e=n.isReconnectable,t=n.reconnectRadius,r=n.edge,o=n.sourceX,i=n.sourceY,u=n.targetX,a=n.targetY,c=n.sourcePosition,l=n.targetPosition,s=n.onReconnect,f=n.onReconnectStart,d=n.onReconnectEnd,h=n.setReconnecting,v=n.setUpdateHover,p=$x(),g=function(n,e){if(0===n.button){var t=p.getState(),o=t.autoPanOnConnect,i=t.domNode,u=t.isValidConnection,a=t.connectionMode,c=t.connectionRadius,l=t.lib,v=t.onConnectStart,g=t.onConnectEnd,y=t.cancelConnection,m=t.nodeLookup,w=t.rfId,x=t.panBy,b=t.updateConnection,_="target"===e.type;h(!0),null==f||f(n,r,e.type);Sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:o,connectionMode:a,connectionRadius:c,domNode:i,handleId:e.id,nodeId:e.nodeId,nodeLookup:m,isTarget:_,edgeUpdaterType:e.type,lib:l,flowId:w,cancelConnection:y,panBy:x,isValidConnection:u,onConnect:function(n){return null==s?void 0:s(r,n)},onConnectStart:v,onConnectEnd:g,onReconnectEnd:function(n,t){h(!1),null==d||d(n,r,e.type,t)},updateConnection:b,getTransform:function(){return p.getState().transform},getFromHandle:function(){return p.getState().connection.fromHandle}})}},y=function(){return v(!0)},m=function(){return v(!1)};return k.jsxs(k.Fragment,{children:[(!0===e||"source"===e)&&k.jsx(lE,{position:c,centerX:o,centerY:i,radius:t,onMouseDown:function(n){var e;return g(n,{nodeId:r.target,id:null!==(e=r.targetHandle)&&void 0!==e?e:null,type:"target"})},onMouseEnter:y,onMouseOut:m,type:"source"}),(!0===e||"target"===e)&&k.jsx(lE,{position:l,centerX:u,centerY:a,radius:t,onMouseDown:function(n){var e;return g(n,{nodeId:r.source,id:null!==(e=r.sourceHandle)&&void 0!==e?e:null,type:"source"})},onMouseEnter:y,onMouseOut:m,type:"target"})]})}function fE(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 dE(n){var e,t,r,o;if(!n)return null;var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.width=null!==(r=l.width)&&void 0!==r?r:1,l.height=null!==(o=l.height)&&void 0!==o?o:1,"source"===l.type?i.push(l):"target"===l.type&&u.push(l)}}catch(n){e={error:n}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return{source:i,target:u}}function hE(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:Jx(e),c=a.width,l=a.height;switch(n){case lp.Top:return[i+c/2,u];case lp.Right:return[i+c,u+l/2];case lp.Bottom:return[i+c/2,u+l];case lp.Left:return[i,u+l/2]}}function vE(n,e){return n&&(e?n.find((function(n){return n.id===e})):n[0])||null}function pE(n){var e,t=n.id,o=n.edgesFocusable,a=n.edgesReconnectable,c=n.elementsSelectable,s=n.onClick,f=n.onDoubleClick,h=n.onContextMenu,v=n.onMouseEnter,p=n.onMouseMove,g=n.onMouseLeave,m=n.reconnectRadius,w=n.onReconnect,x=n.onReconnectStart,b=n.onReconnectEnd,_=n.rfId,E=n.edgeTypes,S=n.noPanClassName,C=n.onError,N=n.disableKeyboardA11y,M=Ux((function(n){return n.edgeLookup.get(t)})),O=Ux((function(n){return n.defaultEdgeOptions})),j=(M=O?d(d({},O),M):M).type||"default",I=(null==E?void 0:E[j])||oE[j];void 0===I&&(null==C||C("011",wv.error011(j)),j="default",I=oE.default);var A=!!(M.focusable||o&&void 0===M.focusable),z=void 0!==w&&(M.reconnectable||a&&void 0===M.reconnectable),L=!!(M.selectable||c&&void 0===M.selectable),R=u(null),T=y(i(!1),2),D=T[0],B=T[1],H=y(i(!1),2),V=H[0],Y=H[1],X=$x(),Z=Ux(l((function(n){var e=n.nodeLookup.get(M.source),r=n.nodeLookup.get(M.target);if(!e||!r)return d({zIndex:M.zIndex},iE);var o=function(n){var e,t,r,o,i,u=n.sourceNode,a=n.targetNode;if(!fE(u)||!fE(a))return null;var c=u.internals.handleBounds||dE(u.handles),l=a.internals.handleBounds||dE(a.handles),s=vE(null!==(e=null==c?void 0:c.source)&&void 0!==e?e:[],n.sourceHandle),f=vE(n.connectionMode===np.Strict?null!==(t=null==l?void 0:l.target)&&void 0!==t?t:[]:(null!==(r=null==l?void 0:l.target)&&void 0!==r?r:[]).concat(null!==(o=null==l?void 0:l.source)&&void 0!==o?o:[]),n.targetHandle),d=(null==s?void 0:s.position)||lp.Bottom,h=(null==f?void 0:f.position)||lp.Top;if(!s||!f)return null===(i=n.onError)||void 0===i||i.call(n,"008",wv.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=y(hE(d,u,s),2),p=v[0],g=v[1],m=y(hE(h,a,f),2);return{sourceX:p,sourceY:g,targetX:m[0],targetY:m[1],sourcePosition:d,targetPosition:h}}({id:t,sourceNode:e,targetNode:r,sourceHandle:M.sourceHandle||null,targetHandle:M.targetHandle||null,connectionMode:n.connectionMode,onError:C}),i=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:M.selected,zIndex:M.zIndex,sourceNode:e,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||iE)}),[M.source,M.target,M.sourceHandle,M.targetHandle,M.selected,M.zIndex]),Cb),W=Z.zIndex,F=Z.sourceX,U=Z.sourceY,$=Z.targetX,G=Z.targetY,q=Z.sourcePosition,K=Z.targetPosition,Q=r((function(){return M.markerStart?"url('#".concat(z_(M.markerStart,_),"')"):void 0}),[M.markerStart,_]),J=r((function(){return M.markerEnd?"url('#".concat(z_(M.markerEnd,_),"')"):void 0}),[M.markerEnd,_]);if(M.hidden||null===F||null===U||null===$||null===G)return null;var nn=f?function(n){f(n,d({},M))}:void 0,en=h?function(n){h(n,d({},M))}:void 0,tn=v?function(n){v(n,d({},M))}:void 0,rn=p?function(n){p(n,d({},M))}:void 0,on=g?function(n){g(n,d({},M))}:void 0;return k.jsx("svg",{style:{zIndex:W},children:k.jsxs("g",{className:P(["ink-flow__edge","ink-flow__edge-".concat(j),M.className,S,{selected:M.selected,animated:M.animated,inactive:!L&&!s,updating:D,selectable:L}]),onClick:function(n){var e,r=X.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,u=r.multiSelectionActive;L&&(X.setState({nodesSelectionActive:!1}),M.selected&&u?(i({nodes:[],edges:[M]}),null===(e=R.current)||void 0===e||e.blur()):o([t])),s&&s(n,M)},onDoubleClick:nn,onContextMenu:en,onMouseEnter:tn,onMouseMove:rn,onMouseLeave:on,onKeyDown:A?function(n){var e;if(!N&&bv.includes(n.key)&&L){var r=X.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(e=R.current)||void 0===e||e.blur(),o({edges:[M]})):i([t])}}:void 0,tabIndex:A?0:void 0,role:A?"button":"img","data-id":t,"data-testid":"rf__edge-".concat(t),"aria-label":null===M.ariaLabel?void 0:M.ariaLabel||"Edge from ".concat(M.source," to ").concat(M.target),"aria-describedby":A?"".concat("ink-flow__edge-desc","-").concat(_):void 0,ref:R,children:[!V&&k.jsx(I,{id:t,source:M.source,target:M.target,type:M.type,selected:M.selected,animated:M.animated,selectable:L,deletable:null===(e=M.deletable)||void 0===e||e,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,sourceX:F,sourceY:U,targetX:$,targetY:G,sourcePosition:q,targetPosition:K,data:M.data,style:M.style,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerStart:Q,markerEnd:J,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth}),z&&k.jsx(sE,{edge:M,isReconnectable:z,reconnectRadius:m,onReconnect:w,onReconnectStart:x,onReconnectEnd:b,sourceX:F,sourceY:U,targetX:$,targetY:G,sourcePosition:q,targetPosition:K,setUpdateHover:B,setReconnecting:Y})]})})}var gE=function(n){return{edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function yE(n){var e=n.defaultMarkerColor,t=n.onlyRenderVisibleElements,r=n.rfId,o=n.edgeTypes,i=n.noPanClassName,u=n.onReconnect,a=n.onEdgeContextMenu,c=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeClick,h=n.reconnectRadius,v=n.onEdgeDoubleClick,p=n.onReconnectStart,y=n.onReconnectEnd,m=n.disableKeyboardA11y,w=Ux(gE,Cb),x=w.edgesFocusable,b=w.edgesReconnectable,_=w.elementsSelectable,E=w.onError,S=function(n){var e=Ux(l((function(e){var t,r;if(!n)return e.edges.map((function(n){return n.id}));var o=[];if(e.width&&e.height)try{for(var i=g(e.edges),u=i.next();!u.done;u=i.next()){var a=u.value,c=e.nodeLookup.get(a.source),l=e.nodeLookup.get(a.target);c&&l&&g_({sourceNode:c,targetNode:l,width:e.width,height:e.height,transform:e.transform})&&o.push(a.id)}}catch(n){t={error:n}}finally{try{u&&!u.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}),[n]),Cb);return e}(t);return k.jsxs("div",{className:"ink-flow__edges",children:[k.jsx(T_,{defaultColor:e,rfId:r}),S.map((function(n){return k.jsx(pE,{id:n,edgesFocusable:x,edgesReconnectable:b,elementsSelectable:_,noPanClassName:i,onReconnect:u,onContextMenu:a,onMouseEnter:c,onMouseMove:s,onMouseLeave:f,onClick:d,reconnectRadius:h,onDoubleClick:v,onReconnectStart:p,onReconnectEnd:y,rfId:r,onError:E,edgeTypes:o,disableKeyboardA11y:m},n)}))]})}yE.displayName="EdgeRenderer";var mE=s(yE),wE=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function xE(n){var e=n.children,t=Ux(wE);return k.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:e})}function bE(n){return n.connection.inProgress?d(d({},n.connection),{to:Zv(n.connection.to,n.transform)}):d({},n.connection)}function _E(n){return Ux(bE,Cb)}var EE=function(n){var e=n.style,t=n.type,r=void 0===t?up.Bezier:t,o=n.CustomComponent,i=n.isValid,u=_E(),a=u.inProgress,c=u.from,l=u.fromNode,s=u.fromHandle,f=u.fromPosition,h=u.to,v=u.toNode,p=u.toHandle,g=u.toPosition;if(a){if(o)return k.jsx(o,{connectionLineType:r,connectionLineStyle:e,fromNode:l,fromHandle:s,fromX:c.x,fromY:c.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:g,connectionStatus:Qv(i),toNode:v,toHandle:p});var m="",w={sourceX:c.x,sourceY:c.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:g};switch(r){case up.Bezier:m=y(pp(w),1)[0];break;case up.SimpleBezier:m=y(Y_(w),1)[0];break;case up.Step:m=y(kp(d(d({},w),{borderRadius:0})),1)[0];break;case up.SmoothStep:m=y(kp(w),1)[0];break;default:m=y(bp(w),1)[0]}return k.jsx("path",{d:m,fill:"none",className:"ink-flow__connection-path",style:e})}};EE.displayName="ConnectionLine";var SE=function(n){return{nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height}};function kE(n){var e=n.containerStyle,t=n.style,r=n.type,o=n.component,i=Ux(SE,Cb),u=i.nodesConnectable,a=i.width,c=i.height,l=i.isValid,s=i.inProgress;return!!(a&&u&&s)?k.jsx("svg",{style:e,width:a,height:c,className:"ink-flow__connectionline ink-flow__container",children:k.jsx("g",{className:P(["ink-flow__connection",Qv(l)]),children:k.jsx(EE,{style:t,type:r,CustomComponent:o,isValid:l})})}):null}function CE(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,p=n.maxZoom,g=n.noPanClassName,y=n.noDragClassName,m=n.nodeOrigin,w=n.viewport,x=n.disableKeyboardA11y,b=n.translateExtent,_=n.defaultViewport,E=n.nodeTypes,S=n.edgeTypes,C=n.elementsSelectable,N=n.defaultMarkerColor,M=n.connectionLineType,O=n.connectionLineStyle,P=n.connectionLineComponent,j=n.connectionLineContainerStyle,I=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,R=n.onPaneMouseLeave,T=n.onPaneScroll,D=n.panOnDrag,B=n.selectionOnDrag,H=n.selectionMode,V=n.onlyRenderVisibleElements,Y=n.paneClickDistance,X=n.nodeClickDistance,Z=n.onReconnect,W=n.onReconnectStart,F=n.onReconnectEnd,U=n.reconnectRadius,$=n.deleteKeyCode,G=n.selectionKeyCode,q=n.multiSelectionKeyCode,K=n.noWheelClassName;return k.jsx(t_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:x,translateExtent:b,defaultViewport:_,elementsSelectable:C,onPaneClick:I,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:R,onPaneScroll:T,panOnDrag:D,selectionOnDrag:B,selectionMode:H,paneClickDistance:Y,nodeClickDistance:X,deleteKeyCode:$,selectionKeyCode:G,multiSelectionKeyCode:q,noWheelClassName:K,children:k.jsxs(xE,{children:[k.jsx(mE,{edgeTypes:S,onEdgeClick:a,onEdgeDoubleClick:c,onReconnect:Z,onReconnectStart:W,onReconnectEnd:F,onlyRenderVisibleElements:V,onEdgeContextMenu:d,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,reconnectRadius:U,defaultMarkerColor:N,noPanClassName:g,disableKeyboardA11y:x,rfId:h}),k.jsx(kE,{style:O,type:M,component:P,containerStyle:j}),k.jsx("div",{className:"ink-flow__edgelabel-renderer"}),k.jsx(I_,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:e,onNodeDoubleClick:t,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),k.jsx("div",{className:"ink-flow__viewport-portal"})]})})}CE.displayName="GraphView";var NE=s(CE),ME={x:0,y:0,zoom:1},OE={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},PE=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,h=null!==(e=null!=a?a:i)&&void 0!==e?e:[],v=null!==(t=null!=u?u:o)&&void 0!==t?t:[];qx(s,f,h),Op(v,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:v,nodeLookup:c,parentLookup:l,edges:h,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:xv,nodeExtent:xv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:d({},sp),connectionClickStartHandle:null,connectOnClick:!0,connectionMode:np.Strict,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:OE,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"ink",debug:!1}},jE={dagre:zp};function IE(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=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=ab(t,e.nodeOrigin);return ob(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ub(t)}(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})}var AE={exports:{}};
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Lodash <https://lodash.com/>
|
|
@@ -21,5 +21,5 @@ S=C,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,l=128,s=256,f=1/0,d=9007199254740991,h=NaN,v=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",a],["partialRight",c],["rearg",s]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",x="[object Date]",b="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",N="[object Promise]",M="[object RegExp]",O="[object Set]",P="[object String]",j="[object Symbol]",I="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",R="[object Float64Array]",T="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",X="[object Uint32Array]",Z=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(U.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\]$/,wn=/^0o[0-7]+$/i,xn=/^(?: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",Nn="a-z\\xdf-\\xf6\\xf8-\\xff",Mn="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+",Rn="["+Cn+"]",Tn="["+Nn+"]",Dn="[^"+Sn+Pn+Ln+Cn+Nn+Mn+"]",Bn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+Mn+"]",Zn="\\u200d",Wn="(?:"+Tn+"|"+Dn+")",Fn="(?:"+Xn+"|"+Dn+")",Un="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Bn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Zn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Rn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,In].join("|")+")",ne=RegExp(jn,"g"),ee=RegExp(zn,"g"),te=RegExp(Bn+"(?="+Bn+")|"+Jn+Kn,"g"),re=RegExp([Xn+"?"+Tn+"+"+Un+"(?="+[An,Xn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Xn+Wn,"$"].join("|")+")",Xn+"?"+Wn+"+"+Un,Xn+"+"+$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("["+Zn+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[R]=ce[T]=ce[D]=ce[B]=ce[V]=ce[H]=ce[Y]=ce[X]=!0,ce[g]=ce[y]=ce[A]=ce[m]=ce[z]=ce[x]=ce[b]=ce[_]=ce[S]=ce[k]=ce[C]=ce[M]=ce[O]=ce[P]=ce[I]=!1;var le={};le[g]=le[y]=le[A]=le[z]=le[m]=le[x]=le[L]=le[R]=le[T]=le[D]=le[B]=le[S]=le[k]=le[C]=le[M]=le[O]=le[P]=le[j]=le[V]=le[H]=le[Y]=le[X]=!0,le[b]=le[_]=le[I]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,de=parseInt,he="object"==typeof w&&w&&w.Object===Object&&w,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,we=me&&he.process,xe=function(){try{var n=ye&&ye.require&&ye.require("util").types;return n||we&&we.binding&&we.binding("util")}catch(n){}}(),be=xe&&xe.isArrayBuffer,_e=xe&&xe.isDate,Ee=xe&&xe.isMap,Se=xe&&xe.isRegExp,ke=xe&&xe.isSet,Ce=xe&&xe.isTypedArray;function Ne(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 Me(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)&&Xe(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 Re(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}function Te(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 De(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 Be(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=Ue("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 Xe(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,We,t)}function Ze(n,e,t,r){for(var o=t-1,i=n.length;++o<i;)if(r(n[o],e))return o;return-1}function We(n){return n!=n}function Fe(n,e){var t=null==n?0:n.length;return t?qe(n,e)/t:h}function Ue(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&&Xe(e,n[t],0)>-1;);return t}function rt(n,e){for(var t=n.length;t--&&Xe(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 w,an=(e=null==e?pe:yt.defaults(pe.Object(),e,yt.pick(pe,ue))).Array,Sn=e.Date,kn=e.Error,Cn=e.Function,Nn=e.Math,Mn=e.Object,On=e.RegExp,Pn=e.String,jn=e.TypeError,In=an.prototype,An=Cn.prototype,zn=Mn.prototype,Ln=e["__core-js_shared__"],Rn=An.toString,Tn=zn.hasOwnProperty,Dn=0,Bn=(w=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Vn=zn.toString,Hn=Rn.call(Mn),Yn=pe._,Xn=On("^"+Rn.call(Tn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zn=me?e.Buffer:t,Wn=e.Symbol,Fn=e.Uint8Array,Un=Zn?Zn.allocUnsafe:t,$n=lt(Mn.getPrototypeOf,Mn),Gn=Mn.create,qn=zn.propertyIsEnumerable,Kn=In.splice,Qn=Wn?Wn.isConcatSpreadable:t,Jn=Wn?Wn.iterator:t,te=Wn?Wn.toStringTag:t,oe=function(){try{var n=hi(Mn,"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=Nn.ceil,ye=Nn.floor,we=Mn.getOwnPropertySymbols,xe=Zn?Zn.isBuffer:t,Ve=e.isFinite,$e=In.join,mt=lt(Mn.keys,Mn),wt=Nn.max,xt=Nn.min,bt=Sn.now,_t=e.parseInt,Et=Nn.random,St=In.reverse,kt=hi(e,"DataView"),Ct=hi(e,"Map"),Nt=hi(e,"Promise"),Mt=hi(e,"Set"),Ot=hi(e,"WeakMap"),Pt=hi(Mn,"create"),jt=Ot&&new Ot,It={},At=Bi(kt),zt=Bi(Ct),Lt=Bi(Nt),Rt=Bi(Mt),Tt=Bi(Ot),Dt=Wn?Wn.prototype:t,Bt=Dt?Dt.valueOf:t,Vt=Dt?Dt.toString:t;function Ht(n){if(ta(n)&&!Wu(n)&&!(n instanceof Wt)){if(n instanceof Zt)return n;if(Tn.call(n,"__wrapped__"))return Vi(n)}return new Zt(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 Xt(){}function Zt(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=t}function Wt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,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 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 $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 Ut(n);this.size=e.size}function Kt(n,e){var t=Wu(n),r=!t&&Zu(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&&!Tn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||xi(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 Ri(jo(n),cr(e,0,n.length))}function nr(n){return Ri(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];Tn.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:Na(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=Wu(n);if(f){if(a=function(n){var e=n.length,t=new n.constructor(e);e&&"string"==typeof n[0]&&Tn.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==g||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 m:case x: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 R:case T:case D:case B:case V:case H:case Y:case X:return No(n,t);case S:return new r;case k:case P:return new r(n);case M: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,Bt?Mn(Bt.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=Mn(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=Xt.prototype,Ht.prototype.constructor=Ht,Zt.prototype=Yt(Xt.prototype),Zt.prototype.constructor=Zt,Wt.prototype=Yt(Xt.prototype),Wt.prototype.constructor=Wt,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 Tn.call(e,n)?e[n]:t},Ft.prototype.has=function(n){var e=this.__data__;return Pt?e[n]!==t:Tn.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},Ut.prototype.clear=function(){this.__data__=[],this.size=0},Ut.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)},Ut.prototype.get=function(n){var e=this.__data__,r=rr(e,n);return r<0?t:e[r][1]},Ut.prototype.has=function(n){return rr(this.__data__,n)>-1},Ut.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||Ut),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 Ut,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 Ut){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=wi),o||(o=[]);++i<u;){var a=n[i];e>0&&t(a)?e>1?mr(a,e-1,t,r,o):Re(o,a):r||(o[o.length]=a)}return o}var wr=Ro(),xr=Ro(!0);function br(n,e){return n&&wr(n,e,Ia)}function _r(n,e){return n&&xr(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[Di(e[r++])];return r&&r==o?n:t}function kr(n,e,t){var r=e(n);return Wu(n)?r:Re(r,t(n))}function Cr(n){return null==n?n===t?"[object Undefined]":"[object Null]":te&&te in Mn(n)?function(n){var e=Tn.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 Nr(n,e){return n>e}function Mr(n,e){return null!=n&&Tn.call(n,e)}function Or(n,e){return null!=n&&e in Mn(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=xt(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[Di(Ki(e))];return null==o?t:Ne(o,n,r)}function Ir(n){return ta(n)&&Cr(n)==g}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=Wu(n),c=Wu(e),l=a?y:gi(n),s=c?y:gi(e),f=(l=l==g?C:l)==C,d=(s=s==g?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 m:case x:case k:return Hu(+n,+e);case b:return n.name==e.name&&n.message==e.message;case M: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(Bt)return Bt.call(n)==Bt.call(e)}return!1}(n,e,l,r,o,i,u);if(!(1&r)){var v=f&&Tn.call(n,"__wrapped__"),p=d&&Tn.call(e,"__wrapped__");if(v||p){var w=v?n.value():n,_=p?e.value():e;return u||(u=new qt),i(w,_,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:Tn.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]],w=e[h];if(o)var x=a?o(w,m,h,e,n,u):o(m,w,h,n,e,u);if(!(x===t?m===w||i(m,w,r,o,u):x)){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=Mn(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,Bn&&Bn in e))&&(Qu(n)?Xn:mn).test(Bi(n));var e}function Rr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Wu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Tr(n){if(!ki(n))return mt(n);var e=[];for(var t in Mn(n))Tn.call(n,t)&&"constructor"!=t&&e.push(t);return e}function Dr(n){if(!ea(n))return function(n){var e=[];if(null!=n)for(var t in Mn(n))e.push(t);return e}(n);var e=ki(n),t=[];for(var r in n)("constructor"!=r||!e&&Tn.call(n,r))&&t.push(r);return t}function Br(n,e){return n<e}function Vr(n,e){var t=-1,r=Uu(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]?Ni(e[0][0],e[0][1]):function(t){return t===n||zr(t,n,e)}}function Yr(n,e){return _i(n)&&Ci(e)?Ni(Di(n),e):function(r){var o=Na(r,n);return o===t&&o===e?Ma(r,n):Ar(e,o,3)}}function Xr(n,e,r,o,i){n!==e&&wr(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=Wu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Wu(c)?f=c:$u(c)?f=jo(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=No(l,!0)):f=[]:ia(l)||Zu(l)?(f=c,Zu(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,Xr,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 Zr(n,e){var r=n.length;if(r)return xi(e+=e<0?r:0,r)?n[e]:t}function Wr(n,e,t){e=e.length?Le(e,(function(n){return Wu(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=Mo(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 Ur(n,e,t,r){var o=r?Ze:Xe,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;xi(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>d)return t;do{e%2&&(t+=n),(e=ye(e/2))&&(n+=n)}while(e);return t}function Kr(n,e){return Ai(Mi(n,e,oc),n+"")}function Qr(n){return Qt(Ha(n))}function Jr(n,e){var t=Ha(n);return Ri(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=Di(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:xi(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 Ri(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 xt(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)?h:+n}function so(n){if("string"==typeof n)return n;if(Wu(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[Di(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 Wt&&(t=t.value()),Te(e,(function(n,e){return e.func.apply(e.thisArg,Re([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 wo(n){return $u(n)?n:[]}function xo(n){return"function"==typeof n?n:oc}function bo(n,e){return Wu(n)?n:_i(n,e)?[n]:Ti(wa(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=Un?Un(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 No(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function Mo(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=wt(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=wt(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=Wu(t)?Me: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=Mn(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(!Uu(t))return n(t,r);for(var o=t.length,i=e?o:-1,u=Mn(t);(e?i--:++i<o)&&!1!==r(u[i],i,u););return t}}function Ro(n){return function(e,t,r){for(var o=-1,i=Mn(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 To(n){return function(e){var r=at(e=wa(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 Do(n){return function(e){return Te(Qa(Za(e).replace(ne,"")),n,"")}}function Bo(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=Mn(e);if(!Uu(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=Zt.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 Zt([],!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&&Wu(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,s,f){var d=e&l,h=1&e,v=2&e,p=24&e,g=512&e,y=v?t:Bo(n);return function l(){for(var m=arguments.length,w=an(m),x=m;x--;)w[x]=arguments[x];if(p)var b=li(l),_=function(n,e){for(var t=n.length,r=0;t--;)n[t]===e&&++r;return r}(w,b);if(o&&(w=Oo(w,o,i,p)),u&&(w=Po(w,u,a,p)),m-=_,p&&m<f){var E=st(w,b);return Go(n,e,Yo,l.placeholder,r,w,E,c,s,f-m)}var S=h?r:this,k=v?S[n]:n;return m=w.length,c?w=function(n,e){var r=n.length,o=xt(e.length,r),i=jo(n);for(;o--;){var u=e[o];n[o]=xi(u,r)?i[u]:t}return n}(w,c):g&&m>1&&w.reverse(),d&&s<m&&(w.length=s),this&&this!==pe&&this instanceof l&&(k=y||Bo(k)),k.apply(S,w)}}function Xo(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 Zo(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 Wo(n){return oi((function(e){return e=Le(e,Je(si())),Kr((function(t){var r=this;return n(e,(function(n){return Ne(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 Uo(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=wt(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=Nn[n];return function(n,t){if(n=ya(n),(t=null==t?0:xt(pa(t),292))&&Ve(n)){var r=(wa(n)+"e").split("e");return+((r=(wa(e(r[0]+"e"+(+r[1]+t)))+"e").split("e"))[0]+"e"+(+r[1]-t))}return e(n)}}var Ko=Mt&&1/ft(new Mt([,-0]))[1]==f?function(n){return new Mt(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,f,d,h,v,p){var g=2&e;if(!g&&"function"!=typeof n)throw new jn(r);var y=f?f.length:0;if(y||(e&=-97,f=d=t),v=v===t?v:wt(pa(v),0),p=p===t?p:pa(p),y-=d?d.length:0,e&c){var m=f,w=d;f=d=t}var x=g?t:ai(n),b=[n,e,o,f,d,m,w,h,v,p];if(x&&function(n,e){var t=n[1],r=e[1],o=t|r,u=o<131,a=r==l&&8==t||r==l&&t==s&&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 f=n[3];n[3]=f?Oo(f,c,e[4]):c,n[4]=f?st(n[3],i):e[4]}(c=e[5])&&(f=n[5],n[5]=f?Po(f,c,e[6]):c,n[6]=f?st(n[5],i):e[6]);(c=e[7])&&(n[7]=c);r&l&&(n[8]=null==n[8]?e[8]:xt(n[8],e[8]));null==n[9]&&(n[9]=e[9]);n[0]=e[0],n[1]=o}(b,x),n=b[0],e=b[1],o=b[2],f=b[3],d=b[4],!(p=b[9]=b[9]===t?g?0:n.length:wt(b[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==u?function(n,e,r){var o=Bo(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):Ne(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=Bo(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 Ne(f,o?t:this,s)}}(n,e,o,f);else var _=function(n,e,t){var r=1&e,o=Bo(n);return function e(){return(this&&this!==pe&&this instanceof e?o:n).apply(r?t:this,arguments)}}(n,e,o);return zi((x?eo:ji)(_,b),n,e)}function ni(n,e,r,o){return n===t||Hu(n,zn[r])&&!Tn.call(o,r)?e:n}function ei(n,e,r,o,i,u){return ea(n)&&ea(e)&&(u.set(e,n),Xr(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(!Be(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(Mi(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=Tn.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(Tn.call(Ht,"placeholder")?Ht:n).placeholder}function si(){var n=Ht.iteratee||ic;return n=n===ic?Rr: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=we?function(n){return null==n?[]:(n=Mn(n),Ie(we(n),(function(e){return qn.call(n,e)})))}:gc,pi=we?function(n){for(var e=[];n;)Re(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=Di(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)&&xi(u,o)&&(Wu(n)||Zu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Yt($n(n))}function wi(n){return Wu(n)||Zu(n)||!!(Qn&&n&&n[Qn])}function xi(n,e){var t=typeof n;return!!(e=null==e?d:e)&&("number"==t||"symbol"!=t&&xn.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?Uu(t)&&xi(e,t.length):"string"==r&&e in t)&&Hu(t[e],n)}function _i(n,e){if(Wu(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 Mn(e))}function Ei(n){var e=ci(n),t=Ht[e];if("function"!=typeof t||!(e in Wt.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||Nt&&gi(Nt.resolve())!=N||Mt&&gi(new Mt)!=O||Ot&&gi(new Ot)!=I)&&(gi=function(n){var e=Cr(n),r=e==C?n.constructor:t,o=r?Bi(r):"";if(o)switch(o){case At:return z;case zt:return S;case Lt:return N;case Rt:return O;case Tt: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 Ni(n,e){return function(r){return null!=r&&(r[n]===e&&(e!==t||n in Mn(r)))}}function Mi(n,e,r){return e=wt(e===t?n.length-1:e,0),function(){for(var t=arguments,o=-1,i=wt(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),Ne(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(p,(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 Ri(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 Ti=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 Di(n){if("string"==typeof n||la(n))return n;var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function Bi(n){if(null!=n){try{return Rn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Wt)return n.clone();var e=new Zt(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)):[]})),Xi=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 Zi(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=wt(r+o,0)),Ye(n,si(e,3),o)}function Wi(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?wt(o+i,0):xt(i,o-1)),Ye(n,si(e,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Ui(n){return n&&n.length?n[0]:t}var $i=Kr((function(n){var e=Le(n,wo);return e.length&&e[0]===n[0]?Pr(e):[]})),Gi=Kr((function(n){var e=Ki(n),r=Le(n,wo);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,wo);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?Ur(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 xi(n,t)?+n:n})).sort(Mo)),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=wt(n.length,e),!0})),Ke(e,(function(e){return Le(n,Ue(e))}))}function uu(n,e){if(!n||!n.length)return[];var r=iu(n);return null==e?r:Le(r,(function(n){return Ne(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 Wt&&xi(r)?((o=o.slice(r,+r+(e?1:0))).__actions__.push({func:vu,args:[i],thisArg:t}),new Zt(o,this.__chain__).thru((function(n){return e&&!n.length&&n.push(t),n}))):this.thru(i)}));var gu=Ao((function(n,e,t){Tn.call(n,t)?++n[t]:ur(n,t,1)}));var yu=Vo(Zi),mu=Vo(Wi);function wu(n,e){return(Wu(n)?Oe:hr)(n,si(e,3))}function xu(n,e){return(Wu(n)?Pe:vr)(n,si(e,3))}var bu=Ao((function(n,e,t){Tn.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=Uu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Ne(e,n,t):jr(n,e,t)})),i})),Eu=Ao((function(n,e,t){ur(n,t,e)}));function Su(n,e){return(Wu(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]]),Wr(n,mr(e,1),[])})),Nu=he||function(){return pe.Date.now()};function Mu(n,e,r){return e=r?t:e,e=n&&null==e?n.length:e,Jo(n,l,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=Nu();if(g(n))return m(n);l=Ii(y,function(n){var t=e-(n-s);return h?xt(t,a-(n-f)):t}(n))}function m(n){return l=t,v&&i?p(n):(i=u=t,c)}function w(){var n=Nu(),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)?wt(ya(o.maxWait)||0,e):a,v="trailing"in o?!!o.trailing:v),w.cancel=function(){l!==t&&So(l),f=0,i=s=u=l=t},w.flush=function(){return l===t?c:m(Nu())},w}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 Ru(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 Tu=_o((function(n,e){var t=(e=1==e.length&&Wu(e[0])?Le(e[0],Je(si())):Le(mr(e,1),Je(si()))).length;return Kr((function(r){for(var o=-1,i=xt(r.length,t);++o<i;)r[o]=e[o].call(this,r[o]);return Ne(n,this,r)}))})),Du=Kr((function(n,e){var r=st(e,li(Du));return Jo(n,a,t,e,r)})),Bu=Kr((function(n,e){var r=st(e,li(Bu));return Jo(n,c,t,e,r)})),Vu=oi((function(n,e){return Jo(n,s,t,t,t,e)}));function Hu(n,e){return n===e||n!=n&&e!=e}var Yu=$o(Nr),Xu=$o((function(n,e){return n>=e})),Zu=Ir(function(){return arguments}())?Ir:function(n){return ta(n)&&Tn.call(n,"callee")&&!qn.call(n,"callee")},Wu=an.isArray,Fu=be?Je(be):function(n){return ta(n)&&Cr(n)==A};function Uu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ta(n)&&Uu(n)}var Gu=xe||yc,qu=_e?Je(_e):function(n){return ta(n)&&Cr(n)==x};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<=d}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=Tn.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&Rn.call(t)==Hn}var ua=Se?Je(Se):function(n){return ta(n)&&Cr(n)==M};var aa=ke?Je(ke):function(n){return ta(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Wu(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(Br),da=$o((function(n,e){return n<=e}));function ha(n){if(!n)return[];if(Uu(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))===f||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,v):0}function ya(n){if("number"==typeof n)return n;if(la(n))return h;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||wn.test(n)?de(n.slice(2),t?2:8):gn.test(n)?h:+n}function ma(n){return Io(n,Aa(n))}function wa(n){return null==n?"":so(n)}var xa=zo((function(n,e){if(ki(e)||Uu(e))Io(e,Ia(e),n);else for(var t in e)Tn.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=Mn(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])&&!Tn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(t,ei),Ne(La,t,n)}));function Na(n,e,r){var o=null==n?t:Sr(n,e);return o===t?r:o}function Ma(n,e){return null!=n&&yi(n,e,Or)}var Oa=Xo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),n[e]=t}),ec(oc)),Pa=Xo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),Tn.call(n,e)?n[e].push(t):n[e]=[t]}),si),ja=Kr(jr);function Ia(n){return Uu(n)?Kt(n):Tr(n)}function Aa(n){return Uu(n)?Kt(n,!0):Dr(n)}var za=zo((function(n,e,t){Xr(n,e,t)})),La=zo((function(n,e,t,r){Xr(n,e,t,r)})),Ra=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 Ta=oi((function(n,e){return null==n?{}:function(n,e){return Fr(n,e,(function(e,t){return Ma(n,t)}))}(n,e)}));function Da(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 Ba=Qo(Ia),Va=Qo(Aa);function Ha(n){return null==n?[]:nt(n,Ia(n))}var Ya=Do((function(n,e,t){return e=e.toLowerCase(),n+(t?Xa(e):e)}));function Xa(n){return Ka(wa(n).toLowerCase())}function Za(n){return(n=wa(n))&&n.replace(bn,ot).replace(ee,"")}var Wa=Do((function(n,e,t){return n+(t?"-":"")+e.toLowerCase()})),Fa=Do((function(n,e,t){return n+(t?" ":"")+e.toLowerCase()})),Ua=To("toLowerCase");var $a=Do((function(n,e,t){return n+(t?"_":"")+e.toLowerCase()}));var Ga=Do((function(n,e,t){return n+(t?" ":"")+Ka(e)}));var qa=Do((function(n,e,t){return n+(t?" ":"")+e.toUpperCase()})),Ka=To("toUpperCase");function Qa(n,e,r){return n=wa(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 Ne(n,t,e)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,e){return Oe(e,(function(e){e=Di(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 Rr("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,Re([this.value()],arguments))})})),n}function lc(){}var sc=Wo(Le),fc=Wo(je),dc=Wo(Be);function hc(n){return _i(n)?Ue(Di(n)):function(n){return function(e){return Sr(e,n)}}(n)}var vc=Uo(),pc=Uo(!0);function gc(){return[]}function yc(){return!1}var mc=Zo((function(n,e){return n+e}),0),wc=qo("ceil"),xc=Zo((function(n,e){return n/e}),1),bc=qo("floor");var _c,Ec=Zo((function(n,e){return n*e}),1),Sc=qo("round"),kc=Zo((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=Mu,Ht.assign=xa,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 Wu(n)?n:[n]},Ht.chain=hu,Ht.chunk=function(n,e,r){e=(r?bi(n,e,r):e===t)?1:wt(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 Re(Wu(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(Ne(o[0],this,t))return Ne(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=Xi,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(Wu(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),f)},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,f):[]},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=Ru,Ht.nthArg=function(n){return n=pa(n),Kr((function(e){return Zr(e,n)}))},Ht.omit=Ra,Ht.omitBy=function(n,e){return Da(n,Ru(si(e)))},Ht.once=function(n){return Ou(2,n)},Ht.orderBy=function(n,e,r,o){return null==n?[]:(Wu(e)||(e=null==e?[]:[e]),Wu(r=o?t:r)||(r=null==r?[]:[r]),Wr(n,e,r))},Ht.over=sc,Ht.overArgs=Tu,Ht.overEvery=fc,Ht.overSome=dc,Ht.partial=Du,Ht.partialRight=Bu,Ht.partition=ku,Ht.pick=Ta,Ht.pickBy=Da,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?Ur(n,e,si(t,2)):n},Ht.pullAllWith=function(n,e,r){return n&&n.length&&e&&e.length?Ur(n,e,t,r):n},Ht.pullAt=nu,Ht.range=vc,Ht.rangeRight=pc,Ht.rearg=Vu,Ht.reject=function(n,e){return(Wu(n)?Ie:yr)(n,Ru(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),(Wu(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(Wu(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?v:r>>>0)?(n=wa(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:wt(pa(e),0),Kr((function(t){var r=t[e],o=Eo(t,0,e);return r&&Re(o,r),Ne(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=Ba,Ht.toPairsIn=Va,Ht.toPath=function(n){return Wu(n)?Le(n,Di):la(n)?[n]:jo(Ti(wa(n)))},Ht.toPlainObject=ma,Ht.transform=function(n,e,t){var r=Wu(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 Mu(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,xo(t))},Ht.updateWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:vo(n,e,xo(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 Du(xo(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=Ba,Ht.entriesIn=Va,Ht.extend=ba,Ht.extendWith=_a,cc(Ht,Ht),Ht.add=mc,Ht.attempt=Ja,Ht.camelCase=Ya,Ht.capitalize=Xa,Ht.ceil=wc,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=Za,Ht.defaultTo=function(n,e){return null==n||n!=n?e:n},Ht.divide=xc,Ht.endsWith=function(n,e,r){n=wa(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=wa(n))&&q.test(n)?n.replace($,it):n},Ht.escapeRegExp=function(n){return(n=wa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},Ht.every=function(n,e,r){var o=Wu(n)?je:pr;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.find=yu,Ht.findIndex=Zi,Ht.findKey=function(n,e){return He(n,si(e,3),br)},Ht.findLast=mu,Ht.findLastIndex=Wi,Ht.findLastKey=function(n,e){return He(n,si(e,3),_r)},Ht.floor=bc,Ht.forEach=wu,Ht.forEachRight=xu,Ht.forIn=function(n,e){return null==n?n:wr(n,si(e,3),Aa)},Ht.forInRight=function(n,e){return null==n?n:xr(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=Na,Ht.gt=Yu,Ht.gte=Xu,Ht.has=function(n,e){return null!=n&&yi(n,e,Mr)},Ht.hasIn=Ma,Ht.head=Ui,Ht.identity=oc,Ht.includes=function(n,e,t,r){n=Uu(n)?n:Ha(n),t=t&&!r?pa(t):0;var o=n.length;return t<0&&(t=wt(o+t,0)),ca(n)?t<=o&&n.indexOf(e,t)>-1:!!o&&Xe(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=wt(r+o,0)),Xe(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>=xt(e,t)&&n<wt(e,t)}(n=ya(n),e,r)},Ht.invoke=ja,Ht.isArguments=Zu,Ht.isArray=Wu,Ht.isArrayBuffer=Fu,Ht.isArrayLike=Uu,Ht.isArrayLikeObject=$u,Ht.isBoolean=function(n){return!0===n||!1===n||ta(n)&&Cr(n)==m},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(Uu(n)&&(Wu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Zu(n)))return!n.length;var e=gi(n);if(e==S||e==O)return!n.size;if(ki(n))return!Tr(n).length;for(var t in n)if(Tn.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<=d},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=Wa,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?wt(o+i,0):xt(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,We,i,!0)},Ht.lowerCase=Fa,Ht.lowerFirst=Ua,Ht.lt=fa,Ht.lte=da,Ht.max=function(n){return n&&n.length?gr(n,oc,Nr):t},Ht.maxBy=function(n,e){return n&&n.length?gr(n,si(e,2),Nr):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,Br):t},Ht.minBy=function(n,e){return n&&n.length?gr(n,si(e,2),Br):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?Zr(n,pa(e)):t},Ht.noConflict=function(){return pe._===this&&(pe._=Yn),this},Ht.noop=lc,Ht.now=Nu,Ht.pad=function(n,e,t){n=wa(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=wa(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=wa(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(wa(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 xt(n+i*(e-n+fe("1e-"+((i+"").length-1))),e)}return Gr(n,e)},Ht.reduce=function(n,e,t){var r=Wu(n)?Te:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,hr)},Ht.reduceRight=function(n,e,t){var r=Wu(n)?De: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(wa(n),e)},Ht.replace=function(){var n=arguments,e=wa(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[Di(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(Wu(n)?Qt:Qr)(n)},Ht.size=function(n){if(null==n)return 0;if(Uu(n))return ca(n)?ht(n):n.length;var e=gi(n);return e==S||e==O?n.size:Tr(n).length},Ht.snakeCase=$a,Ht.some=function(n,e,r){var o=Wu(n)?Be: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=wa(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=wa(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="+(Tn.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=Tn.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(Z,""):d).replace(W,"$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>d)return[];var t=v,r=xt(n,v);e=si(e),n-=v;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 wa(n).toLowerCase()},Ht.toNumber=ya,Ht.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,d):0===n?n:0},Ht.toString=wa,Ht.toUpper=function(n){return wa(n).toUpperCase()},Ht.trim=function(n,e,r){if((n=wa(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=wa(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=wa(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=wa(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,wa(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=wa(n))&&G.test(n)?n.replace(U,gt):n},Ht.uniqueId=function(n){var e=++Dn;return wa(n)+e},Ht.upperCase=qa,Ht.upperFirst=Ka,Ht.each=wu,Ht.eachRight=xu,Ht.first=Ui,cc(Ht,(_c={},br(Ht,(function(n,e){Tn.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){Wt.prototype[n]=function(r){r=r===t?1:wt(pa(r),0);var o=this.__filtered__&&!e?new Wt(this):this.clone();return o.__filtered__?o.__takeCount__=xt(r,o.__takeCount__):o.__views__.push({size:xt(r,v),type:n+(o.__dir__<0?"Right":"")}),o},Wt.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;Wt.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":"");Wt.prototype[n]=function(){return this[t](1).value()[0]}})),Oe(["initial","tail"],(function(n,e){var t="drop"+(e?"":"Right");Wt.prototype[n]=function(){return this.__filtered__?new Wt(this):this[t](1)}})),Wt.prototype.compact=function(){return this.filter(oc)},Wt.prototype.find=function(n){return this.filter(n).head()},Wt.prototype.findLast=function(n){return this.reverse().find(n)},Wt.prototype.invokeMap=Kr((function(n,e){return"function"==typeof n?new Wt(this):this.map((function(t){return jr(t,n,e)}))})),Wt.prototype.reject=function(n){return this.filter(Ru(si(n)))},Wt.prototype.slice=function(n,e){n=pa(n);var r=this;return r.__filtered__&&(n>0||e<0)?new Wt(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)},Wt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Wt.prototype.toArray=function(){return this.take(v)},br(Wt.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 Wt,l=a[0],s=c||Wu(e),f=function(n){var e=i.apply(Ht,Re([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 Wt(this);var g=n.apply(e,a);return g.__actions__.push({func:vu,args:[f],thisArg:t}),new Zt(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(Wu(o)?o:[],n)}return this[t]((function(t){return e.apply(Wu(t)?t:[],n)}))}})),br(Wt.prototype,(function(n,e){var t=Ht[e];if(t){var r=t.name+"";Tn.call(It,r)||(It[r]=[]),It[r].push({name:e,func:t})}})),It[Yo(t,2).name]=[{name:"wrapper",func:t}],Wt.prototype.clone=function(){var n=new Wt(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},Wt.prototype.reverse=function(){if(this.__filtered__){var n=new Wt(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Wt.prototype.value=function(){var n=this.__wrapped__.value(),e=this.__dir__,t=Wu(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=xt(e,n+u);break;case"takeRight":n=wt(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=xt(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,w=y.type,x=m(g);if(2==w)g=x;else if(!x){if(1==w)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 Zt(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 Xt;){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 Wt){var e=n;return this.__actions__.length&&(e=new Wt(this)),(e=e.reverse()).__actions__.push({func:vu,args:[eu],thisArg:t}),new Zt(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(w)}(PE,PE.exports);var jE=x(PE.exports);function IE(n){var e=n.layoutTypes,t=n.layoutConfig,r=void 0===t?CE:t,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=e[null==r?void 0:r.type]||ME[null==r?void 0:r.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)}))}(u)&&c?function(n){var e=n.layoutConfig,t=void 0===e?CE:e,r=n.edges,o=n.nodeOrigin,i=n.nodes,u=n.container,a=n.layoutFn,c=jE.cloneDeep(i);c.forEach((function(n){n.data&&(n.data.width=n.measured.width,n.data.height=n.measured.height)}));var l=a(c,r,d({nodeOrigin:o,width:u.width,height:u.height},null==t?void 0:t.options)),s=l.nodes,f=l.edges;return{nodes:s,edges:f,layoutComplete:!0}}({layoutConfig:r,container:a,nodeOrigin:i,nodes:u,layoutFn:c,edges:o}):{nodes:u,edges:o,layoutComplete:!1}}function AE(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=Jx(e),l=Gx(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&&OE({nodes:a,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var zE=function(n){var e,t,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return e=function(n,e){return d(d({},NE({nodes:r,edges:o,width:a,height:c,fitView:l,defaultNodes:i,defaultEdges:u})),{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(t){var r=e(),o=r.triggerNodeChanges,i=r.nodeLookup,u=r.parentLookup,a=r.domNode,c=r.nodeOrigin,l=r.debug,s=r.nodeExtent,f=function(n,e,t,r,o,i){var u,a,c=null==r?void 0:r.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};var s=[],f=window.getComputedStyle(c),d=new window.DOMMatrixReadOnly(f.transform).m22,h=[];try{for(var v=U(n.values()),p=v.next();!p.done;p=v.next()){var g=p.value,y=e.get(g.id);if(y)if(y.hidden)e.set(y.id,W(W({},y),{internals:W(W({},y.internals),{handleBounds:void 0})})),l=!0;else{var m=rp(g.nodeElement),w=y.measured.width!==m.width||y.measured.height!==m.height;if(m.width&&m.height&&(w||!y.internals.handleBounds||g.force)){var x=g.nodeElement.getBoundingClientRect(),b=$v(y.extent)?y.extent:i,_=y.internals.positionAbsolute;y.parentId&&"parent"===y.extent?_=qv(_,m,e.get(y.parentId)):b&&(_=Av(_,b,m));var E=W(W({},y),{measured:m,internals:W(W({},y.internals),{positionAbsolute:_,handleBounds:{source:ip("source",g.nodeElement,x,d,y.id),target:ip("target",g.nodeElement,x,d,y.id)}})});e.set(y.id,E),y.parentId&&jp(E,e,t,{nodeOrigin:o}),l=!0,w&&(s.push({id:y.id,type:"dimensions",dimensions:m}),y.expandParent&&y.parentId&&h.push({id:y.id,parentId:y.parentId,rect:Bv(E,o)}))}}}}catch(n){u={error:n}}finally{try{p&&!p.done&&(a=v.return)&&a.call(v)}finally{if(u)throw u.error}}if(h.length>0){var S=Pp(h,e,t,o);s.push.apply(s,G([],$(S),!1))}return{changes:s,updatedInternals:l}}(t,i,u,a,c,s),d=f.changes;if(f.updatedInternals){var h=jE.cloneDeep(i);n({nodeLookup:h}),function(n,e,t){var r,o,i=Ip(Np,t);try{for(var u=U(n.values()),a=u.next();!a.done;a=u.next()){var c=a.value;if(c.parentId)jp(c,n,e,i);else{var l=Mv(c,i.nodeOrigin),s=$v(c.extent)?c.extent:i.nodeExtent,f=Av(l,s,Gv(c));c.internals.positionAbsolute=f}}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}(i,u,{nodeOrigin:c,nodeExtent:s}),(null==d?void 0:d.length)>0&&(l&&console.log("Ink Flow: trigger node changes",d),null==o||o(d))}},updateNodePositions:function(n,t){var r,o;void 0===t&&(t=!1);var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=y(c.value,2),s=l[0],f=l[1],h={id:s,type:"position",position:f.position,dragging:t};(null==f?void 0:f.expandParent)&&(null==f?void 0:f.parentId)&&h.position&&(i.push({id:s,parentId:f.parentId,rect:d(d({},f.internals.positionAbsolute),{width:f.measured.width,height:f.measured.height})}),h.position.x=Math.max(0,h.position.x),h.position.y=Math.max(0,h.position.y)),u.push(h)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}if(i.length>0){var v=e(),p=function(n,e,t,r){var o,i,u,a,c,l=[],s=new Map;try{for(var f=g(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=e.get(h.parentId);if(v){var p=null!==(a=null===(u=s.get(h.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:rb(v,null!==(c=v.origin)&&void 0!==c?c:r),y=cb(p,h.rect);s.set(h.parentId,{expandedRect:y,parent:v})}}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return s.size>0&&s.forEach((function(e,r){var o=e.expandedRect,i=e.parent,u=Gx(i,i.origin).position,a=Jx(i),c=o.x<u.x?Math.round(Math.abs(u.x-o.x)):0,s=o.y<u.y?Math.round(Math.abs(u.y-o.y)):0;if(c>0||s>0){l.push({id:r,type:"position",position:{x:u.x-c,y:u.y-s}});var f=t.get(r);null==f||f.forEach((function(e){n.some((function(n){return n.id===e.id}))||l.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+s}})}))}(a.width<o.width||a.height<o.height)&&l.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))}})})),l}(i,v.nodeLookup,v.parentLookup);u.push.apply(u,m([],y(p),!1))}e().triggerNodeChanges(u)},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,a=t.triggerEdgeChanges;r?u(n.map((function(n){return Ab(n,!0)}))):(u(zb(i,new Set(m([],y(n),!1)),!0)),a(zb(o)))},addSelectedEdges:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,a=t.triggerEdgeChanges;r?a(n.map((function(n){return Ab(n,!0)}))):(a(zb(o,new Set(m([],y(n),!1)))),u(zb(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,Ab(n.id,!1)})),d=s.map((function(n){return Ab(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?m(m([],y(n),!1),[Ab(e.id,!1)],!1):n}),[]),a=t.reduce((function(n,e){return e.selected?m(m([],y(n),!1),[Ab(e.id,!1)],!1):n}),[]);o(u),i(a)},setNodeExtent:function(t){var r,o,i=e().nodeLookup;try{for(var u=g(i),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=Qx(c.position,t);i.set(c.id,d(d({},c),{internals:d(d({},c.internals),{positionAbsolute:l})}))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}n({nodeExtent:t})},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(){n({connection:d({},sp)})},updateConnection:function(e){n({connection:e})},reset:function(){return n(d({},NE()))},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,w=a.fitViewOnInit,x=a.minZoom,b=a.maxZoom,_=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,N=a.centered,M=a.layoutAnchorId,O=i||Array.from(p.values());if(O.length){var P=IE({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||CE});if(P.layoutComplete&&(Op(P.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:P.layoutComplete}),h&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){var j=O.find((function(n){return n.id===M})),I=P.nodes.find((function(n){return n.id===M}));if(j&&I)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:Gx(j,v).position,panZoom:h,position:Gx(I,v).position,transform:E}),void n({layoutAnchorId:void 0});if(u||!(k||N||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=Db(c,i).positionAbsolute,s=Jx(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(w)return Vb({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:w,minZoom:x,maxZoom:b,fitViewOnInitOptions:_,nodes:p}),void n({fitViewDone:!0});S&&(AE({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var t=n.changes,r=n.userNodes;if(t||r){var o=e(),i=o.setNodes,u=o.nodeLookup,a=o.parentLookup,c=o.elevateNodesOnSelect,l=o.nodeOrigin,s=o.nodes,f=o.autoLayout,h=o.updateLayout,v=!(null==t?void 0:t.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(t||[]),g=[];g=v?(r||[]).map((function(n){var e=u.get(n.id),t=d(d({},e),n);return f&&(t.position=(null==e?void 0:e.position)||{x:0,y:0}),t})):function(n,e){return Ib(n,e)}(t,Array.from(u.values())),!v&&p&&f||Op(g,u,a,{nodeOrigin:l,elevateNodesOnSelect:c,checkEquality:!0}),f&&(p||r&&r!==s)&&h({nodes:v?Array.from(u.values()):g}),i(r||s)}},onEdgesChange:function(n){var t=n.changes,r=void 0===t?[]:t,o=n.userEdges,i=e(),u=i.connectionLookup,a=i.edgeLookup,c=i.setEdges,l=i.edges,s=[];if((null==r?void 0:r.length)<=0)s=o.map((function(n){var e=a.get(n.id)||{};return d(d({},e),n)})),c(o);else{s=function(n,e){return Ib(n,e)}(r,Array.from(a.values()));var f=s.map((function(n){return n.id}));c(l.filter((function(n){return f.includes(n.id)})))}qx(u,a,s)},updateLayoutConfig:function(t){var r=e(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;jE.isEqual(t,u)||(n({layoutConfig:t}),o&&i({config:t,force:!0}))},setLayoutAnchorId:function(e){n({layoutAnchorId:e})}})},t=Object.is,e?Y(e,t):Y};function LE(n){var e=n.initialNodes,t=n.initialEdges,r=n.defaultNodes,o=n.defaultEdges,u=n.initialWidth,a=n.initialHeight,c=n.fitView,l=n.children,s=y(i((function(){return zE({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:u,height:a,fitView:c})})),1)[0];return k.jsx(Z,{value:s,children:k.jsx(Tb,{children:l})})}function RE(n){var e=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return t(X)?k.jsx(k.Fragment,{children:e}):k.jsx(LE,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:e})}var TE=m(m([],y(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","minZoom","maxZoom","nodeExtent","elementsSelectable","connectionMode","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","nodeOrigin","isValidConnection","autoLayout","centerConfig","layoutTypes","autoPanSpeed"]),!1),["rfId"],!1),DE=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}},BE={translateExtent:xv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function VE(n){var e=Ux(DE,kb),t=e.setMinZoom,r=e.setMaxZoom,o=e.setTranslateExtent,i=e.setNodeExtent,c=e.reset,l=e.setDefaultNodesAndEdges,s=e.onNodesChange,f=e.onEdgesChange,h=e.updateLayoutConfig,v=$x();a((function(){return l(n.defaultNodes,n.defaultEdges),function(){p.current=BE,c()}}),[]);var p=u(BE);return a((function(){var e,u,a,c;try{for(var l=g(TE),y=l.next();!y.done;y=l.next()){var m=y.value,w=n[m];if(w!==p.current[m]&&void 0!==n[m])if("nodes"===m)s({userNodes:w});else if("edges"===m)f({userEdges:w});else if("minZoom"===m)t(w);else if("maxZoom"===m)r(w);else if("translateExtent"===m)o(w);else if("nodeExtent"===m)i(w);else if("fitView"===m)v.setState({fitViewOnInit:w});else if("fitViewOptions"===m)v.setState({fitViewOnInitOptions:w});else if("layoutConfig"===m){var x=w||{},b=d(d({},x),{options:d(d({},x.options||{}),{rankdir:(null===(c=x.options)||void 0===c?void 0:c.rankdir)||"TB"})});h(b)}else v.setState(((a={})[m]=w,a))}}catch(n){e={error:n}}finally{try{y&&!y.done&&(u=l.return)&&u.call(l)}finally{if(e)throw e.error}}p.current=n}),TE.map((function(e){return n[e]}))),null}var HE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var YE=lb((function(n,e){var t=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?xv:o,u=n.defaultViewport,a=void 0===u?kE:u,c=n.minZoom,l=void 0===c?.5:c,s=n.maxZoom,f=void 0===s?2:s,v=n.defaultMarkerColor,p=void 0===v?"#b1b1b7":v,g=n.nodeOrigin,y=n.noDragClassName,m=void 0===y?"nodrag":y,w=n.noPanClassName,x=void 0===w?"nopan":w,b=n.disableKeyboardA11y,_=n.nodeTypes,E=n.edgeTypes;n.connectionMode;var S=n.connectionLineType,C=void 0===S?up.Bezier:S,N=n.connectionLineStyle,M=n.connectionLineComponent,O=n.connectionLineContainerStyle,j=n.onNodeClick,I=n.onNodeDoubleClick,A=n.onNodeMouseEnter,z=n.onNodeMouseMove,L=n.onNodeMouseLeave,R=n.onNodeContextMenu,T=n.onEdgeClick,D=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,V=n.onEdgeMouseLeave,H=n.onEdgeContextMenu,Y=n.onEdgeDoubleClick,X=n.fitView,Z=n.fitViewOptions,W=n.nodeExtent,F=n.nodesDraggable,U=n.children,$=n.id,G=n.width,q=n.height,K=n.panOnDrag,Q=void 0===K||K,J=n.onPaneClick,nn=n.onPaneContextMenu,en=n.onPaneMouseEnter,tn=n.onPaneMouseMove,rn=n.onPaneMouseLeave,on=n.onPaneScroll,un=n.elementsSelectable,an=void 0===un||un,cn=n.autoPanSpeed,ln=n.autoLayout,sn=void 0===ln||ln,fn=n.layoutConfig,dn=void 0===fn?CE:fn,hn=n.centerConfig,vn=void 0===hn?{}:hn,pn=n.layoutTypes,gn=void 0===pn?{}:pn,yn=n.selectionOnDrag,mn=void 0!==yn&&yn,wn=n.selectionMode,xn=void 0===wn?tp.Full:wn,bn=n.deleteKeyCode,_n=void 0===bn?"Backspace":bn,En=n.selectionKeyCode,Sn=n.multiSelectionKeyCode,kn=n.onlyRenderVisibleElements,Cn=n.paneClickDistance,Nn=n.nodeClickDistance,Mn=n.noWheelClassName,On=n.onConnect,Pn=n.onConnectStart,jn=n.onConnectEnd,In=n.onNodesDelete,An=n.onEdgesDelete,zn=n.onDelete,Ln=n.isValidConnection,Rn=n.onNodeDragStop,Tn=h(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","panOnDrag","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoPanSpeed","autoLayout","layoutConfig","centerConfig","layoutTypes","selectionOnDrag","selectionMode","deleteKeyCode","selectionKeyCode","multiSelectionKeyCode","onlyRenderVisibleElements","paneClickDistance","nodeClickDistance","noWheelClassName","onConnect","onConnectStart","onConnectEnd","onNodesDelete","onEdgesDelete","onDelete","isValidConnection","onNodeDragStop"]),Dn=$||"1";return k.jsx("div",d({},Tn,{ref:e,style:d({},HE),className:P(["ink-flow"]),"data-testid":"rf__wrapper",id:$,children:k.jsxs(RE,{nodes:t,edges:r,width:G,height:q,fitView:X,children:[k.jsx(SE,{deleteKeyCode:_n,selectionKeyCode:En,multiSelectionKeyCode:Sn,onlyRenderVisibleElements:kn,paneClickDistance:Cn,nodeClickDistance:Nn,onNodeClick:j,onNodeMouseEnter:A,onNodeMouseMove:z,onNodeMouseLeave:L,onNodeContextMenu:R,onNodeDoubleClick:I,onEdgeClick:T,onEdgeMouseEnter:D,onEdgeMouseMove:B,onEdgeMouseLeave:V,onEdgeContextMenu:H,onEdgeDoubleClick:Y,rfId:Dn,nodeTypes:_,edgeTypes:E,minZoom:l,maxZoom:f,nodeOrigin:g,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,translateExtent:i,defaultMarkerColor:p,connectionLineType:C,connectionLineStyle:N,connectionLineComponent:M,connectionLineContainerStyle:O,defaultViewport:a,panOnDrag:Q,onPaneClick:J,onPaneContextMenu:nn,onPaneMouseEnter:en,onPaneMouseMove:tn,onPaneMouseLeave:rn,onPaneScroll:on,selectionOnDrag:mn,selectionMode:xn,noWheelClassName:Mn}),k.jsx(VE,{nodes:t,edges:r,rfId:Dn,fitView:X,fitViewOptions:Z,nodeExtent:W,nodesDraggable:F,elementsSelectable:an,minZoom:l,maxZoom:f,nodeOrigin:g,autoLayout:sn,layoutConfig:dn,layoutTypes:gn,centerConfig:vn,autoPanSpeed:cn,onConnect:On,onConnectStart:Pn,onConnectEnd:jn,onDelete:zn,onEdgesDelete:An,onNodesDelete:In,isValidConnection:Ln,onNodeDragStop:Rn}),U]})}))}));function XE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.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 ZE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.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 WE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.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 FE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.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 UE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.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 $E(n){var e=n.children,t=n.className,r=h(n,["children","className"]);return k.jsx("button",d({type:"button",className:P(["ink-flow__controls-button",t])},r,{children:e}))}var GE=function(n){return n.userSelectionActive?"none":"all"};function qE(n){var e=n.position,t=void 0===e?"top-left":e,r=n.children,o=n.className,i=n.style,u=h(n,["position","children","className","style"]),a=Ux(GE),c="".concat(t).split("-");return k.jsx("div",d({className:P(m(["ink-flow__panel",o],y(c),!1)),style:d(d({},i),{pointerEvents:a})},u,{children:r}))}var KE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function QE(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,p=n.position,g=void 0===p?"bottom-left":p,y=n.orientation,m=void 0===y?"vertical":y,w=n["aria-label"],x=void 0===w?"Ink Flow controls":w,b=$x(),_=Ux(KE,kb),E=_.isInteractive,S=_.minZoomReached,C=_.maxZoomReached,N=Wb(),M=N.zoomIn,O=N.zoomOut,j=N.fitView,I="horizontal"===m?"horizontal":"vertical";return k.jsxs(qE,{className:P(["ink-flow__controls",I,h]),position:g,style:e,"data-testid":"rf__controls","aria-label":x,children:[i&&k.jsx($E,{className:"ink-flow__controls-fitview",onClick:function(){j(c),null==f||f()},"aria-label":"fit view",children:k.jsx(WE,{})}),r&&k.jsxs("div",{className:"ink-flow__controls-zoom",children:[k.jsx($E,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:C,children:k.jsx(XE,{})}),k.jsx($E,{onClick:function(){O(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:S,children:k.jsx(ZE,{})})]}),a&&k.jsx($E,{className:"ink-flow__controls-interactive",onClick:function(){b.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==d||d(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?k.jsx(UE,{}):k.jsx(FE,{})}),v]})}QE.displayName="Controls";var JE,nS,eS=s(QE);function tS(n){var e=n.dimensions,t=n.lineWidth,r=n.variant,o=n.className;return k.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:P(["ink-flow__background-pattern",r,o])})}function rS(n){var e=n.radius,t=n.className;return k.jsx("circle",{cx:e,cy:e,r:e,className:P(["ink-flow__background-pattern","dots",t])})}!function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"}(JE||(JE={}));var oS=((nS={})[JE.Dots]=1,nS[JE.Lines]=1,nS[JE.Cross]=6,nS),iS=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function uS(n){var e=n.id,t=n.variant,r=void 0===t?JE.Dots:t,o=n.gap,i=void 0===o?20:o,a=n.size,c=n.lineWidth,l=void 0===c?1:c,s=n.offset,f=void 0===s?2:s,h=n.color,v=n.bgColor,p=n.style,g=n.className,y=n.patternClassName,m=u(null),w=Ux(iS,kb),x=w.transform,b=w.patternId,_=a||oS[r],E=r===JE.Dots,S=r===JE.Cross,C=Array.isArray(i)?i:[i,i],N=[C[0]*x[2]||1,C[1]*x[2]||1],M=_*x[2],O=S?[M,M]:N,j=E?[M/f,M/f]:[O[0]/f,O[1]/f],I="".concat(b).concat(e||"");return k.jsxs("svg",{className:P(["ink-flow__background",g]),style:d(d(d({},p),Cb),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[k.jsx("pattern",{id:I,x:x[0]%N[0],y:x[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(j[0],",-").concat(j[1],")"),children:E?k.jsx(rS,{radius:M/f,className:y}):k.jsx(tS,{dimensions:O,lineWidth:l,variant:r,className:y})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(I,")")})]})}uS.displayName="Background";var aS=s(uS);var cS=s((function(n){var e,t=n.nodeId,r=n.position,o=n.variant,i=void 0===o?Ox.Handle:o,c=n.className,l=n.style,s=void 0===l?{}:l,f=n.children,h=n.color,v=n.minWidth,p=void 0===v?10:v,w=n.minHeight,x=void 0===w?10:w,b=n.maxWidth,_=void 0===b?Number.MAX_VALUE:b,E=n.maxHeight,S=void 0===E?Number.MAX_VALUE:E,C=n.keepAspectRatio,N=void 0!==C&&C,M=n.shouldResize,O=n.onResizeStart,j=n.onResize,I=n.onResizeEnd,A=c_(),z="string"==typeof t?t:A,L=$x(),R=u(null),T=i===Ox.Line?"right":"bottom-right",D=null!=r?r:T,B=u(null);a((function(){if(R.current&&z)return B.current||(B.current=function(n){var e=n.domNode,t=n.nodeId,r=n.getStoreItems,o=n.onChange,i=n.onEnd,u=nm(e);return{update:function(n){var e=n.controlPosition,a=n.boundaries,c=n.keepAspectRatio,l=n.onResizeStart,s=n.onResize,f=n.onResizeEnd,d=n.shouldResize,h=W({},Xx),v=W({},Zx),p=function(n){return{isHorizontal:n.includes("right")||n.includes("left"),isVertical:n.includes("bottom")||n.includes("top"),affectsX:n.includes("left"),affectsY:n.includes("top")}}(e),g=void 0,y=[],m=void 0,w=void 0,x=void 0,b=vm().on("start",(function(n){var e,o,i,u,a,c,s,f,d,p=r(),b=p.nodeLookup,_=p.transform,E=p.snapGrid,S=p.snapToGrid,k=p.nodeOrigin;if(g=b.get(t)){var C=Jv(n.sourceEvent,{transform:_,snapGrid:E,snapToGrid:S}),N=C.xSnapped,M=C.ySnapped;h={width:null!==(u=null===(i=g.measured)||void 0===i?void 0:i.width)&&void 0!==u?u:0,height:null!==(c=null===(a=g.measured)||void 0===a?void 0:a.height)&&void 0!==c?c:0,x:null!==(s=g.position.x)&&void 0!==s?s:0,y:null!==(f=g.position.y)&&void 0!==f?f:0},v=W(W({},h),{pointerX:N,pointerY:M,aspectRatio:h.width/h.height}),m=void 0,("parent"===g.extent||g.expandParent)&&(m=b.get(g.parentId))&&"parent"===g.extent&&(w=function(n){return[[0,0],[n.measured.width,n.measured.height]]}(m)),y=[],x=void 0;try{for(var O=U(b),P=O.next();!P.done;P=O.next()){var j=$(P.value,2),I=j[0],A=j[1];if(A.parentId===t&&(y.push({id:I,position:W({},A.position),extent:A.extent}),"parent"===A.extent||A.expandParent)){var z=Wx(A,g,null!==(d=A.origin)&&void 0!==d?d:k);x=x?[[Math.min(z[0][0],x[0][0]),Math.min(z[0][1],x[0][1])],[Math.max(z[1][0],x[1][0]),Math.max(z[1][1],x[1][1])]]:z}}}catch(n){e={error:n}}finally{try{P&&!P.done&&(o=O.return)&&o.call(O)}finally{if(e)throw e.error}}null==l||l(n,W({},h))}})).on("drag",(function(n){var e,t,i,u=r(),l=u.transform,f=u.snapGrid,b=u.snapToGrid,_=u.nodeOrigin,E=Jv(n.sourceEvent,{transform:l,snapGrid:f,snapToGrid:b}),S=[];if(g){var k=h.x,C=h.y,N=h.width,M=h.height,O={},P=null!==(i=g.origin)&&void 0!==i?i:_,j=function(n,e,t,r,o,i,u,a){var c=e.affectsX,l=e.affectsY,s=e.isHorizontal,f=e.isVertical,d=s&&f,h=t.xSnapped,v=t.ySnapped,p=r.minWidth,g=r.maxWidth,y=r.minHeight,m=r.maxHeight,w=n.x,x=n.y,b=n.width,_=n.height,E=n.aspectRatio,S=Math.floor(s?h-n.pointerX:0),k=Math.floor(f?v-n.pointerY:0),C=b+(c?-S:S),N=_+(l?-k:k),M=-i[0]*b,O=-i[1]*_,P=Hx(C,p,g),j=Hx(N,y,m);if(u){var I=0,A=0;c&&S<0?I=Bx(w+S+M,u[0][0]):!c&&S>0&&(I=Vx(w+C+M,u[1][0])),l&&k<0?A=Bx(x+k+O,u[0][1]):!l&&k>0&&(A=Vx(x+N+O,u[1][1])),P=Math.max(P,I),j=Math.max(j,A)}if(a&&(I=0,A=0,c&&S>0?I=Vx(w+S,a[0][0]):!c&&S<0&&(I=Bx(w+C,a[1][0])),l&&k>0?A=Vx(x+k,a[0][1]):!l&&k<0&&(A=Bx(x+N,a[1][1])),P=Math.max(P,I),j=Math.max(j,A)),o){if(s){var z=Hx(C/E,y,m)*E;if(P=Math.max(P,z),u){var L=0;L=!c&&!l||c&&!l&&d?Vx(x+O+C/E,u[1][1])*E:Bx(x+O+(c?S:-S)/E,u[0][1])*E,P=Math.max(P,L)}a&&(L=0,L=!c&&!l||c&&!l&&d?Bx(x+C/E,a[1][1])*E:Vx(x+(c?S:-S)/E,a[0][1])*E,P=Math.max(P,L))}if(f){var R=Hx(N*E,p,g)/E;j=Math.max(j,R),u&&(L=0,L=!c&&!l||l&&!c&&d?Vx(w+N*E+M,u[1][0])/E:Bx(w+(l?k:-k)*E+M,u[0][0])/E,j=Math.max(j,L)),a&&(L=0,L=!c&&!l||l&&!c&&d?Bx(w+N*E,a[1][0])/E:Vx(w+(l?k:-k)*E,a[0][0])/E,j=Math.max(j,L))}}k+=k<0?j:-j,S+=S<0?P:-P,o&&(d?C>N*E?k=(Yx(c,l)?-S:S)/E:S=(Yx(c,l)?-k:k)*E:s?(k=S/E,l=c):(S=k*E,c=l));var T=c?w+S:w,D=l?x+k:x;return{width:b+(c?-S:S),height:_+(l?-k:k),x:i[0]*S*(c?-1:1)+T,y:i[1]*k*(l?-1:1)+D}}(v,p,E,a,c,P,w,x),I=j.width,A=j.height,z=j.x,L=j.y,R=I!==N,T=A!==M,D=z!==k&&R,B=L!==C&&T;if(D||B||R||T){if((D||B||1===P[0]||1==P[1])&&(O.x=D?z:h.x,O.y=B?L:h.y,h.x=O.x,h.y=O.y,m&&g.expandParent&&(O.x&&O.x<0&&(h.x=0,v.x=v.x-O.x),O.y&&O.y<0&&(h.y=0,v.y=v.y-O.y)),y.length>0)){var V=z-k,H=L-C;try{for(var Y=U(y),X=Y.next();!X.done;X=Y.next()){var Z=X.value;Z.position={x:Z.position.x-V+P[0]*(I-N),y:Z.position.y-H+P[1]*(A-M)},S.push(Z)}}catch(n){e={error:n}}finally{try{X&&!X.done&&(t=Y.return)&&t.call(Y)}finally{if(e)throw e.error}}}(R||T)&&(O.width=R?I:h.width,O.height=T?A:h.height,h.width=O.width,h.height=O.height);var F=function(n){var e=n.affectsY,t=n.width-n.prevWidth,r=n.height-n.prevHeight,o=[t>0?1:t<0?-1:0,r>0?1:r<0?-1:0];return t&&n.affectsX&&(o[0]=-1*o[0]),r&&e&&(o[1]=-1*o[1]),o}({width:h.width,prevWidth:N,height:h.height,prevHeight:M,affectsX:p.affectsX,affectsY:p.affectsY}),$=W(W({},h),{direction:F});!1!==(null==d?void 0:d(n,$))&&(null==s||s(n,$),o(O,S))}}})).on("end",(function(n){null==f||f(n,W({},h)),null==i||i()}));u.call(b)},destroy:function(){u.on(".drag",null)}}}({domNode:R.current,nodeId:z,getStoreItems:function(){var n=L.getState();return{nodeLookup:n.nodeLookup,transform:n.transform,snapGrid:n.snapGrid,snapToGrid:n.snapToGrid,nodeOrigin:n.nodeOrigin,paneDomNode:n.domNode}},onChange:function(n,e){var t,r,o,i,u,a,c,l,s,f=L.getState(),h=f.triggerNodeChanges,v=f.nodeLookup,p=f.parentLookup,w=f.nodeOrigin,x=[],b={x:n.x,y:n.y},_=v.get(z);if(_&&_.expandParent&&_.parentId){var E=null!==(o=_.origin)&&void 0!==o?o:w,S=null!==(u=null!==(i=n.width)&&void 0!==i?i:_.measured.width)&&void 0!==u?u:0,k=null!==(c=null!==(a=n.height)&&void 0!==a?a:_.measured.height)&&void 0!==c?c:0,C=Pp([{id:_.id,parentId:_.parentId,rect:d({width:S,height:k},pb({x:null!==(l=n.x)&&void 0!==l?l:_.position.x,y:null!==(s=n.y)&&void 0!==s?s:_.position.y},_.parentId,v,E,{width:S,height:k}))}],v,p,w);x.push.apply(x,m([],y(C),!1)),b.x=n.x?Math.max(E[0]*S,n.x):void 0,b.y=n.y?Math.max(E[1]*k,n.y):void 0}if(void 0!==b.x&&void 0!==b.y){var N={id:z,type:"position",position:d({},b)};x.push(N)}if(void 0!==n.width&&void 0!==n.height){var M={id:z,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:n.width,height:n.height}};x.push(M)}try{for(var O=g(e),P=O.next();!P.done;P=O.next()){var j=P.value;N=d(d({},j),{type:"position"});x.push(N)}}catch(n){t={error:n}}finally{try{P&&!P.done&&(r=O.return)&&r.call(O)}finally{if(t)throw t.error}}h(x)},onEnd:function(){var n={id:z,type:"dimensions",resizing:!1};L.getState().triggerNodeChanges([n])}})),B.current.update({controlPosition:D,boundaries:{minWidth:p,minHeight:x,maxWidth:_,maxHeight:S},keepAspectRatio:N,onResizeStart:O,onResize:j,onResizeEnd:I,shouldResize:M}),function(){var n;null===(n=B.current)||void 0===n||n.destroy()}}),[D,p,x,_,S,N,O,j,I,M]);var V=D.split("-"),H=i===Ox.Line?"borderColor":"backgroundColor",Y=h?d(d({},s),((e={})[H]=h,e)):s;return k.jsx("div",{className:P(m(m(["ink-flow__resize-control","nodrag"],y(V),!1),[i,c],!1)),ref:R,style:Y,children:f})}));function lS(n){var e=n.nodeId,t=n.isVisible,r=void 0===t||t,o=n.handleClassName,i=n.handleStyle,u=n.lineClassName,a=n.lineStyle,c=n.color,l=n.minWidth,s=void 0===l?10:l,f=n.minHeight,d=void 0===f?10:f,h=n.maxWidth,v=void 0===h?Number.MAX_VALUE:h,p=n.maxHeight,g=void 0===p?Number.MAX_VALUE:p,y=n.keepAspectRatio,m=void 0!==y&&y,w=n.shouldResize,x=n.onResizeStart,b=n.onResize,_=n.onResizeEnd;return r?k.jsxs(k.Fragment,{children:[Dx.map((function(n){return k.jsx(cS,{className:u,style:a,nodeId:e,position:n,variant:Ox.Line,color:c,minWidth:s,minHeight:d,maxWidth:v,maxHeight:g,onResizeStart:x,keepAspectRatio:m,shouldResize:w,onResize:b,onResizeEnd:_},n)})),Tx.map((function(n){return k.jsx(cS,{className:o,style:i,nodeId:e,position:n,color:c,minWidth:s,minHeight:d,maxWidth:v,maxHeight:g,onResizeStart:x,keepAspectRatio:m,shouldResize:w,onResize:b,onResizeEnd:_},n)}))]}):null}var sS=function(n){var e;return null===(e=n.domNode)||void 0===e?void 0:e.querySelector(".ink-flow__edgelabel-renderer")};function fS(n){var e=n.children,t=Ux(sS);return t?f(e,t):null}export{aS as Background,JE as BackgroundVariant,T_ as BaseEdge,up as ConnectionLineType,np as ConnectionMode,$E as ControlButton,eS as Controls,fS as EdgeLabelRenderer,b_ as Handle,LE as InkFlowProvider,ap as MarkerType,cS as NodeResizeControl,lS as NodeResizer,ep as PanOnScrollMode,lp as Position,tp as SelectionMode,Z_ as SmoothStepEdge,U_ as StepEdge,wp as addEdge,zp as dagreLayout,YE as default,dp as getBezierEdgeCenter,pp as getBezierPath,Pv as getConnectedEdges,gp as getEdgeCenter,Nv as getIncomers,Ov as getNodesBounds,Cv as getOutgoers,kp as getSmoothStepPath,bp as getStraightPath,Fv as getViewportForBounds,xp as updateEdge,t_ as useEdgesState,Wb as useInkFlow,r_ as useNodesState,Ux as useStore,$x as useStoreApi};
|
|
24
|
+
*/!function(n,e){(function(){var t,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",u=16,a=32,c=64,l=128,s=256,f=1/0,d=9007199254740991,h=NaN,v=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",a],["partialRight",c],["rearg",s]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",x="[object Date]",b="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",N="[object Promise]",M="[object RegExp]",O="[object Set]",P="[object String]",j="[object Symbol]",I="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",R="[object Float64Array]",T="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",H="[object Uint8Array]",V="[object Uint8ClampedArray]",Y="[object Uint16Array]",X="[object Uint32Array]",Z=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(U.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\]$/,wn=/^0o[0-7]+$/i,xn=/^(?: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",Nn="a-z\\xdf-\\xf6\\xf8-\\xff",Mn="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+",Rn="["+Cn+"]",Tn="["+Nn+"]",Dn="[^"+Sn+Pn+Ln+Cn+Nn+Mn+"]",Bn="\\ud83c[\\udffb-\\udfff]",Hn="[^"+Sn+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+Mn+"]",Zn="\\u200d",Wn="(?:"+Tn+"|"+Dn+")",Fn="(?:"+Xn+"|"+Dn+")",Un="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Bn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Zn+"(?:"+[Hn,Vn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Rn,Vn,Yn].join("|")+")"+Kn,Jn="(?:"+[Hn+zn+"?",zn,Vn,Yn,In].join("|")+")",ne=RegExp(jn,"g"),ee=RegExp(zn,"g"),te=RegExp(Bn+"(?="+Bn+")|"+Jn+Kn,"g"),re=RegExp([Xn+"?"+Tn+"+"+Un+"(?="+[An,Xn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Xn+Wn,"$"].join("|")+")",Xn+"?"+Wn+"+"+Un,Xn+"+"+$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("["+Zn+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[R]=ce[T]=ce[D]=ce[B]=ce[H]=ce[V]=ce[Y]=ce[X]=!0,ce[g]=ce[y]=ce[A]=ce[m]=ce[z]=ce[x]=ce[b]=ce[_]=ce[S]=ce[k]=ce[C]=ce[M]=ce[O]=ce[P]=ce[I]=!1;var le={};le[g]=le[y]=le[A]=le[z]=le[m]=le[x]=le[L]=le[R]=le[T]=le[D]=le[B]=le[S]=le[k]=le[C]=le[M]=le[O]=le[P]=le[j]=le[H]=le[V]=le[Y]=le[X]=!0,le[b]=le[_]=le[I]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,de=parseInt,he="object"==typeof w&&w&&w.Object===Object&&w,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,we=me&&he.process,xe=function(){try{var n=ye&&ye.require&&ye.require("util").types;return n||we&&we.binding&&we.binding("util")}catch(n){}}(),be=xe&&xe.isArrayBuffer,_e=xe&&xe.isDate,Ee=xe&&xe.isMap,Se=xe&&xe.isRegExp,ke=xe&&xe.isSet,Ce=xe&&xe.isTypedArray;function Ne(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 Me(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)&&Xe(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 Re(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}function Te(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 De(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 Be(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 He=Ue("length");function Ve(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 Xe(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,We,t)}function Ze(n,e,t,r){for(var o=t-1,i=n.length;++o<i;)if(r(n[o],e))return o;return-1}function We(n){return n!=n}function Fe(n,e){var t=null==n?0:n.length;return t?qe(n,e)/t:h}function Ue(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&&Xe(e,n[t],0)>-1;);return t}function rt(n,e){for(var t=n.length;t--&&Xe(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):He(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 w,an=(e=null==e?pe:yt.defaults(pe.Object(),e,yt.pick(pe,ue))).Array,Sn=e.Date,kn=e.Error,Cn=e.Function,Nn=e.Math,Mn=e.Object,On=e.RegExp,Pn=e.String,jn=e.TypeError,In=an.prototype,An=Cn.prototype,zn=Mn.prototype,Ln=e["__core-js_shared__"],Rn=An.toString,Tn=zn.hasOwnProperty,Dn=0,Bn=(w=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Hn=zn.toString,Vn=Rn.call(Mn),Yn=pe._,Xn=On("^"+Rn.call(Tn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zn=me?e.Buffer:t,Wn=e.Symbol,Fn=e.Uint8Array,Un=Zn?Zn.allocUnsafe:t,$n=lt(Mn.getPrototypeOf,Mn),Gn=Mn.create,qn=zn.propertyIsEnumerable,Kn=In.splice,Qn=Wn?Wn.isConcatSpreadable:t,Jn=Wn?Wn.iterator:t,te=Wn?Wn.toStringTag:t,oe=function(){try{var n=hi(Mn,"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=Nn.ceil,ye=Nn.floor,we=Mn.getOwnPropertySymbols,xe=Zn?Zn.isBuffer:t,He=e.isFinite,$e=In.join,mt=lt(Mn.keys,Mn),wt=Nn.max,xt=Nn.min,bt=Sn.now,_t=e.parseInt,Et=Nn.random,St=In.reverse,kt=hi(e,"DataView"),Ct=hi(e,"Map"),Nt=hi(e,"Promise"),Mt=hi(e,"Set"),Ot=hi(e,"WeakMap"),Pt=hi(Mn,"create"),jt=Ot&&new Ot,It={},At=Bi(kt),zt=Bi(Ct),Lt=Bi(Nt),Rt=Bi(Mt),Tt=Bi(Ot),Dt=Wn?Wn.prototype:t,Bt=Dt?Dt.valueOf:t,Ht=Dt?Dt.toString:t;function Vt(n){if(ta(n)&&!Wu(n)&&!(n instanceof Wt)){if(n instanceof Zt)return n;if(Tn.call(n,"__wrapped__"))return Hi(n)}return new Zt(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 Xt(){}function Zt(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=t}function Wt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,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 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 $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 Ut(n);this.size=e.size}function Kt(n,e){var t=Wu(n),r=!t&&Zu(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&&!Tn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||xi(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 Ri(jo(n),cr(e,0,n.length))}function nr(n){return Ri(jo(n))}function er(n,e,r){(r!==t&&!Vu(n[e],r)||r===t&&!(e in n))&&ur(n,e,r)}function tr(n,e,r){var o=n[e];Tn.call(n,e)&&Vu(o,r)&&(r!==t||e in n)||ur(n,e,r)}function rr(n,e){for(var t=n.length;t--;)if(Vu(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:Na(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=Wu(n);if(f){if(a=function(n){var e=n.length,t=new n.constructor(e);e&&"string"==typeof n[0]&&Tn.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==g||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 m:case x: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 R:case T:case D:case B:case H:case V:case Y:case X:return No(n,t);case S:return new r;case k:case P:return new r(n);case M: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,Bt?Mn(Bt.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=Mn(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}Vt.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:Vt}},Vt.prototype=Xt.prototype,Vt.prototype.constructor=Vt,Zt.prototype=Yt(Xt.prototype),Zt.prototype.constructor=Zt,Wt.prototype=Yt(Xt.prototype),Wt.prototype.constructor=Wt,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 Tn.call(e,n)?e[n]:t},Ft.prototype.has=function(n){var e=this.__data__;return Pt?e[n]!==t:Tn.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},Ut.prototype.clear=function(){this.__data__=[],this.size=0},Ut.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)},Ut.prototype.get=function(n){var e=this.__data__,r=rr(e,n);return r<0?t:e[r][1]},Ut.prototype.has=function(n){return rr(this.__data__,n)>-1},Ut.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||Ut),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 Ut,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 Ut){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=wi),o||(o=[]);++i<u;){var a=n[i];e>0&&t(a)?e>1?mr(a,e-1,t,r,o):Re(o,a):r||(o[o.length]=a)}return o}var wr=Ro(),xr=Ro(!0);function br(n,e){return n&&wr(n,e,Ia)}function _r(n,e){return n&&xr(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[Di(e[r++])];return r&&r==o?n:t}function kr(n,e,t){var r=e(n);return Wu(n)?r:Re(r,t(n))}function Cr(n){return null==n?n===t?"[object Undefined]":"[object Null]":te&&te in Mn(n)?function(n){var e=Tn.call(n,te),r=n[te];try{n[te]=t;var o=!0}catch(n){}var i=Hn.call(n);o&&(e?n[te]=r:delete n[te]);return i}(n):function(n){return Hn.call(n)}(n)}function Nr(n,e){return n>e}function Mr(n,e){return null!=n&&Tn.call(n,e)}function Or(n,e){return null!=n&&e in Mn(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=xt(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[Di(Ki(e))];return null==o?t:Ne(o,n,r)}function Ir(n){return ta(n)&&Cr(n)==g}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=Wu(n),c=Wu(e),l=a?y:gi(n),s=c?y:gi(e),f=(l=l==g?C:l)==C,d=(s=s==g?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 m:case x:case k:return Vu(+n,+e);case b:return n.name==e.name&&n.message==e.message;case M: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(Bt)return Bt.call(n)==Bt.call(e)}return!1}(n,e,l,r,o,i,u);if(!(1&r)){var v=f&&Tn.call(n,"__wrapped__"),p=d&&Tn.call(e,"__wrapped__");if(v||p){var w=v?n.value():n,_=p?e.value():e;return u||(u=new qt),i(w,_,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:Tn.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]],w=e[h];if(o)var x=a?o(w,m,h,e,n,u):o(m,w,h,n,e,u);if(!(x===t?m===w||i(m,w,r,o,u):x)){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=Mn(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,Bn&&Bn in e))&&(Qu(n)?Xn:mn).test(Bi(n));var e}function Rr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Wu(n)?Yr(n[0],n[1]):Vr(n):hc(n)}function Tr(n){if(!ki(n))return mt(n);var e=[];for(var t in Mn(n))Tn.call(n,t)&&"constructor"!=t&&e.push(t);return e}function Dr(n){if(!ea(n))return function(n){var e=[];if(null!=n)for(var t in Mn(n))e.push(t);return e}(n);var e=ki(n),t=[];for(var r in n)("constructor"!=r||!e&&Tn.call(n,r))&&t.push(r);return t}function Br(n,e){return n<e}function Hr(n,e){var t=-1,r=Uu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++t]=e(n,o,i)})),r}function Vr(n){var e=di(n);return 1==e.length&&e[0][2]?Ni(e[0][0],e[0][1]):function(t){return t===n||zr(t,n,e)}}function Yr(n,e){return _i(n)&&Ci(e)?Ni(Di(n),e):function(r){var o=Na(r,n);return o===t&&o===e?Ma(r,n):Ar(e,o,3)}}function Xr(n,e,r,o,i){n!==e&&wr(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=Wu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Wu(c)?f=c:$u(c)?f=jo(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=No(l,!0)):f=[]:ia(l)||Zu(l)?(f=c,Zu(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,Xr,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 Zr(n,e){var r=n.length;if(r)return xi(e+=e<0?r:0,r)?n[e]:t}function Wr(n,e,t){e=e.length?Le(e,(function(n){return Wu(n)?function(e){return Sr(e,1===n.length?n[0]:n)}:n})):[oc];var r=-1;e=Le(e,Je(si()));var o=Hr(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=Mo(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 Ur(n,e,t,r){var o=r?Ze:Xe,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;xi(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>d)return t;do{e%2&&(t+=n),(e=ye(e/2))&&(n+=n)}while(e);return t}function Kr(n,e){return Ai(Mi(n,e,oc),n+"")}function Qr(n){return Qt(Va(n))}function Jr(n,e){var t=Va(n);return Ri(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=Di(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:xi(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 Ri(Va(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 xt(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||!Vu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function lo(n){return"number"==typeof n?n:la(n)?h:+n}function so(n){if("string"==typeof n)return n;if(Wu(n))return Le(n,so)+"";if(la(n))return Ht?Ht.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[Di(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 Wt&&(t=t.value()),Te(e,(function(n,e){return e.func.apply(e.thisArg,Re([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 wo(n){return $u(n)?n:[]}function xo(n){return"function"==typeof n?n:oc}function bo(n,e){return Wu(n)?n:_i(n,e)?[n]:Ti(wa(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=Un?Un(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 No(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function Mo(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=wt(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=wt(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=Wu(t)?Me: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=Mn(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(!Uu(t))return n(t,r);for(var o=t.length,i=e?o:-1,u=Mn(t);(e?i--:++i<o)&&!1!==r(u[i],i,u););return t}}function Ro(n){return function(e,t,r){for(var o=-1,i=Mn(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 To(n){return function(e){var r=at(e=wa(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 Do(n){return function(e){return Te(Qa(Za(e).replace(ne,"")),n,"")}}function Bo(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 Ho(n){return function(e,r,o){var i=Mn(e);if(!Uu(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 Vo(n){return oi((function(e){var o=e.length,i=o,u=Zt.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 Zt([],!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&&Wu(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,s,f){var d=e&l,h=1&e,v=2&e,p=24&e,g=512&e,y=v?t:Bo(n);return function l(){for(var m=arguments.length,w=an(m),x=m;x--;)w[x]=arguments[x];if(p)var b=li(l),_=function(n,e){for(var t=n.length,r=0;t--;)n[t]===e&&++r;return r}(w,b);if(o&&(w=Oo(w,o,i,p)),u&&(w=Po(w,u,a,p)),m-=_,p&&m<f){var E=st(w,b);return Go(n,e,Yo,l.placeholder,r,w,E,c,s,f-m)}var S=h?r:this,k=v?S[n]:n;return m=w.length,c?w=function(n,e){var r=n.length,o=xt(e.length,r),i=jo(n);for(;o--;){var u=e[o];n[o]=xi(u,r)?i[u]:t}return n}(w,c):g&&m>1&&w.reverse(),d&&s<m&&(w.length=s),this&&this!==pe&&this instanceof l&&(k=y||Bo(k)),k.apply(S,w)}}function Xo(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 Zo(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 Wo(n){return oi((function(e){return e=Le(e,Je(si())),Kr((function(t){var r=this;return n(e,(function(n){return Ne(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 Uo(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=wt(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=Nn[n];return function(n,t){if(n=ya(n),(t=null==t?0:xt(pa(t),292))&&He(n)){var r=(wa(n)+"e").split("e");return+((r=(wa(e(r[0]+"e"+(+r[1]+t)))+"e").split("e"))[0]+"e"+(+r[1]-t))}return e(n)}}var Ko=Mt&&1/ft(new Mt([,-0]))[1]==f?function(n){return new Mt(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,f,d,h,v,p){var g=2&e;if(!g&&"function"!=typeof n)throw new jn(r);var y=f?f.length:0;if(y||(e&=-97,f=d=t),v=v===t?v:wt(pa(v),0),p=p===t?p:pa(p),y-=d?d.length:0,e&c){var m=f,w=d;f=d=t}var x=g?t:ai(n),b=[n,e,o,f,d,m,w,h,v,p];if(x&&function(n,e){var t=n[1],r=e[1],o=t|r,u=o<131,a=r==l&&8==t||r==l&&t==s&&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 f=n[3];n[3]=f?Oo(f,c,e[4]):c,n[4]=f?st(n[3],i):e[4]}(c=e[5])&&(f=n[5],n[5]=f?Po(f,c,e[6]):c,n[6]=f?st(n[5],i):e[6]);(c=e[7])&&(n[7]=c);r&l&&(n[8]=null==n[8]?e[8]:xt(n[8],e[8]));null==n[9]&&(n[9]=e[9]);n[0]=e[0],n[1]=o}(b,x),n=b[0],e=b[1],o=b[2],f=b[3],d=b[4],!(p=b[9]=b[9]===t?g?0:n.length:wt(b[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==u?function(n,e,r){var o=Bo(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):Ne(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=Bo(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 Ne(f,o?t:this,s)}}(n,e,o,f);else var _=function(n,e,t){var r=1&e,o=Bo(n);return function e(){return(this&&this!==pe&&this instanceof e?o:n).apply(r?t:this,arguments)}}(n,e,o);return zi((x?eo:ji)(_,b),n,e)}function ni(n,e,r,o){return n===t||Vu(n,zn[r])&&!Tn.call(o,r)?e:n}function ei(n,e,r,o,i,u){return ea(n)&&ea(e)&&(u.set(e,n),Xr(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(!Be(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(Mi(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=Tn.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(Tn.call(Vt,"placeholder")?Vt:n).placeholder}function si(){var n=Vt.iteratee||ic;return n=n===ic?Rr: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=we?function(n){return null==n?[]:(n=Mn(n),Ie(we(n),(function(e){return qn.call(n,e)})))}:gc,pi=we?function(n){for(var e=[];n;)Re(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=Di(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)&&xi(u,o)&&(Wu(n)||Zu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Yt($n(n))}function wi(n){return Wu(n)||Zu(n)||!!(Qn&&n&&n[Qn])}function xi(n,e){var t=typeof n;return!!(e=null==e?d:e)&&("number"==t||"symbol"!=t&&xn.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?Uu(t)&&xi(e,t.length):"string"==r&&e in t)&&Vu(t[e],n)}function _i(n,e){if(Wu(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 Mn(e))}function Ei(n){var e=ci(n),t=Vt[e];if("function"!=typeof t||!(e in Wt.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||Nt&&gi(Nt.resolve())!=N||Mt&&gi(new Mt)!=O||Ot&&gi(new Ot)!=I)&&(gi=function(n){var e=Cr(n),r=e==C?n.constructor:t,o=r?Bi(r):"";if(o)switch(o){case At:return z;case zt:return S;case Lt:return N;case Rt:return O;case Tt: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 Ni(n,e){return function(r){return null!=r&&(r[n]===e&&(e!==t||n in Mn(r)))}}function Mi(n,e,r){return e=wt(e===t?n.length-1:e,0),function(){for(var t=arguments,o=-1,i=wt(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),Ne(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(p,(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 Ri(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 Ti=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 Di(n){if("string"==typeof n||la(n))return n;var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function Bi(n){if(null!=n){try{return Rn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Hi(n){if(n instanceof Wt)return n.clone();var e=new Zt(n.__wrapped__,n.__chain__);return e.__actions__=jo(n.__actions__),e.__index__=n.__index__,e.__values__=n.__values__,e}var Vi=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)):[]})),Xi=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 Zi(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=wt(r+o,0)),Ye(n,si(e,3),o)}function Wi(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?wt(o+i,0):xt(i,o-1)),Ye(n,si(e,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Ui(n){return n&&n.length?n[0]:t}var $i=Kr((function(n){var e=Le(n,wo);return e.length&&e[0]===n[0]?Pr(e):[]})),Gi=Kr((function(n){var e=Ki(n),r=Le(n,wo);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,wo);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?Ur(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 xi(n,t)?+n:n})).sort(Mo)),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=wt(n.length,e),!0})),Ke(e,(function(e){return Le(n,Ue(e))}))}function uu(n,e){if(!n||!n.length)return[];var r=iu(n);return null==e?r:Le(r,(function(n){return Ne(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=Vt(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 Wt&&xi(r)?((o=o.slice(r,+r+(e?1:0))).__actions__.push({func:vu,args:[i],thisArg:t}),new Zt(o,this.__chain__).thru((function(n){return e&&!n.length&&n.push(t),n}))):this.thru(i)}));var gu=Ao((function(n,e,t){Tn.call(n,t)?++n[t]:ur(n,t,1)}));var yu=Ho(Zi),mu=Ho(Wi);function wu(n,e){return(Wu(n)?Oe:hr)(n,si(e,3))}function xu(n,e){return(Wu(n)?Pe:vr)(n,si(e,3))}var bu=Ao((function(n,e,t){Tn.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=Uu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Ne(e,n,t):jr(n,e,t)})),i})),Eu=Ao((function(n,e,t){ur(n,t,e)}));function Su(n,e){return(Wu(n)?Le:Hr)(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]]),Wr(n,mr(e,1),[])})),Nu=he||function(){return pe.Date.now()};function Mu(n,e,r){return e=r?t:e,e=n&&null==e?n.length:e,Jo(n,l,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=Nu();if(g(n))return m(n);l=Ii(y,function(n){var t=e-(n-s);return h?xt(t,a-(n-f)):t}(n))}function m(n){return l=t,v&&i?p(n):(i=u=t,c)}function w(){var n=Nu(),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)?wt(ya(o.maxWait)||0,e):a,v="trailing"in o?!!o.trailing:v),w.cancel=function(){l!==t&&So(l),f=0,i=s=u=l=t},w.flush=function(){return l===t?c:m(Nu())},w}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 Ru(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 Tu=_o((function(n,e){var t=(e=1==e.length&&Wu(e[0])?Le(e[0],Je(si())):Le(mr(e,1),Je(si()))).length;return Kr((function(r){for(var o=-1,i=xt(r.length,t);++o<i;)r[o]=e[o].call(this,r[o]);return Ne(n,this,r)}))})),Du=Kr((function(n,e){var r=st(e,li(Du));return Jo(n,a,t,e,r)})),Bu=Kr((function(n,e){var r=st(e,li(Bu));return Jo(n,c,t,e,r)})),Hu=oi((function(n,e){return Jo(n,s,t,t,t,e)}));function Vu(n,e){return n===e||n!=n&&e!=e}var Yu=$o(Nr),Xu=$o((function(n,e){return n>=e})),Zu=Ir(function(){return arguments}())?Ir:function(n){return ta(n)&&Tn.call(n,"callee")&&!qn.call(n,"callee")},Wu=an.isArray,Fu=be?Je(be):function(n){return ta(n)&&Cr(n)==A};function Uu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ta(n)&&Uu(n)}var Gu=xe||yc,qu=_e?Je(_e):function(n){return ta(n)&&Cr(n)==x};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<=d}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=Tn.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&Rn.call(t)==Vn}var ua=Se?Je(Se):function(n){return ta(n)&&Cr(n)==M};var aa=ke?Je(ke):function(n){return ta(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Wu(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(Br),da=$o((function(n,e){return n<=e}));function ha(n){if(!n)return[];if(Uu(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:Va)(n)}function va(n){return n?(n=ya(n))===f||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,v):0}function ya(n){if("number"==typeof n)return n;if(la(n))return h;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||wn.test(n)?de(n.slice(2),t?2:8):gn.test(n)?h:+n}function ma(n){return Io(n,Aa(n))}function wa(n){return null==n?"":so(n)}var xa=zo((function(n,e){if(ki(e)||Uu(e))Io(e,Ia(e),n);else for(var t in e)Tn.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=Mn(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||Vu(f,zn[s])&&!Tn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(t,ei),Ne(La,t,n)}));function Na(n,e,r){var o=null==n?t:Sr(n,e);return o===t?r:o}function Ma(n,e){return null!=n&&yi(n,e,Or)}var Oa=Xo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Hn.call(e)),n[e]=t}),ec(oc)),Pa=Xo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Hn.call(e)),Tn.call(n,e)?n[e].push(t):n[e]=[t]}),si),ja=Kr(jr);function Ia(n){return Uu(n)?Kt(n):Tr(n)}function Aa(n){return Uu(n)?Kt(n,!0):Dr(n)}var za=zo((function(n,e,t){Xr(n,e,t)})),La=zo((function(n,e,t,r){Xr(n,e,t,r)})),Ra=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 Ta=oi((function(n,e){return null==n?{}:function(n,e){return Fr(n,e,(function(e,t){return Ma(n,t)}))}(n,e)}));function Da(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 Ba=Qo(Ia),Ha=Qo(Aa);function Va(n){return null==n?[]:nt(n,Ia(n))}var Ya=Do((function(n,e,t){return e=e.toLowerCase(),n+(t?Xa(e):e)}));function Xa(n){return Ka(wa(n).toLowerCase())}function Za(n){return(n=wa(n))&&n.replace(bn,ot).replace(ee,"")}var Wa=Do((function(n,e,t){return n+(t?"-":"")+e.toLowerCase()})),Fa=Do((function(n,e,t){return n+(t?" ":"")+e.toLowerCase()})),Ua=To("toLowerCase");var $a=Do((function(n,e,t){return n+(t?"_":"")+e.toLowerCase()}));var Ga=Do((function(n,e,t){return n+(t?" ":"")+Ka(e)}));var qa=Do((function(n,e,t){return n+(t?" ":"")+e.toUpperCase()})),Ka=To("toUpperCase");function Qa(n,e,r){return n=wa(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 Ne(n,t,e)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,e){return Oe(e,(function(e){e=Di(e),ur(n,e,Pu(n[e],n))})),n}));function ec(n){return function(){return n}}var tc=Vo(),rc=Vo(!0);function oc(n){return n}function ic(n){return Rr("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,Re([this.value()],arguments))})})),n}function lc(){}var sc=Wo(Le),fc=Wo(je),dc=Wo(Be);function hc(n){return _i(n)?Ue(Di(n)):function(n){return function(e){return Sr(e,n)}}(n)}var vc=Uo(),pc=Uo(!0);function gc(){return[]}function yc(){return!1}var mc=Zo((function(n,e){return n+e}),0),wc=qo("ceil"),xc=Zo((function(n,e){return n/e}),1),bc=qo("floor");var _c,Ec=Zo((function(n,e){return n*e}),1),Sc=qo("round"),kc=Zo((function(n,e){return n-e}),0);return Vt.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)}},Vt.ary=Mu,Vt.assign=xa,Vt.assignIn=ba,Vt.assignInWith=_a,Vt.assignWith=Ea,Vt.at=Sa,Vt.before=Ou,Vt.bind=Pu,Vt.bindAll=nc,Vt.bindKey=ju,Vt.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Wu(n)?n:[n]},Vt.chain=hu,Vt.chunk=function(n,e,r){e=(r?bi(n,e,r):e===t)?1:wt(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},Vt.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},Vt.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 Re(Wu(t)?jo(t):[t],mr(e,1))},Vt.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(Ne(o[0],this,t))return Ne(o[1],this,t)}}))},Vt.conforms=function(n){return function(n){var e=Ia(n);return function(t){return sr(t,n,e)}}(lr(n,1))},Vt.constant=ec,Vt.countBy=gu,Vt.create=function(n,e){var t=Yt(n);return null==e?t:ir(t,e)},Vt.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},Vt.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},Vt.debounce=Iu,Vt.defaults=ka,Vt.defaultsDeep=Ca,Vt.defer=Au,Vt.delay=zu,Vt.difference=Vi,Vt.differenceBy=Yi,Vt.differenceWith=Xi,Vt.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):[]},Vt.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):[]},Vt.dropRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0,!0):[]},Vt.dropWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0):[]},Vt.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)):[]},Vt.filter=function(n,e){return(Wu(n)?Ie:yr)(n,si(e,3))},Vt.flatMap=function(n,e){return mr(Su(n,e),1)},Vt.flatMapDeep=function(n,e){return mr(Su(n,e),f)},Vt.flatMapDepth=function(n,e,r){return r=r===t?1:pa(r),mr(Su(n,e),r)},Vt.flatten=Fi,Vt.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,f):[]},Vt.flattenDepth=function(n,e){return(null==n?0:n.length)?mr(n,e=e===t?1:pa(e)):[]},Vt.flip=function(n){return Jo(n,512)},Vt.flow=tc,Vt.flowRight=rc,Vt.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},Vt.functions=function(n){return null==n?[]:Er(n,Ia(n))},Vt.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},Vt.groupBy=bu,Vt.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},Vt.intersection=$i,Vt.intersectionBy=Gi,Vt.intersectionWith=qi,Vt.invert=Oa,Vt.invertBy=Pa,Vt.invokeMap=_u,Vt.iteratee=ic,Vt.keyBy=Eu,Vt.keys=Ia,Vt.keysIn=Aa,Vt.map=Su,Vt.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},Vt.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},Vt.matches=function(n){return Vr(lr(n,1))},Vt.matchesProperty=function(n,e){return Yr(n,lr(e,1))},Vt.memoize=Lu,Vt.merge=za,Vt.mergeWith=La,Vt.method=uc,Vt.methodOf=ac,Vt.mixin=cc,Vt.negate=Ru,Vt.nthArg=function(n){return n=pa(n),Kr((function(e){return Zr(e,n)}))},Vt.omit=Ra,Vt.omitBy=function(n,e){return Da(n,Ru(si(e)))},Vt.once=function(n){return Ou(2,n)},Vt.orderBy=function(n,e,r,o){return null==n?[]:(Wu(e)||(e=null==e?[]:[e]),Wu(r=o?t:r)||(r=null==r?[]:[r]),Wr(n,e,r))},Vt.over=sc,Vt.overArgs=Tu,Vt.overEvery=fc,Vt.overSome=dc,Vt.partial=Du,Vt.partialRight=Bu,Vt.partition=ku,Vt.pick=Ta,Vt.pickBy=Da,Vt.property=hc,Vt.propertyOf=function(n){return function(e){return null==n?t:Sr(n,e)}},Vt.pull=Qi,Vt.pullAll=Ji,Vt.pullAllBy=function(n,e,t){return n&&n.length&&e&&e.length?Ur(n,e,si(t,2)):n},Vt.pullAllWith=function(n,e,r){return n&&n.length&&e&&e.length?Ur(n,e,t,r):n},Vt.pullAt=nu,Vt.range=vc,Vt.rangeRight=pc,Vt.rearg=Hu,Vt.reject=function(n,e){return(Wu(n)?Ie:yr)(n,Ru(si(e,3)))},Vt.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},Vt.rest=function(n,e){if("function"!=typeof n)throw new jn(r);return Kr(n,e=e===t?e:pa(e))},Vt.reverse=eu,Vt.sampleSize=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),(Wu(n)?Jt:Jr)(n,e)},Vt.set=function(n,e,t){return null==n?n:no(n,e,t)},Vt.setWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:no(n,e,r,o)},Vt.shuffle=function(n){return(Wu(n)?nr:ro)(n)},Vt.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)):[]},Vt.sortBy=Cu,Vt.sortedUniq=function(n){return n&&n.length?co(n):[]},Vt.sortedUniqBy=function(n,e){return n&&n.length?co(n,si(e,2)):[]},Vt.split=function(n,e,r){return r&&"number"!=typeof r&&bi(n,e,r)&&(e=r=t),(r=r===t?v:r>>>0)?(n=wa(n))&&("string"==typeof e||null!=e&&!ua(e))&&!(e=so(e))&&at(n)?Eo(vt(n),0,r):n.split(e,r):[]},Vt.spread=function(n,e){if("function"!=typeof n)throw new jn(r);return e=null==e?0:wt(pa(e),0),Kr((function(t){var r=t[e],o=Eo(t,0,e);return r&&Re(o,r),Ne(n,this,o)}))},Vt.tail=function(n){var e=null==n?0:n.length;return e?oo(n,1,e):[]},Vt.take=function(n,e,r){return n&&n.length?oo(n,0,(e=r||e===t?1:pa(e))<0?0:e):[]},Vt.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):[]},Vt.takeRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!1,!0):[]},Vt.takeWhile=function(n,e){return n&&n.length?po(n,si(e,3)):[]},Vt.tap=function(n,e){return e(n),n},Vt.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})},Vt.thru=vu,Vt.toArray=ha,Vt.toPairs=Ba,Vt.toPairsIn=Ha,Vt.toPath=function(n){return Wu(n)?Le(n,Di):la(n)?[n]:jo(Ti(wa(n)))},Vt.toPlainObject=ma,Vt.transform=function(n,e,t){var r=Wu(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},Vt.unary=function(n){return Mu(n,1)},Vt.union=tu,Vt.unionBy=ru,Vt.unionWith=ou,Vt.uniq=function(n){return n&&n.length?fo(n):[]},Vt.uniqBy=function(n,e){return n&&n.length?fo(n,si(e,2)):[]},Vt.uniqWith=function(n,e){return e="function"==typeof e?e:t,n&&n.length?fo(n,t,e):[]},Vt.unset=function(n,e){return null==n||ho(n,e)},Vt.unzip=iu,Vt.unzipWith=uu,Vt.update=function(n,e,t){return null==n?n:vo(n,e,xo(t))},Vt.updateWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:vo(n,e,xo(r),o)},Vt.values=Va,Vt.valuesIn=function(n){return null==n?[]:nt(n,Aa(n))},Vt.without=au,Vt.words=Qa,Vt.wrap=function(n,e){return Du(xo(e),n)},Vt.xor=cu,Vt.xorBy=lu,Vt.xorWith=su,Vt.zip=fu,Vt.zipObject=function(n,e){return mo(n||[],e||[],tr)},Vt.zipObjectDeep=function(n,e){return mo(n||[],e||[],no)},Vt.zipWith=du,Vt.entries=Ba,Vt.entriesIn=Ha,Vt.extend=ba,Vt.extendWith=_a,cc(Vt,Vt),Vt.add=mc,Vt.attempt=Ja,Vt.camelCase=Ya,Vt.capitalize=Xa,Vt.ceil=wc,Vt.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)},Vt.clone=function(n){return lr(n,4)},Vt.cloneDeep=function(n){return lr(n,5)},Vt.cloneDeepWith=function(n,e){return lr(n,5,e="function"==typeof e?e:t)},Vt.cloneWith=function(n,e){return lr(n,4,e="function"==typeof e?e:t)},Vt.conformsTo=function(n,e){return null==e||sr(n,e,Ia(e))},Vt.deburr=Za,Vt.defaultTo=function(n,e){return null==n||n!=n?e:n},Vt.divide=xc,Vt.endsWith=function(n,e,r){n=wa(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},Vt.eq=Vu,Vt.escape=function(n){return(n=wa(n))&&q.test(n)?n.replace($,it):n},Vt.escapeRegExp=function(n){return(n=wa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},Vt.every=function(n,e,r){var o=Wu(n)?je:pr;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Vt.find=yu,Vt.findIndex=Zi,Vt.findKey=function(n,e){return Ve(n,si(e,3),br)},Vt.findLast=mu,Vt.findLastIndex=Wi,Vt.findLastKey=function(n,e){return Ve(n,si(e,3),_r)},Vt.floor=bc,Vt.forEach=wu,Vt.forEachRight=xu,Vt.forIn=function(n,e){return null==n?n:wr(n,si(e,3),Aa)},Vt.forInRight=function(n,e){return null==n?n:xr(n,si(e,3),Aa)},Vt.forOwn=function(n,e){return n&&br(n,si(e,3))},Vt.forOwnRight=function(n,e){return n&&_r(n,si(e,3))},Vt.get=Na,Vt.gt=Yu,Vt.gte=Xu,Vt.has=function(n,e){return null!=n&&yi(n,e,Mr)},Vt.hasIn=Ma,Vt.head=Ui,Vt.identity=oc,Vt.includes=function(n,e,t,r){n=Uu(n)?n:Va(n),t=t&&!r?pa(t):0;var o=n.length;return t<0&&(t=wt(o+t,0)),ca(n)?t<=o&&n.indexOf(e,t)>-1:!!o&&Xe(n,e,t)>-1},Vt.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=wt(r+o,0)),Xe(n,e,o)},Vt.inRange=function(n,e,r){return e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t){return n>=xt(e,t)&&n<wt(e,t)}(n=ya(n),e,r)},Vt.invoke=ja,Vt.isArguments=Zu,Vt.isArray=Wu,Vt.isArrayBuffer=Fu,Vt.isArrayLike=Uu,Vt.isArrayLikeObject=$u,Vt.isBoolean=function(n){return!0===n||!1===n||ta(n)&&Cr(n)==m},Vt.isBuffer=Gu,Vt.isDate=qu,Vt.isElement=function(n){return ta(n)&&1===n.nodeType&&!ia(n)},Vt.isEmpty=function(n){if(null==n)return!0;if(Uu(n)&&(Wu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Zu(n)))return!n.length;var e=gi(n);if(e==S||e==O)return!n.size;if(ki(n))return!Tr(n).length;for(var t in n)if(Tn.call(n,t))return!1;return!0},Vt.isEqual=function(n,e){return Ar(n,e)},Vt.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},Vt.isError=Ku,Vt.isFinite=function(n){return"number"==typeof n&&He(n)},Vt.isFunction=Qu,Vt.isInteger=Ju,Vt.isLength=na,Vt.isMap=ra,Vt.isMatch=function(n,e){return n===e||zr(n,e,di(e))},Vt.isMatchWith=function(n,e,r){return r="function"==typeof r?r:t,zr(n,e,di(e),r)},Vt.isNaN=function(n){return oa(n)&&n!=+n},Vt.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},Vt.isNil=function(n){return null==n},Vt.isNull=function(n){return null===n},Vt.isNumber=oa,Vt.isObject=ea,Vt.isObjectLike=ta,Vt.isPlainObject=ia,Vt.isRegExp=ua,Vt.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=d},Vt.isSet=aa,Vt.isString=ca,Vt.isSymbol=la,Vt.isTypedArray=sa,Vt.isUndefined=function(n){return n===t},Vt.isWeakMap=function(n){return ta(n)&&gi(n)==I},Vt.isWeakSet=function(n){return ta(n)&&"[object WeakSet]"==Cr(n)},Vt.join=function(n,e){return null==n?"":$e.call(n,e)},Vt.kebabCase=Wa,Vt.last=Ki,Vt.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?wt(o+i,0):xt(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,We,i,!0)},Vt.lowerCase=Fa,Vt.lowerFirst=Ua,Vt.lt=fa,Vt.lte=da,Vt.max=function(n){return n&&n.length?gr(n,oc,Nr):t},Vt.maxBy=function(n,e){return n&&n.length?gr(n,si(e,2),Nr):t},Vt.mean=function(n){return Fe(n,oc)},Vt.meanBy=function(n,e){return Fe(n,si(e,2))},Vt.min=function(n){return n&&n.length?gr(n,oc,Br):t},Vt.minBy=function(n,e){return n&&n.length?gr(n,si(e,2),Br):t},Vt.stubArray=gc,Vt.stubFalse=yc,Vt.stubObject=function(){return{}},Vt.stubString=function(){return""},Vt.stubTrue=function(){return!0},Vt.multiply=Ec,Vt.nth=function(n,e){return n&&n.length?Zr(n,pa(e)):t},Vt.noConflict=function(){return pe._===this&&(pe._=Yn),this},Vt.noop=lc,Vt.now=Nu,Vt.pad=function(n,e,t){n=wa(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)},Vt.padEnd=function(n,e,t){n=wa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?n+Fo(e-r,t):n},Vt.padStart=function(n,e,t){n=wa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?Fo(e-r,t)+n:n},Vt.parseInt=function(n,e,t){return t||null==e?e=0:e&&(e=+e),_t(wa(n).replace(un,""),e||0)},Vt.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 xt(n+i*(e-n+fe("1e-"+((i+"").length-1))),e)}return Gr(n,e)},Vt.reduce=function(n,e,t){var r=Wu(n)?Te:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,hr)},Vt.reduceRight=function(n,e,t){var r=Wu(n)?De:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,vr)},Vt.repeat=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),qr(wa(n),e)},Vt.replace=function(){var n=arguments,e=wa(n[0]);return n.length<3?e:e.replace(n[1],n[2])},Vt.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[Di(e[o])];u===t&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},Vt.round=Sc,Vt.runInContext=n,Vt.sample=function(n){return(Wu(n)?Qt:Qr)(n)},Vt.size=function(n){if(null==n)return 0;if(Uu(n))return ca(n)?ht(n):n.length;var e=gi(n);return e==S||e==O?n.size:Tr(n).length},Vt.snakeCase=$a,Vt.some=function(n,e,r){var o=Wu(n)?Be:io;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Vt.sortedIndex=function(n,e){return uo(n,e)},Vt.sortedIndexBy=function(n,e,t){return ao(n,e,si(t,2))},Vt.sortedIndexOf=function(n,e){var t=null==n?0:n.length;if(t){var r=uo(n,e);if(r<t&&Vu(n[r],e))return r}return-1},Vt.sortedLastIndex=function(n,e){return uo(n,e,!0)},Vt.sortedLastIndexBy=function(n,e,t){return ao(n,e,si(t,2),!0)},Vt.sortedLastIndexOf=function(n,e){if(null==n?0:n.length){var t=uo(n,e,!0)-1;if(Vu(n[t],e))return t}return-1},Vt.startCase=Ga,Vt.startsWith=function(n,e,t){return n=wa(n),t=null==t?0:cr(pa(t),0,n.length),e=so(e),n.slice(t,t+e.length)==e},Vt.subtract=kc,Vt.sum=function(n){return n&&n.length?qe(n,oc):0},Vt.sumBy=function(n,e){return n&&n.length?qe(n,si(e,2)):0},Vt.template=function(n,e,r){var o=Vt.templateSettings;r&&bi(n,e,r)&&(e=t),n=wa(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="+(Tn.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=Tn.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(Z,""):d).replace(W,"$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},Vt.times=function(n,e){if((n=pa(n))<1||n>d)return[];var t=v,r=xt(n,v);e=si(e),n-=v;for(var o=Ke(r,e);++t<n;)e(t);return o},Vt.toFinite=va,Vt.toInteger=pa,Vt.toLength=ga,Vt.toLower=function(n){return wa(n).toLowerCase()},Vt.toNumber=ya,Vt.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,d):0===n?n:0},Vt.toString=wa,Vt.toUpper=function(n){return wa(n).toUpperCase()},Vt.trim=function(n,e,r){if((n=wa(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("")},Vt.trimEnd=function(n,e,r){if((n=wa(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("")},Vt.trimStart=function(n,e,r){if((n=wa(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("")},Vt.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=wa(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,wa(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},Vt.unescape=function(n){return(n=wa(n))&&G.test(n)?n.replace(U,gt):n},Vt.uniqueId=function(n){var e=++Dn;return wa(n)+e},Vt.upperCase=qa,Vt.upperFirst=Ka,Vt.each=wu,Vt.eachRight=xu,Vt.first=Ui,cc(Vt,(_c={},br(Vt,(function(n,e){Tn.call(Vt.prototype,e)||(_c[e]=n)})),_c),{chain:!1}),Vt.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Vt[n].placeholder=Vt})),Oe(["drop","take"],(function(n,e){Wt.prototype[n]=function(r){r=r===t?1:wt(pa(r),0);var o=this.__filtered__&&!e?new Wt(this):this.clone();return o.__filtered__?o.__takeCount__=xt(r,o.__takeCount__):o.__views__.push({size:xt(r,v),type:n+(o.__dir__<0?"Right":"")}),o},Wt.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;Wt.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":"");Wt.prototype[n]=function(){return this[t](1).value()[0]}})),Oe(["initial","tail"],(function(n,e){var t="drop"+(e?"":"Right");Wt.prototype[n]=function(){return this.__filtered__?new Wt(this):this[t](1)}})),Wt.prototype.compact=function(){return this.filter(oc)},Wt.prototype.find=function(n){return this.filter(n).head()},Wt.prototype.findLast=function(n){return this.reverse().find(n)},Wt.prototype.invokeMap=Kr((function(n,e){return"function"==typeof n?new Wt(this):this.map((function(t){return jr(t,n,e)}))})),Wt.prototype.reject=function(n){return this.filter(Ru(si(n)))},Wt.prototype.slice=function(n,e){n=pa(n);var r=this;return r.__filtered__&&(n>0||e<0)?new Wt(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)},Wt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Wt.prototype.toArray=function(){return this.take(v)},br(Wt.prototype,(function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=Vt[o?"take"+("last"==e?"Right":""):e],u=o||/^find/.test(e);i&&(Vt.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,c=e instanceof Wt,l=a[0],s=c||Wu(e),f=function(n){var e=i.apply(Vt,Re([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 Wt(this);var g=n.apply(e,a);return g.__actions__.push({func:vu,args:[f],thisArg:t}),new Zt(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);Vt.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Wu(o)?o:[],n)}return this[t]((function(t){return e.apply(Wu(t)?t:[],n)}))}})),br(Wt.prototype,(function(n,e){var t=Vt[e];if(t){var r=t.name+"";Tn.call(It,r)||(It[r]=[]),It[r].push({name:e,func:t})}})),It[Yo(t,2).name]=[{name:"wrapper",func:t}],Wt.prototype.clone=function(){var n=new Wt(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},Wt.prototype.reverse=function(){if(this.__filtered__){var n=new Wt(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Wt.prototype.value=function(){var n=this.__wrapped__.value(),e=this.__dir__,t=Wu(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=xt(e,n+u);break;case"takeRight":n=wt(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=xt(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,w=y.type,x=m(g);if(2==w)g=x;else if(!x){if(1==w)continue n;break n}}v[d++]=g}return v},Vt.prototype.at=pu,Vt.prototype.chain=function(){return hu(this)},Vt.prototype.commit=function(){return new Zt(this.value(),this.__chain__)},Vt.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__++]}},Vt.prototype.plant=function(n){for(var e,r=this;r instanceof Xt;){var o=Hi(r);o.__index__=0,o.__values__=t,e?i.__wrapped__=o:e=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,e},Vt.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Wt){var e=n;return this.__actions__.length&&(e=new Wt(this)),(e=e.reverse()).__actions__.push({func:vu,args:[eu],thisArg:t}),new Zt(e,this.__chain__)}return this.thru(eu)},Vt.prototype.toJSON=Vt.prototype.valueOf=Vt.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Vt.prototype.first=Vt.prototype.head,Jn&&(Vt.prototype[Jn]=function(){return this}),Vt}();ye?((ye.exports=yt)._=yt,ge._=yt):pe._=yt}).call(w)}(AE,AE.exports);var zE=x(AE.exports);function LE(n){var e=n.layoutTypes,t=n.layoutConfig,r=void 0===t?OE:t,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=e[null==r?void 0:r.type]||jE[null==r?void 0:r.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)}))}(u)&&c?function(n){var e=n.layoutConfig,t=void 0===e?OE:e,r=n.edges,o=n.nodeOrigin,i=n.nodes,u=n.container,a=n.layoutFn,c=zE.cloneDeep(i);c.forEach((function(n){n.data&&(n.data.width=n.measured.width,n.data.height=n.measured.height)}));var l=a(c,r,d({nodeOrigin:o,width:u.width,height:u.height},null==t?void 0:t.options)),s=l.nodes,f=l.edges;return{nodes:s,edges:f,layoutComplete:!0}}({layoutConfig:r,container:a,nodeOrigin:i,nodes:u,layoutFn:c,edges:o}):{nodes:u,edges:o,layoutComplete:!1}}function RE(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=Jx(e),l=Gx(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&&IE({nodes:a,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var TE=function(n){var e,t,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return e=function(n,e){return d(d({},PE({nodes:r,edges:o,width:a,height:c,fitView:l,defaultNodes:i,defaultEdges:u})),{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(t){var r=e(),o=r.triggerNodeChanges,i=r.nodeLookup,u=r.parentLookup,a=r.domNode,c=r.nodeOrigin,l=r.debug,s=r.nodeExtent,f=function(n,e,t,r,o,i){var u,a,c=null==r?void 0:r.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};var s=[],f=window.getComputedStyle(c),d=new window.DOMMatrixReadOnly(f.transform).m22,h=[];try{for(var v=U(n.values()),p=v.next();!p.done;p=v.next()){var g=p.value,y=e.get(g.id);if(y)if(y.hidden)e.set(y.id,W(W({},y),{internals:W(W({},y.internals),{handleBounds:void 0})})),l=!0;else{var m=rp(g.nodeElement),w=y.measured.width!==m.width||y.measured.height!==m.height;if(m.width&&m.height&&(w||!y.internals.handleBounds||g.force)){var x=g.nodeElement.getBoundingClientRect(),b=$v(y.extent)?y.extent:i,_=y.internals.positionAbsolute;y.parentId&&"parent"===y.extent?_=qv(_,m,e.get(y.parentId)):b&&(_=Av(_,b,m));var E=W(W({},y),{measured:m,internals:W(W({},y.internals),{positionAbsolute:_,handleBounds:{source:ip("source",g.nodeElement,x,d,y.id),target:ip("target",g.nodeElement,x,d,y.id)}})});e.set(y.id,E),y.parentId&&jp(E,e,t,{nodeOrigin:o}),l=!0,w&&(s.push({id:y.id,type:"dimensions",dimensions:m}),y.expandParent&&y.parentId&&h.push({id:y.id,parentId:y.parentId,rect:Bv(E,o)}))}}}}catch(n){u={error:n}}finally{try{p&&!p.done&&(a=v.return)&&a.call(v)}finally{if(u)throw u.error}}if(h.length>0){var S=Pp(h,e,t,o);s.push.apply(s,G([],$(S),!1))}return{changes:s,updatedInternals:l}}(t,i,u,a,c,s),d=f.changes;if(f.updatedInternals){var h=zE.cloneDeep(i);n({nodeLookup:h}),function(n,e,t){var r,o,i=Ip(Np,t);try{for(var u=U(n.values()),a=u.next();!a.done;a=u.next()){var c=a.value;if(c.parentId)jp(c,n,e,i);else{var l=Mv(c,i.nodeOrigin),s=$v(c.extent)?c.extent:i.nodeExtent,f=Av(l,s,Gv(c));c.internals.positionAbsolute=f}}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}(i,u,{nodeOrigin:c,nodeExtent:s}),(null==d?void 0:d.length)>0&&(l&&console.log("Ink Flow: trigger node changes",d),null==o||o(d))}},updateNodePositions:function(n,t){var r,o;void 0===t&&(t=!1);var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=y(c.value,2),s=l[0],f=l[1],h={id:s,type:"position",position:f.position,dragging:t};(null==f?void 0:f.expandParent)&&(null==f?void 0:f.parentId)&&h.position&&(i.push({id:s,parentId:f.parentId,rect:d(d({},f.internals.positionAbsolute),{width:f.measured.width,height:f.measured.height})}),h.position.x=Math.max(0,h.position.x),h.position.y=Math.max(0,h.position.y)),u.push(h)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}if(i.length>0){var v=e(),p=function(n,e,t,r){var o,i,u,a,c,l=[],s=new Map;try{for(var f=g(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=e.get(h.parentId);if(v){var p=null!==(a=null===(u=s.get(h.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:rb(v,null!==(c=v.origin)&&void 0!==c?c:r),y=cb(p,h.rect);s.set(h.parentId,{expandedRect:y,parent:v})}}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return s.size>0&&s.forEach((function(e,r){var o=e.expandedRect,i=e.parent,u=Gx(i,i.origin).position,a=Jx(i),c=o.x<u.x?Math.round(Math.abs(u.x-o.x)):0,s=o.y<u.y?Math.round(Math.abs(u.y-o.y)):0;if(c>0||s>0){l.push({id:r,type:"position",position:{x:u.x-c,y:u.y-s}});var f=t.get(r);null==f||f.forEach((function(e){n.some((function(n){return n.id===e.id}))||l.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+s}})}))}(a.width<o.width||a.height<o.height)&&l.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))}})})),l}(i,v.nodeLookup,v.parentLookup);u.push.apply(u,m([],y(p),!1))}e().triggerNodeChanges(u)},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,a=t.triggerEdgeChanges;r?u(n.map((function(n){return zb(n,!0)}))):(u(Lb(i,new Set(m([],y(n),!1)),!0)),a(Lb(o)))},addSelectedEdges:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,a=t.triggerEdgeChanges;r?a(n.map((function(n){return zb(n,!0)}))):(a(Lb(o,new Set(m([],y(n),!1)))),u(Lb(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,zb(n.id,!1)})),d=s.map((function(n){return zb(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?m(m([],y(n),!1),[zb(e.id,!1)],!1):n}),[]),a=t.reduce((function(n,e){return e.selected?m(m([],y(n),!1),[zb(e.id,!1)],!1):n}),[]);o(u),i(a)},setNodeExtent:function(t){var r,o,i=e().nodeLookup;try{for(var u=g(i),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=Qx(c.position,t);i.set(c.id,d(d({},c),{internals:d(d({},c.internals),{positionAbsolute:l})}))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}n({nodeExtent:t})},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(){n({connection:d({},sp)})},updateConnection:function(e){n({connection:e})},reset:function(){return n(d({},PE()))},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,w=a.fitViewOnInit,x=a.minZoom,b=a.maxZoom,_=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,N=a.centered,M=a.layoutAnchorId,O=i||Array.from(p.values());if(O.length){var P=LE({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||OE});if(P.layoutComplete&&(Op(P.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:P.layoutComplete}),h&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){var j=O.find((function(n){return n.id===M})),I=P.nodes.find((function(n){return n.id===M}));if(j&&I)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:Gx(j,v).position,panZoom:h,position:Gx(I,v).position,transform:E}),void n({layoutAnchorId:void 0});if(u||!(k||N||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=Bb(c,i).positionAbsolute,s=Jx(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(w)return Vb({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:w,minZoom:x,maxZoom:b,fitViewOnInitOptions:_,nodes:p}),void n({fitViewDone:!0});S&&(RE({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var t=n.changes,r=n.userNodes;if(t||r){var o=e(),i=o.setNodes,u=o.nodeLookup,a=o.parentLookup,c=o.elevateNodesOnSelect,l=o.nodeOrigin,s=o.nodes,f=o.autoLayout,h=o.updateLayout,v=!(null==t?void 0:t.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(t||[]),g=[];g=v?(r||[]).map((function(n){var e=u.get(n.id),t=d(d({},e),n);return f&&(t.position=(null==e?void 0:e.position)||{x:0,y:0}),t})):function(n,e){return Ab(n,e)}(t,Array.from(u.values())),!v&&p&&f||Op(g,u,a,{nodeOrigin:l,elevateNodesOnSelect:c,checkEquality:!0}),f&&(p||r&&r!==s)&&h({nodes:v?Array.from(u.values()):g}),i(r||s)}},onEdgesChange:function(n){var t=n.changes,r=void 0===t?[]:t,o=n.userEdges,i=e(),u=i.connectionLookup,a=i.edgeLookup,c=i.setEdges,l=i.edges,s=[];if((null==r?void 0:r.length)<=0)s=o.map((function(n){var e=a.get(n.id)||{};return d(d({},e),n)})),c(o);else{s=function(n,e){return Ab(n,e)}(r,Array.from(a.values()));var f=s.map((function(n){return n.id}));c(l.filter((function(n){return f.includes(n.id)})))}qx(u,a,s)},updateLayoutConfig:function(t){var r=e(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;zE.isEqual(t,u)||(n({layoutConfig:t}),o&&i({config:t,force:!0}))},setLayoutAnchorId:function(e){n({layoutAnchorId:e})}})},t=Object.is,e?Y(e,t):Y};function DE(n){var e=n.initialNodes,t=n.initialEdges,r=n.defaultNodes,o=n.defaultEdges,u=n.initialWidth,a=n.initialHeight,c=n.fitView,l=n.children,s=y(i((function(){return TE({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:u,height:a,fitView:c})})),1)[0];return k.jsx(Z,{value:s,children:k.jsx(Db,{children:l})})}function BE(n){var e=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return t(X)?k.jsx(k.Fragment,{children:e}):k.jsx(DE,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:e})}var HE=m(m([],y(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","minZoom","maxZoom","nodeExtent","elementsSelectable","connectionMode","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","nodeOrigin","isValidConnection","autoLayout","centerConfig","layoutTypes","autoPanSpeed"]),!1),["rfId"],!1),VE=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}},YE={translateExtent:xv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function XE(n){var e=Ux(VE,Cb),t=e.setMinZoom,r=e.setMaxZoom,o=e.setTranslateExtent,i=e.setNodeExtent,c=e.reset,l=e.setDefaultNodesAndEdges,s=e.onNodesChange,f=e.onEdgesChange,h=e.updateLayoutConfig,v=$x();a((function(){return l(n.defaultNodes,n.defaultEdges),function(){p.current=YE,c()}}),[]);var p=u(YE);return a((function(){var e,u,a,c;try{for(var l=g(HE),y=l.next();!y.done;y=l.next()){var m=y.value,w=n[m];if(w!==p.current[m]&&void 0!==n[m])if("nodes"===m)s({userNodes:w});else if("edges"===m)f({userEdges:w});else if("minZoom"===m)t(w);else if("maxZoom"===m)r(w);else if("translateExtent"===m)o(w);else if("nodeExtent"===m)i(w);else if("fitView"===m)v.setState({fitViewOnInit:w});else if("fitViewOptions"===m)v.setState({fitViewOnInitOptions:w});else if("layoutConfig"===m){var x=w||{},b=d(d({},x),{options:d(d({},x.options||{}),{rankdir:(null===(c=x.options)||void 0===c?void 0:c.rankdir)||"TB"})});h(b)}else v.setState(((a={})[m]=w,a))}}catch(n){e={error:n}}finally{try{y&&!y.done&&(u=l.return)&&u.call(l)}finally{if(e)throw e.error}}p.current=n}),HE.map((function(e){return n[e]}))),null}var ZE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var WE=lb((function(n,e){var t=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?xv:o,u=n.defaultViewport,a=void 0===u?ME:u,c=n.minZoom,l=void 0===c?.5:c,s=n.maxZoom,f=void 0===s?2:s,v=n.defaultMarkerColor,p=void 0===v?"#b1b1b7":v,g=n.nodeOrigin,y=n.noDragClassName,m=void 0===y?"nodrag":y,w=n.noPanClassName,x=void 0===w?"nopan":w,b=n.disableKeyboardA11y,_=n.nodeTypes,E=n.edgeTypes;n.connectionMode;var S=n.connectionLineType,C=void 0===S?up.Bezier:S,N=n.connectionLineStyle,M=n.connectionLineComponent,O=n.connectionLineContainerStyle,j=n.onNodeClick,I=n.onNodeDoubleClick,A=n.onNodeMouseEnter,z=n.onNodeMouseMove,L=n.onNodeMouseLeave,R=n.onNodeContextMenu,T=n.onEdgeClick,D=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,H=n.onEdgeMouseLeave,V=n.onEdgeContextMenu,Y=n.onEdgeDoubleClick,X=n.fitView,Z=n.fitViewOptions,W=n.nodeExtent,F=n.nodesDraggable,U=n.children,$=n.id,G=n.width,q=n.height,K=n.panOnDrag,Q=void 0===K||K,J=n.onPaneClick,nn=n.onPaneContextMenu,en=n.onPaneMouseEnter,tn=n.onPaneMouseMove,rn=n.onPaneMouseLeave,on=n.onPaneScroll,un=n.elementsSelectable,an=void 0===un||un,cn=n.autoPanSpeed,ln=n.autoLayout,sn=void 0===ln||ln,fn=n.layoutConfig,dn=void 0===fn?OE:fn,hn=n.centerConfig,vn=void 0===hn?{}:hn,pn=n.layoutTypes,gn=void 0===pn?{}:pn,yn=n.selectionOnDrag,mn=void 0!==yn&&yn,wn=n.selectionMode,xn=void 0===wn?tp.Full:wn,bn=n.deleteKeyCode,_n=void 0===bn?"Backspace":bn,En=n.selectionKeyCode,Sn=n.multiSelectionKeyCode,kn=n.onlyRenderVisibleElements,Cn=n.paneClickDistance,Nn=n.nodeClickDistance,Mn=n.noWheelClassName,On=n.onConnect,Pn=n.onConnectStart,jn=n.onConnectEnd,In=n.onNodesDelete,An=n.onEdgesDelete,zn=n.onDelete,Ln=n.isValidConnection,Rn=n.onNodeDragStop,Tn=h(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","panOnDrag","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoPanSpeed","autoLayout","layoutConfig","centerConfig","layoutTypes","selectionOnDrag","selectionMode","deleteKeyCode","selectionKeyCode","multiSelectionKeyCode","onlyRenderVisibleElements","paneClickDistance","nodeClickDistance","noWheelClassName","onConnect","onConnectStart","onConnectEnd","onNodesDelete","onEdgesDelete","onDelete","isValidConnection","onNodeDragStop"]),Dn=$||"1";return k.jsx("div",d({},Tn,{ref:e,style:d({},ZE),className:P(["ink-flow"]),"data-testid":"rf__wrapper",id:$,children:k.jsxs(BE,{nodes:t,edges:r,width:G,height:q,fitView:X,children:[k.jsx(NE,{deleteKeyCode:_n,selectionKeyCode:En,multiSelectionKeyCode:Sn,onlyRenderVisibleElements:kn,paneClickDistance:Cn,nodeClickDistance:Nn,onNodeClick:j,onNodeMouseEnter:A,onNodeMouseMove:z,onNodeMouseLeave:L,onNodeContextMenu:R,onNodeDoubleClick:I,onEdgeClick:T,onEdgeMouseEnter:D,onEdgeMouseMove:B,onEdgeMouseLeave:H,onEdgeContextMenu:V,onEdgeDoubleClick:Y,rfId:Dn,nodeTypes:_,edgeTypes:E,minZoom:l,maxZoom:f,nodeOrigin:g,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,translateExtent:i,defaultMarkerColor:p,connectionLineType:C,connectionLineStyle:N,connectionLineComponent:M,connectionLineContainerStyle:O,defaultViewport:a,panOnDrag:Q,onPaneClick:J,onPaneContextMenu:nn,onPaneMouseEnter:en,onPaneMouseMove:tn,onPaneMouseLeave:rn,onPaneScroll:on,selectionOnDrag:mn,selectionMode:xn,noWheelClassName:Mn}),k.jsx(XE,{nodes:t,edges:r,rfId:Dn,fitView:X,fitViewOptions:Z,nodeExtent:W,nodesDraggable:F,elementsSelectable:an,minZoom:l,maxZoom:f,nodeOrigin:g,autoLayout:sn,layoutConfig:dn,layoutTypes:gn,centerConfig:vn,autoPanSpeed:cn,onConnect:On,onConnectStart:Pn,onConnectEnd:jn,onDelete:zn,onEdgesDelete:An,onNodesDelete:In,isValidConnection:Ln,onNodeDragStop:Rn}),U]})}))}));function FE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.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 UE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.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 $E(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.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 GE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.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 qE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.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 KE(n){var e=n.children,t=n.className,r=h(n,["children","className"]);return k.jsx("button",d({type:"button",className:P(["ink-flow__controls-button",t])},r,{children:e}))}var QE=function(n){return n.userSelectionActive?"none":"all"};function JE(n){var e=n.position,t=void 0===e?"top-left":e,r=n.children,o=n.className,i=n.style,u=h(n,["position","children","className","style"]),a=Ux(QE),c="".concat(t).split("-");return k.jsx("div",d({className:P(m(["ink-flow__panel",o],y(c),!1)),style:d(d({},i),{pointerEvents:a})},u,{children:r}))}var nS=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function eS(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,p=n.position,g=void 0===p?"bottom-left":p,y=n.orientation,m=void 0===y?"vertical":y,w=n["aria-label"],x=void 0===w?"Ink Flow controls":w,b=$x(),_=Ux(nS,Cb),E=_.isInteractive,S=_.minZoomReached,C=_.maxZoomReached,N=Fb(),M=N.zoomIn,O=N.zoomOut,j=N.fitView,I="horizontal"===m?"horizontal":"vertical";return k.jsxs(JE,{className:P(["ink-flow__controls",I,h]),position:g,style:e,"data-testid":"rf__controls","aria-label":x,children:[i&&k.jsx(KE,{className:"ink-flow__controls-fitview",onClick:function(){j(c),null==f||f()},"aria-label":"fit view",children:k.jsx($E,{})}),r&&k.jsxs("div",{className:"ink-flow__controls-zoom",children:[k.jsx(KE,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:C,children:k.jsx(FE,{})}),k.jsx(KE,{onClick:function(){O(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:S,children:k.jsx(UE,{})})]}),a&&k.jsx(KE,{className:"ink-flow__controls-interactive",onClick:function(){b.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==d||d(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?k.jsx(qE,{}):k.jsx(GE,{})}),v]})}eS.displayName="Controls";var tS,rS,oS=s(eS);function iS(n){var e=n.dimensions,t=n.lineWidth,r=n.variant,o=n.className;return k.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:P(["ink-flow__background-pattern",r,o])})}function uS(n){var e=n.radius,t=n.className;return k.jsx("circle",{cx:e,cy:e,r:e,className:P(["ink-flow__background-pattern","dots",t])})}!function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"}(tS||(tS={}));var aS=((rS={})[tS.Dots]=1,rS[tS.Lines]=1,rS[tS.Cross]=6,rS),cS=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function lS(n){var e=n.id,t=n.variant,r=void 0===t?tS.Dots:t,o=n.gap,i=void 0===o?20:o,a=n.size,c=n.lineWidth,l=void 0===c?1:c,s=n.offset,f=void 0===s?2:s,h=n.color,v=n.bgColor,p=n.style,g=n.className,y=n.patternClassName,m=u(null),w=Ux(cS,Cb),x=w.transform,b=w.patternId,_=a||aS[r],E=r===tS.Dots,S=r===tS.Cross,C=Array.isArray(i)?i:[i,i],N=[C[0]*x[2]||1,C[1]*x[2]||1],M=_*x[2],O=S?[M,M]:N,j=E?[M/f,M/f]:[O[0]/f,O[1]/f],I="".concat(b).concat(e||"");return k.jsxs("svg",{className:P(["ink-flow__background",g]),style:d(d(d({},p),Nb),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[k.jsx("pattern",{id:I,x:x[0]%N[0],y:x[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(j[0],",-").concat(j[1],")"),children:E?k.jsx(uS,{radius:M/f,className:y}):k.jsx(iS,{dimensions:O,lineWidth:l,variant:r,className:y})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(I,")")})]})}lS.displayName="Background";var sS=s(lS);var fS=s((function(n){var e,t=n.nodeId,r=n.position,o=n.variant,i=void 0===o?Ox.Handle:o,c=n.className,l=n.style,s=void 0===l?{}:l,f=n.children,h=n.color,v=n.minWidth,p=void 0===v?10:v,w=n.minHeight,x=void 0===w?10:w,b=n.maxWidth,_=void 0===b?Number.MAX_VALUE:b,E=n.maxHeight,S=void 0===E?Number.MAX_VALUE:E,C=n.keepAspectRatio,N=void 0!==C&&C,M=n.shouldResize,O=n.onResizeStart,j=n.onResize,I=n.onResizeEnd,A=f_(),z="string"==typeof t?t:A,L=$x(),R=u(null),T=i===Ox.Line?"right":"bottom-right",D=null!=r?r:T,B=u(null);a((function(){if(R.current&&z)return B.current||(B.current=function(n){var e=n.domNode,t=n.nodeId,r=n.getStoreItems,o=n.onChange,i=n.onEnd,u=nm(e);return{update:function(n){var e=n.controlPosition,a=n.boundaries,c=n.keepAspectRatio,l=n.onResizeStart,s=n.onResize,f=n.onResizeEnd,d=n.shouldResize,h=W({},Xx),v=W({},Zx),p=function(n){return{isHorizontal:n.includes("right")||n.includes("left"),isVertical:n.includes("bottom")||n.includes("top"),affectsX:n.includes("left"),affectsY:n.includes("top")}}(e),g=void 0,y=[],m=void 0,w=void 0,x=void 0,b=vm().on("start",(function(n){var e,o,i,u,a,c,s,f,d,p=r(),b=p.nodeLookup,_=p.transform,E=p.snapGrid,S=p.snapToGrid,k=p.nodeOrigin;if(g=b.get(t)){var C=Jv(n.sourceEvent,{transform:_,snapGrid:E,snapToGrid:S}),N=C.xSnapped,M=C.ySnapped;h={width:null!==(u=null===(i=g.measured)||void 0===i?void 0:i.width)&&void 0!==u?u:0,height:null!==(c=null===(a=g.measured)||void 0===a?void 0:a.height)&&void 0!==c?c:0,x:null!==(s=g.position.x)&&void 0!==s?s:0,y:null!==(f=g.position.y)&&void 0!==f?f:0},v=W(W({},h),{pointerX:N,pointerY:M,aspectRatio:h.width/h.height}),m=void 0,("parent"===g.extent||g.expandParent)&&(m=b.get(g.parentId))&&"parent"===g.extent&&(w=function(n){return[[0,0],[n.measured.width,n.measured.height]]}(m)),y=[],x=void 0;try{for(var O=U(b),P=O.next();!P.done;P=O.next()){var j=$(P.value,2),I=j[0],A=j[1];if(A.parentId===t&&(y.push({id:I,position:W({},A.position),extent:A.extent}),"parent"===A.extent||A.expandParent)){var z=Wx(A,g,null!==(d=A.origin)&&void 0!==d?d:k);x=x?[[Math.min(z[0][0],x[0][0]),Math.min(z[0][1],x[0][1])],[Math.max(z[1][0],x[1][0]),Math.max(z[1][1],x[1][1])]]:z}}}catch(n){e={error:n}}finally{try{P&&!P.done&&(o=O.return)&&o.call(O)}finally{if(e)throw e.error}}null==l||l(n,W({},h))}})).on("drag",(function(n){var e,t,i,u=r(),l=u.transform,f=u.snapGrid,b=u.snapToGrid,_=u.nodeOrigin,E=Jv(n.sourceEvent,{transform:l,snapGrid:f,snapToGrid:b}),S=[];if(g){var k=h.x,C=h.y,N=h.width,M=h.height,O={},P=null!==(i=g.origin)&&void 0!==i?i:_,j=function(n,e,t,r,o,i,u,a){var c=e.affectsX,l=e.affectsY,s=e.isHorizontal,f=e.isVertical,d=s&&f,h=t.xSnapped,v=t.ySnapped,p=r.minWidth,g=r.maxWidth,y=r.minHeight,m=r.maxHeight,w=n.x,x=n.y,b=n.width,_=n.height,E=n.aspectRatio,S=Math.floor(s?h-n.pointerX:0),k=Math.floor(f?v-n.pointerY:0),C=b+(c?-S:S),N=_+(l?-k:k),M=-i[0]*b,O=-i[1]*_,P=Vx(C,p,g),j=Vx(N,y,m);if(u){var I=0,A=0;c&&S<0?I=Bx(w+S+M,u[0][0]):!c&&S>0&&(I=Hx(w+C+M,u[1][0])),l&&k<0?A=Bx(x+k+O,u[0][1]):!l&&k>0&&(A=Hx(x+N+O,u[1][1])),P=Math.max(P,I),j=Math.max(j,A)}if(a&&(I=0,A=0,c&&S>0?I=Hx(w+S,a[0][0]):!c&&S<0&&(I=Bx(w+C,a[1][0])),l&&k>0?A=Hx(x+k,a[0][1]):!l&&k<0&&(A=Bx(x+N,a[1][1])),P=Math.max(P,I),j=Math.max(j,A)),o){if(s){var z=Vx(C/E,y,m)*E;if(P=Math.max(P,z),u){var L=0;L=!c&&!l||c&&!l&&d?Hx(x+O+C/E,u[1][1])*E:Bx(x+O+(c?S:-S)/E,u[0][1])*E,P=Math.max(P,L)}a&&(L=0,L=!c&&!l||c&&!l&&d?Bx(x+C/E,a[1][1])*E:Hx(x+(c?S:-S)/E,a[0][1])*E,P=Math.max(P,L))}if(f){var R=Vx(N*E,p,g)/E;j=Math.max(j,R),u&&(L=0,L=!c&&!l||l&&!c&&d?Hx(w+N*E+M,u[1][0])/E:Bx(w+(l?k:-k)*E+M,u[0][0])/E,j=Math.max(j,L)),a&&(L=0,L=!c&&!l||l&&!c&&d?Bx(w+N*E,a[1][0])/E:Hx(w+(l?k:-k)*E,a[0][0])/E,j=Math.max(j,L))}}k+=k<0?j:-j,S+=S<0?P:-P,o&&(d?C>N*E?k=(Yx(c,l)?-S:S)/E:S=(Yx(c,l)?-k:k)*E:s?(k=S/E,l=c):(S=k*E,c=l));var T=c?w+S:w,D=l?x+k:x;return{width:b+(c?-S:S),height:_+(l?-k:k),x:i[0]*S*(c?-1:1)+T,y:i[1]*k*(l?-1:1)+D}}(v,p,E,a,c,P,w,x),I=j.width,A=j.height,z=j.x,L=j.y,R=I!==N,T=A!==M,D=z!==k&&R,B=L!==C&&T;if(D||B||R||T){if((D||B||1===P[0]||1==P[1])&&(O.x=D?z:h.x,O.y=B?L:h.y,h.x=O.x,h.y=O.y,m&&g.expandParent&&(O.x&&O.x<0&&(h.x=0,v.x=v.x-O.x),O.y&&O.y<0&&(h.y=0,v.y=v.y-O.y)),y.length>0)){var H=z-k,V=L-C;try{for(var Y=U(y),X=Y.next();!X.done;X=Y.next()){var Z=X.value;Z.position={x:Z.position.x-H+P[0]*(I-N),y:Z.position.y-V+P[1]*(A-M)},S.push(Z)}}catch(n){e={error:n}}finally{try{X&&!X.done&&(t=Y.return)&&t.call(Y)}finally{if(e)throw e.error}}}(R||T)&&(O.width=R?I:h.width,O.height=T?A:h.height,h.width=O.width,h.height=O.height);var F=function(n){var e=n.affectsY,t=n.width-n.prevWidth,r=n.height-n.prevHeight,o=[t>0?1:t<0?-1:0,r>0?1:r<0?-1:0];return t&&n.affectsX&&(o[0]=-1*o[0]),r&&e&&(o[1]=-1*o[1]),o}({width:h.width,prevWidth:N,height:h.height,prevHeight:M,affectsX:p.affectsX,affectsY:p.affectsY}),$=W(W({},h),{direction:F});!1!==(null==d?void 0:d(n,$))&&(null==s||s(n,$),o(O,S))}}})).on("end",(function(n){null==f||f(n,W({},h)),null==i||i()}));u.call(b)},destroy:function(){u.on(".drag",null)}}}({domNode:R.current,nodeId:z,getStoreItems:function(){var n=L.getState();return{nodeLookup:n.nodeLookup,transform:n.transform,snapGrid:n.snapGrid,snapToGrid:n.snapToGrid,nodeOrigin:n.nodeOrigin,paneDomNode:n.domNode}},onChange:function(n,e){var t,r,o,i,u,a,c,l,s,f=L.getState(),h=f.triggerNodeChanges,v=f.nodeLookup,p=f.parentLookup,w=f.nodeOrigin,x=[],b={x:n.x,y:n.y},_=v.get(z);if(_&&_.expandParent&&_.parentId){var E=null!==(o=_.origin)&&void 0!==o?o:w,S=null!==(u=null!==(i=n.width)&&void 0!==i?i:_.measured.width)&&void 0!==u?u:0,k=null!==(c=null!==(a=n.height)&&void 0!==a?a:_.measured.height)&&void 0!==c?c:0,C=Pp([{id:_.id,parentId:_.parentId,rect:d({width:S,height:k},gb({x:null!==(l=n.x)&&void 0!==l?l:_.position.x,y:null!==(s=n.y)&&void 0!==s?s:_.position.y},_.parentId,v,E,{width:S,height:k}))}],v,p,w);x.push.apply(x,m([],y(C),!1)),b.x=n.x?Math.max(E[0]*S,n.x):void 0,b.y=n.y?Math.max(E[1]*k,n.y):void 0}if(void 0!==b.x&&void 0!==b.y){var N={id:z,type:"position",position:d({},b)};x.push(N)}if(void 0!==n.width&&void 0!==n.height){var M={id:z,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:n.width,height:n.height}};x.push(M)}try{for(var O=g(e),P=O.next();!P.done;P=O.next()){var j=P.value;N=d(d({},j),{type:"position"});x.push(N)}}catch(n){t={error:n}}finally{try{P&&!P.done&&(r=O.return)&&r.call(O)}finally{if(t)throw t.error}}h(x)},onEnd:function(){var n={id:z,type:"dimensions",resizing:!1};L.getState().triggerNodeChanges([n])}})),B.current.update({controlPosition:D,boundaries:{minWidth:p,minHeight:x,maxWidth:_,maxHeight:S},keepAspectRatio:N,onResizeStart:O,onResize:j,onResizeEnd:I,shouldResize:M}),function(){var n;null===(n=B.current)||void 0===n||n.destroy()}}),[D,p,x,_,S,N,O,j,I,M]);var H=D.split("-"),V=i===Ox.Line?"borderColor":"backgroundColor",Y=h?d(d({},s),((e={})[V]=h,e)):s;return k.jsx("div",{className:P(m(m(["ink-flow__resize-control","nodrag"],y(H),!1),[i,c],!1)),ref:R,style:Y,children:f})}));function dS(n){var e=n.nodeId,t=n.isVisible,r=void 0===t||t,o=n.handleClassName,i=n.handleStyle,u=n.lineClassName,a=n.lineStyle,c=n.color,l=n.minWidth,s=void 0===l?10:l,f=n.minHeight,d=void 0===f?10:f,h=n.maxWidth,v=void 0===h?Number.MAX_VALUE:h,p=n.maxHeight,g=void 0===p?Number.MAX_VALUE:p,y=n.keepAspectRatio,m=void 0!==y&&y,w=n.shouldResize,x=n.onResizeStart,b=n.onResize,_=n.onResizeEnd;return r?k.jsxs(k.Fragment,{children:[Dx.map((function(n){return k.jsx(fS,{className:u,style:a,nodeId:e,position:n,variant:Ox.Line,color:c,minWidth:s,minHeight:d,maxWidth:v,maxHeight:g,onResizeStart:x,keepAspectRatio:m,shouldResize:w,onResize:b,onResizeEnd:_},n)})),Tx.map((function(n){return k.jsx(fS,{className:o,style:i,nodeId:e,position:n,color:c,minWidth:s,minHeight:d,maxWidth:v,maxHeight:g,onResizeStart:x,keepAspectRatio:m,shouldResize:w,onResize:b,onResizeEnd:_},n)}))]}):null}var hS=function(n){var e;return null===(e=n.domNode)||void 0===e?void 0:e.querySelector(".ink-flow__edgelabel-renderer")};function vS(n){var e=n.children,t=Ux(hS);return t?f(e,t):null}export{sS as Background,tS as BackgroundVariant,H_ as BaseEdge,up as ConnectionLineType,np as ConnectionMode,KE as ControlButton,oS as Controls,vS as EdgeLabelRenderer,S_ as Handle,DE as InkFlowProvider,ap as MarkerType,fS as NodeResizeControl,dS as NodeResizer,ep as PanOnScrollMode,lp as Position,tp as SelectionMode,U_ as SmoothStepEdge,q_ as StepEdge,wp as addEdge,zp as dagreLayout,WE as default,dp as getBezierEdgeCenter,pp as getBezierPath,Pv as getConnectedEdges,gp as getEdgeCenter,Nv as getIncomers,Ov as getNodesBounds,Cv as getOutgoers,kp as getSmoothStepPath,bp as getStraightPath,Fv as getViewportForBounds,xp as updateEdge,r_ as useEdgesState,Fb as useInkFlow,u_ as useNodeInView,i_ as useNodesInView,o_ as useNodesState,Ux as useStore,$x as useStoreApi};
|
|
25
25
|
//# sourceMappingURL=index.esm.js.map
|