@aloudata/ink-flow 1.0.20 → 1.0.22

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.
Files changed (36) hide show
  1. package/dist/components/BatchProvider/index.d.ts.map +1 -1
  2. package/dist/components/Handle/index.d.ts.map +1 -1
  3. package/dist/components/StoreUpdater/index.d.ts +1 -1
  4. package/dist/components/StoreUpdater/index.d.ts.map +1 -1
  5. package/dist/container/InkFlow/index.d.ts.map +1 -1
  6. package/dist/container/InkFlow/init-values.d.ts +1 -1
  7. package/dist/container/InkFlow/init-values.d.ts.map +1 -1
  8. package/dist/hooks/useEdgesState.d.ts +2 -2
  9. package/dist/hooks/useEdgesState.d.ts.map +1 -1
  10. package/dist/hooks/useInkFlow.d.ts.map +1 -1
  11. package/dist/hooks/useNodesState.d.ts +2 -2
  12. package/dist/hooks/useNodesState.d.ts.map +1 -1
  13. package/dist/index.cjs.js +11 -3
  14. package/dist/index.cjs.js.map +1 -1
  15. package/dist/index.esm.js +11 -3
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/store/index.d.ts.map +1 -1
  18. package/dist/store/initialState.d.ts.map +1 -1
  19. package/dist/types/general.d.ts +13 -2
  20. package/dist/types/general.d.ts.map +1 -1
  21. package/dist/types/instance.d.ts +0 -4
  22. package/dist/types/instance.d.ts.map +1 -1
  23. package/dist/types/layout.d.ts +37 -0
  24. package/dist/types/layout.d.ts.map +1 -0
  25. package/dist/types/props.d.ts +1 -3
  26. package/dist/types/props.d.ts.map +1 -1
  27. package/dist/types/store.d.ts +10 -2
  28. package/dist/types/store.d.ts.map +1 -1
  29. package/dist/utils/general.d.ts.map +1 -1
  30. package/dist/utils/layout.d.ts +23 -0
  31. package/dist/utils/layout.d.ts.map +1 -0
  32. package/dist/utils/node.d.ts +2 -5
  33. package/dist/utils/node.d.ts.map +1 -1
  34. package/dist/utils/positions.d.ts.map +1 -1
  35. package/dist/utils/store.d.ts.map +1 -1
  36. package/package.json +3 -2
package/dist/index.esm.js CHANGED
@@ -1,10 +1,10 @@
1
- import e,{createContext as n,useContext as t,useMemo as r,forwardRef as o,useState as i,useRef as a,useEffect as u,memo as c,useCallback as l,useLayoutEffect as s}from"react";import{createPortal as d}from"react-dom";var f=function(){return f=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},f.apply(this,arguments)};function h(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function v(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function p(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function g(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function m(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var b,x={exports:{}},_={};x.exports=function(){if(b)return _;b=1;var n=e,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(e,n,r){var u,c={},l=null,s=null;for(u in void 0!==r&&(l=""+r),void 0!==n.key&&(l=""+n.key),void 0!==n.ref&&(s=n.ref),n)o.call(n,u)&&!a.hasOwnProperty(u)&&(c[u]=n[u]);if(e&&e.defaultProps)for(u in n=e.defaultProps)void 0===c[u]&&(c[u]=n[u]);return{$$typeof:t,type:e,key:l,ref:s,props:c,_owner:i.current}}return _.Fragment=r,_.jsx=u,_.jsxs=u,_}();var E,S=x.exports,k={exports:{}};
1
+ import n,{createContext as t,useContext as e,useMemo as r,forwardRef as o,useState as i,useRef as u,useEffect as a,memo as c,useLayoutEffect as l,useCallback as s}from"react";import{createPortal as f}from"react-dom";var d=function(){return d=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},d.apply(this,arguments)};function h(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(e[r[o]]=n[r[o]])}return e}function v(n,t,e,r){return new(e||(e=Promise))((function(o,i){function u(n){try{c(r.next(n))}catch(n){i(n)}}function a(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,a)}c((r=r.apply(n,t||[])).next())}))}function p(n,t){var e,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(n,i)}catch(n){a=[6,n],r=0}finally{e=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function g(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.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(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function m(n,t,e){if(e||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _,x={exports:{}},E={};x.exports=function(){if(_)return E;_=1;var t=n,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function a(n,t,r){var a,c={},l=null,s=null;for(a in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(s=t.ref),t)o.call(t,a)&&!u.hasOwnProperty(a)&&(c[a]=t[a]);if(n&&n.defaultProps)for(a in t=n.defaultProps)void 0===c[a]&&(c[a]=t[a]);return{$$typeof:e,type:n,key:l,ref:s,props:c,_owner:i.current}}return E.Fragment=r,E.jsx=a,E.jsxs=a,E}();var S,k=x.exports,C={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
6
  */
7
- E=k,function(){var e={}.hasOwnProperty;function n(){for(var e="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(e=r(e,t(o)))}return e}function t(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var i in t)e.call(t,i)&&t[i]&&(o=r(o,i));return o}function r(e,n){return n?e?e+" "+n:e+n:e}E.exports?(n.default=n,E.exports=n):window.classNames=n}();var N,C,M,O=w(k.exports),j={exports:{}},P={},I={exports:{}},A={};function z(){return C||(C=1,I.exports=function(){if(N)return A;N=1;var n=e,t="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},r=n.useState,o=n.useEffect,i=n.useLayoutEffect,a=n.useDebugValue;function u(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),c=r({inst:{value:t,getSnapshot:n}}),l=c[0].inst,s=c[1];return i((function(){l.value=t,l.getSnapshot=n,u(l)&&s({inst:l})}),[e,t,n]),o((function(){return u(l)&&s({inst:l}),e((function(){u(l)&&s({inst:l})}))}),[e]),a(t),t};return A.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c,A}()),I.exports}
7
+ S=C,function(){var n={}.hasOwnProperty;function t(){for(var n="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(n=r(n,e(o)))}return n}function e(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return t.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var o="";for(var i in e)n.call(e,i)&&e[i]&&(o=r(o,i));return o}function r(n,t){return t?n?n+" "+t:n+t:n}S.exports?(t.default=t,S.exports=t):window.classNames=t}();var N,M,O,j=b(C.exports),I={exports:{}},P={},A={exports:{}},z={};function L(){return M||(M=1,A.exports=function(){if(N)return z;N=1;var t=n,e="function"==typeof Object.is?Object.is:function(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,u=t.useDebugValue;function a(n){var t=n.getSnapshot;n=n.value;try{var r=t();return!e(n,r)}catch(n){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(n,t){return t()}:function(n,t){var e=t(),c=r({inst:{value:e,getSnapshot:t}}),l=c[0].inst,s=c[1];return i((function(){l.value=e,l.getSnapshot=t,a(l)&&s({inst:l})}),[n,e,t]),o((function(){return a(l)&&s({inst:l}),n((function(){a(l)&&s({inst:l})}))}),[n]),u(e),e};return z.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,z}()),A.exports}
8
8
  /**
9
9
  * @license React
10
10
  * use-sync-external-store-shim/with-selector.production.min.js
@@ -13,5 +13,13 @@ E=k,function(){var e={}.hasOwnProperty;function n(){for(var e="",n=0;n<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(M)return P;M=1;var n=e,t=z(),r="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},o=t.useSyncExternalStore,i=n.useRef,a=n.useEffect,u=n.useMemo,c=n.useDebugValue;return P.useSyncExternalStoreWithSelector=function(e,n,t,l,s){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=u((function(){function e(e){if(!a){if(a=!0,o=e,e=l(e),void 0!==s&&f.hasValue){var n=f.value;if(s(n,e))return i=n}return i=e}if(n=i,r(o,e))return n;var t=l(e);return void 0!==s&&s(n,t)?n:(o=e,i=t)}var o,i,a=!1,u=void 0===t?null:t;return[function(){return e(n())},null===u?void 0:function(){return e(u())}]}),[n,t,l,s]);var h=o(e,d[0],d[1]);return a((function(){f.hasValue=!0,f.value=h}),[h]),c(h),h},P}();var T=w(j.exports);const L=e=>{let n;const t=new Set,r=(e,r)=>{const o="function"==typeof e?e(n):e;if(!Object.is(o,n)){const e=n;n=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},n,o),t.forEach((t=>t(n,e)))}},o=()=>n,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(t.add(e),()=>t.delete(e)),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()}},a=n=e(r,o,i);return i},{useDebugValue:B}=e,{useSyncExternalStoreWithSelector:D}=T,R=e=>e;function V(e,n=R,t){const r=D(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return B(r),r}const H=(e,n)=>{const t=(e=>e?L(e):L)(e),r=(e,r=n)=>V(t,e,r);return Object.assign(r,t),r};var Y=n(null),X=Y.Provider,Z=function(){return Z=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},Z.apply(this,arguments)};function F(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function W(e,n,t){if(2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var G,q,$,K,Q,J,ee,ne,te,re,oe,ie,ae,ue,ce,le,se,de,fe,he,ve,pe,ge,ye,me,we,be,xe,_e,Ee,Se,ke,Ne,Ce,Me,Oe,je,Pe,Ie,Ae,ze,Te,Le,Be,De,Re,Ve,He,Ye,Xe,Ze,Fe,Ue,We,Ge,qe,$e,Ke,Qe,Je,en,nn,tn,rn,on,an,un,cn,ln,sn,dn,fn,hn,vn,pn,gn,yn,mn,wn,bn,xn,_n,En,Sn,kn,Nn,Cn,Mn,On,jn,Pn,In,An,zn,Tn,Ln,Bn,Dn,Rn,Vn,Hn,Yn,Xn,Zn,Fn,Un,Wn,Gn,qn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function $n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kn(){return K?$:(K=1,$=function(e,n){return e===n||e!=e&&n!=n})}function Qn(){if(J)return Q;J=1;var e=Kn();return Q=function(n,t){for(var r=n.length;r--;)if(e(n[r][0],t))return r;return-1},Q}function Jn(){if(le)return ce;le=1;var e=q?G:(q=1,G=function(){this.__data__=[],this.size=0}),n=function(){if(ne)return ee;ne=1;var e=Qn(),n=Array.prototype.splice;return ee=function(t){var r=this.__data__,o=e(r,t);return!(o<0||(o==r.length-1?r.pop():n.call(r,o,1),--this.size,0))}}(),t=function(){if(re)return te;re=1;var e=Qn();return te=function(n){var t=this.__data__,r=e(t,n);return r<0?void 0:t[r][1]}}(),r=function(){if(ie)return oe;ie=1;var e=Qn();return oe=function(n){return e(this.__data__,n)>-1}}(),o=function(){if(ue)return ae;ue=1;var e=Qn();return ae=function(n,t){var r=this.__data__,o=e(r,n);return o<0?(++this.size,r.push([n,t])):r[o][1]=t,this}}();function i(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=n,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,ce=i}function et(){if(we)return me;we=1;var e="object"==typeof qn&&qn&&qn.Object===Object&&qn;return me=e}function nt(){if(xe)return be;xe=1;var e=et(),n="object"==typeof self&&self&&self.Object===Object&&self,t=e||n||Function("return this")();return be=t}function tt(){if(Ee)return _e;Ee=1;var e=nt().Symbol;return _e=e}function rt(){if(Oe)return Me;Oe=1;var e=tt(),n=function(){if(ke)return Se;ke=1;var e=tt(),n=Object.prototype,t=n.hasOwnProperty,r=n.toString,o=e?e.toStringTag:void 0;return Se=function(e){var n=t.call(e,o),i=e[o];try{e[o]=void 0;var a=!0}catch(e){}var u=r.call(e);return a&&(n?e[o]=i:delete e[o]),u}}(),t=function(){if(Ce)return Ne;Ce=1;var e=Object.prototype.toString;return Ne=function(n){return e.call(n)}}(),r=e?e.toStringTag:void 0;return Me=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?n(e):t(e)}}function ot(){return Pe?je:(Pe=1,je=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)})}function it(){if(Ae)return Ie;Ae=1;var e=rt(),n=ot();return Ie=function(t){if(!n(t))return!1;var r=e(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function at(){if(Re)return De;Re=1;var e=Function.prototype.toString;return De=function(n){if(null!=n){try{return e.call(n)}catch(e){}try{return n+""}catch(e){}}return""}}function ut(){if(Fe)return Ze;Fe=1;var e=function(){if(He)return Ve;He=1;var e=it(),n=function(){if(Be)return Le;Be=1;var e,n=function(){if(Te)return ze;Te=1;var e=nt()["__core-js_shared__"];return ze=e}(),t=(e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return Le=function(e){return!!t&&t in e}}(),t=ot(),r=at(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,u=i.toString,c=a.hasOwnProperty,l=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Ve=function(i){return!(!t(i)||n(i))&&(e(i)?l:o).test(r(i))}}(),n=Xe?Ye:(Xe=1,Ye=function(e,n){return null==e?void 0:e[n]});return Ze=function(t,r){var o=n(t,r);return e(o)?o:void 0}}function ct(){if(We)return Ue;We=1;var e=ut()(nt(),"Map");return Ue=e}function lt(){if(qe)return Ge;qe=1;var e=ut()(Object,"create");return Ge=e}function st(){if(vn)return hn;vn=1;var e=fn?dn:(fn=1,dn=function(e){var n=typeof e;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e});return hn=function(n,t){var r=n.__data__;return e(t)?r["string"==typeof t?"string":"hash"]:r.map},hn}function dt(){if(Sn)return En;Sn=1;var e=function(){if(sn)return ln;sn=1;var e=function(){if(cn)return un;cn=1;var e=function(){if(Ke)return $e;Ke=1;var e=lt();return $e=function(){this.__data__=e?e(null):{},this.size=0}}(),n=Je?Qe:(Je=1,Qe=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}),t=function(){if(nn)return en;nn=1;var e=lt(),n=Object.prototype.hasOwnProperty;return en=function(t){var r=this.__data__;if(e){var o=r[t];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(r,t)?r[t]:void 0}}(),r=function(){if(rn)return tn;rn=1;var e=lt(),n=Object.prototype.hasOwnProperty;return tn=function(t){var r=this.__data__;return e?void 0!==r[t]:n.call(r,t)}}(),o=function(){if(an)return on;an=1;var e=lt();return on=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=e&&void 0===t?"__lodash_hash_undefined__":t,this}}();function i(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=n,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,un=i}(),n=Jn(),t=ct();return ln=function(){this.size=0,this.__data__={hash:new e,map:new(t||n),string:new e}}}(),n=function(){if(gn)return pn;gn=1;var e=st();return pn=function(n){var t=e(this,n).delete(n);return this.size-=t?1:0,t}}(),t=function(){if(mn)return yn;mn=1;var e=st();return yn=function(n){return e(this,n).get(n)}}(),r=function(){if(bn)return wn;bn=1;var e=st();return wn=function(n){return e(this,n).has(n)}}(),o=function(){if(_n)return xn;_n=1;var e=st();return xn=function(n,t){var r=e(this,n),o=r.size;return r.set(n,t),this.size+=r.size==o?0:1,this},xn}();function i(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=n,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,En=i}function ft(){if(Mn)return Cn;Mn=1;var e=Jn(),n=function(){if(de)return se;de=1;var e=Jn();return se=function(){this.__data__=new e,this.size=0}}(),t=he?fe:(he=1,fe=function(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t}),r=pe?ve:(pe=1,ve=function(e){return this.__data__.get(e)}),o=ye?ge:(ye=1,ge=function(e){return this.__data__.has(e)}),i=function(){if(Nn)return kn;Nn=1;var e=Jn(),n=ct(),t=dt();return kn=function(r,o){var i=this.__data__;if(i instanceof e){var a=i.__data__;if(!n||a.length<199)return a.push([r,o]),this.size=++i.size,this;i=this.__data__=new t(a)}return i.set(r,o),this.size=i.size,this}}();function a(n){var t=this.__data__=new e(n);this.size=t.size}return a.prototype.clear=n,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=o,a.prototype.set=i,Cn=a}function ht(){return jn||(jn=1,On=function(e,n){for(var t=-1,r=null==e?0:e.length;++t<r&&!1!==n(e[t],t,e););return e}),On}function vt(){if(In)return Pn;In=1;var e=ut(),n=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch(e){}}();return Pn=n}function pt(){if(zn)return An;zn=1;var e=vt();return An=function(n,t,r){"__proto__"==t&&e?e(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}}function gt(){if(Ln)return Tn;Ln=1;var e=pt(),n=Kn(),t=Object.prototype.hasOwnProperty;return Tn=function(r,o,i){var a=r[o];t.call(r,o)&&n(a,i)&&(void 0!==i||o in r)||e(r,o,i)}}function yt(){if(Dn)return Bn;Dn=1;var e=gt(),n=pt();return Bn=function(t,r,o,i){var a=!o;o||(o={});for(var u=-1,c=r.length;++u<c;){var l=r[u],s=i?i(o[l],t[l],l,o,t):void 0;void 0===s&&(s=t[l]),a?n(o,l,s):e(o,l,s)}return o}}function mt(){return Yn?Hn:(Yn=1,Hn=function(e){return null!=e&&"object"==typeof e})}function wt(){if(Un)return Fn;Un=1;var e=function(){if(Zn)return Xn;Zn=1;var e=rt(),n=mt();return Xn=function(t){return n(t)&&"[object Arguments]"==e(t)}}(),n=mt(),t=Object.prototype,r=t.hasOwnProperty,o=t.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(e){return n(e)&&r.call(e,"callee")&&!o.call(e,"callee")};return Fn=i}function bt(){if(Gn)return Wn;Gn=1;var e=Array.isArray;return Wn=e}var xt,_t,Et,St,kt,Nt,Ct,Mt,Ot,jt,Pt,It={exports:{}};function At(){return Et||(Et=1,function(e,n){var t=nt(),r=_t?xt:(_t=1,xt=function(){return!1}),o=n&&!n.nodeType&&n,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?t.Buffer:void 0,u=(a?a.isBuffer:void 0)||r;e.exports=u}(It,It.exports)),It.exports}function zt(){if(kt)return St;kt=1;var e=/^(?:0|[1-9]\d*)$/;return St=function(n,t){var r=typeof n;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&e.test(n))&&n>-1&&n%1==0&&n<t}}function Tt(){return Ct?Nt:(Ct=1,Nt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991})}function Lt(){return Pt?jt:(Pt=1,jt=function(e){return function(n){return e(n)}})}It.exports;var Bt,Dt,Rt,Vt,Ht,Yt,Xt,Zt,Ft,Ut,Wt,Gt,qt,$t,Kt,Qt,Jt,er,nr,tr,rr,or,ir,ar,ur,cr,lr,sr={exports:{}};function dr(){return Bt||(Bt=1,e=sr,n=sr.exports,t=et(),r=n&&!n.nodeType&&n,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&t.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}(),e.exports=a),sr.exports;var e,n,t,r,o,i,a}function fr(){if(Rt)return Dt;Rt=1;var e=function(){if(Ot)return Mt;Ot=1;var e=rt(),n=Tt(),t=mt(),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,Mt=function(o){return t(o)&&n(o.length)&&!!r[e(o)]}}(),n=Lt(),t=dr(),r=t&&t.isTypedArray,o=r?n(r):e;return Dt=o}function hr(){if(Ht)return Vt;Ht=1;var e=Vn?Rn:(Vn=1,Rn=function(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}),n=wt(),t=bt(),r=At(),o=zt(),i=fr(),a=Object.prototype.hasOwnProperty;return Vt=function(u,c){var l=t(u),s=!l&&n(u),d=!l&&!s&&r(u),f=!l&&!s&&!d&&i(u),h=l||s||d||f,v=h?e(u.length,String):[],p=v.length;for(var g in u)!c&&!a.call(u,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,p))||v.push(g);return v},Vt}function vr(){if(Xt)return Yt;Xt=1;var e=Object.prototype;return Yt=function(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||e)}}function pr(){return Ft||(Ft=1,Zt=function(e,n){return function(t){return e(n(t))}}),Zt}function gr(){if(qt)return Gt;qt=1;var e=vr(),n=function(){if(Wt)return Ut;Wt=1;var e=pr()(Object.keys,Object);return Ut=e}(),t=Object.prototype.hasOwnProperty;return Gt=function(r){if(!e(r))return n(r);var o=[];for(var i in Object(r))t.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function yr(){if(Kt)return $t;Kt=1;var e=it(),n=Tt();return $t=function(t){return null!=t&&n(t.length)&&!e(t)}}function mr(){if(Jt)return Qt;Jt=1;var e=hr(),n=gr(),t=yr();return Qt=function(r){return t(r)?e(r):n(r)}}function wr(){if(ur)return ar;ur=1;var e=hr(),n=function(){if(ir)return or;ir=1;var e=ot(),n=vr(),t=rr?tr:(rr=1,tr=function(e){var n=[];if(null!=e)for(var t in Object(e))n.push(t);return n}),r=Object.prototype.hasOwnProperty;return or=function(o){if(!e(o))return t(o);var i=n(o),a=[];for(var u in o)("constructor"!=u||!i&&r.call(o,u))&&a.push(u);return a}}(),t=yr();return ar=function(r){return t(r)?e(r,!0):n(r)}}sr.exports;var br,xr,_r,Er,Sr,kr,Nr,Cr,Mr,Or,jr,Pr,Ir,Ar,zr,Tr,Lr,Br,Dr,Rr,Vr,Hr,Yr,Xr,Zr,Fr,Ur,Wr,Gr,qr,$r,Kr,Qr,Jr,eo,no,to,ro,oo,io,ao,uo,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,bo,xo,_o,Eo,So,ko,No,Co,Mo,Oo,jo,Po,Io,Ao,zo,To,Lo,Bo,Do,Ro,Vo,Ho,Yo,Xo,Zo,Fo,Uo,Wo,Go,qo,$o,Ko,Qo,Jo,ei,ni,ti,ri,oi,ii,ai,ui,ci,li,si,di,fi,hi,vi,pi,gi,yi,mi,wi,bi,xi,_i,Ei,Si,ki,Ni,Ci,Mi,Oi,ji,Pi,Ii,Ai,zi,Ti,Li,Bi,Di,Ri,Vi,Hi,Yi,Xi,Zi,Fi,Ui,Wi,Gi,qi,$i,Ki,Qi,Ji,ea,na,ta,ra,oa,ia,aa,ua,ca,la,sa,da,fa,ha,va,pa,ga,ya,ma,wa,ba,xa,_a,Ea,Sa,ka,Na,Ca,Ma,Oa,ja,Pa,Ia,Aa,za,Ta,La,Ba,Da,Ra,Va,Ha,Ya,Xa,Za,Fa,Ua,Wa,Ga,qa,$a,Ka,Qa,Ja,eu,nu,tu,ru,ou,iu,au,uu,cu,lu,su,du,fu,hu,vu,pu,gu,yu,mu,wu,bu,xu,_u,Eu,Su,ku,Nu,Cu,Mu,Ou,ju,Pu,Iu,Au,zu,Tu,Lu,Bu,Du,Ru,Vu,Hu,Yu,Xu,Zu,Fu,Uu,Wu,Gu,qu,$u,Ku,Qu,Ju,ec,nc,tc,rc,oc,ic,ac,uc,cc,lc,sc,dc,fc,hc,vc,pc,gc,yc,mc,wc,bc,xc,_c,Ec,Sc,kc,Nc,Cc,Mc,Oc,jc,Pc={exports:{}};function Ic(){return br||(br=1,function(e,n){var t=nt(),r=n&&!n.nodeType&&n,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?t.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var t=e.length,r=a?a(t):new e.constructor(t);return e.copy(r),r}}(Pc,Pc.exports)),Pc.exports}function Ac(){return _r||(_r=1,xr=function(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}),xr}function zc(){return Sr||(Sr=1,Er=function(e,n){for(var t=-1,r=null==e?0:e.length,o=0,i=[];++t<r;){var a=e[t];n(a,t,e)&&(i[o++]=a)}return i}),Er}function Tc(){return Nr?kr:(Nr=1,kr=function(){return[]})}function Lc(){if(Mr)return Cr;Mr=1;var e=zc(),n=Tc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Cr=r?function(n){return null==n?[]:(n=Object(n),e(r(n),(function(e){return t.call(n,e)})))}:n}function Bc(){return Ir||(Ir=1,Pr=function(e,n){for(var t=-1,r=n.length,o=e.length;++t<r;)e[o+t]=n[t];return e}),Pr}function Dc(){if(zr)return Ar;zr=1;var e=pr()(Object.getPrototypeOf,Object);return Ar=e}function Rc(){if(Lr)return Tr;Lr=1;var e=Bc(),n=Dc(),t=Lc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)e(o,t(r)),r=n(r);return o}:r}function Vc(){if(Vr)return Rr;Vr=1;var e=Bc(),n=bt();return Rr=function(t,r,o){var i=r(t);return n(t)?i:e(i,o(t))}}function Hc(){if(Yr)return Hr;Yr=1;var e=Vc(),n=Lc(),t=mr();return Hr=function(r){return e(r,t,n)}}function Yc(){if($r)return qr;$r=1;var e=ut()(nt(),"Set");return qr=e}function Xc(){if(eo)return Jr;eo=1;var e=function(){if(Ur)return Fr;Ur=1;var e=ut()(nt(),"DataView");return Fr=e}(),n=ct(),t=function(){if(Gr)return Wr;Gr=1;var e=ut()(nt(),"Promise");return Wr=e}(),r=Yc(),o=function(){if(Qr)return Kr;Qr=1;var e=ut()(nt(),"WeakMap");return Kr=e}(),i=rt(),a=at(),u="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",d="[object DataView]",f=a(e),h=a(n),v=a(t),p=a(r),g=a(o),y=i;return(e&&y(new e(new ArrayBuffer(1)))!=d||n&&y(new n)!=u||t&&y(t.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(e){var n=i(e),t="[object Object]"==n?e.constructor:void 0,r=t?a(t):"";if(r)switch(r){case f:return d;case h:return u;case v:return c;case p:return l;case g:return s}return n}),Jr=y}function Zc(){if(oo)return ro;oo=1;var e=nt().Uint8Array;return ro=e}function Fc(){if(ao)return io;ao=1;var e=Zc();return io=function(n){var t=new n.constructor(n.byteLength);return new e(t).set(new e(n)),t}}function Uc(){if(po)return vo;po=1;var e=Fc();return vo=function(n,t){var r=t?e(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}}function Wc(){if(wo)return mo;wo=1;var e=ot(),n=Object.create,t=function(){function t(){}return function(r){if(!e(r))return{};if(n)return n(r);t.prototype=r;var o=new t;return t.prototype=void 0,o}}();return mo=t}function Gc(){if(xo)return bo;xo=1;var e=Wc(),n=Dc(),t=vr();return bo=function(r){return"function"!=typeof r.constructor||t(r)?{}:e(n(r))}}function qc(){if(Po)return jo;Po=1;var e=ft(),n=ht(),t=gt(),r=function(){if(nr)return er;nr=1;var e=yt(),n=mr();return er=function(t,r){return t&&e(r,n(r),t)}}(),o=function(){if(lr)return cr;lr=1;var e=yt(),n=wr();return cr=function(t,r){return t&&e(r,n(r),t)}}(),i=Ic(),a=Ac(),u=function(){if(jr)return Or;jr=1;var e=yt(),n=Lc();return Or=function(t,r){return e(t,n(t),r)}}(),c=function(){if(Dr)return Br;Dr=1;var e=yt(),n=Rc();return Br=function(t,r){return e(t,n(t),r)}}(),l=Hc(),s=function(){if(Zr)return Xr;Zr=1;var e=Vc(),n=Rc(),t=wr();return Xr=function(r){return e(r,t,n)}}(),d=Xc(),f=function(){if(to)return no;to=1;var e=Object.prototype.hasOwnProperty;return no=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&e.call(n,"index")&&(r.index=n.index,r.input=n.input),r},no}(),h=function(){if(yo)return go;yo=1;var e=Fc(),n=function(){if(co)return uo;co=1;var e=Fc();return uo=function(n,t){var r=t?e(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}}(),t=function(){if(so)return lo;so=1;var e=/\w*$/;return lo=function(n){var t=new n.constructor(n.source,e.exec(n));return t.lastIndex=n.lastIndex,t}}(),r=function(){if(ho)return fo;ho=1;var e=tt(),n=e?e.prototype:void 0,t=n?n.valueOf:void 0;return fo=function(e){return t?Object(t.call(e)):{}}}(),o=Uc();return go=function(i,a,u){var c=i.constructor;switch(a){case"[object ArrayBuffer]":return e(i);case"[object Boolean]":case"[object Date]":return new c(+i);case"[object DataView]":return n(i,u);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,u);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=Gc(),p=bt(),g=At(),y=function(){if(ko)return So;ko=1;var e=function(){if(Eo)return _o;Eo=1;var e=Xc(),n=mt();return _o=function(t){return n(t)&&"[object Map]"==e(t)}}(),n=Lt(),t=dr(),r=t&&t.isMap,o=r?n(r):e;return So=o}(),m=ot(),w=function(){if(Oo)return Mo;Oo=1;var e=function(){if(Co)return No;Co=1;var e=Xc(),n=mt();return No=function(t){return n(t)&&"[object Set]"==e(t)}}(),n=Lt(),t=dr(),r=t&&t.isSet,o=r?n(r):e;return Mo=o}(),b=mr(),x=wr(),_="[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,jo=function N(C,M,O,j,P,I){var A,z=1&M,T=2&M,L=4&M;if(O&&(A=P?O(C,j,P,I):O(C)),void 0!==A)return A;if(!m(C))return C;var B=p(C);if(B){if(A=f(C),!z)return a(C,A)}else{var D=d(C),R=D==E||"[object GeneratorFunction]"==D;if(g(C))return i(C,z);if(D==S||D==_||R&&!P){if(A=T||R?{}:v(C),!z)return T?c(C,o(A,C)):u(C,r(A,C))}else{if(!k[D])return P?C:{};A=h(C,D,z)}}I||(I=new e);var V=I.get(C);if(V)return V;I.set(C,A),w(C)?C.forEach((function(e){A.add(N(e,M,O,e,C,I))})):y(C)&&C.forEach((function(e,n){A.set(n,N(e,M,O,n,C,I))}));var H=B?void 0:(L?T?s:l:T?x:b)(C);return n(H||C,(function(e,n){H&&(e=C[n=e]),t(A,n,N(e,M,O,n,C,I))})),A},jo}function $c(){if(Ao)return Io;Ao=1;var e=qc();return Io=function(n){return e(n,4)}}function Kc(){return To?zo:(To=1,zo=function(e){return function(){return e}})}function Qc(){if(Ro)return Do;Ro=1;var e=(Bo?Lo:(Bo=1,Lo=function(e){return function(n,t,r){for(var o=-1,i=Object(n),a=r(n),u=a.length;u--;){var c=a[e?u:++o];if(!1===t(i[c],c,i))break}return n}}))();return Do=e}function Jc(){if(Ho)return Vo;Ho=1;var e=Qc(),n=mr();return Vo=function(t,r){return t&&e(t,r,n)}}function el(){if(Fo)return Zo;Fo=1;var e=Jc(),n=function(){if(Xo)return Yo;Xo=1;var e=yr();return Yo=function(n,t){return function(r,o){if(null==r)return r;if(!e(r))return n(r,o);for(var i=r.length,a=t?i:-1,u=Object(r);(t?a--:++a<i)&&!1!==o(u[a],a,u););return r}}}(),t=n(e);return Zo=t}function nl(){return Wo?Uo:(Wo=1,Uo=function(e){return e})}function tl(){if(qo)return Go;qo=1;var e=nl();return Go=function(n){return"function"==typeof n?n:e}}function rl(){if(Ko)return $o;Ko=1;var e=ht(),n=el(),t=tl(),r=bt();return $o=function(o,i){return(r(o)?e:n)(o,t(i))}}function ol(){return Jo?Qo:(Jo=1,Qo=rl())}function il(){if(ui)return ai;ui=1;var e=dt(),n=ri?ti:(ri=1,ti=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}),t=ii?oi:(ii=1,oi=function(e){return this.__data__.has(e)});function r(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new e;++t<r;)this.add(n[t])}return r.prototype.add=r.prototype.push=n,r.prototype.has=t,ai=r}function al(){return di?si:(di=1,si=function(e,n){return e.has(n)})}function ul(){if(hi)return fi;hi=1;var e=il(),n=(li||(li=1,ci=function(e,n){for(var t=-1,r=null==e?0:e.length;++t<r;)if(n(e[t],t,e))return!0;return!1}),ci),t=al();return fi=function(r,o,i,a,u,c){var l=1&i,s=r.length,d=o.length;if(s!=d&&!(l&&d>s))return!1;var f=c.get(r),h=c.get(o);if(f&&h)return f==o&&h==r;var v=-1,p=!0,g=2&i?new e:void 0;for(c.set(r,o),c.set(o,r);++v<s;){var y=r[v],m=o[v];if(a)var w=l?a(m,y,v,o,r,c):a(y,m,v,r,o,c);if(void 0!==w){if(w)continue;p=!1;break}if(g){if(!n(o,(function(e,n){if(!t(g,n)&&(y===e||u(y,e,i,a,c)))return g.push(n)}))){p=!1;break}}else if(y!==m&&!u(y,m,i,a,c)){p=!1;break}}return c.delete(r),c.delete(o),p},fi}function cl(){return yi||(yi=1,gi=function(e){var n=-1,t=Array(e.size);return e.forEach((function(e){t[++n]=e})),t}),gi}function ll(){if(Ei)return _i;Ei=1;var e=ft(),n=ul(),t=function(){if(wi)return mi;wi=1;var e=tt(),n=Zc(),t=Kn(),r=ul(),o=(pi||(pi=1,vi=function(e){var n=-1,t=Array(e.size);return e.forEach((function(e,r){t[++n]=[r,e]})),t}),vi),i=cl(),a=e?e.prototype:void 0,u=a?a.valueOf:void 0;return mi=function(e,a,c,l,s,d,f){switch(c){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!d(new n(e),new n(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var h=o;case"[object Set]":var v=1&l;if(h||(h=i),e.size!=a.size&&!v)return!1;var p=f.get(e);if(p)return p==a;l|=2,f.set(e,a);var g=r(h(e),h(a),l,s,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(a)}return!1}}(),r=function(){if(xi)return bi;xi=1;var e=Hc(),n=Object.prototype.hasOwnProperty;return bi=function(t,r,o,i,a,u){var c=1&o,l=e(t),s=l.length;if(s!=e(r).length&&!c)return!1;for(var d=s;d--;){var f=l[d];if(!(c?f in r:n.call(r,f)))return!1}var h=u.get(t),v=u.get(r);if(h&&v)return h==r&&v==t;var p=!0;u.set(t,r),u.set(r,t);for(var g=c;++d<s;){var y=t[f=l[d]],m=r[f];if(i)var w=c?i(m,y,f,r,t,u):i(y,m,f,t,r,u);if(!(void 0===w?y===m||a(y,m,o,i,u):w)){p=!1;break}g||(g="constructor"==f)}if(p&&!g){var b=t.constructor,x=r.constructor;b==x||!("constructor"in t)||!("constructor"in r)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(p=!1)}return u.delete(t),u.delete(r),p}}(),o=Xc(),i=bt(),a=At(),u=fr(),c="[object Arguments]",l="[object Array]",s="[object Object]",d=Object.prototype.hasOwnProperty;return _i=function(f,h,v,p,g,y){var m=i(f),w=i(h),b=m?l:o(f),x=w?l:o(h),_=(b=b==c?s:b)==s,E=(x=x==c?s:x)==s,S=b==x;if(S&&a(f)){if(!a(h))return!1;m=!0,_=!1}if(S&&!_)return y||(y=new e),m||u(f)?n(f,h,v,p,g,y):t(f,h,b,v,p,g,y);if(!(1&v)){var k=_&&d.call(f,"__wrapped__"),N=E&&d.call(h,"__wrapped__");if(k||N){var C=k?f.value():f,M=N?h.value():h;return y||(y=new e),g(C,M,v,p,y)}}return!!S&&(y||(y=new e),r(f,h,v,p,g,y))}}function sl(){if(ki)return Si;ki=1;var e=ll(),n=mt();return Si=function t(r,o,i,a,u){return r===o||(null==r||null==o||!n(r)&&!n(o)?r!=r&&o!=o:e(r,o,i,a,t,u))},Si}function dl(){if(Oi)return Mi;Oi=1;var e=ot();return Mi=function(n){return n==n&&!e(n)}}function fl(){return Ai?Ii:(Ai=1,Ii=function(e,n){return function(t){return null!=t&&t[e]===n&&(void 0!==n||e in Object(t))}})}function hl(){if(Bi)return Li;Bi=1;var e=rt(),n=mt();return Li=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==e(t)}}function vl(){if(Ri)return Di;Ri=1;var e=bt(),n=hl(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Di=function(o,i){if(e(o))return!1;var a=typeof o;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=o&&!n(o))||r.test(o)||!t.test(o)||null!=i&&o in Object(i)}}function pl(){return Wi||(Wi=1,Ui=function(e,n){for(var t=-1,r=null==e?0:e.length,o=Array(r);++t<r;)o[t]=n(e[t],t,e);return o}),Ui}function gl(){if(Ki)return $i;Ki=1;var e=function(){if(qi)return Gi;qi=1;var e=tt(),n=pl(),t=bt(),r=hl(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Gi=function e(o){if("string"==typeof o)return o;if(t(o))return n(o,e)+"";if(r(o))return i?i.call(o):"";var a=o+"";return"0"==a&&1/o==-1/0?"-0":a},Gi}();return $i=function(n){return null==n?"":e(n)}}function yl(){if(Ji)return Qi;Ji=1;var e=bt(),n=vl(),t=function(){if(Fi)return Zi;Fi=1;var e=function(){if(Xi)return Yi;Xi=1;var e=function(){if(Hi)return Vi;Hi=1;var e=dt();function n(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var e=arguments,n=r?r.apply(this,e):e[0],i=o.cache;if(i.has(n))return i.get(n);var a=t.apply(this,e);return o.cache=i.set(n,a)||i,a};return o.cache=new(n.Cache||e),o}return n.Cache=e,Vi=n}();return Yi=function(n){var t=e(n,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}}(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=e((function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(n,(function(e,n,o,i){r.push(o?i.replace(t,"$1"):n||e)})),r}));return Zi=r}(),r=gl();return Qi=function(o,i){return e(o)?o:n(o,i)?[o]:t(r(o))}}function ml(){if(na)return ea;na=1;var e=hl();return ea=function(n){if("string"==typeof n||e(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}}function wl(){if(ra)return ta;ra=1;var e=yl(),n=ml();return ta=function(t,r){for(var o=0,i=(r=e(r,t)).length;null!=t&&o<i;)t=t[n(r[o++])];return o&&o==i?t:void 0}}function bl(){if(la)return ca;la=1;var e=yl(),n=wt(),t=bt(),r=zt(),o=Tt(),i=ml();return ca=function(a,u,c){for(var l=-1,s=(u=e(u,a)).length,d=!1;++l<s;){var f=i(u[l]);if(!(d=null!=a&&c(a,f)))break;a=a[f]}return d||++l!=s?d:!!(s=null==a?0:a.length)&&o(s)&&r(f,s)&&(t(a)||n(a))}}function xl(){if(da)return sa;da=1;var e=ua?aa:(ua=1,aa=function(e,n){return null!=e&&n in Object(e)}),n=bl();return sa=function(t,r){return null!=t&&n(t,r,e)}}function _l(){return pa?va:(pa=1,va=function(e){return function(n){return null==n?void 0:n[e]}})}function El(){if(xa)return ba;xa=1;var e=function(){if(Ti)return zi;Ti=1;var e=function(){if(Ci)return Ni;Ci=1;var e=ft(),n=sl();return Ni=function(t,r,o,i){var a=o.length,u=a,c=!i;if(null==t)return!u;for(t=Object(t);a--;){var l=o[a];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a<u;){var s=(l=o[a])[0],d=t[s],f=l[1];if(c&&l[2]){if(void 0===d&&!(s in t))return!1}else{var h=new e;if(i)var v=i(d,f,s,t,r,h);if(!(void 0===v?n(f,d,3,i,h):v))return!1}}return!0}}(),n=function(){if(Pi)return ji;Pi=1;var e=dl(),n=mr();return ji=function(t){for(var r=n(t),o=r.length;o--;){var i=r[o],a=t[i];r[o]=[i,a,e(a)]}return r}}(),t=fl();return zi=function(r){var o=n(r);return 1==o.length&&o[0][2]?t(o[0][0],o[0][1]):function(n){return n===r||e(n,r,o)}}}(),n=function(){if(ha)return fa;ha=1;var e=sl(),n=function(){if(ia)return oa;ia=1;var e=wl();return oa=function(n,t,r){var o=null==n?void 0:e(n,t);return void 0===o?r:o}}(),t=xl(),r=vl(),o=dl(),i=fl(),a=ml();return fa=function(u,c){return r(u)&&o(c)?i(a(u),c):function(r){var o=n(r,u);return void 0===o&&o===c?t(r,u):e(c,o,3)}}}(),t=nl(),r=bt(),o=function(){if(wa)return ma;wa=1;var e=_l(),n=function(){if(ya)return ga;ya=1;var e=wl();return ga=function(n){return function(t){return e(t,n)}}}(),t=vl(),r=ml();return ma=function(o){return t(o)?e(r(o)):n(o)}}();return ba=function(i){return"function"==typeof i?i:null==i?t:"object"==typeof i?r(i)?n(i[0],i[1]):e(i):o(i)}}function Sl(){if(Ea)return _a;Ea=1;var e=zc(),n=function(){if(ni)return ei;ni=1;var e=el();return ei=function(n,t){var r=[];return e(n,(function(e,n,o){t(e,n,o)&&r.push(e)})),r}}(),t=El(),r=bt();return _a=function(o,i){return(r(o)?e:n)(o,t(i,3))}}function kl(){if(Ca)return Na;Ca=1;var e=function(){if(ka)return Sa;ka=1;var e=Object.prototype.hasOwnProperty;return Sa=function(n,t){return null!=n&&e.call(n,t)}}(),n=bl();return Na=function(t,r){return null!=t&&n(t,r,e)}}function Nl(){if(Oa)return Ma;Oa=1;var e=gr(),n=Xc(),t=wt(),r=bt(),o=yr(),i=At(),a=vr(),u=fr(),c=Object.prototype.hasOwnProperty;return Ma=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||u(l)||t(l)))return!l.length;var s=n(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(a(l))return!e(l).length;for(var d in l)if(c.call(l,d))return!1;return!0}}function Cl(){return Pa?ja:(Pa=1,ja=function(e){return void 0===e})}function Ml(){if(Aa)return Ia;Aa=1;var e=el(),n=yr();return Ia=function(t,r){var o=-1,i=n(t)?Array(t.length):[];return e(t,(function(e,n,t){i[++o]=r(e,n,t)})),i}}function Ol(){if(Ta)return za;Ta=1;var e=pl(),n=El(),t=Ml(),r=bt();return za=function(o,i){return(r(o)?e:t)(o,n(i,3))}}function jl(){if(Ha)return Va;Ha=1;var e=(Ba||(Ba=1,La=function(e,n,t,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(t=e[++o]);++o<i;)t=n(t,e[o],o,e);return t}),La),n=el(),t=El(),r=Ra?Da:(Ra=1,Da=function(e,n,t,r,o){return o(e,(function(e,o,i){t=r?(r=!1,e):n(t,e,o,i)})),t}),o=bt();return Va=function(i,a,u){var c=o(i)?e:r,l=arguments.length<3;return c(i,t(a,4),u,l,n)},Va}function Pl(){if(Ja)return Qa;Ja=1;var e=gr(),n=Xc(),t=yr(),r=function(){if(Xa)return Ya;Xa=1;var e=rt(),n=bt(),t=mt();return Ya=function(r){return"string"==typeof r||!n(r)&&t(r)&&"[object String]"==e(r)}}(),o=function(){if(Ka)return $a;Ka=1;var e=function(){if(Fa)return Za;Fa=1;var e=_l()("length");return Za=e}(),n=function(){if(Wa)return Ua;Wa=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Ua=function(n){return e.test(n)}}(),t=function(){if(qa)return Ga;qa=1;var e="\\ud800-\\udfff",n="["+e+"]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+t+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+u+"(?:\\u200d(?:"+[o,i,a].join("|")+")"+c+u+")*",s="(?:"+[o+t+"?",t,i,a,n].join("|")+")",d=RegExp(r+"(?="+r+")|"+s+l,"g");return Ga=function(e){for(var n=d.lastIndex=0;d.test(e);)++n;return n}}();return $a=function(r){return n(r)?t(r):e(r)}}();return Qa=function(i){if(null==i)return 0;if(t(i))return r(i)?o(i):i.length;var a=n(i);return"[object Map]"==a||"[object Set]"==a?i.size:e(i).length}}function Il(){if(nu)return eu;nu=1;var e=ht(),n=Wc(),t=Jc(),r=El(),o=Dc(),i=bt(),a=At(),u=it(),c=ot(),l=fr();return eu=function(s,d,f){var h=i(s),v=h||a(s)||l(s);if(d=r(d,4),null==f){var p=s&&s.constructor;f=v?h?new p:[]:c(s)&&u(p)?n(o(s)):{}}return(v?e:t)(s,(function(e,n,t){return d(f,e,n,t)})),f}}function Al(){if(iu)return ou;iu=1;var e=Bc(),n=function(){if(ru)return tu;ru=1;var e=tt(),n=wt(),t=bt(),r=e?e.isConcatSpreadable:void 0;return tu=function(e){return t(e)||n(e)||!!(r&&e&&e[r])}}();return ou=function t(r,o,i,a,u){var c=-1,l=r.length;for(i||(i=n),u||(u=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?t(s,o-1,i,a,u):e(u,s):a||(u[u.length]=s)}return u},ou}function zl(){if(lu)return cu;lu=1;var e=uu?au:(uu=1,au=function(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}),n=Math.max;return cu=function(t,r,o){return r=n(void 0===r?t.length-1:r,0),function(){for(var i=arguments,a=-1,u=n(i.length-r,0),c=Array(u);++a<u;)c[a]=i[r+a];a=-1;for(var l=Array(r+1);++a<r;)l[a]=i[a];return l[r]=o(c),e(t,this,l)}},cu}function Tl(){if(pu)return vu;pu=1;var e=function(){if(du)return su;du=1;var e=Kc(),n=vt(),t=nl();return su=n?function(t,r){return n(t,"toString",{configurable:!0,enumerable:!1,value:e(r),writable:!0})}:t}(),n=function(){if(hu)return fu;hu=1;var e=Date.now;return fu=function(n){var t=0,r=0;return function(){var o=e(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(void 0,arguments)}},fu}(),t=n(e);return vu=t}function Ll(){if(yu)return gu;yu=1;var e=nl(),n=zl(),t=Tl();return gu=function(r,o){return t(n(r,o,e),r+"")},gu}function Bl(){return wu||(wu=1,mu=function(e,n,t,r){for(var o=e.length,i=t+(r?1:-1);r?i--:++i<o;)if(n(e[i],i,e))return i;return-1}),mu}function Dl(){if(Tu)return zu;Tu=1;var e=il(),n=function(){if(Cu)return Nu;Cu=1;var e=function(){if(ku)return Su;ku=1;var e=Bl(),n=xu?bu:(xu=1,bu=function(e){return e!=e}),t=(Eu||(Eu=1,_u=function(e,n,t){for(var r=t-1,o=e.length;++r<o;)if(e[r]===n)return r;return-1}),_u);return Su=function(r,o,i){return o==o?t(r,o,i):e(r,n,i)},Su}();return Nu=function(n,t){return!(null==n||!n.length)&&e(n,t,0)>-1},Nu}(),t=(Ou||(Ou=1,Mu=function(e,n,t){for(var r=-1,o=null==e?0:e.length;++r<o;)if(t(n,e[r]))return!0;return!1}),Mu),r=al(),o=function(){if(Au)return Iu;Au=1;var e=Yc(),n=Pu?ju:(Pu=1,ju=function(){}),t=cl(),r=e&&1/t(new e([,-0]))[1]==1/0?function(n){return new e(n)}:n;return Iu=r}(),i=cl();return zu=function(a,u,c){var l=-1,s=n,d=a.length,f=!0,h=[],v=h;if(c)f=!1,s=t;else if(d>=200){var p=u?null:o(a);if(p)return i(p);f=!1,s=r,v=new e}else v=u?[]:h;e:for(;++l<d;){var g=a[l],y=u?u(g):g;if(g=c||0!==g?g:0,f&&y==y){for(var m=v.length;m--;)if(v[m]===y)continue e;u&&v.push(y),h.push(g)}else s(v,y,c)||(v!==h&&v.push(y),h.push(g))}return h},zu}function Rl(){if(Bu)return Lu;Bu=1;var e=yr(),n=mt();return Lu=function(t){return n(t)&&e(t)}}function Vl(){if(Ru)return Du;Ru=1;var e=Al(),n=Ll(),t=Dl(),r=Rl(),o=n((function(n){return t(e(n,1,r,!0))}));return Du=o}function Hl(){if(Xu)return Yu;Xu=1;var e=function(){if(Hu)return Vu;Hu=1;var e=pl();return Vu=function(n,t){return e(t,(function(e){return n[e]}))}}(),n=mr();return Yu=function(t){return null==t?[]:e(t,n(t))}}function Yl(){if(Fu)return Zu;var e;Fu=1;try{e={clone:$c(),constant:Kc(),each:ol(),filter:Sl(),has:kl(),isArray:bt(),isEmpty:Nl(),isFunction:it(),isUndefined:Cl(),keys:mr(),map:Ol(),reduce:jl(),size:Pl(),transform:Il(),union:Vl(),values:Hl()}}catch(e){}return e||(e=window._),Zu=e}function Xl(){if(Wu)return Uu;Wu=1;var e=Yl();Uu=o;var n="\0",t="\0",r="";function o(n){this._isDirected=!e.has(n,"directed")||n.directed,this._isMultigraph=!!e.has(n,"multigraph")&&n.multigraph,this._isCompound=!!e.has(n,"compound")&&n.compound,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function i(e,n){e[n]?e[n]++:e[n]=1}function a(e,n){--e[n]||delete e[n]}function u(t,o,i,a){var u=""+o,c=""+i;if(!t&&u>c){var l=u;u=c,c=l}return u+r+c+r+(e.isUndefined(a)?n:a)}function c(e,n){return u(e,n.v,n.w,n.name)}return o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(n){return e.isFunction(n)||(n=e.constant(n)),this._defaultNodeLabelFn=n,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var n=this;return e.filter(this.nodes(),(function(t){return e.isEmpty(n._in[t])}))},o.prototype.sinks=function(){var n=this;return e.filter(this.nodes(),(function(t){return e.isEmpty(n._out[t])}))},o.prototype.setNodes=function(n,t){var r=arguments,o=this;return e.each(n,(function(e){r.length>1?o.setNode(e,t):o.setNode(e)})),this},o.prototype.setNode=function(n,r){return e.has(this._nodes,n)?(arguments.length>1&&(this._nodes[n]=r),this):(this._nodes[n]=arguments.length>1?r:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]=t,this._children[n]={},this._children[t][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(n){return e.has(this._nodes,n)},o.prototype.removeNode=function(n){var t=this;if(e.has(this._nodes,n)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],e.each(this.children(n),(function(e){t.setParent(e)})),delete this._children[n]),e.each(e.keys(this._in[n]),r),delete this._in[n],delete this._preds[n],e.each(e.keys(this._out[n]),r),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this},o.prototype.setParent=function(n,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(r))r=t;else{for(var o=r+="";!e.isUndefined(o);o=this.parent(o))if(o===n)throw new Error("Setting "+r+" as parent of "+n+" would create a cycle");this.setNode(r)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=r,this._children[r][n]=!0,this},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(n!==t)return n}},o.prototype.children=function(n){if(e.isUndefined(n)&&(n=t),this._isCompound){var r=this._children[n];if(r)return e.keys(r)}else{if(n===t)return this.nodes();if(this.hasNode(n))return[]}},o.prototype.predecessors=function(n){var t=this._preds[n];if(t)return e.keys(t)},o.prototype.successors=function(n){var t=this._sucs[n];if(t)return e.keys(t)},o.prototype.neighbors=function(n){var t=this.predecessors(n);if(t)return e.union(t,this.successors(n))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.prototype.filterNodes=function(n){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;e.each(this._nodes,(function(e,r){n(r)&&t.setNode(r,e)})),e.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))}));var o={};function i(e){var n=r.parent(e);return void 0===n||t.hasNode(n)?(o[e]=n,n):n in o?o[n]:i(n)}return this._isCompound&&e.each(t.nodes(),(function(e){t.setParent(e,i(e))})),t},o.prototype.setDefaultEdgeLabel=function(n){return e.isFunction(n)||(n=e.constant(n)),this._defaultEdgeLabelFn=n,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(n,t){var r=this,o=arguments;return e.reduce(n,(function(e,n){return o.length>1?r.setEdge(e,n,t):r.setEdge(e,n),n})),this},o.prototype.setEdge=function(){var n,t,r,o,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(n=c.v,t=c.w,r=c.name,2===arguments.length&&(o=arguments[1],a=!0)):(n=c,t=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),n=""+n,t=""+t,e.isUndefined(r)||(r=""+r);var l=u(this._isDirected,n,t,r);if(e.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=o),this;if(!e.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(t),this._edgeLabels[l]=a?o:this._defaultEdgeLabelFn(n,t,r);var s=function(e,n,t,r){var o=""+n,i=""+t;if(!e&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};return r&&(u.name=r),u}(this._isDirected,n,t,r);return n=s.v,t=s.w,Object.freeze(s),this._edgeObjs[l]=s,i(this._preds[t],n),i(this._sucs[n],t),this._in[t][l]=s,this._out[n][l]=s,this._edgeCount++,this},o.prototype.edge=function(e,n,t){var r=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,e,n,t);return this._edgeLabels[r]},o.prototype.hasEdge=function(n,t,r){var o=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,n,t,r);return e.has(this._edgeLabels,o)},o.prototype.removeEdge=function(e,n,t){var r=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,e,n,t),o=this._edgeObjs[r];return o&&(e=o.v,n=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],a(this._preds[n],e),a(this._sucs[e],n),delete this._in[n][r],delete this._out[e][r],this._edgeCount--),this},o.prototype.inEdges=function(n,t){var r=this._in[n];if(r){var o=e.values(r);return t?e.filter(o,(function(e){return e.v===t})):o}},o.prototype.outEdges=function(n,t){var r=this._out[n];if(r){var o=e.values(r);return t?e.filter(o,(function(e){return e.w===t})):o}},o.prototype.nodeEdges=function(e,n){var t=this.inEdges(e,n);if(t)return t.concat(this.outEdges(e,n))},Uu}function Zl(){if(Ju)return Qu;Ju=1;var e=Yl(),n=Xl();function t(n){return e.map(n.nodes(),(function(t){var r=n.node(t),o=n.parent(t),i={v:t};return e.isUndefined(r)||(i.value=r),e.isUndefined(o)||(i.parent=o),i}))}function r(n){return e.map(n.edges(),(function(t){var r=n.edge(t),o={v:t.v,w:t.w};return e.isUndefined(t.name)||(o.name=t.name),e.isUndefined(r)||(o.value=r),o}))}return Qu={write:function(n){var o={options:{directed:n.isDirected(),multigraph:n.isMultigraph(),compound:n.isCompound()},nodes:t(n),edges:r(n)};return e.isUndefined(n.graph())||(o.value=e.clone(n.graph())),o},read:function(t){var r=new n(t.options).setGraph(t.value);return e.each(t.nodes,(function(e){r.setNode(e.v,e.value),e.parent&&r.setParent(e.v,e.parent)})),e.each(t.edges,(function(e){r.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),r}}}function Fl(){if(nc)return ec;nc=1;var e=Yl();return ec=function(n){var t,r={},o=[];function i(o){e.has(r,o)||(r[o]=!0,t.push(o),e.each(n.successors(o),i),e.each(n.predecessors(o),i))}return e.each(n.nodes(),(function(e){t=[],i(e),t.length&&o.push(t)})),o},ec}function Ul(){if(rc)return tc;rc=1;var e=Yl();function n(){this._arr=[],this._keyIndices={}}return tc=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},n.prototype.has=function(n){return e.has(this._keyIndices,n)},n.prototype.priority=function(e){var n=this._keyIndices[e];if(void 0!==n)return this._arr[n].priority},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(n,t){var r=this._keyIndices;if(n=String(n),!e.has(r,n)){var o=this._arr,i=o.length;return r[n]=i,o.push({key:n,priority:t}),this._decrease(i),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},n.prototype.decrease=function(e,n){var t=this._keyIndices[e];if(n>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[t].priority+" New: "+n);this._arr[t].priority=n,this._decrease(t)},n.prototype._heapify=function(e){var n=this._arr,t=2*e,r=t+1,o=e;t<n.length&&(o=n[t].priority<n[o].priority?t:o,r<n.length&&(o=n[r].priority<n[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))},n.prototype._decrease=function(e){for(var n,t=this._arr,r=t[e].priority;0!==e&&!(t[n=e>>1].priority<r);)this._swap(e,n),e=n},n.prototype._swap=function(e,n){var t=this._arr,r=this._keyIndices,o=t[e],i=t[n];t[e]=i,t[n]=o,r[i.key]=e,r[o.key]=n},tc}function Wl(){if(ic)return oc;ic=1;var e=Yl(),n=Ul();oc=function(e,r,o,i){return function(e,t,r,o){var i,a,u={},c=new n,l=function(e){var n=e.v!==i?e.v:e.w,t=u[n],o=r(e),l=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<t.distance&&(t.distance=l,t.predecessor=i,c.decrease(n,l))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;u[e]={distance:n},c.add(e,n)}));c.size()>0&&(i=c.removeMin(),(a=u[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return u}(e,String(r),o||t,i||function(n){return e.outEdges(n)})};var t=e.constant(1);return oc}function Gl(){if(uc)return ac;uc=1;var e=Wl(),n=Yl();return ac=function(t,r,o){return n.transform(t.nodes(),(function(n,i){n[i]=e(t,i,r,o)}),{})}}function ql(){if(lc)return cc;lc=1;var e=Yl();return cc=function(n){var t=0,r=[],o={},i=[];function a(u){var c=o[u]={onStack:!0,lowlink:t,index:t++};if(r.push(u),n.successors(u).forEach((function(n){e.has(o,n)?o[n].onStack&&(c.lowlink=Math.min(c.lowlink,o[n].index)):(a(n),c.lowlink=Math.min(c.lowlink,o[n].lowlink))})),c.lowlink===c.index){var l,s=[];do{l=r.pop(),o[l].onStack=!1,s.push(l)}while(u!==l);i.push(s)}}return n.nodes().forEach((function(n){e.has(o,n)||a(n)})),i},cc}function $l(){if(dc)return sc;dc=1;var e=Yl(),n=ql();return sc=function(t){return e.filter(n(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}}function Kl(){if(hc)return fc;hc=1;var e=Yl();fc=function(e,t,r){return function(e,n,t){var r={},o=e.nodes();return o.forEach((function(e){r[e]={},r[e][e]={distance:0},o.forEach((function(n){e!==n&&(r[e][n]={distance:Number.POSITIVE_INFINITY})})),t(e).forEach((function(t){var o=t.v===e?t.w:t.v,i=n(t);r[e][o]={distance:i,predecessor:e}}))})),o.forEach((function(e){var n=r[e];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[e],o=n[t],a=i[t],u=r.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)}))}))})),r}(e,t||n,r||function(n){return e.outEdges(n)})};var n=e.constant(1);return fc}function Ql(){if(pc)return vc;pc=1;var e=Yl();function n(n){var r={},o={},i=[];if(e.each(n.sinks(),(function a(u){if(e.has(o,u))throw new t;e.has(r,u)||(o[u]=!0,r[u]=!0,e.each(n.predecessors(u),a),delete o[u],i.push(u))})),e.size(r)!==n.nodeCount())throw new t;return i}function t(){}return vc=n,n.CycleException=t,t.prototype=new Error,vc}function Jl(){if(yc)return gc;yc=1;var e=Ql();return gc=function(n){try{e(n)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}}function es(){if(wc)return mc;wc=1;var e=Yl();function n(t,r,o,i,a,u){e.has(i,r)||(i[r]=!0,o||u.push(r),e.each(a(r),(function(e){n(t,e,o,i,a,u)})),o&&u.push(r))}return mc=function(t,r,o){e.isArray(r)||(r=[r]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],u={};return e.each(r,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);n(t,e,"post"===o,u,i,a)})),a},mc}function ns(){if(xc)return bc;xc=1;var e=es();return bc=function(n,t){return e(n,t,"post")}}function ts(){if(Ec)return _c;Ec=1;var e=es();return _c=function(n,t){return e(n,t,"pre")}}function rs(){if(kc)return Sc;kc=1;var e=Yl(),n=Xl(),t=Ul();return Sc=function(r,o){var i,a=new n,u={},c=new t;function l(e){var n=e.v===i?e.w:e.v,t=c.priority(n);if(void 0!==t){var r=o(e);r<t&&(u[n]=i,c.decrease(n,r))}}if(0===r.nodeCount())return a;e.each(r.nodes(),(function(e){c.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),c.decrease(r.nodes()[0],0);for(var s=!1;c.size()>0;){if(i=c.removeMin(),e.has(u,i))a.setEdge(i,u[i]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(i).forEach(l)}return a},Sc}Pc.exports;try{jc=function(){if(Oc)return Mc;Oc=1;var e=Ku?$u:(Ku=1,$u={Graph:Xl(),version:qu?Gu:(qu=1,Gu="2.1.8")});return Mc={Graph:e.Graph,json:Zl(),alg:Cc?Nc:(Cc=1,Nc={components:Fl(),dijkstra:Wl(),dijkstraAll:Gl(),findCycles:$l(),floydWarshall:Kl(),isAcyclic:Jl(),postorder:ns(),preorder:ts(),prim:rs(),tarjan:ql(),topsort:Ql()}),version:e.version}}()}catch(Z){}jc||(jc=window.graphlib);var os,is,as,us,cs,ls,ss,ds,fs,hs,vs,ps,gs,ys,ms,ws,bs,xs,_s,Es,Ss,ks,Ns,Cs,Ms,Os,js,Ps,Is,As,zs,Ts,Ls,Bs,Ds,Rs,Vs,Hs,Ys,Xs,Zs,Fs,Us,Ws,Gs,qs,$s,Ks,Qs,Js,ed,nd,td,rd,od,id,ad,ud,cd,ld,sd,dd,fd,hd,vd,pd,gd,yd,md,wd,bd,xd,_d,Ed,Sd,kd,Nd,Cd,Md,Od,jd,Pd,Id,Ad,zd,Td,Ld,Bd,Dd,Rd,Vd,Hd,Yd,Xd=jc;function Zd(){if(us)return as;us=1;var e=Kn(),n=yr(),t=zt(),r=ot();return as=function(o,i,a){if(!r(a))return!1;var u=typeof i;return!!("number"==u?n(a)&&t(i,a.length):"string"==u&&i in a)&&e(a[i],o)}}function Fd(){if(ws)return ms;ws=1;var e=function(){if(ys)return gs;ys=1;var e=function(){if(ps)return vs;ps=1;var e=function(){if(hs)return fs;hs=1;var e=/\s/;return fs=function(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}}(),n=/^\s+/;return vs=function(t){return t?t.slice(0,e(t)+1).replace(n,""):t}}(),n=ot(),t=hl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;return gs=function(u){if("number"==typeof u)return u;if(t(u))return NaN;if(n(u)){var c="function"==typeof u.valueOf?u.valueOf():u;u=n(c)?c+"":c}if("string"!=typeof u)return 0===u?u:+u;u=e(u);var l=o.test(u);return l||i.test(u)?a(u.slice(2),l?2:8):r.test(u)?NaN:+u}}(),n=1/0;return ms=function(t){return t?(t=e(t))===n||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}}function Ud(){if(Cs)return Ns;Cs=1;var e=Al();return Ns=function(n){return null!=n&&n.length?e(n,1):[]}}function Wd(){if(Ts)return zs;Ts=1;var e=hl();return zs=function(n,t,r){for(var o=-1,i=n.length;++o<i;){var a=n[o],u=t(a);if(null!=u&&(void 0===c?u==u&&!e(u):r(u,c)))var c=u,l=a}return l},zs}function Gd(){if(Hs)return Vs;Hs=1;var e=pt(),n=Kn();return Vs=function(t,r,o){(void 0!==o&&!n(t[r],o)||void 0===o&&!(r in t))&&e(t,r,o)}}function qd(){return Fs?Zs:(Fs=1,Zs=function(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]})}function $d(){return rd?td:(rd=1,td=function(e,n){return e<n})}function Kd(){if(Ad)return Id;Ad=1;var e=pl(),n=wl(),t=El(),r=Ml(),o=(Cd||(Cd=1,Nd=function(e,n){var t=e.length;for(e.sort(n);t--;)e[t]=e[t].value;return e}),Nd),i=Lt(),a=function(){if(Pd)return jd;Pd=1;var e=function(){if(Od)return Md;Od=1;var e=hl();return Md=function(n,t){if(n!==t){var r=void 0!==n,o=null===n,i=n==n,a=e(n),u=void 0!==t,c=null===t,l=t==t,s=e(t);if(!c&&!s&&!a&&n>t||a&&u&&l&&!c&&!s||o&&u&&l||!r&&l||!i)return 1;if(!o&&!a&&!s&&n<t||s&&r&&i&&!o&&!a||c&&r&&i||!u&&i||!l)return-1}return 0}}();return jd=function(n,t,r){for(var o=-1,i=n.criteria,a=t.criteria,u=i.length,c=r.length;++o<u;){var l=e(i[o],a[o]);if(l)return o>=c?l:l*("desc"==r[o]?-1:1)}return n.index-t.index}}(),u=nl(),c=bt();return Id=function(l,s,d){s=s.length?e(s,(function(e){return c(e)?function(t){return n(t,1===e.length?e[0]:e)}:e})):[u];var f=-1;s=e(s,i(t));var h=r(l,(function(n,t,r){return{criteria:e(s,(function(e){return e(n)})),index:++f,value:n}}));return o(h,(function(e,n){return a(e,n,d)}))}}try{Yd={cloneDeep:function(){if(is)return os;is=1;var e=qc();return os=function(n){return e(n,5)}}(),constant:Kc(),defaults:function(){if(ls)return cs;ls=1;var e=Ll(),n=Kn(),t=Zd(),r=wr(),o=Object.prototype,i=o.hasOwnProperty,a=e((function(e,a){e=Object(e);var u=-1,c=a.length,l=c>2?a[2]:void 0;for(l&&t(a[0],a[1],l)&&(c=1);++u<c;)for(var s=a[u],d=r(s),f=-1,h=d.length;++f<h;){var v=d[f],p=e[v];(void 0===p||n(p,o[v])&&!i.call(e,v))&&(e[v]=s[v])}return e}));return cs=a}(),each:ol(),filter:Sl(),find:function(){if(ks)return Ss;ks=1;var e=function(){if(ds)return ss;ds=1;var e=El(),n=yr(),t=mr();return ss=function(r){return function(o,i,a){var u=Object(o);if(!n(o)){var c=e(i,3);o=t(o),i=function(e){return c(u[e],e,u)}}var l=r(o,i,a);return l>-1?u[c?o[l]:l]:void 0}}}(),n=e(function(){if(Es)return _s;Es=1;var e=Bl(),n=El(),t=function(){if(xs)return bs;xs=1;var e=Fd();return bs=function(n){var t=e(n),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return _s=function(o,i,a){var u=null==o?0:o.length;if(!u)return-1;var c=null==a?0:t(a);return c<0&&(c=r(u+c,0)),e(o,n(i,3),c)},_s}());return Ss=n}(),flatten:Ud(),forEach:rl(),forIn:function(){if(Os)return Ms;Os=1;var e=Qc(),n=tl(),t=wr();return Ms=function(r,o){return null==r?r:e(r,n(o),t)}}(),has:kl(),isUndefined:Cl(),last:(Ps||(Ps=1,js=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}),js),map:Ol(),mapValues:function(){if(As)return Is;As=1;var e=pt(),n=Jc(),t=El();return Is=function(r,o){var i={};return o=t(o,3),n(r,(function(n,t,r){e(i,t,o(n,t,r))})),i}}(),max:function(){if(Rs)return Ds;Rs=1;var e=Wd(),n=Bs?Ls:(Bs=1,Ls=function(e,n){return e>n}),t=nl();return Ds=function(r){return r&&r.length?e(r,t,n):void 0},Ds}(),merge:function(){if(nd)return ed;nd=1;var e=function(){if(Ks)return $s;Ks=1;var e=ft(),n=Gd(),t=Qc(),r=function(){if(qs)return Gs;qs=1;var e=Gd(),n=Ic(),t=Uc(),r=Ac(),o=Gc(),i=wt(),a=bt(),u=Rl(),c=At(),l=it(),s=ot(),d=function(){if(Xs)return Ys;Xs=1;var e=rt(),n=Dc(),t=mt(),r=Function.prototype,o=Object.prototype,i=r.toString,a=o.hasOwnProperty,u=i.call(Object);return Ys=function(r){if(!t(r)||"[object Object]"!=e(r))return!1;var o=n(r);if(null===o)return!0;var c=a.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==u}}(),f=fr(),h=qd(),v=function(){if(Ws)return Us;Ws=1;var e=yt(),n=wr();return Us=function(t){return e(t,n(t))}}();return Gs=function(p,g,y,m,w,b,x){var _=h(p,y),E=h(g,y),S=x.get(E);if(S)e(p,y,S);else{var k=b?b(_,E,y+"",p,g,x):void 0,N=void 0===k;if(N){var C=a(E),M=!C&&c(E),O=!C&&!M&&f(E);k=E,C||M||O?a(_)?k=_:u(_)?k=r(_):M?(N=!1,k=n(E,!0)):O?(N=!1,k=t(E,!0)):k=[]:d(E)||i(E)?(k=_,i(_)?k=v(_):s(_)&&!l(_)||(k=o(E))):N=!1}N&&(x.set(E,k),w(k,E,m,b,x),x.delete(E)),e(p,y,k)}}}(),o=ot(),i=wr(),a=qd();return $s=function u(c,l,s,d,f){c!==l&&t(l,(function(t,i){if(f||(f=new e),o(t))r(c,l,i,s,u,d,f);else{var h=d?d(a(c,i),t,i+"",c,l,f):void 0;void 0===h&&(h=t),n(c,i,h)}}),i)},$s}(),n=function(){if(Js)return Qs;Js=1;var e=Ll(),n=Zd();return Qs=function(t){return e((function(e,r){var o=-1,i=r.length,a=i>1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&n(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++o<i;){var c=r[o];c&&t(e,c,o,a)}return e}))}}()((function(n,t,r){e(n,t,r)}));return ed=n}(),min:function(){if(id)return od;id=1;var e=Wd(),n=$d(),t=nl();return od=function(r){return r&&r.length?e(r,t,n):void 0},od}(),minBy:function(){if(ud)return ad;ud=1;var e=Wd(),n=El(),t=$d();return ad=function(r,o){return r&&r.length?e(r,n(o,2),t):void 0},ad}(),now:function(){if(ld)return cd;ld=1;var e=nt();return cd=function(){return e.Date.now()}}(),pick:function(){if(wd)return md;wd=1;var e=function(){if(pd)return vd;pd=1;var e=function(){if(hd)return fd;hd=1;var e=wl(),n=function(){if(dd)return sd;dd=1;var e=gt(),n=yl(),t=zt(),r=ot(),o=ml();return sd=function(i,a,u,c){if(!r(i))return i;for(var l=-1,s=(a=n(a,i)).length,d=s-1,f=i;null!=f&&++l<s;){var h=o(a[l]),v=u;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(l!=d){var p=f[h];void 0===(v=c?c(p,h,f):void 0)&&(v=r(p)?p:t(a[l+1])?[]:{})}e(f,h,v),f=f[h]}return i}}(),t=yl();return fd=function(r,o,i){for(var a=-1,u=o.length,c={};++a<u;){var l=o[a],s=e(r,l);i(s,l)&&n(c,t(l,r),s)}return c}}(),n=xl();return vd=function(t,r){return e(t,r,(function(e,r){return n(t,r)}))}}(),n=function(){if(yd)return gd;yd=1;var e=Ud(),n=zl(),t=Tl();return gd=function(r){return t(n(r,void 0,e),r+"")}}(),t=n((function(n,t){return null==n?{}:e(n,t)}));return md=t}(),range:function(){if(kd)return Sd;kd=1;var e=function(){if(Ed)return _d;Ed=1;var e=function(){if(xd)return bd;xd=1;var e=Math.ceil,n=Math.max;return bd=function(t,r,o,i){for(var a=-1,u=n(e((r-t)/(o||1)),0),c=Array(u);u--;)c[i?u:++a]=t,t+=o;return c},bd}(),n=Zd(),t=Fd();return _d=function(r){return function(o,i,a){return a&&"number"!=typeof a&&n(o,i,a)&&(i=a=void 0),o=t(o),void 0===i?(i=o,o=0):i=t(i),a=void 0===a?o<i?1:-1:t(a),e(o,i,a,r)}},_d}()();return Sd=e}(),reduce:jl(),sortBy:function(){if(Td)return zd;Td=1;var e=Al(),n=Kd(),t=Ll(),r=Zd(),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]]),n(t,e(o,1),[])}));return zd=o}(),uniqueId:function(){if(Bd)return Ld;Bd=1;var e=gl(),n=0;return Ld=function(t){var r=++n;return e(t)+r},Ld}(),values:Hl(),zipObject:function(){if(Hd)return Vd;Hd=1;var e=gt(),n=(Rd||(Rd=1,Dd=function(e,n,t){for(var r=-1,o=e.length,i=n.length,a={};++r<o;){var u=r<i?n[r]:void 0;t(a,e[r],u)}return a}),Dd);return Vd=function(t,r){return n(t||[],r||[],e)},Vd}()}}catch(Z){}Yd||(Yd=window._);var Qd=Yd,Jd=ef;function ef(){var e={};e._next=e._prev=e,this._sentinel=e}function nf(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function tf(e,n){if("_next"!==e&&"_prev"!==e)return n}ef.prototype.dequeue=function(){var e=this._sentinel,n=e._prev;if(n!==e)return nf(n),n},ef.prototype.enqueue=function(e){var n=this._sentinel;e._prev&&e._next&&nf(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n},ef.prototype.toString=function(){for(var e=[],n=this._sentinel,t=n._prev;t!==n;)e.push(JSON.stringify(t,tf)),t=t._prev;return"["+e.join(", ")+"]"};var rf=Qd,of=Xd.Graph,af=Jd,uf=rf.constant(1);function cf(e,n,t,r,o){var i=o?[]:void 0;return rf.forEach(e.inEdges(r.v),(function(r){var a=e.edge(r),u=e.node(r.v);o&&i.push({v:r.v,w:r.w}),u.out-=a,lf(n,t,u)})),rf.forEach(e.outEdges(r.v),(function(r){var o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,lf(n,t,a)})),e.removeNode(r.v),i}function lf(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}var sf=Qd,df=function(e,n){if(e.nodeCount()<=1)return[];var t=function(e,n){var t=new of,r=0,o=0;rf.forEach(e.nodes(),(function(e){t.setNode(e,{v:e,in:0,out:0})})),rf.forEach(e.edges(),(function(e){var i=t.edge(e.v,e.w)||0,a=n(e),u=i+a;t.setEdge(e.v,e.w,u),o=Math.max(o,t.node(e.v).out+=a),r=Math.max(r,t.node(e.w).in+=a)}));var i=rf.range(o+r+3).map((function(){return new af})),a=r+1;return rf.forEach(t.nodes(),(function(e){lf(i,a,t.node(e))})),{graph:t,buckets:i,zeroIdx:a}}(e,n||uf),r=function(e,n,t){for(var r,o=[],i=n[n.length-1],a=n[0];e.nodeCount();){for(;r=a.dequeue();)cf(e,n,t,r);for(;r=i.dequeue();)cf(e,n,t,r);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(r=n[u].dequeue()){o=o.concat(cf(e,n,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return rf.flatten(rf.map(r,(function(n){return e.outEdges(n.v,n.w)})),!0)},ff={run:function(e){var n="greedy"===e.graph().acyclicer?df(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],t={},r={};return sf.forEach(e.nodes(),(function o(i){sf.has(r,i)||(r[i]=!0,t[i]=!0,sf.forEach(e.outEdges(i),(function(e){sf.has(t,e.w)?n.push(e):o(e.w)})),delete t[i])})),n}(e);sf.forEach(n,(function(n){var t=e.edge(n);e.removeEdge(n),t.forwardName=n.name,t.reversed=!0,e.setEdge(n.w,n.v,t,sf.uniqueId("rev"))}))},undo:function(e){sf.forEach(e.edges(),(function(n){var t=e.edge(n);if(t.reversed){e.removeEdge(n);var r=t.forwardName;delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,r)}}))}},hf=Qd,vf=Xd.Graph,pf={addDummyNode:gf,simplify:function(e){var n=(new vf).setGraph(e.graph());return hf.forEach(e.nodes(),(function(t){n.setNode(t,e.node(t))})),hf.forEach(e.edges(),(function(t){var r=n.edge(t.v,t.w)||{weight:0,minlen:1},o=e.edge(t);n.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),n},asNonCompoundGraph:function(e){var n=new vf({multigraph:e.isMultigraph()}).setGraph(e.graph());return hf.forEach(e.nodes(),(function(t){e.children(t).length||n.setNode(t,e.node(t))})),hf.forEach(e.edges(),(function(t){n.setEdge(t,e.edge(t))})),n},successorWeights:function(e){var n=hf.map(e.nodes(),(function(n){var t={};return hf.forEach(e.outEdges(n),(function(n){t[n.w]=(t[n.w]||0)+e.edge(n).weight})),t}));return hf.zipObject(e.nodes(),n)},predecessorWeights:function(e){var n=hf.map(e.nodes(),(function(n){var t={};return hf.forEach(e.inEdges(n),(function(n){t[n.v]=(t[n.v]||0)+e.edge(n).weight})),t}));return hf.zipObject(e.nodes(),n)},intersectRect:function(e,n){var t,r,o=e.x,i=e.y,a=n.x-o,u=n.y-i,c=e.width/2,l=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*c>Math.abs(a)*l?(u<0&&(l=-l),t=l*a/u,r=l):(a<0&&(c=-c),t=c,r=c*u/a),{x:o+t,y:i+r}},buildLayerMatrix:function(e){var n=hf.map(hf.range(yf(e)+1),(function(){return[]}));return hf.forEach(e.nodes(),(function(t){var r=e.node(t),o=r.rank;hf.isUndefined(o)||(n[o][r.order]=t)})),n},normalizeRanks:function(e){var n=hf.min(hf.map(e.nodes(),(function(n){return e.node(n).rank})));hf.forEach(e.nodes(),(function(t){var r=e.node(t);hf.has(r,"rank")&&(r.rank-=n)}))},removeEmptyRanks:function(e){var n=hf.min(hf.map(e.nodes(),(function(n){return e.node(n).rank}))),t=[];hf.forEach(e.nodes(),(function(r){var o=e.node(r).rank-n;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=e.graph().nodeRankFactor;hf.forEach(t,(function(n,t){hf.isUndefined(n)&&t%o!=0?--r:r&&hf.forEach(n,(function(n){e.node(n).rank+=r}))}))},addBorderNode:function(e,n,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),gf(e,"border",o,n)},maxRank:yf,partition:function(e,n){var t={lhs:[],rhs:[]};return hf.forEach(e,(function(e){n(e)?t.lhs.push(e):t.rhs.push(e)})),t},time:function(e,n){var t=hf.now();try{return n()}finally{console.log(e+" time: "+(hf.now()-t)+"ms")}},notime:function(e,n){return n()}};function gf(e,n,t,r){var o;do{o=hf.uniqueId(r)}while(e.hasNode(o));return t.dummy=n,e.setNode(o,t),o}function yf(e){return hf.max(hf.map(e.nodes(),(function(n){var t=e.node(n).rank;if(!hf.isUndefined(t))return t})))}var mf=Qd,wf=pf,bf={run:function(e){e.graph().dummyChains=[],mf.forEach(e.edges(),(function(n){!function(e,n){var t,r,o,i=n.v,a=e.node(i).rank,u=n.w,c=e.node(u).rank,l=n.name,s=e.edge(n),d=s.labelRank;if(c!==a+1){for(e.removeEdge(n),o=0,++a;a<c;++o,++a)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:n,rank:a},t=wf.addDummyNode(e,"edge",r,"_d"),a===d&&(r.width=s.width,r.height=s.height,r.dummy="edge-label",r.labelpos=s.labelpos),e.setEdge(i,t,{weight:s.weight},l),0===o&&e.graph().dummyChains.push(t),i=t;e.setEdge(i,u,{weight:s.weight},l)}}(e,n)}))},undo:function(e){mf.forEach(e.graph().dummyChains,(function(n){var t,r=e.node(n),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)t=e.successors(n)[0],e.removeNode(n),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),n=t,r=e.node(n)}))}},xf=Qd,_f=function(e){var n={};xf.forEach(e.sources(),(function t(r){var o=e.node(r);if(xf.has(n,r))return o.rank;n[r]=!0;var i=xf.min(xf.map(e.outEdges(r),(function(n){return t(n.w)-e.edge(n).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},Ef=function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen},Sf=Qd,kf=Xd.Graph,Nf=Ef,Cf=function(e){var n,t,r=new kf({directed:!1}),o=e.nodes()[0],i=e.nodeCount();for(r.setNode(o,{});Mf(r,e)<i;)n=Of(r,e),t=r.hasNode(n.v)?Nf(e,n):-Nf(e,n),jf(r,e,t);return r};function Mf(e,n){return Sf.forEach(e.nodes(),(function t(r){Sf.forEach(n.nodeEdges(r),(function(o){var i=o.v,a=r===i?o.w:i;e.hasNode(a)||Nf(n,o)||(e.setNode(a,{}),e.setEdge(r,a,{}),t(a))}))})),e.nodeCount()}function Of(e,n){return Sf.minBy(n.edges(),(function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return Nf(n,t)}))}function jf(e,n,t){Sf.forEach(e.nodes(),(function(e){n.node(e).rank+=t}))}var Pf=Qd,If=Cf,Af=Ef,zf=_f,Tf=Xd.alg.preorder,Lf=Xd.alg.postorder,Bf=pf.simplify,Df=Rf;function Rf(e){e=Bf(e),zf(e);var n,t=If(e);for(Yf(t),Vf(t,e);n=Zf(t);)Uf(t,e,n,Ff(t,e,n))}function Vf(e,n){var t=Lf(e,e.nodes());t=t.slice(0,t.length-1),Pf.forEach(t,(function(t){!function(e,n,t){var r=e.node(t).parent;e.edge(t,r).cutvalue=Hf(e,n,t)}(e,n,t)}))}function Hf(e,n,t){var r=e.node(t).parent,o=!0,i=n.edge(t,r),a=0;return i||(o=!1,i=n.edge(r,t)),a=i.weight,Pf.forEach(n.nodeEdges(t),(function(i){var u,c,l=i.v===t,s=l?i.w:i.v;if(s!==r){var d=l===o,f=n.edge(i).weight;if(a+=d?f:-f,u=t,c=s,e.hasEdge(u,c)){var h=e.edge(t,s).cutvalue;a+=d?-h:h}}})),a}function Yf(e,n){arguments.length<2&&(n=e.nodes()[0]),Xf(e,{},1,n)}function Xf(e,n,t,r,o){var i=t,a=e.node(r);return n[r]=!0,Pf.forEach(e.neighbors(r),(function(o){Pf.has(n,o)||(t=Xf(e,n,t,o,r))})),a.low=i,a.lim=t++,o?a.parent=o:delete a.parent,t}function Zf(e){return Pf.find(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function Ff(e,n,t){var r=t.v,o=t.w;n.hasEdge(r,o)||(r=t.w,o=t.v);var i=e.node(r),a=e.node(o),u=i,c=!1;i.lim>a.lim&&(u=a,c=!0);var l=Pf.filter(n.edges(),(function(n){return c===Wf(e,e.node(n.v),u)&&c!==Wf(e,e.node(n.w),u)}));return Pf.minBy(l,(function(e){return Af(n,e)}))}function Uf(e,n,t,r){var o=t.v,i=t.w;e.removeEdge(o,i),e.setEdge(r.v,r.w,{}),Yf(e),Vf(e,n),function(e,n){var t=Pf.find(e.nodes(),(function(e){return!n.node(e).parent})),r=Tf(e,t);r=r.slice(1),Pf.forEach(r,(function(t){var r=e.node(t).parent,o=n.edge(t,r),i=!1;o||(o=n.edge(r,t),i=!0),n.node(t).rank=n.node(r).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function Wf(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}Rf.initLowLimValues=Yf,Rf.initCutValues=Vf,Rf.calcCutValue=Hf,Rf.leaveEdge=Zf,Rf.enterEdge=Ff,Rf.exchangeEdges=Uf;var Gf=_f,qf=Cf,$f=Df,Kf=Gf;var Qf=Qd,Jf=Qd,eh=pf,nh={run:function(e){var n=eh.addDummyNode(e,"root",{},"_root"),t=function(e){var n={};function t(r,o){var i=e.children(r);i&&i.length&&Jf.forEach(i,(function(e){t(e,o+1)})),n[r]=o}return Jf.forEach(e.children(),(function(e){t(e,1)})),n}(e),r=Jf.max(Jf.values(t))-1,o=2*r+1;e.graph().nestingRoot=n,Jf.forEach(e.edges(),(function(n){e.edge(n).minlen*=o}));var i=function(e){return Jf.reduce(e.edges(),(function(n,t){return n+e.edge(t).weight}),0)}(e)+1;Jf.forEach(e.children(),(function(a){th(e,n,o,i,r,t,a)})),e.graph().nodeRankFactor=o},cleanup:function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,Jf.forEach(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}};function th(e,n,t,r,o,i,a){var u=e.children(a);if(u.length){var c=eh.addBorderNode(e,"_bt"),l=eh.addBorderNode(e,"_bb"),s=e.node(a);e.setParent(c,a),s.borderTop=c,e.setParent(l,a),s.borderBottom=l,Jf.forEach(u,(function(u){th(e,n,t,r,o,i,u);var s=e.node(u),d=s.borderTop?s.borderTop:u,f=s.borderBottom?s.borderBottom:u,h=s.borderTop?r:2*r,v=d!==f?1:o-i[a]+1;e.setEdge(c,d,{weight:h,minlen:v,nestingEdge:!0}),e.setEdge(f,l,{weight:h,minlen:v,nestingEdge:!0})})),e.parent(a)||e.setEdge(n,c,{weight:0,minlen:o+i[a]})}else a!==n&&e.setEdge(n,a,{weight:0,minlen:t})}var rh=Qd,oh=pf;function ih(e,n,t,r,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],c=oh.addDummyNode(e,"border",a,t);o[n][i]=c,e.setParent(c,r),u&&e.setEdge(u,c,{weight:1})}var ah=Qd,uh={adjust:function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||ch(e)},undo:function(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){ah.forEach(e.nodes(),(function(n){sh(e.node(n))})),ah.forEach(e.edges(),(function(n){var t=e.edge(n);ah.forEach(t.points,sh),ah.has(t,"y")&&sh(t)}))}(e),"lr"!==n&&"rl"!==n||(function(e){ah.forEach(e.nodes(),(function(n){dh(e.node(n))})),ah.forEach(e.edges(),(function(n){var t=e.edge(n);ah.forEach(t.points,dh),ah.has(t,"x")&&dh(t)}))}(e),ch(e))}};function ch(e){ah.forEach(e.nodes(),(function(n){lh(e.node(n))})),ah.forEach(e.edges(),(function(n){lh(e.edge(n))}))}function lh(e){var n=e.width;e.width=e.height,e.height=n}function sh(e){e.y=-e.y}function dh(e){var n=e.x;e.x=e.y,e.y=n}var fh=Qd,hh=Qd;function vh(e,n,t){for(var r=hh.zipObject(t,hh.map(t,(function(e,n){return n}))),o=hh.flatten(hh.map(n,(function(n){return hh.sortBy(hh.map(e.outEdges(n),(function(n){return{pos:r[n.w],weight:e.edge(n).weight}})),"pos")})),!0),i=1;i<t.length;)i<<=1;var a=2*i-1;i-=1;var u=hh.map(new Array(a),(function(){return 0})),c=0;return hh.forEach(o.forEach((function(e){var n=e.pos+i;u[n]+=e.weight;for(var t=0;n>0;)n%2&&(t+=u[n+1]),u[n=n-1>>1]+=e.weight;c+=e.weight*t}))),c}var ph=Qd,gh=Qd,yh=Qd,mh=pf;function wh(e,n,t){for(var r;n.length&&(r=yh.last(n)).i<=t;)n.pop(),e.push(r.vs),t++;return t}var bh=Qd,xh=Qd,_h=Xd.Graph,Eh=Qd,Sh=Qd,kh=function(e){var n={},t=fh.filter(e.nodes(),(function(n){return!e.children(n).length})),r=fh.max(fh.map(t,(function(n){return e.node(n).rank}))),o=fh.map(fh.range(r+1),(function(){return[]}));var i=fh.sortBy(t,(function(n){return e.node(n).rank}));return fh.forEach(i,(function t(r){if(!fh.has(n,r)){n[r]=!0;var i=e.node(r);o[i.rank].push(r),fh.forEach(e.successors(r),t)}})),o},Nh=function(e,n){for(var t=0,r=1;r<n.length;++r)t+=vh(e,n[r-1],n[r]);return t},Ch=function e(n,t,r,o){var i=n.children(t),a=n.node(t),u=a?a.borderLeft:void 0,c=a?a.borderRight:void 0,l={};u&&(i=bh.filter(i,(function(e){return e!==u&&e!==c})));var s=function(e,n){return ph.map(n,(function(n){var t=e.inEdges(n);if(t.length){var r=ph.reduce(t,(function(n,t){var r=e.edge(t),o=e.node(t.v);return{sum:n.sum+r.weight*o.order,weight:n.weight+r.weight}}),{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}return{v:n}}))}(n,i);bh.forEach(s,(function(t){if(n.children(t.v).length){var i=e(n,t.v,r,o);l[t.v]=i,bh.has(i,"barycenter")&&(a=t,u=i,bh.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var d=function(e,n){var t={};return gh.forEach(e,(function(e,n){var r=t[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};gh.isUndefined(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)})),gh.forEach(n.edges(),(function(e){var n=t[e.v],r=t[e.w];gh.isUndefined(n)||gh.isUndefined(r)||(r.indegree++,n.out.push(t[e.w]))})),function(e){var n=[];function t(e){return function(n){n.merged||(gh.isUndefined(n.barycenter)||gh.isUndefined(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var t=0,r=0;e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=t/r,e.weight=r,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function r(n){return function(t){t.in.push(n),0==--t.indegree&&e.push(t)}}for(;e.length;){var o=e.pop();n.push(o),gh.forEach(o.in.reverse(),t(o)),gh.forEach(o.out,r(o))}return gh.map(gh.filter(n,(function(e){return!e.merged})),(function(e){return gh.pick(e,["vs","i","barycenter","weight"])}))}(gh.filter(t,(function(e){return!e.indegree})))}(s,r);!function(e,n){bh.forEach(e,(function(e){e.vs=bh.flatten(e.vs.map((function(e){return n[e]?n[e].vs:e})),!0)}))}(d,l);var f=function(e,n){var t,r=mh.partition(e,(function(e){return yh.has(e,"barycenter")})),o=r.lhs,i=yh.sortBy(r.rhs,(function(e){return-e.i})),a=[],u=0,c=0,l=0;o.sort((t=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i})),l=wh(a,i,l),yh.forEach(o,(function(e){l+=e.vs.length,a.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,l=wh(a,i,l)}));var s={vs:yh.flatten(a,!0)};return c&&(s.barycenter=u/c,s.weight=c),s}(d,o);if(u&&(f.vs=bh.flatten([u,f.vs,c],!0),n.predecessors(u).length)){var h=n.node(n.predecessors(u)[0]),v=n.node(n.predecessors(c)[0]);bh.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+v.order)/(f.weight+2),f.weight+=2}return f},Mh=function(e,n,t){var r=function(e){for(var n;e.hasNode(n=xh.uniqueId("_root")););return n}(e),o=new _h({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(n){return e.node(n)}));return xh.forEach(e.nodes(),(function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||r),xh.forEach(e[t](i),(function(n){var t=n.v===i?n.w:n.v,r=o.edge(t,i),a=xh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:e.edge(n).weight+a})})),xh.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))})),o},Oh=Xd.Graph,jh=pf;function Ph(e,n,t){return Sh.map(n,(function(n){return Mh(e,n,t)}))}function Ih(e,n){var t=new Oh;Sh.forEach(e,(function(e){var r=e.graph().root,o=Ch(e,r,t,n);Sh.forEach(o.vs,(function(n,t){e.node(n).order=t})),function(e,n,t){var r,o={};Eh.forEach(t,(function(t){for(var i,a,u=e.parent(t);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))}(e,t,o.vs)}))}function Ah(e,n){Sh.forEach(n,(function(n){Sh.forEach(n,(function(n,t){e.node(n).order=t}))}))}var zh=Qd,Th=Xd.Graph,Lh=pf;function Bh(e,n,t){if(n>t){var r=n;n=t,t=r}var o=e[n];o||(e[n]=o={}),o[t]=!0}function Dh(e,n,t){if(n>t){var r=n;n=t,t=r}return zh.has(e[n],t)}var Rh=Qd,Vh=pf,Hh=function(e){var n,t=Lh.buildLayerMatrix(e),r=zh.merge(function(e,n){var t={};return zh.reduce(n,(function(n,r){var o=0,i=0,a=n.length,u=zh.last(r);return zh.forEach(r,(function(n,c){var l=function(e,n){if(e.node(n).dummy)return zh.find(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),s=l?e.node(l).order:a;(l||n===u)&&(zh.forEach(r.slice(i,c+1),(function(n){zh.forEach(e.predecessors(n),(function(r){var i=e.node(r),a=i.order;!(a<o||s<a)||i.dummy&&e.node(n).dummy||Bh(t,r,n)}))})),i=c+1,o=s)})),r})),t}(e,t),function(e,n){var t={};function r(n,r,o,i,a){var u;zh.forEach(zh.range(r,o),(function(r){u=n[r],e.node(u).dummy&&zh.forEach(e.predecessors(u),(function(n){var r=e.node(n);r.dummy&&(r.order<i||r.order>a)&&Bh(t,n,u)}))}))}return zh.reduce(n,(function(n,t){var o,i=-1,a=0;return zh.forEach(t,(function(u,c){if("border"===e.node(u).dummy){var l=e.predecessors(u);l.length&&(o=e.node(l[0]).order,r(t,a,c,i,o),a=c,i=o)}r(t,a,t.length,o,n.length)})),t})),t}(e,t)),o={};zh.forEach(["u","d"],(function(i){n="u"===i?t:zh.values(t).reverse(),zh.forEach(["l","r"],(function(t){"r"===t&&(n=zh.map(n,(function(e){return zh.values(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e),u=function(e,n,t,r){var o={},i={},a={};return zh.forEach(n,(function(e){zh.forEach(e,(function(e,n){o[e]=e,i[e]=e,a[e]=n}))})),zh.forEach(n,(function(e){var n=-1;zh.forEach(e,(function(e){var u=r(e);if(u.length){u=zh.sortBy(u,(function(e){return a[e]}));for(var c=(u.length-1)/2,l=Math.floor(c),s=Math.ceil(c);l<=s;++l){var d=u[l];i[e]===e&&n<a[d]&&!Dh(t,e,d)&&(i[d]=e,i[e]=o[e]=o[d],n=a[d])}}}))})),{root:o,align:i}}(0,n,r,a),c=function(e,n,t,r,o){var i={},a=function(e,n,t,r){var o=new Th,i=e.graph(),a=function(e,n,t){return function(r,o,i){var a,u=r.node(o),c=r.node(i),l=0;if(l+=u.width/2,zh.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(l+=t?a:-a),a=0,l+=(u.dummy?n:e)/2,l+=(c.dummy?n:e)/2,l+=c.width/2,zh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=c.width/2;break;case"r":a=-c.width/2}return a&&(l+=t?a:-a),a=0,l}}(i.nodesep,i.edgesep,r);return zh.forEach(n,(function(n){var r;zh.forEach(n,(function(n){var i=t[n];if(o.setNode(i),r){var u=t[r],c=o.edge(u,i);o.setEdge(u,i,Math.max(a(e,n,r),c||0))}r=n}))})),o}(e,n,t,o),u=o?"borderLeft":"borderRight";function c(e,n){for(var t=a.nodes(),r=t.pop(),o={};r;)o[r]?e(r):(o[r]=!0,t.push(r),t=t.concat(n(r))),r=t.pop()}return c((function(e){i[e]=a.inEdges(e).reduce((function(e,n){return Math.max(e,i[n.v]+a.edge(n))}),0)}),a.predecessors.bind(a)),c((function(n){var t=a.outEdges(n).reduce((function(e,n){return Math.min(e,i[n.w]-a.edge(n))}),Number.POSITIVE_INFINITY),r=e.node(n);t!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(i[n]=Math.max(i[n],t))}),a.successors.bind(a)),zh.forEach(r,(function(e){i[e]=i[t[e]]})),i}(e,n,u.root,u.align,"r"===t);"r"===t&&(c=zh.mapValues(c,(function(e){return-e}))),o[i+t]=c}))}));var i=function(e,n){return zh.minBy(zh.values(n),(function(n){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return zh.forIn(n,(function(n,o){var i=function(e,n){return e.node(n).width}(e,o)/2;t=Math.max(n+i,t),r=Math.min(n-i,r)})),t-r}))}(e,o);return function(e,n){var t=zh.values(n),r=zh.min(t),o=zh.max(t);zh.forEach(["u","d"],(function(t){zh.forEach(["l","r"],(function(i){var a,u=t+i,c=e[u];if(c!==n){var l=zh.values(c);(a="l"===i?r-zh.min(l):o-zh.max(l))&&(e[u]=zh.mapValues(c,(function(e){return e+a})))}}))}))}(o,i),function(e,n){return zh.mapValues(e.ul,(function(t,r){if(n)return e[n.toLowerCase()][r];var o=zh.sortBy(zh.map(e,r));return(o[1]+o[2])/2}))}(o,e.graph().align)},Yh=Qd,Xh=ff,Zh=bf,Fh=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){$f(e)}(e);break;case"tight-tree":!function(e){Gf(e),qf(e)}(e);break;case"longest-path":Kf(e)}},Uh=pf.normalizeRanks,Wh=function(e){var n=function(e){var n={},t=0;return Qf.forEach(e.children(),(function r(o){var i=t;Qf.forEach(e.children(o),r),n[o]={low:i,lim:t++}})),n}(e);Qf.forEach(e.graph().dummyChains,(function(t){for(var r=e.node(t),o=r.edgeObj,i=function(e,n,t,r){var o,i,a=[],u=[],c=Math.min(n[t].low,n[r].low),l=Math.max(n[t].lim,n[r].lim);o=t;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>c||l>n[o].lim));for(i=o,o=r;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,c=0,l=a[c],s=!0;t!==o.w;){if(r=e.node(t),s){for(;(l=a[c])!==u&&e.node(l).maxRank<r.rank;)c++;l===u&&(s=!1)}if(!s){for(;c<a.length-1&&e.node(l=a[c+1]).minRank<=r.rank;)c++;l=a[c]}e.setParent(t,l),t=e.successors(t)[0]}}))},Gh=pf.removeEmptyRanks,qh=nh,$h=function(e){rh.forEach(e.children(),(function n(t){var r=e.children(t),o=e.node(t);if(r.length&&rh.forEach(r,n),rh.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)ih(e,"borderLeft","_bl",t,o,i),ih(e,"borderRight","_br",t,o,i)}}))},Kh=uh,Qh=function(e){var n=jh.maxRank(e),t=Ph(e,Sh.range(1,n+1),"inEdges"),r=Ph(e,Sh.range(n-1,-1,-1),"outEdges"),o=kh(e);Ah(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ih(u%2?t:r,u%4>=2),o=jh.buildLayerMatrix(e);var l=Nh(e,o);l<a&&(c=0,i=Sh.cloneDeep(o),a=l)}Ah(e,i)},Jh=function(e){(function(e){var n=Vh.buildLayerMatrix(e),t=e.graph().ranksep,r=0;Rh.forEach(n,(function(n){var o=Rh.max(Rh.map(n,(function(n){return e.node(n).height})));Rh.forEach(n,(function(n){e.node(n).y=r+o/2})),r+=o+t}))})(e=Vh.asNonCompoundGraph(e)),Rh.forEach(Hh(e),(function(n,t){e.node(t).x=n}))},ev=pf,nv=Xd.Graph,tv=["nodesep","edgesep","ranksep","marginx","marginy"],rv={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ov=["acyclicer","ranker","rankdir","align"],iv=["width","height"],av={width:0,height:0},uv=["minlen","weight","width","height","labeloffset"],cv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},lv=["labelpos"];function sv(e,n){return Yh.mapValues(Yh.pick(e,n),Number)}function dv(e){var n={};return Yh.forEach(e,(function(e,t){n[t.toLowerCase()]=e})),n}var fv=Qd,hv=pf,vv=Xd.Graph,pv={debugOrdering:function(e){var n=hv.buildLayerMatrix(e),t=new vv({compound:!0,multigraph:!0}).setGraph({});return fv.forEach(e.nodes(),(function(n){t.setNode(n,{label:n}),t.setParent(n,"layer"+e.node(n).rank)})),fv.forEach(e.edges(),(function(e){t.setEdge(e.v,e.w,{},e.name)})),fv.forEach(n,(function(e,n){var r="layer"+n;t.setNode(r,{rank:"same"}),fv.reduce(e,(function(e,n){return t.setEdge(e,n,{style:"invis"}),n}))})),t}},gv=$n({graphlib:Xd,layout:function(e,n){var t=n&&n.debugTiming?ev.time:ev.notime;t("layout",(function(){var n=t(" buildLayoutGraph",(function(){return function(e){var n=new nv({multigraph:!0,compound:!0}),t=dv(e.graph());return n.setGraph(Yh.merge({},rv,sv(t,tv),Yh.pick(t,ov))),Yh.forEach(e.nodes(),(function(t){var r=dv(e.node(t));n.setNode(t,Yh.defaults(sv(r,iv),av)),n.setParent(t,e.parent(t))})),Yh.forEach(e.edges(),(function(t){var r=dv(e.edge(t));n.setEdge(t,Yh.merge({},cv,sv(r,uv),Yh.pick(r,lv)))})),n}(e)}));t(" runLayout",(function(){!function(e,n){n(" makeSpaceForEdgeLabels",(function(){!function(e){var n=e.graph();n.ranksep/=2,Yh.forEach(e.edges(),(function(t){var r=e.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),n(" removeSelfEdges",(function(){!function(e){Yh.forEach(e.edges(),(function(n){if(n.v===n.w){var t=e.node(n.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}}))}(e)})),n(" acyclic",(function(){Xh.run(e)})),n(" nestingGraph.run",(function(){qh.run(e)})),n(" rank",(function(){Fh(ev.asNonCompoundGraph(e))})),n(" injectEdgeLabelProxies",(function(){!function(e){Yh.forEach(e.edges(),(function(n){var t=e.edge(n);if(t.width&&t.height){var r=e.node(n.v),o={rank:(e.node(n.w).rank-r.rank)/2+r.rank,e:n};ev.addDummyNode(e,"edge-proxy",o,"_ep")}}))}(e)})),n(" removeEmptyRanks",(function(){Gh(e)})),n(" nestingGraph.cleanup",(function(){qh.cleanup(e)})),n(" normalizeRanks",(function(){Uh(e)})),n(" assignRankMinMax",(function(){!function(e){var n=0;Yh.forEach(e.nodes(),(function(t){var r=e.node(t);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,n=Yh.max(n,r.maxRank))})),e.graph().maxRank=n}(e)})),n(" removeEdgeLabelProxies",(function(){!function(e){Yh.forEach(e.nodes(),(function(n){var t=e.node(n);"edge-proxy"===t.dummy&&(e.edge(t.e).labelRank=t.rank,e.removeNode(n))}))}(e)})),n(" normalize.run",(function(){Zh.run(e)})),n(" parentDummyChains",(function(){Wh(e)})),n(" addBorderSegments",(function(){$h(e)})),n(" order",(function(){Qh(e)})),n(" insertSelfEdges",(function(){!function(e){var n=ev.buildLayerMatrix(e);Yh.forEach(n,(function(n){var t=0;Yh.forEach(n,(function(n,r){var o=e.node(n);o.order=r+t,Yh.forEach(o.selfEdges,(function(n){ev.addDummyNode(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:r+ ++t,e:n.e,label:n.label},"_se")})),delete o.selfEdges}))}))}(e)})),n(" adjustCoordinateSystem",(function(){Kh.adjust(e)})),n(" position",(function(){Jh(e)})),n(" positionSelfEdges",(function(){!function(e){Yh.forEach(e.nodes(),(function(n){var t=e.node(n);if("selfedge"===t.dummy){var r=e.node(t.e.v),o=r.x+r.width/2,i=r.y,a=t.x-o,u=r.height/2;e.setEdge(t.e,t.label),e.removeNode(n),t.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],t.label.x=t.x,t.label.y=t.y}}))}(e)})),n(" removeBorderNodes",(function(){!function(e){Yh.forEach(e.nodes(),(function(n){if(e.children(n).length){var t=e.node(n),r=e.node(t.borderTop),o=e.node(t.borderBottom),i=e.node(Yh.last(t.borderLeft)),a=e.node(Yh.last(t.borderRight));t.width=Math.abs(a.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}})),Yh.forEach(e.nodes(),(function(n){"border"===e.node(n).dummy&&e.removeNode(n)}))}(e)})),n(" normalize.undo",(function(){Zh.undo(e)})),n(" fixupEdgeLabelCoords",(function(){!function(e){Yh.forEach(e.edges(),(function(n){var t=e.edge(n);if(Yh.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}}))}(e)})),n(" undoCoordinateSystem",(function(){Kh.undo(e)})),n(" translateGraph",(function(){!function(e){var n=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function c(e){var i=e.x,a=e.y,u=e.width,c=e.height;n=Math.min(n,i-u/2),t=Math.max(t,i+u/2),r=Math.min(r,a-c/2),o=Math.max(o,a+c/2)}Yh.forEach(e.nodes(),(function(n){c(e.node(n))})),Yh.forEach(e.edges(),(function(n){var t=e.edge(n);Yh.has(t,"x")&&c(t)})),n-=a,r-=u,Yh.forEach(e.nodes(),(function(t){var o=e.node(t);o.x-=n,o.y-=r})),Yh.forEach(e.edges(),(function(t){var o=e.edge(t);Yh.forEach(o.points,(function(e){e.x-=n,e.y-=r})),Yh.has(o,"x")&&(o.x-=n),Yh.has(o,"y")&&(o.y-=r)})),i.width=t-n+a,i.height=o-r+u}(e)})),n(" assignNodeIntersects",(function(){!function(e){Yh.forEach(e.edges(),(function(n){var t,r,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=a,r=i),o.points.unshift(ev.intersectRect(i,t)),o.points.push(ev.intersectRect(a,r))}))}(e)})),n(" reversePoints",(function(){!function(e){Yh.forEach(e.edges(),(function(n){var t=e.edge(n);t.reversed&&t.points.reverse()}))}(e)})),n(" acyclic.undo",(function(){Xh.undo(e)}))}(n,t)})),t(" updateInputGraph",(function(){!function(e,n){Yh.forEach(e.nodes(),(function(t){var r=e.node(t),o=n.node(t);r&&(r.x=o.x,r.y=o.y,n.children(t).length&&(r.width=o.width,r.height=o.height))})),Yh.forEach(e.edges(),(function(t){var r=e.edge(t),o=n.edge(t);r.points=o.points,Yh.has(o,"x")&&(r.x=o.x,r.y=o.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n)}))}))},debug:pv,util:{time:pf.time,notime:pf.notime},version:"0.8.5"}),yv={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(e){return'Node type "'.concat(e,'" 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(e){return"The old edge with id=".concat(e," does not exist.")},error009:function(e){return'Marker type "'.concat(e,"\" doesn't exist.")},error008:function(e,n){var t=n.id,r=n.sourceHandle,o=n.targetHandle;return"Couldn't create edge for ".concat(e,' 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(e){return'Edge type "'.concat(e,'" not found. Using fallback type "default".')},error012:function(e){return'Node with id "'.concat(e,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},error013:function(e){return void 0===e&&(e="react"),"It seems that you haven't loaded the styles. Please import '@aloudata/".concat(e,"/dist/style.css' or base.css to make sure everything is working properly.")}},mv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wv=["Enter"," ","Escape"],bv={min:.5,max:2},xv=[0,0],_v=function(e,n,t){if(!e.id)return[];var r=new Set;return t.forEach((function(n){n.source===e.id&&r.add(n.target)})),n.filter((function(e){return r.has(e.id)}))},Ev=function(e,n,t){if(!e.id)return[];var r=new Set;return t.forEach((function(n){n.target===e.id&&r.add(n.source)})),n.filter((function(e){return r.has(e.id)}))},Sv=function(e,n){void 0===n&&(n=[0,0]);var t=Xv(e),r=t.width,o=t.height,i="internals"in e?e.internals.positionAbsolute:e.position,a=e.origin||n,u=r*a[0],c=o*a[1];return{position:{x:e.position.x-u,y:e.position.y-c},positionAbsolute:{x:i.x-u,y:i.y-c}}},kv=function(e,n){if(void 0===n&&(n={nodeOrigin:[0,0]}),0===e.length)return{x:0,y:0,width:0,height:0};var t=e.reduce((function(e,t){var r=Lv(t,n.nodeOrigin);return Av(e,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Tv(t)},Nv=function(e,n){if(void 0===n&&(n={nodeOrigin:[0,0]}),0===e.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 e.forEach((function(e){if(null==n.filter||n.filter(e)){var r=Lv(e,n.nodeOrigin);t=Av(t,r)}})),Tv(t)},Cv=function(e,n){var t=new Set;return e.forEach((function(e){t.add(e.id)})),n.filter((function(e){return t.has(e.source)||t.has(e.target)}))};function Mv(e){var n=e.nodeId,t=e.nextPosition,r=e.nodeLookup,o=e.nodeOrigin,i=void 0===o?[0,0]:o,a=e.nodeExtent,u=e.onError,c=r.get(n),l=c.parentId?r.get(c.parentId):void 0,s=l?Sv(l,l.origin||i).positionAbsolute:{x:0,y:0},d=s.x,f=s.y,h=function(e,n){var t,r,o,i;return n&&"parent"!==n?[n[0],[n[1][0]-(null!==(r=null===(t=e.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),n[1][1]-(null!==(i=null===(o=e.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:n}(c,c.extent||a);if("parent"!==c.extent||c.expandParent)l&&Yv(c.extent)&&(h=[[c.extent[0][0]+d,c.extent[0][1]+f],[c.extent[1][0]+d,c.extent[1][1]+f]]);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=d+v*m[0],b=f+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==u||u("005",yv.error005());var x=Yv(h)?jv(t,h):t;return{position:{x:x.x-d,y:x.y-f},positionAbsolute:x}}var Ov=function(e,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),Math.min(Math.max(e,n),t)},jv=function(e,n){return void 0===e&&(e={x:0,y:0}),{x:Ov(e.x,n[0][0],n[1][0]),y:Ov(e.y,n[0][1],n[1][1])}},Pv=function(e,n,t){return e<n?Ov(Math.abs(e-n),1,50)/50:e>t?-Ov(Math.abs(e-t),1,50)/50:0},Iv=function(e,n){return[20*Pv(e.x,35,n.width-35),20*Pv(e.y,35,n.height-35)]},Av=function(e,n){return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}},zv=function(e){var n=e.x,t=e.y;return{x:n,y:t,x2:n+e.width,y2:t+e.height}},Tv=function(e){var n=e.x,t=e.y;return{x:n,y:t,width:e.x2-n,height:e.y2-t}},Lv=function(e,n){var t,r,o,i,a,u;void 0===n&&(n=[0,0]);var c=Sv(e,n).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=e.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:e.width)&&void 0!==o?o:0),y2:s+(null!==(u=null!==(a=null===(i=e.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:e.height)&&void 0!==u?u:0)}},Bv=function(e,n){return void 0===n&&(n=[1,1]),{x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}},Dv=function(e,n,t,r){var o=e.x,i=e.y,a=U(n,3),u=a[0],c=a[1],l=a[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var s={x:(o-u)/l,y:(i-c)/l};return t?Bv(s,r):s},Rv=function(e,n){var t=e.x,r=e.y,o=U(n,3),i=o[0],a=o[1],u=o[2];return{x:t*u+i,y:r*u+a}},Vv=function(e,n,t,r,o,i){var a=n/(e.width*(1+i)),u=t/(e.height*(1+i)),c=Math.min(a,u),l=Ov(c,r,o);return{x:n/2-(e.x+e.width/2)*l,y:t/2-(e.y+e.height/2)*l,zoom:l}},Hv=function(){var e;return"undefined"!=typeof navigator&&(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.indexOf("Mac"))>=0};function Yv(e){return void 0!==e&&"parent"!==e}function Xv(e){var n,t,r,o,i,a,u,c;return{width:null!==(o=null!==(r=null!==(t=null===(n=e.measured)||void 0===n?void 0:n.width)&&void 0!==t?t:e.width)&&void 0!==r?r:e.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(u=null!==(a=null===(i=e.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:e.height)&&void 0!==u?u:e.initialHeight)&&void 0!==c?c:0}}var Zv={x:0,y:0};function Fv(e,n){var t=n.snapGrid,r=void 0===t?[0,0]:t,o=n.snapToGrid,i=void 0!==o&&o,a=n.transform,u=Qv(e),c=u.x,l=u.y,s=Dv({x:c,y:l},a),d=i?Bv(s,r):s,f=d.x,h=d.y;return Z({xSnapped:f,ySnapped:h},s)}var Uv,Wv,Gv,qv,$v,Kv,Qv=function(e,n){var t,r,o,i,a=function(e){return"clientX"in e}(e),u=a?e.clientX:null===(t=e.touches)||void 0===t?void 0:t[0].clientX,c=a?e.clientY:null===(r=e.touches)||void 0===r?void 0:r[0].clientY;return{x:u-(null!==(o=null==n?void 0:n.left)&&void 0!==o?o:0),y:c-(null!==(i=null==n?void 0:n.top)&&void 0!==i?i:0)}};function Jv(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,o=e.targetY,i=e.sourceControlX,a=e.sourceControlY,u=.125*n+.375*i+.375*e.targetControlX+.125*r,c=.125*t+.375*a+.375*e.targetControlY+.125*o;return[u,c,Math.abs(u-n),Math.abs(c-t)]}function ep(e,n){return e>=0?.5*e:25*n*Math.sqrt(-e)}function np(e){var n=e.pos,t=e.x1,r=e.y1,o=e.x2,i=e.y2,a=e.c;switch(n){case Kv.Left:return[t-ep(t-o,a),r];case Kv.Right:return[t+ep(o-t,a),r];case Kv.Top:return[t,r-ep(r-i,a)];case Kv.Bottom:return[t,r+ep(i-r,a)]}}function tp(e){var n=e.sourceX,t=e.sourceY,r=e.sourcePosition,o=void 0===r?Kv.Bottom:r,i=e.targetX,a=e.targetY,u=e.targetPosition,c=void 0===u?Kv.Top:u,l=e.curvature,s=void 0===l?.25:l,d=U(np({pos:o,x1:n,y1:t,x2:i,y2:a,c:s}),2),f=d[0],h=d[1],v=U(np({pos:c,x1:i,y1:a,x2:n,y2:t,c:s}),2),p=v[0],g=v[1],y=U(Jv({sourceX:n,sourceY:t,targetX:i,targetY:a,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],b=y[2],x=y[3];return["M".concat(n,",").concat(t," C").concat(f,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(a),m,w,b,x]}function rp(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,o=e.targetY,i=Math.abs(r-n)/2,a=r<n?r+i:r-i,u=Math.abs(o-t)/2;return[a,o<t?o+u:o-u,i,u]}!function(e){e.Strict="strict",e.Loose="loose"}(Uv||(Uv={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(Wv||(Wv={})),function(e){e.Partial="partial",e.Full="full"}(Gv||(Gv={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(qv||(qv={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}($v||($v={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(Kv||(Kv={}));var op,ip=function(e){var n=e.source,t=e.sourceHandle,r=e.target,o=e.targetHandle;return"xy-edge__".concat(n).concat(t||"","-").concat(r).concat(o||"")},ap=function(e,n){return e.source&&e.target?function(e,n){return n.some((function(n){return!(n.source!==e.source||n.target!==e.target||n.sourceHandle!==e.sourceHandle&&(n.sourceHandle||e.sourceHandle)||n.targetHandle!==e.targetHandle&&(n.targetHandle||e.targetHandle))}))}(t=function(e){return"id"in e&&"source"in e&&"target"in e}(e)?Z({},e):Z(Z({},e),{id:ip(e)}),n)?n:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,n.concat(t)):n;var t},up=function(e,n,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=e.id,i=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(e,["id"]);if(!n.source||!n.target)return t;if(!t.find((function(n){return n.id===e.id})))return t;var a=Z(Z({},i),{id:r.shouldReplaceId?ip(n):o,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle});return t.filter((function(e){return e.id!==o})).concat(a)};function cp(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,o=e.targetY,i=U(rp({sourceX:n,sourceY:t,targetX:r,targetY:o}),4),a=i[0],u=i[1],c=i[2],l=i[3];return["M ".concat(n,",").concat(t,"L ").concat(r,",").concat(o),a,u,c,l]}var lp=((op={})[Kv.Left]={x:-1,y:0},op[Kv.Right]={x:1,y:0},op[Kv.Top]={x:0,y:-1},op[Kv.Bottom]={x:0,y:1},op),sp=function(e,n){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))};function dp(e){var n=e.sourceX,t=e.sourceY,r=e.sourcePosition,o=void 0===r?Kv.Bottom:r,i=e.targetX,a=e.targetY,u=e.targetPosition,c=void 0===u?Kv.Top:u,l=e.borderRadius,s=void 0===l?5:l,d=e.centerX,f=e.centerY,h=e.offset,v=U(function(e){var n,t,r,o,i=e.source,a=e.sourcePosition,u=void 0===a?Kv.Bottom:a,c=e.target,l=e.targetPosition,s=void 0===l?Kv.Top:l,d=e.center,f=e.offset,h=lp[u],v=lp[s],p={x:i.x+h.x*f,y:i.y+h.y*f},g={x:c.x+v.x*f,y:c.y+v.y*f},y=function(e){var n=e.source,t=e.sourcePosition,r=void 0===t?Kv.Bottom:t,o=e.target;return r===Kv.Left||r===Kv.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:u,target:g}),m=0!==y.x?"x":"y",w=y[m],b=[],x={x:0,y:0},_={x:0,y:0},E=U(rp({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],N=E[2],C=E[3];if(h[m]*v[m]==-1){r=null!==(n=d.x)&&void 0!==n?n:S,o=null!==(t=d.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}];b=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var j=[{x:p.x,y:g.y}],P=[{x:g.x,y:p.y}];if(b="x"===m?h.x===w?P:j:h.y===w?j:P,u===s){var I=Math.abs(i[m]-c[m]);if(I<=f){var A=Math.min(f-1,f-I);h[m]===w?x[m]=(p[m]>i[m]?-1:1)*A:_[m]=(g[m]>c[m]?-1:1)*A}}if(u!==s){var z="x"===m?"y":"x",T=h[m]===v[z],L=p[z]>g[z],B=p[z]<g[z];(1===h[m]&&(!T&&L||T&&B)||1!==h[m]&&(!T&&B||T&&L))&&(b="x"===m?j:P)}var D={x:p.x+x.x,y:p.y+x.y},R={x:g.x+_.x,y:g.y+_.y};Math.max(Math.abs(D.x-b[0].x),Math.abs(R.x-b[0].x))>=Math.max(Math.abs(D.y-b[0].y),Math.abs(R.y-b[0].y))?(r=(D.x+R.x)/2,o=b[0].y):(r=b[0].x,o=(D.y+R.y)/2)}return[W(W([i,{x:p.x+x.x,y:p.y+x.y}],U(b),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,N,C]}({source:{x:n,y:t},sourcePosition:o,target:{x:i,y:a},targetPosition:c,center:{x:d,y:f},offset:void 0===h?20:h}),5),p=v[0],g=v[1],y=v[2],m=v[3],w=v[4],b=p.reduce((function(e,n,t){var r;return r=t>0&&t<p.length-1?function(e,n,t,r){var o=Math.min(sp(e,n)/2,sp(n,t)/2,r),i=n.x,a=n.y;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return"L".concat(i," ").concat(a);if(e.y===a){var u=e.x<t.x?-1:1,c=e.y<t.y?1:-1;return"L ".concat(i+o*u,",").concat(a,"Q ").concat(i,",").concat(a," ").concat(i,",").concat(a+o*c)}var l=e.x<t.x?1:-1,s=e.y<t.y?-1:1;return"L ".concat(i,",").concat(a+o*s,"Q ").concat(i,",").concat(a," ").concat(i+o*l,",").concat(a)}(p[t-1],n,p[t+1],s):"".concat(0===t?"M":"L").concat(n.x," ").concat(n.y),e+r}),"");return[b,g,y,m,w]}function fp(e,n,t){var r=(null==t?void 0:t.rankdir)||"TB",o=new gv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(Z({rankdir:r},t));var i=e.map((function(e){return Z({},e)}));i.forEach((function(e){var n,t;if(!e.id)throw new Error('Node "id" does not exist');var r=(null===(n=e.data)||void 0===n?void 0:n.width)||200,i=(null===(t=e.data)||void 0===t?void 0:t.height)||56;o.setNode(e.id,{width:r,height:i})})),n.forEach((function(e){o.setEdge(e.source,e.target)})),gv.layout(o),i.forEach((function(e){var n=o.node(e.id),t="bottom",i="top";switch(r){case"TB":default:t="bottom",i="top";break;case"BT":t="top",i="bottom";break;case"LR":case"RL":t="right",i="left"}e.targetPosition=i,e.sourcePosition=t,e.position={x:n.x-n.width/2,y:n.y-n.height/2}}));var a=function(e){var n=e.centerNodeId,t=e.containerHeight,r=void 0===t?0:t,o=e.containerWidth,i=void 0===o?0:o,a=e.centerByBBox,u=e.nodes,c=e.nodeOrigin,l=void 0===c?xv:c;if(!n&&!a||!r||!i)return Zv;if(null==n?void 0:n.trim()){var s=null==u?void 0:u.find((function(e){return e.id===(null==n?void 0:n.trim())}));if(s){var d=function(e,n){if(!e)return Zv;var t=Xv(e),r=t.width,o=t.height,i=r*n[0],a=o*n[1];return{x:e.position.x+r/2-i,y:e.position.y+o/2-a}}(s,l);return{x:i/2-d.x,y:r/2-d.y}}}return a?(d=function(e,n){if(!(null==e?void 0:e.length))return Zv;var t=kv(e,{nodeOrigin:n}),r=t.x,o=t.y;return{x:r+t.width/2,y:o+t.height/2}}(u,l),{x:i/2-d.x,y:r/2-d.y}):Zv}({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}),u=a.x,c=void 0===u?0:u,l=a.y,s=void 0===l?0:l;i.forEach((function(e){e.position={x:e.position.x+c,y:e.position.y+s}}));var d={overflowBoundary:!1,transform:{x:0,y:0,zoom:1}};return(null==t?void 0:t.width)&&(null==t?void 0:t.height)&&t.fitViewOptions&&(d=function(e,n){var t=n||{},r=t.minZoom,o=void 0===r?bv.min:r,i=t.maxZoom,a=void 0===i?bv.max:i,u=t.padding,c=void 0===u?.1:u,l=t.nodeOrigin,s=void 0===l?xv:l,d=t.width,f=t.height,h=kv(e||[],{nodeOrigin:s}),v=h.width>=d||h.height>=f;return{transform:Vv(h,d,f,o,a,c),overflowBoundary:v}}(i,Z({width:t.width,height:t.height,nodeOrigin:t.nodeOrigin},t.fitViewOptions))),{nodes:i,edges:n,transform:d.transform,overflowBoundary:d.overflowBoundary}}var hp=function(e){return null!==e&&"function"!=typeof e&&isFinite(e.length)},vp=function(e,n){return!!hp(e)&&e.indexOf(n)>-1},pp=function(e,n){if(!hp(e))return e;for(var t=[],r=0;r<e.length;r++){var o=e[r];n(o,r)&&t.push(o)}return t},gp={}.toString,yp=function(e,n){return gp.call(e)==="[object "+n+"]"},mp=function(e){return yp(e,"Function")},wp=function(e){return null==e},bp=function(e){return Array.isArray?Array.isArray(e):yp(e,"Array")},xp=function(e){var n=typeof e;return null!==e&&"object"===n||"function"===n};function _p(e,n){if(e)if(bp(e))for(var t=0,r=e.length;t<r&&!1!==n(e[t],t);t++);else if(xp(e))for(var o in e)if(e.hasOwnProperty(o)&&!1===n(e[o],o))break}var Ep=Object.keys?function(e){return Object.keys(e)}:function(e){var n=[];return _p(e,(function(t,r){mp(e)&&"prototype"===r||n.push(r)})),n};function Sp(e,n){var t=Ep(n),r=t.length;if(wp(e))return!r;for(var o=0;o<r;o+=1){var i=t[o];if(n[i]!==e[i]||!(i in e))return!1}return!0}var kp=function(e){return"object"==typeof e&&null!==e},Np=function(e){if(!kp(e)||!yp(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n},Cp=function(e,n){if(void 0===n&&(n=[]),bp(e))for(var t=0;t<e.length;t+=1)Cp(e[t],n);else n.push(e);return n},Mp=function(e){if(bp(e))return e.reduce((function(e,n){return Math.max(e,n)}),e[0])},Op=function(e){if(bp(e))return e.reduce((function(e,n){return Math.min(e,n)}),e[0])},jp=Array.prototype,Pp=jp.splice,Ip=jp.indexOf,Ap=Array.prototype.splice,zp=function(e,n){if(!hp(e))return[];for(var t=e?n.length:0,r=t-1;t--;){var o=void 0,i=n[t];t!==r&&i===o||(o=i,Ap.call(e,i,1))}return e},Tp=function(e,n,t){if(!bp(e)&&!Np(e))return e;var r=t;return _p(e,(function(e,t){r=n(r,e,t)})),r},Lp=function(e){return yp(e,"String")};function Bp(e,n){void 0===n&&(n=new Map);var t=[];if(Array.isArray(e))for(var r=0,o=e.length;r<o;r++){var i=e[r];n.has(i)||(t.push(i),n.set(i,!0))}return t}var Dp=Object.prototype.hasOwnProperty;function Rp(e,n){if(!n||!bp(e))return{};for(var t,r={},o=mp(n)?n:function(e){return e[n]},i=0;i<e.length;i++){var a=e[i];t=o(a),Dp.call(r,t)?r[t].push(a):r[t]=[a]}return r}function Vp(e,n){if(!n)return{0:e};if(!mp(n)){var t=bp(n)?n:n.replace(/\s+/g,"").split("*");n=function(e){for(var n="_",r=0,o=t.length;r<o;r++)n+=e[t[r]]&&e[t[r]].toString();return n}}return Rp(e,n)}var Hp={},Yp=function(e){return yp(e,"Number")},Xp=Number.isInteger?Number.isInteger:function(e){return Yp(e)&&e%1==0},Zp=180/Math.PI,Fp=parseInt,Up=Math.PI/180,Wp=function(e,n){return e.hasOwnProperty(n)},Gp=Object.values?function(e){return Object.values(e)}:function(e){var n=[];return _p(e,(function(t,r){mp(e)&&"prototype"===r||n.push(t)})),n},qp=function(e){return wp(e)?"":e.toString()},$p={}.toString,Kp=function(e){return $p.call(e).replace(/^\[object /,"").replace(/]$/,"")},Qp=Object.prototype,Jp=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||Qp)};function eg(e,n){for(var t in n)n.hasOwnProperty(t)&&"constructor"!==t&&void 0!==n[t]&&(e[t]=n[t])}function ng(e,n,t,r){return n&&eg(e,n),t&&eg(e,t),r&&eg(e,r),e}var tg=function(e){if("object"!=typeof e||null===e)return e;var n;if(bp(e)){n=[];for(var t=0,r=e.length;t<r;t++)"object"==typeof e[t]&&null!=e[t]?n[t]=tg(e[t]):n[t]=e[t]}else for(var o in n={},e)"object"==typeof e[o]&&null!=e[o]?n[o]=tg(e[o]):n[o]=e[o];return n},rg=function(e,n){if(!mp(e))throw new TypeError("Expected a function");var t=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=n?n.apply(this,r):r[0],a=t.cache;if(a.has(i))return a.get(i);var u=e.apply(this,r);return a.set(i,u),u};return t.cache=new Map,t};function og(e,n,t,r){for(var o in t=t||0,r=r||5,n)if(n.hasOwnProperty(o)){var i=n[o];null!==i&&Np(i)?(Np(e[o])||(e[o]={}),t<r?og(e[o],i,t+1,r):e[o]=n[o]):bp(i)?(e[o]=[],e[o]=e[o].concat(i)):void 0!==i&&(e[o]=i)}}var ig,ag=Object.prototype.hasOwnProperty,ug=function(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Lp(e)||Lp(n))return!1;if(hp(e)||hp(n)){if(e.length!==n.length)return!1;for(var t=!0,r=0;r<e.length&&(t=ug(e[r],n[r]));r++);return t}if(kp(e)||kp(n)){var o=Object.keys(e),i=Object.keys(n);if(o.length!==i.length)return!1;for(t=!0,r=0;r<o.length&&(t=ug(e[o[r]],n[o[r]]));r++);return t}return!1},cg=function(e){return e},lg=Object.prototype.hasOwnProperty,sg={},dg=rg((function(e,n){void 0===n&&(n={});var t=n.fontSize,r=n.fontFamily,o=n.fontWeight,i=n.fontStyle,a=n.fontVariant;return ig||(ig=document.createElement("canvas").getContext("2d")),ig.font=[i,a,o,t+"px",r].join(" "),ig.measureText(Lp(e)?e:"").width}),(function(e,n){return void 0===n&&(n={}),function(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var r=Array(e),o=0;for(n=0;n<t;n++)for(var i=arguments[n],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}([e],Gp(n)).join("")})),fg=function(){function e(){this.map={}}return e.prototype.has=function(e){return void 0!==this.map[e]},e.prototype.get=function(e,n){var t=this.map[e];return void 0===t?n:t},e.prototype.set=function(e,n){this.map[e]=n},e.prototype.clear=function(){this.map={}},e.prototype.delete=function(e){delete this.map[e]},e.prototype.size=function(){return Object.keys(this.map).length},e}(),hg=Object.freeze({__proto__:null,Cache:fg,assign:ng,augment:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t=e[0],r=1;r<e.length;r++){var o=e[r];mp(o)&&(o=o.prototype),ng(t.prototype,o)}},clamp:function(e,n,t){return e<n?n:e>t?t:e},clearAnimationFrame:function(e){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(e)},clone:tg,contains:vp,debounce:function(e,n,t){var r;return function(){var o=this,i=arguments,a=t&&!r;clearTimeout(r),r=setTimeout((function(){r=null,t||e.apply(o,i)}),n),a&&e.apply(o,i)}},deepMix:function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var r=0;r<n.length;r+=1)og(e,n[r]);return e},difference:function(e,n){return void 0===n&&(n=[]),pp(e,(function(e){return!vp(n,e)}))},each:_p,endsWith:function(e,n){return!(!bp(e)&&!Lp(e))&&e[e.length-1]===n},every:function(e,n){for(var t=0;t<e.length;t++)if(!n(e[t],t))return!1;return!0},extend:function(e,n,t,r){mp(n)||(t=n,n=e,e=function(){});var o=Object.create?function(e,n){return Object.create(e,{constructor:{value:n}})}:function(e,n){function t(){}t.prototype=e;var r=new t;return r.constructor=n,r},i=o(n.prototype,e);return e.prototype=ng(i,e.prototype),e.superclass=o(n.prototype,n),ng(i,t),ng(e,r),e},filter:pp,find:function(e,n){if(!bp(e))return null;var t;if(mp(n)&&(t=n),Np(n)&&(t=function(e){return Sp(e,n)}),t)for(var r=0;r<e.length;r+=1)if(t(e[r]))return e[r];return null},findIndex:function(e,n,t){void 0===t&&(t=0);for(var r=t;r<e.length;r++)if(n(e[r],r))return r;return-1},firstValue:function(e,n){for(var t=null,r=0;r<e.length;r++){var o=e[r][n];if(!wp(o)){t=bp(o)?o[0]:o;break}}return t},fixedBase:function(e,n){var t=n.toString(),r=t.indexOf(".");if(-1===r)return Math.round(e);var o=t.substr(r+1).length;return o>20&&(o=20),parseFloat(e.toFixed(o))},flatten:function(e){if(!bp(e))return[];for(var n=[],t=0;t<e.length;t++)n=n.concat(e[t]);return n},flattenDeep:Cp,forIn:_p,get:function(e,n,t){for(var r=0,o=Lp(n)?n.split("."):n;e&&r<o.length;)e=e[o[r++]];return void 0===e||r<o.length?t:e},getEllipsisText:function(e,n,t,r){void 0===r&&(r="...");var o,i,a=dg(r,t),u=Lp(e)?e:qp(e),c=n,l=[];if(dg(e,t)<=n)return e;for(;o=u.substr(0,16),!((i=dg(o,t))+a>c&&i>c);)if(l.push(o),c-=i,!(u=u.substr(16)))return l.join("");for(;o=u.substr(0,1),!((i=dg(o,t))+a>c);)if(l.push(o),c-=i,!(u=u.substr(1)))return l.join("");return""+l.join("")+r},getRange:function(e){var n=e.filter((function(e){return!isNaN(e)}));if(!n.length)return{min:0,max:0};if(bp(e[0])){for(var t=[],r=0;r<e.length;r++)t=t.concat(e[r]);n=t}var o=Mp(n);return{min:Op(n),max:o}},getType:Kp,getWrapBehavior:function(e,n){return e["_wrap_"+n]},group:function(e,n){if(!n)return[e];var t=Vp(e,n),r=[];for(var o in t)r.push(t[o]);return r},groupBy:Rp,groupToMap:Vp,has:Wp,hasKey:Wp,hasValue:function(e,n){return vp(Gp(e),n)},head:function(e){if(hp(e))return e[0]},identity:function(e){return e},includes:vp,indexOf:function(e,n){if(!hp(e))return-1;var t=Array.prototype.indexOf;if(t)return t.call(e,n);for(var r=-1,o=0;o<e.length;o++)if(e[o]===n){r=o;break}return r},isArguments:function(e){return yp(e,"Arguments")},isArray:bp,isArrayLike:hp,isBoolean:function(e){return yp(e,"Boolean")},isDate:function(e){return yp(e,"Date")},isDecimal:function(e){return Yp(e)&&e%1!=0},isElement:function(e){return e instanceof Element||e instanceof HTMLDocument},isEmpty:function(e){if(wp(e))return!0;if(hp(e))return!e.length;var n=Kp(e);if("Map"===n||"Set"===n)return!e.size;if(Jp(e))return!Object.keys(e).length;for(var t in e)if(ag.call(e,t))return!1;return!0},isEqual:ug,isEqualWith:function(e,n,t){return mp(t)?!!t(e,n):ug(e,n)},isError:function(e){return yp(e,"Error")},isEven:function(e){return Yp(e)&&e%2==0},isFinite:function(e){return Yp(e)&&isFinite(e)},isFunction:mp,isInteger:Xp,isMatch:Sp,isNegative:function(e){return Yp(e)&&e<0},isNil:wp,isNull:function(e){return null===e},isNumber:Yp,isNumberEqual:function(e,n,t){return void 0===t&&(t=1e-5),Math.abs(e-n)<t},isObject:xp,isObjectLike:kp,isOdd:function(e){return Yp(e)&&e%2!=0},isPlainObject:Np,isPositive:function(e){return Yp(e)&&e>0},isPrototype:Jp,isRegExp:function(e){return yp(e,"RegExp")},isString:Lp,isType:yp,isUndefined:function(e){return void 0===e},keys:Ep,last:function(e){if(hp(e))return e[e.length-1]},lowerCase:function(e){return qp(e).toLowerCase()},lowerFirst:function(e){var n=qp(e);return n.charAt(0).toLowerCase()+n.substring(1)},map:function(e,n){if(!hp(e))return e;for(var t=[],r=0;r<e.length;r++){var o=e[r];t.push(n(o,r))}return t},mapValues:function(e,n){void 0===n&&(n=cg);var t={};return xp(e)&&!wp(e)&&Object.keys(e).forEach((function(r){t[r]=n(e[r],r)})),t},max:Mp,maxBy:function(e,n){if(bp(e)){for(var t,r=-1/0,o=0;o<e.length;o++){var i=e[o],a=mp(n)?n(i):i[n];a>r&&(t=i,r=a)}return t}},measureTextWidth:dg,memoize:rg,min:Op,minBy:function(e,n){if(bp(e)){for(var t,r=1/0,o=0;o<e.length;o++){var i=e[o],a=mp(n)?n(i):i[n];a<r&&(t=i,r=a)}return t}},mix:ng,mod:function(e,n){return(e%n+n)%n},noop:function(){},number2color:function(e){var n=Hp[e];if(!n){for(var t=e.toString(16),r=t.length;r<6;r++)t="0"+t;n="#"+t,Hp[e]=n}return n},omit:function(e,n){return Tp(e,(function(e,t,r){return n.includes(r)||(e[r]=t),e}),{})},parseRadius:function(e){var n=0,t=0,r=0,o=0;return bp(e)?1===e.length?n=t=r=o=e[0]:2===e.length?(n=r=e[0],t=o=e[1]):3===e.length?(n=e[0],t=o=e[1],r=e[2]):(n=e[0],t=e[1],r=e[2],o=e[3]):n=t=r=o=e,{r1:n,r2:t,r3:r,r4:o}},pick:function(e,n){if(null===e||!Np(e))return{};var t={};return _p(n,(function(n){lg.call(e,n)&&(t[n]=e[n])})),t},pull:function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var r=0;r<n.length;r++)for(var o=n[r],i=-1;(i=Ip.call(e,o))>-1;)Pp.call(e,i,1);return e},pullAt:zp,reduce:Tp,remove:function(e,n){var t=[];if(!hp(e))return t;for(var r=-1,o=[],i=e.length;++r<i;){var a=e[r];n(a,r,e)&&(t.push(a),o.push(r))}return zp(e,o),t},requestAnimationFrame:function(e){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)})(e)},set:function(e,n,t){var r=e,o=Lp(n)?n.split("."):n;return o.forEach((function(e,n){n<o.length-1?(xp(r[e])||(r[e]=Yp(o[n+1])?[]:{}),r=r[e]):r[e]=t})),e},size:function(e){return wp(e)?0:hp(e)?e.length:Object.keys(e).length},some:function(e,n){for(var t=0;t<e.length;t++)if(n(e[t],t))return!0;return!1},sortBy:function(e,n){var t;if(mp(n))t=function(e,t){return n(e)-n(t)};else{var r=[];Lp(n)?r.push(n):bp(n)&&(r=n),t=function(e,n){for(var t=0;t<r.length;t+=1){var o=r[t];if(e[o]>n[o])return 1;if(e[o]<n[o])return-1}return 0}}return e.sort(t),e},startsWith:function(e,n){return!(!bp(e)&&!Lp(e))&&e[0]===n},substitute:function(e,n){return e&&n?e.replace(/\\?\{([^{}]+)\}/g,(function(e,t){return"\\"===e.charAt(0)?e.slice(1):void 0===n[t]?"":n[t]})):e},throttle:function(e,n,t){var r,o,i,a,u=0;t||(t={});var c=function(){u=!1===t.leading?0:Date.now(),r=null,a=e.apply(o,i),r||(o=i=null)},l=function(){var l=Date.now();u||!1!==t.leading||(u=l);var s=n-(l-u);return o=this,i=arguments,s<=0||s>n?(r&&(clearTimeout(r),r=null),u=l,a=e.apply(o,i),r||(o=i=null)):r||!1===t.trailing||(r=setTimeout(c,s)),a};return l.cancel=function(){clearTimeout(r),u=0,r=o=i=null},l},toArray:function(e){return hp(e)?Array.prototype.slice.call(e):[]},toDegree:function(e){return Zp*e},toInteger:Fp,toRadian:function(e){return Up*e},toString:qp,union:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Bp([].concat.apply([],e))},uniq:Bp,uniqueId:function(e){return sg[e=e||"g"]?sg[e]+=1:sg[e]=1,e+sg[e]},upperCase:function(e){return qp(e).toUpperCase()},upperFirst:function(e){var n=qp(e);return n.charAt(0).toUpperCase()+n.substring(1)},values:Gp,valuesOfKey:function(e,n){for(var t=[],r={},o=0;o<e.length;o++){var i=e[o][n];if(!wp(i)){bp(i)||(i=[i]);for(var a=0;a<i.length;a++){var u=i[a];r[u]||(t.push(u),r[u]=!0)}}}return t},wrapBehavior:function(e,n){if(e["_wrap_"+n])return e["_wrap_"+n];var t=function(t){e[n](t)};return e["_wrap_"+n]=t,t}}),vg={assign:function(e){if(e.__esModule)return e;var n=e.default;if("function"==typeof n){var t=function e(){return this instanceof e?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}(hg).mix,getHeight:function(e,n,t,r){return void 0===r&&(r="height"),"center"===t?(e[r]+n[r])/2:e.height}},pg=vg,gg={getId:function(e){return e.id||e.name},getPreH:function(e){return e.preH||0},getPreV:function(e){return e.preV||0},getHGap:function(e){return e.hgap||18},getVGap:function(e){return e.vgap||18},getChildren:function(e){return e.children},getHeight:function(e){return e.height||36},getWidth:function(e){var n=e.label||" ";return e.width||18*n.split("").length}};function yg(e,n){var t=this;if(t.vgap=t.hgap=0,e instanceof yg)return e;t.data=e;var r=n.getHGap(e),o=n.getVGap(e);return t.preH=n.getPreH(e),t.preV=n.getPreV(e),t.width=n.getWidth(e),t.height=n.getHeight(e),t.width+=t.preH,t.height+=t.preV,t.id=n.getId(e),t.x=t.y=0,t.depth=0,t.children||(t.children=[]),t.addGap(r,o),t}pg.assign(yg.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(e,n){var t=this;t.hgap+=e,t.vgap+=n,t.width+=2*e,t.height+=2*n},eachNode:function(e){for(var n,t=[this];n=t.shift();)e(n),t=n.children.concat(t)},DFTraverse:function(e){this.eachNode(e)},BFTraverse:function(e){for(var n,t=[this];n=t.shift();)e(n),t=t.concat(n.children)},getBoundingBox:function(){var e={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(n){e.left=Math.min(e.left,n.x),e.top=Math.min(e.top,n.y),e.width=Math.max(e.width,n.x+n.width),e.height=Math.max(e.height,n.y+n.height)})),e},translate:function(e,n){void 0===e&&(e=0),void 0===n&&(n=0),this.eachNode((function(t){t.x+=e,t.y+=n,t.x+=t.preH,t.y+=t.preV}))},right2left:function(){var e=this,n=e.getBoundingBox();e.eachNode((function(e){e.x=e.x-2*(e.x-n.left)-e.width})),e.translate(n.width,0)},bottom2top:function(){var e=this,n=e.getBoundingBox();e.eachNode((function(e){e.y=e.y-2*(e.y-n.top)-e.height})),e.translate(0,n.height)}});var mg=function(e,n,t){void 0===n&&(n={});var r,o=new yg(e,n=pg.assign({},gg,n)),i=[o];if(!t&&!e.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var a=n.getChildren(r.data),u=a?a.length:0;if(r.children=new Array(u),a&&u)for(var c=0;c<u;c++){var l=new yg(a[c],n);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},wg=mg,bg=function(){function e(e,n){void 0===n&&(n={}),this.options=n,this.rootNode=wg(e,n)}return e.prototype.execute=function(){throw new Error("please override this method")},e}(),xg=bg;function _g(e,n,t,r){void 0===r&&(r=[]);var o=this;o.w=e||0,o.h=n||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 Eg(e,n,t){t?e.y+=n:e.x+=n,e.children.forEach((function(e){Eg(e,n,t)}))}function Sg(e,n){var t=n?e.y:e.x;return e.children.forEach((function(e){t=Math.min(Sg(e,n),t)})),t}function kg(e,n){Eg(e,-Sg(e,n),n)}function Ng(e,n,t){t?n.y=e.x:n.x=e.x,e.c.forEach((function(e,r){Ng(e,n.children[r],t)}))}function Cg(e,n,t){void 0===t&&(t=0),n?(e.x=t,t+=e.width):(e.y=t,t+=e.height),e.children.forEach((function(e){Cg(e,n,t)}))}_g.fromNode=function(e,n){if(!e)return null;var t=[];return e.children.forEach((function(e){t.push(_g.fromNode(e,n))})),n?new _g(e.height,e.width,e.x,t):new _g(e.width,e.height,e.y,t)};var Mg=mg,Og=function(e,n){for(var t=Mg(e.data,n,!0),r=Mg(e.data,n,!0),o=e.children.length,i=Math.round(o/2),a=n.getSide||function(e,n){return n<i?"right":"left"},u=0;u<o;u++){var c=e.children[u];"right"===a(c,u)?r.children.push(c):t.children.push(c)}return t.eachNode((function(e){e.isRoot()||(e.side="left")})),r.eachNode((function(e){e.isRoot()||(e.side="right")})),{left:t,right:r}},jg=Og,Pg=["LR","RL","TB","BT","H","V"],Ig=["LR","RL","H"],Ag=Pg[0],zg=function(e,n,t){var r=n.direction||Ag;if(n.isHorizontal=function(e){return Ig.indexOf(e)>-1}(r),r&&-1===Pg.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Pg[0])t(e,n);else if(r===Pg[1])t(e,n),e.right2left();else if(r===Pg[2])t(e,n);else if(r===Pg[3])t(e,n),e.bottom2top();else if(r===Pg[4]||r===Pg[5]){var o=jg(e,n),i=o.left,a=o.right;t(i,n),t(a,n),n.isHorizontal?i.right2left():i.bottom2top(),a.translate(i.x-a.x,i.y-a.y),e.x=i.x,e.y=a.y;var u=e.getBoundingBox();n.isHorizontal?u.top<0&&e.translate(0,-u.top):u.left<0&&e.translate(-u.left,0)}var c=n.fixedRoot;return void 0===c&&(c=!0),c&&e.translate(-(e.x+e.width/2+e.hgap),-(e.y+e.height/2+e.vgap)),e};function Tg(e,n){return Tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},Tg(e,n)}var Lg=function(e,n){void 0===n&&(n={});var t=n.isHorizontal;function r(e){0===e.cs?(e.el=e,e.er=e,e.msel=e.mser=0):(e.el=e.c[0].el,e.msel=e.c[0].msel,e.er=e.c[e.cs-1].er,e.mser=e.c[e.cs-1].mser)}function o(e,n,t){for(var r=e.c[n-1],o=r.mod,l=e.c[n],s=l.mod;null!==r&&null!==l;){c(r)>t.low&&(t=t.nxt);var d=o+r.prelim+r.w-(s+l.prelim);d>0&&(s+=d,i(e,n,t.index,d));var f=c(r),h=c(l);f<=h&&null!==(r=u(r))&&(o+=r.mod),f>=h&&null!==(l=a(l))&&(s+=l.mod)}!r&&l?function(e,n,t,r){var o=e.c[0].el;o.tl=t;var i=r-t.mod-e.c[0].msel;o.mod+=i,o.prelim-=i,e.c[0].el=e.c[n].el,e.c[0].msel=e.c[n].msel}(e,n,l,s):r&&!l&&function(e,n,t,r){var o=e.c[n].er;o.tr=t;var i=r-t.mod-e.c[n].mser;o.mod+=i,o.prelim-=i,e.c[n].er=e.c[n-1].er,e.c[n].mser=e.c[n-1].mser}(e,n,r,o)}function i(e,n,t,r){e.c[n].mod+=r,e.c[n].msel+=r,e.c[n].mser+=r,function(e,n,t,r){if(t!==n-1){var o=n-t;e.c[t+1].shift+=r/o,e.c[n].shift-=r/o,e.c[n].change-=r-r/o}}(e,n,t,r)}function a(e){return 0===e.cs?e.tl:e.c[0]}function u(e){return 0===e.cs?e.tr:e.c[e.cs-1]}function c(e){return e.y+e.h}function l(e,n,t){for(;null!==t&&e>=t.low;)t=t.nxt;return{low:e,index:n,nxt:t}}Cg(e,t);var s=_g.fromNode(e,t);return function e(n){if(0!==n.cs){e(n.c[0]);for(var t=l(c(n.c[0].el),0,null),i=1;i<n.cs;++i){e(n.c[i]);var a=c(n.c[i].er);o(n,i,t),t=l(a,i,t)}!function(e){e.prelim=(e.c[0].prelim+e.c[0].mod+e.c[e.cs-1].mod+e.c[e.cs-1].prelim+e.c[e.cs-1].w)/2-e.w/2}(n),r(n)}else r(n)}(s),function e(n,t){t+=n.mod,n.x=n.prelim+t,function(e){for(var n=0,t=0,r=0;r<e.cs;r++)t+=(n+=e.c[r].shift)+e.c[r].change,e.c[r].mod+=t}(n);for(var r=0;r<n.cs;r++)e(n.c[r],t)}(s,0),Ng(s,e,t),kg(e,t),e},Bg=zg,Dg=vg,Rg=function(e){var n,t;function r(){return e.apply(this,arguments)||this}return t=e,(n=r).prototype=Object.create(t.prototype),n.prototype.constructor=n,Tg(n,t),r.prototype.execute=function(){return Bg(this.rootNode,this.options,Lg)},r}(xg),Vg={},Hg=vg;function Yg(e,n){void 0===n&&(n=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=n}var Xg={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Zg(e,n,t){t?(n.x=e.x,n.y=e.y):(n.x=e.y,n.y=e.x),e.children.forEach((function(e,r){Zg(e,n.children[r],t)}))}function Fg(e,n){return Fg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},Fg(e,n)}var Ug=function(e,n){void 0===n&&(n={}),n=Hg.assign({},Xg,n);var t,r=0,o=function e(n){if(!n)return null;n.width=0,n.depth&&n.depth>r&&(r=n.depth);var t=n.children,o=t.length,i=new Yg(n.height,[]);return t.forEach((function(n,t){var r=e(n);i.children.push(r),0===t&&(i.leftChild=r),t===o-1&&(i.rightChild=r)})),i.originNode=n,i.isLeaf=n.isLeaf(),i}(e);return function e(n){if(n.isLeaf||0===n.children.length)n.drawingDepth=r;else{var t=n.children.map((function(n){return e(n)})),o=Math.min.apply(null,t);n.drawingDepth=o-1}return n.drawingDepth}(o),function e(r){r.x=r.drawingDepth*n.rankSep,r.isLeaf?(r.y=0,t&&(r.y=t.y+t.height+n.nodeSep,r.originNode.parent!==t.originNode.parent&&(r.y+=n.subTreeSep)),t=r):(r.children.forEach((function(n){e(n)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Zg(o,e,n.isHorizontal),e},Wg=zg,Gg=vg,qg=function(e){var n,t;function r(){return e.apply(this,arguments)||this}return t=e,(n=r).prototype=Object.create(t.prototype),n.prototype.constructor=n,Fg(n,t),r.prototype.execute=function(){var e=this;return e.rootNode.width=0,Wg(e.rootNode,e.options,Ug)},r}(xg),$g={},Kg=vg;function Qg(e,n){return Qg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},Qg(e,n)}var Jg=xg,ey=function(e,n,t,r){var o=null;e.eachNode((function(e){!function(e,n,t,r,o){var i="function"==typeof t?t(e):t*e.depth;if(!r)try{if(e.id===e.parent.children[0].id)return e.x+=i,void(e.y=n?n.y:0)}catch(e){}if(e.x+=i,n){if(e.y=n.y+Kg.getHeight(n,e,o),n.parent&&e.parent.id!==n.parent.id){var a=n.parent,u=a.y+Kg.getHeight(a,e,o);e.y=u>e.y?u:e.y}}else e.y=0}(e,o,n,t,r),o=e}))},ny=Og,ty=vg,ry=["LR","RL","H"],oy=ry[0],iy=function(e){var n,t;function r(){return e.apply(this,arguments)||this}return t=e,(n=r).prototype=Object.create(t.prototype),n.prototype.constructor=n,Qg(n,t),r.prototype.execute=function(){var e=this.options,n=this.rootNode;e.isHorizontal=!0;var t=e.indent,r=void 0===t?20:t,o=e.dropCap,i=void 0===o||o,a=e.direction,u=void 0===a?oy:a,c=e.align;if(u&&-1===ry.indexOf(u))throw new TypeError("Invalid direction: "+u);if(u===ry[0])ey(n,r,i,c);else if(u===ry[1])ey(n,r,i,c),n.right2left();else if(u===ry[2]){var l=ny(n,e),s=l.left,d=l.right;ey(s,r,i,c),s.right2left(),ey(d,r,i,c);var f=s.getBoundingBox();d.translate(f.width,0),n.x=d.x-n.width/2}return n},r}(Jg),ay={},uy=vg;function cy(e,n){var t=0;return e.children.length?e.children.forEach((function(e){t+=cy(e,n)})):t=e.height,e._subTreeSep=n.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,t)+2*e._subTreeSep,e.totalHeight}function ly(e){var n=e.children,t=n.length;if(t){n.forEach((function(e){ly(e)}));var r=n[0],o=n[t-1],i=o.y-r.y+o.height,a=0;if(n.forEach((function(e){a+=e.totalHeight})),i>e.height)e.y=r.y+i/2-e.height/2;else if(1!==n.length||e.height>a){var u=e.y+(e.height-i)/2-r.y;n.forEach((function(e){e.translate(0,u)}))}else e.y=(r.y+r.height/2+o.y+o.height/2)/2-e.height/2}}var sy={getSubTreeSep:function(){return 0}};function dy(e,n){return dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},dy(e,n)}var fy=function(e,n){void 0===n&&(n={}),n=uy.assign({},sy,n),e.parent={x:0,width:0,height:0,y:0},e.BFTraverse((function(e){e.x=e.parent.x+e.parent.width})),e.parent=null,cy(e,n),e.startY=0,e.y=e.totalHeight/2-e.height/2,e.eachNode((function(e){var n=e.children,t=n.length;if(t){var r=n[0];if(r.startY=e.startY+e._subTreeSep,1===t)r.y=e.y+e.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=n[o];i.startY=n[o-1].startY+n[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),ly(e)},hy=zg,vy=vg,py=function(e){var n,t;function r(){return e.apply(this,arguments)||this}return t=e,(n=r).prototype=Object.create(t.prototype),n.prototype.constructor=n,dy(n,t),r.prototype.execute=function(){return hy(this.rootNode,this.options,fy)},r}(xg),gy={};$n({compactBox:function(e,n){return n=Dg.assign({},Vg,n),new Rg(e,n).execute()},dendrogram:function(e,n){return n=Gg.assign({},$g,n),new qg(e,n).execute()},indented:function(e,n){return n=ty.assign({},ay,n),new iy(e,n).execute()},mindmap:function(e,n){return n=vy.assign({},gy,n),new py(e,n).execute()}});var yy={value:()=>{}};function my(){for(var e,n=0,t=arguments.length,r={};n<t;++n){if(!(e=arguments[n]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new wy(r)}function wy(e){this._=e}function by(e,n){for(var t,r=0,o=e.length;r<o;++r)if((t=e[r]).name===n)return t.value}function xy(e,n,t){for(var r=0,o=e.length;r<o;++r)if(e[r].name===n){e[r]=yy,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=t&&e.push({name:n,value:t}),e}wy.prototype=my.prototype={constructor:wy,on:function(e,n){var t,r,o=this._,i=(r=o,(e+"").trim().split(/^|\s+/).map((function(e){var n="",t=e.indexOf(".");if(t>=0&&(n=e.slice(t+1),e=e.slice(0,t)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a<u;)if(t=(e=i[a]).type)o[t]=xy(o[t],e.name,n);else if(null==n)for(t in o)o[t]=xy(o[t],e.name,null);return this}for(;++a<u;)if((t=(e=i[a]).type)&&(t=by(o[t],e.name)))return t},copy:function(){var e={},n=this._;for(var t in n)e[t]=n[t].slice();return new wy(e)},call:function(e,n){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(e))throw new Error("unknown type: "+e);for(i=0,t=(r=this._[e]).length;i<t;++i)r[i].value.apply(n,o)},apply:function(e,n,t){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(n,t)}};var _y="http://www.w3.org/1999/xhtml",Ey={svg:"http://www.w3.org/2000/svg",xhtml:_y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sy(e){var n=e+="",t=n.indexOf(":");return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),Ey.hasOwnProperty(n)?{space:Ey[n],local:e}:e}function ky(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===_y&&n.documentElement.namespaceURI===_y?n.createElement(e):n.createElementNS(t,e)}}function Ny(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Cy(e){var n=Sy(e);return(n.local?Ny:ky)(n)}function My(){}function Oy(e){return null==e?My:function(){return this.querySelector(e)}}function jy(){return[]}function Py(e){return null==e?jy:function(){return this.querySelectorAll(e)}}function Iy(e){return function(){return this.matches(e)}}function Ay(e){return function(n){return n.matches(e)}}var zy=Array.prototype.find;function Ty(){return this.firstElementChild}var Ly=Array.prototype.filter;function By(){return Array.from(this.children)}function Dy(e){return new Array(e.length)}function Ry(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}function Vy(e,n,t,r,o,i){for(var a,u=0,c=n.length,l=i.length;u<l;++u)(a=n[u])?(a.__data__=i[u],r[u]=a):t[u]=new Ry(e,i[u]);for(;u<c;++u)(a=n[u])&&(o[u]=a)}function Hy(e,n,t,r,o,i,a){var u,c,l,s=new Map,d=n.length,f=i.length,h=new Array(d);for(u=0;u<d;++u)(c=n[u])&&(h[u]=l=a.call(c,c.__data__,u,n)+"",s.has(l)?o[u]=c:s.set(l,c));for(u=0;u<f;++u)l=a.call(e,i[u],u,i)+"",(c=s.get(l))?(r[u]=c,c.__data__=i[u],s.delete(l)):t[u]=new Ry(e,i[u]);for(u=0;u<d;++u)(c=n[u])&&s.get(h[u])===c&&(o[u]=c)}function Yy(e){return e.__data__}function Xy(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Zy(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function Fy(e){return function(){this.removeAttribute(e)}}function Uy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Wy(e,n){return function(){this.setAttribute(e,n)}}function Gy(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function qy(e,n){return function(){var t=n.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}}function $y(e,n){return function(){var t=n.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}}function Ky(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Qy(e){return function(){this.style.removeProperty(e)}}function Jy(e,n,t){return function(){this.style.setProperty(e,n,t)}}function em(e,n,t){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,t)}}function nm(e,n){return e.style.getPropertyValue(n)||Ky(e).getComputedStyle(e,null).getPropertyValue(n)}function tm(e){return function(){delete this[e]}}function rm(e,n){return function(){this[e]=n}}function om(e,n){return function(){var t=n.apply(this,arguments);null==t?delete this[e]:this[e]=t}}function im(e){return e.trim().split(/^|\s+/)}function am(e){return e.classList||new um(e)}function um(e){this._node=e,this._names=im(e.getAttribute("class")||"")}function cm(e,n){for(var t=am(e),r=-1,o=n.length;++r<o;)t.add(n[r])}function lm(e,n){for(var t=am(e),r=-1,o=n.length;++r<o;)t.remove(n[r])}function sm(e){return function(){cm(this,e)}}function dm(e){return function(){lm(this,e)}}function fm(e,n){return function(){(n.apply(this,arguments)?cm:lm)(this,e)}}function hm(){this.textContent=""}function vm(e){return function(){this.textContent=e}}function pm(e){return function(){var n=e.apply(this,arguments);this.textContent=null==n?"":n}}function gm(){this.innerHTML=""}function ym(e){return function(){this.innerHTML=e}}function mm(e){return function(){var n=e.apply(this,arguments);this.innerHTML=null==n?"":n}}function wm(){this.nextSibling&&this.parentNode.appendChild(this)}function bm(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xm(){return null}function _m(){var e=this.parentNode;e&&e.removeChild(this)}function Em(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Sm(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function km(e){return function(){var n=this.__on;if(n){for(var t,r=0,o=-1,i=n.length;r<i;++r)t=n[r],e.type&&t.type!==e.type||t.name!==e.name?n[++o]=t:this.removeEventListener(t.type,t.listener,t.options);++o?n.length=o:delete this.__on}}}function Nm(e,n,t){return function(){var r,o=this.__on,i=function(e){return function(n){e.call(this,n,this.__data__)}}(n);if(o)for(var a=0,u=o.length;a<u;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=t),void(r.value=n);this.addEventListener(e.type,i,t),r={type:e.type,name:e.name,value:n,listener:i,options:t},o?o.push(r):this.__on=[r]}}function Cm(e,n,t){var r=Ky(e),o=r.CustomEvent;"function"==typeof o?o=new o(n,t):(o=r.document.createEvent("Event"),t?(o.initEvent(n,t.bubbles,t.cancelable),o.detail=t.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function Mm(e,n){return function(){return Cm(this,e,n)}}function Om(e,n){return function(){return Cm(this,e,n.apply(this,arguments))}}Ry.prototype={constructor:Ry,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},um.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var jm=[null];function Pm(e,n){this._groups=e,this._parents=n}function Im(){return new Pm([[document.documentElement]],jm)}function Am(e){return"string"==typeof e?new Pm([[document.querySelector(e)]],[document.documentElement]):new Pm([[e]],jm)}function zm(e,n){if(e=function(e){let n;for(;n=e.sourceEvent;)e=n;return e}(e),void 0===n&&(n=e.currentTarget),n){var t=n.ownerSVGElement||n;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}Pm.prototype=Im.prototype={constructor:Pm,select:function(e){"function"!=typeof e&&(e=Oy(e));for(var n=this._groups,t=n.length,r=new Array(t),o=0;o<t;++o)for(var i,a,u=n[o],c=u.length,l=r[o]=new Array(c),s=0;s<c;++s)(i=u[s])&&(a=e.call(i,i.__data__,s,u))&&("__data__"in i&&(a.__data__=i.__data__),l[s]=a);return new Pm(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(n=e.apply(this,arguments))?[]:Array.isArray(n)?n:Array.from(n);var n}}(e):Py(e);for(var n=this._groups,t=n.length,r=[],o=[],i=0;i<t;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)(a=u[l])&&(r.push(e.call(a,a.__data__,l,u)),o.push(a));return new Pm(r,o)},selectChild:function(e){return this.select(null==e?Ty:function(e){return function(){return zy.call(this.children,e)}}("function"==typeof e?e:Ay(e)))},selectChildren:function(e){return this.selectAll(null==e?By:function(e){return function(){return Ly.call(this.children,e)}}("function"==typeof e?e:Ay(e)))},filter:function(e){"function"!=typeof e&&(e=Iy(e));for(var n=this._groups,t=n.length,r=new Array(t),o=0;o<t;++o)for(var i,a=n[o],u=a.length,c=r[o]=[],l=0;l<u;++l)(i=a[l])&&e.call(i,i.__data__,l,a)&&c.push(i);return new Pm(r,this._parents)},data:function(e,n){if(!arguments.length)return Array.from(this,Yy);var t,r=n?Hy:Vy,o=this._parents,i=this._groups;"function"!=typeof e&&(t=e,e=function(){return t});for(var a=i.length,u=new Array(a),c=new Array(a),l=new Array(a),s=0;s<a;++s){var d=o[s],f=i[s],h=f.length,v=Xy(e.call(d,d&&d.__data__,s,o)),p=v.length,g=c[s]=new Array(p),y=u[s]=new Array(p);r(d,f,g,y,l[s]=new Array(h),v,n);for(var m,w,b=0,x=0;b<p;++b)if(m=g[b]){for(b>=x&&(x=b+1);!(w=y[x])&&++x<p;);m._next=w||null}}return(u=new Pm(u,o))._enter=c,u._exit=l,u},enter:function(){return new Pm(this._enter||this._groups.map(Dy),this._parents)},exit:function(){return new Pm(this._exit||this._groups.map(Dy),this._parents)},join:function(e,n,t){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=n&&(o=n(o))&&(o=o.selection()),null==t?i.remove():t(i),r&&o?r.merge(o).order():o},merge:function(e){for(var n=e.selection?e.selection():e,t=this._groups,r=n._groups,o=t.length,i=r.length,a=Math.min(o,i),u=new Array(o),c=0;c<a;++c)for(var l,s=t[c],d=r[c],f=s.length,h=u[c]=new Array(f),v=0;v<f;++v)(l=s[v]||d[v])&&(h[v]=l);for(;c<o;++c)u[c]=t[c];return new Pm(u,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,n=-1,t=e.length;++n<t;)for(var r,o=e[n],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function n(n,t){return n&&t?e(n.__data__,t.__data__):!n-!t}e||(e=Zy);for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i){for(var a,u=t[i],c=u.length,l=o[i]=new Array(c),s=0;s<c;++s)(a=u[s])&&(l[s]=a);l.sort(n)}return new Pm(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,n=0,t=e.length;n<t;++n)for(var r=e[n],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const n of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var n=this._groups,t=0,r=n.length;t<r;++t)for(var o,i=n[t],a=0,u=i.length;a<u;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,n){var t=Sy(e);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((null==n?t.local?Uy:Fy:"function"==typeof n?t.local?$y:qy:t.local?Gy:Wy)(t,n))},style:function(e,n,t){return arguments.length>1?this.each((null==n?Qy:"function"==typeof n?em:Jy)(e,n,null==t?"":t)):nm(this.node(),e)},property:function(e,n){return arguments.length>1?this.each((null==n?tm:"function"==typeof n?om:rm)(e,n)):this.node()[e]},classed:function(e,n){var t=im(e+"");if(arguments.length<2){for(var r=am(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof n?fm:n?sm:dm)(t,n))},text:function(e){return arguments.length?this.each(null==e?hm:("function"==typeof e?pm:vm)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?gm:("function"==typeof e?mm:ym)(e)):this.node().innerHTML},raise:function(){return this.each(wm)},lower:function(){return this.each(bm)},append:function(e){var n="function"==typeof e?e:Cy(e);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(e,n){var t="function"==typeof e?e:Cy(e),r=null==n?xm:"function"==typeof n?n:Oy(n);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(_m)},clone:function(e){return this.select(e?Sm:Em)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,n,t){var r,o,i=function(e){return e.trim().split(/^|\s+/).map((function(e){var n="",t=e.indexOf(".");return t>=0&&(n=e.slice(t+1),e=e.slice(0,t)),{type:e,name:n}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(u=n?Nm:km,r=0;r<a;++r)this.each(u(i[r],n,t));return this}var u=this.node().__on;if(u)for(var c,l=0,s=u.length;l<s;++l)for(r=0,c=u[l];r<a;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(e,n){return this.each(("function"==typeof n?Om:Mm)(e,n))},[Symbol.iterator]:function*(){for(var e=this._groups,n=0,t=e.length;n<t;++n)for(var r,o=e[n],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const Tm={passive:!1},Lm={capture:!0,passive:!1};function Bm(e){e.stopImmediatePropagation()}function Dm(e){e.preventDefault(),e.stopImmediatePropagation()}function Rm(e){var n=e.document.documentElement,t=Am(e).on("dragstart.drag",Dm,Lm);"onselectstart"in n?t.on("selectstart.drag",Dm,Lm):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Vm(e,n){var t=e.document.documentElement,r=Am(e).on("dragstart.drag",null);n&&(r.on("click.drag",Dm,Lm),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 Hm=e=>()=>e;function Ym(e,{sourceEvent:n,subject:t,target:r,identifier:o,active:i,x:a,y:u,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,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:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function Xm(e){return!e.ctrlKey&&!e.button}function Zm(){return this.parentNode}function Fm(e,n){return null==n?{x:e.x,y:e.y}:n}function Um(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wm(e,n){if(!e.parentId)return!1;var t=n.get(e.parentId);return!!t&&(!!t.selected||Wm(t,n))}function Gm(e,n,t){var r=e;do{if(null==r?void 0:r.matches(n))return!0;if(r===t)return!1;r=r.parentElement}while(r);return!1}function qm(e){var n,t,r,o,i=e.nodeId,a=e.dragItems,u=e.nodeLookup,c=[];try{for(var l=F(a),s=l.next();!s.done;s=l.next()){var d=U(s.value,2),f=d[0],h=d[1],v=null===(r=u.get(f))||void 0===r?void 0:r.internals.userNode;v&&c.push(Z(Z({},v),{position:h.position}))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(t=l.return)&&t.call(l)}finally{if(n)throw n.error}}if(!i)return[c[0],c];var p=u.get(i).internals.userNode;return[Z(Z({},p),{position:(null===(o=a.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function $m(e){var n=e.onNodeMouseDown,t=e.getStoreItems,r=e.onDragStart,o=e.onDrag,i=e.onDragStop,a={x:null,y:null},u=0,c=new Map,l=!1,s={x:0,y:0},d=null,f=!1,h=null;return{update:function(e){var v=e.noDragClassName,p=e.handleSelector,g=e.domNode,y=e.isSelectable,m=e.nodeId;function w(e,n){var r,i,u=e.x,l=e.y,s=t(),d=s.nodeLookup,f=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,w=s.onError,b=s.updateNodePositions;a={x:u,y:l};var x=!1,_={x:0,y:0,x2:0,y2:0};if(c.size>1&&f){var E=Nv(c,{nodeOrigin:p});_=zv(E)}try{for(var S=F(c),k=S.next();!k.done;k=S.next()){var N=U(k.value,2),C=N[0],M=N[1],O={x:u-M.distance.x,y:l-M.distance.y};v&&(O=Bv(O,h));var j=[[f[0][0],f[0][1]],[f[1][0],f[1][1]]];if(c.size>1&&f&&!M.extent){var P=M.internals.positionAbsolute,I=P.x-_.x+f[0][0],A=P.x+M.measured.width-_.x2+f[1][0];j=[[I,P.y-_.y+f[0][1]],[A,P.y+M.measured.height-_.y2+f[1][1]]]}var z=Mv({nodeId:C,nextPosition:O,nodeLookup:d,nodeExtent:j,nodeOrigin:p,onError:w}),T=z.position,L=z.positionAbsolute;x=x||M.position.x!==T.x||M.position.y!==T.y,M.position=T,M.internals.positionAbsolute=L}}catch(e){r={error:e}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(x&&(b(c,!0),n&&(o||g||!m&&y))){var B=U(qm({nodeId:m,dragItems:c,nodeLookup:d}),2),D=B[0],R=B[1];null==o||o(n,c,D,R),null==g||g(n,D,R),m||null==y||y(n,R)}}function b(){var e,n;if(d){var r=U(Iv(s,d),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=t(),l=c.transform,f=c.panBy;a.x=(null!==(e=a.x)&&void 0!==e?e:0)-o/l[2],a.y=(null!==(n=a.y)&&void 0!==n?n:0)-i/l[2],f({x:o,y:i})&&w(a,null)}u=requestAnimationFrame(b)}}function x(e){var o,i=t(),u=i.nodeLookup,l=i.multiSelectionActive,s=i.nodesDraggable,d=i.transform,h=i.snapGrid,v=i.snapToGrid,p=i.selectNodesOnDrag,g=i.onNodeDragStart,w=i.onSelectionDragStart,b=i.unselectNodesAndEdges;f=!0,p&&y||l||!m||(null===(o=u.get(m))||void 0===o?void 0:o.selected)||b(),y&&p&&m&&(null==n||n(m));var x=Fv(e.sourceEvent,{transform:d,snapGrid:h,snapToGrid:v});if(a=x,c=function(e,n,t,r){var o,i,a,u,c=new Map;try{for(var l=F(e),s=l.next();!s.done;s=l.next()){var d=U(s.value,2),f=d[0],h=d[1];if((h.selected||h.id===r)&&(!h.parentId||!Wm(h,e))&&(h.draggable||n&&void 0===h.draggable)){var v=e.get(f);v&&c.set(f,{id:f,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!==(a=v.measured.width)&&void 0!==a?a:0,height:null!==(u=v.measured.height)&&void 0!==u?u:0}})}}}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return c}(u,s,x,m),c.size>0&&(r||g||!m&&w)){var _=U(qm({nodeId:m,dragItems:c,nodeLookup:u}),2),E=_[0],S=_[1];null==r||r(e.sourceEvent,c,E,S),null==g||g(e.sourceEvent,E,S),m||null==w||w(e.sourceEvent,S)}}h=Am(g);var _=function(){var e,n,t,r,o=Xm,i=Zm,a=Fm,u=Um,c={},l=my("start","drag","end"),s=0,d=0;function f(e){e.on("mousedown.drag",h).filter(u).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(a,u){if(!r&&o.call(this,a,u)){var c=w(this,i.call(this,a,u),a,u,"mouse");c&&(Am(a.view).on("mousemove.drag",v,Lm).on("mouseup.drag",p,Lm),Rm(a.view),Bm(a),t=!1,e=a.clientX,n=a.clientY,c("start",a))}}function v(r){if(Dm(r),!t){var o=r.clientX-e,i=r.clientY-n;t=o*o+i*i>d}c.mouse("drag",r)}function p(e){Am(e.view).on("mousemove.drag mouseup.drag",null),Vm(e.view,t),Dm(e),c.mouse("end",e)}function g(e,n){if(o.call(this,e,n)){var t,r,a=e.changedTouches,u=i.call(this,e,n),c=a.length;for(t=0;t<c;++t)(r=w(this,u,e,n,a[t].identifier,a[t]))&&(Bm(e),r("start",e,a[t]))}}function y(e){var n,t,r=e.changedTouches,o=r.length;for(n=0;n<o;++n)(t=c[r[n].identifier])&&(Dm(e),t("drag",e,r[n]))}function m(e){var n,t,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),n=0;n<i;++n)(t=c[o[n].identifier])&&(Bm(e),t("end",e,o[n]))}function w(e,n,t,r,o,i){var u,d,h,v=l.copy(),p=zm(i||t,n);if(null!=(h=a.call(e,new Ym("beforestart",{sourceEvent:t,target:f,identifier:o,active:s,x:p[0],y:p[1],dx:0,dy:0,dispatch:v}),r)))return u=h.x-p[0]||0,d=h.y-p[1]||0,function t(i,a,l){var g,y=p;switch(i){case"start":c[o]=t,g=s++;break;case"end":delete c[o],--s;case"drag":p=zm(l||a,n),g=s}v.call(i,e,new Ym(i,{sourceEvent:a,subject:h,target:f,identifier:o,active:g,x:p[0]+u,y:p[1]+d,dx:p[0]-y[0],dy:p[1]-y[1],dispatch:v}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:Hm(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:Hm(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:Hm(e),f):a},f.touchable=function(e){return arguments.length?(u="function"==typeof e?e:Hm(!!e),f):u},f.on=function(){var e=l.on.apply(l,arguments);return e===l?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",(function(e){var n=t(),r=n.domNode,o=n.nodeDragThreshold,i=n.transform,u=n.snapGrid,c=n.snapToGrid;0===o&&x(e);var l=Fv(e.sourceEvent,{transform:i,snapGrid:u,snapToGrid:c});a=l,d=(null==r?void 0:r.getBoundingClientRect())||null,s=Qv(e.sourceEvent,d)})).on("drag",(function(e){var n,r,o=t(),i=o.autoPanOnNodeDrag,u=o.transform,h=o.snapGrid,v=o.snapToGrid,p=o.nodeDragThreshold,g=Fv(e.sourceEvent,{transform:u,snapGrid:h,snapToGrid:v});if(!l&&i&&f&&(l=!0,b()),!f){var y=g.xSnapped-(null!==(n=a.x)&&void 0!==n?n:0),m=g.ySnapped-(null!==(r=a.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&x(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&c&&f&&(s=Qv(e.sourceEvent,d),w(g,e.sourceEvent))})).on("end",(function(e){if(f&&(l=!1,f=!1,cancelAnimationFrame(u),c.size>0)){var n=t(),r=n.nodeLookup,o=n.updateNodePositions,a=n.onNodeDragStop,s=n.onSelectionDragStop;if(o(c,!1),i||a||!m&&s){var d=U(qm({nodeId:m,dragItems:c,nodeLookup:r}),2),h=d[0],v=d[1];null==i||i(e.sourceEvent,c,h,v),null==a||a(e.sourceEvent,h,v),m||null==s||s(e.sourceEvent,v)}}})).filter((function(e){var n=e.target;return!e.button&&(!v||!Gm(n,".".concat(v),g))&&(!p||Gm(n,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function Km(e,n,t,r){return(n[t]||[]).reduce((function(n,o){return"".concat(e.id,"-").concat(o.id,"-").concat(t)!==r&&n.push({id:o.id||null,type:t,nodeId:e.id,x:e.internals.positionAbsolute.x+o.x+o.width/2,y:e.internals.positionAbsolute.y+o.y+o.height/2}),n}),[])}function Qm(e,n){return e||((null==n?void 0:n.classList.contains("target"))?"target":(null==n?void 0:n.classList.contains("source"))?"source":null)}Ym.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Jm=function(){return!0},ew=null;function nw(e,n){var t=n.handle,r=n.connectionMode,o=n.fromNodeId,i=n.fromHandleId,a=n.fromType,u=n.doc,c=n.lib,l=n.flowId,s=n.isValidConnection,d=void 0===s?Jm:s,f="target"===a,h=t?u.querySelector(".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==t?void 0:t.nodeId,"-").concat(null==t?void 0:t.id,"-").concat(null==t?void 0:t.type,'"]')):null,v=Qv(e),p=v.x,g=v.y,y=u.elementFromPoint(p,g),m=(null==y?void 0:y.classList.contains("".concat(c,"-flow__handle")))?y:h,w={handleDomNode:m,isValid:!1,connection:null,endHandle:null};if(m){var b=Qm(void 0,m),x=m.getAttribute("data-nodeid"),_=m.getAttribute("data-handleid"),E=m.classList.contains("connectable"),S=m.classList.contains("connectableend");if(!x)return w;var k={source:f?x:o,sourceHandle:f?_:i,target:f?o:x,targetHandle:f?i:_};w.connection=k,E&&S&&(r===Uv.Strict?f&&"source"===b||!f&&"target"===b:x!==o||_!==i)&&(w.endHandle={nodeId:x,handleId:_,type:b},w.isValid=d(k))}return w}var tw={onPointerDown:function(e,n){var t,r=n.connectionMode,o=n.connectionRadius,i=n.handleId,a=n.nodeId,u=n.edgeUpdaterType,c=n.isTarget,l=n.domNode,s=n.nodeLookup,d=n.lib,f=n.autoPanOnConnect,h=n.flowId,v=n.panBy,p=n.cancelConnection,g=n.onConnectStart,y=n.onConnect,m=n.onConnectEnd,w=n.isValidConnection,b=void 0===w?Jm:w,x=n.onEdgeUpdateEnd,_=n.updateConnection,E=n.getTransform,S=n.getConnectionStartHandle,k=function(e){var n;return(null===(n=e.getRootNode)||void 0===n?void 0:n.call(e))||(null===window||void 0===window?void 0:window.document)}(e.target),N=0,C=Qv(e),M=C.x,O=C.y,j=null==k?void 0:k.elementFromPoint(M,O),P=Qm(u,j),I=null==l?void 0:l.getBoundingClientRect();if(I&&P){var A=Qv(e,I),z=!1,T=null,L=!1,B=null,D=function(e){var n,t,r=e.nodeLookup,o=e.nodeId,i=e.handleId,a=e.handleType,u=[];try{for(var c=F(r),l=c.next();!l.done;l=c.next()){var s=U(l.value,2)[1];if(s.internals.handleBounds){var d="".concat(o,"-").concat(i,"-").concat(a),f=Km(s,s.internals.handleBounds,"source",d),h=Km(s,s.internals.handleBounds,"target",d);u.push.apply(u,W(W([],U(f),!1),U(h),!1))}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(n)throw n.error}}return u}({nodeLookup:s,nodeId:a,handleId:i,handleType:P});_({connectionPosition:A,connectionStatus:null,connectionStartHandle:ew={nodeId:a,handleId:i,type:P},connectionEndHandle:null}),null==g||g(e,{nodeId:a,handleId:i,handleType:P}),k.addEventListener("mousemove",V),k.addEventListener("mouseup",H),k.addEventListener("touchmove",V),k.addEventListener("touchend",H)}function R(){if(f&&I){var e=U(Iv(A,I),2),n=e[0],t=e[1];v({x:n,y:t}),N=requestAnimationFrame(R)}}function V(e){S()||H(e);var n=E();A=Qv(e,I),t=function(e,n,t){var r,o,i=[],a=1/0;try{for(var u=F(t),c=u.next();!c.done;c=u.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-e.x,2)+Math.pow(l.y-e.y,2));s<=n&&(s<a?i=[l]:s===a&&i.push(l),a=s)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i.length?1===i.length?i[0]:i.find((function(e){return"target"===e.type}))||i[0]:null}(Dv(A,n,!1,[1,1]),o,D),z||(R(),z=!0);var u,l,s,f=nw(e,{handle:t,connectionMode:r,fromNodeId:a,fromHandleId:i,fromType:c?"target":"source",isValidConnection:b,doc:k,lib:d,flowId:h});B=f.handleDomNode,T=f.connection,L=f.isValid,_({connectionStartHandle:ew,connectionPosition:t&&L?Rv({x:t.x,y:t.y},n):A,connectionStatus:(u=!!t,l=L,s=null,l?s="valid":u&&!l&&(s="invalid"),s),connectionEndHandle:f.endHandle})}function H(e){(t||B)&&T&&L&&(null==y||y(T)),null==m||m(e),u&&(null==x||x(e)),p(),cancelAnimationFrame(N),z=!1,L=!1,T=null,B=null,ew=null,k.removeEventListener("mousemove",V),k.removeEventListener("mouseup",H),k.removeEventListener("touchmove",V),k.removeEventListener("touchend",H)}},isValid:nw};function rw(e,n,t){e.prototype=n.prototype=t,t.constructor=e}function ow(e,n){var t=Object.create(e.prototype);for(var r in n)t[r]=n[r];return t}function iw(){}var aw=.7,uw=1/aw,cw="\\s*([+-]?\\d+)\\s*",lw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dw=/^#([0-9a-f]{3,8})$/,fw=new RegExp(`^rgb\\(${cw},${cw},${cw}\\)$`),hw=new RegExp(`^rgb\\(${sw},${sw},${sw}\\)$`),vw=new RegExp(`^rgba\\(${cw},${cw},${cw},${lw}\\)$`),pw=new RegExp(`^rgba\\(${sw},${sw},${sw},${lw}\\)$`),gw=new RegExp(`^hsl\\(${lw},${sw},${sw}\\)$`),yw=new RegExp(`^hsla\\(${lw},${sw},${sw},${lw}\\)$`),mw={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 ww(){return this.rgb().formatHex()}function bw(){return this.rgb().formatRgb()}function xw(e){var n,t;return e=(e+"").trim().toLowerCase(),(n=dw.exec(e))?(t=n[1].length,n=parseInt(n[1],16),6===t?_w(n):3===t?new kw(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===t?Ew(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===t?Ew(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=fw.exec(e))?new kw(n[1],n[2],n[3],1):(n=hw.exec(e))?new kw(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=vw.exec(e))?Ew(n[1],n[2],n[3],n[4]):(n=pw.exec(e))?Ew(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=gw.exec(e))?Pw(n[1],n[2]/100,n[3]/100,1):(n=yw.exec(e))?Pw(n[1],n[2]/100,n[3]/100,n[4]):mw.hasOwnProperty(e)?_w(mw[e]):"transparent"===e?new kw(NaN,NaN,NaN,0):null}function _w(e){return new kw(e>>16&255,e>>8&255,255&e,1)}function Ew(e,n,t,r){return r<=0&&(e=n=t=NaN),new kw(e,n,t,r)}function Sw(e,n,t,r){return 1===arguments.length?((o=e)instanceof iw||(o=xw(o)),o?new kw((o=o.rgb()).r,o.g,o.b,o.opacity):new kw):new kw(e,n,t,null==r?1:r);var o}function kw(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}function Nw(){return`#${jw(this.r)}${jw(this.g)}${jw(this.b)}`}function Cw(){const e=Mw(this.opacity);return`${1===e?"rgb(":"rgba("}${Ow(this.r)}, ${Ow(this.g)}, ${Ow(this.b)}${1===e?")":`, ${e})`}`}function Mw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ow(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jw(e){return((e=Ow(e))<16?"0":"")+e.toString(16)}function Pw(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Aw(e,n,t,r)}function Iw(e){if(e instanceof Aw)return new Aw(e.h,e.s,e.l,e.opacity);if(e instanceof iw||(e=xw(e)),!e)return new Aw;if(e instanceof Aw)return e;var n=(e=e.rgb()).r/255,t=e.g/255,r=e.b/255,o=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,u=i-o,c=(i+o)/2;return u?(a=n===i?(t-r)/u+6*(t<r):t===i?(r-n)/u+2:(n-t)/u+4,u/=c<.5?i+o:2-i-o,a*=60):u=c>0&&c<1?0:a,new Aw(a,u,c,e.opacity)}function Aw(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}function zw(e){return(e=(e||0)%360)<0?e+360:e}function Tw(e){return Math.max(0,Math.min(1,e||0))}function Lw(e,n,t){return 255*(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)}rw(iw,xw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ww,formatHex:ww,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Iw(this).formatHsl()},formatRgb:bw,toString:bw}),rw(kw,Sw,ow(iw,{brighter(e){return e=null==e?uw:Math.pow(uw,e),new kw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?aw:Math.pow(aw,e),new kw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kw(Ow(this.r),Ow(this.g),Ow(this.b),Mw(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:Nw,formatHex:Nw,formatHex8:function(){return`#${jw(this.r)}${jw(this.g)}${jw(this.b)}${jw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Cw,toString:Cw})),rw(Aw,(function(e,n,t,r){return 1===arguments.length?Iw(e):new Aw(e,n,t,null==r?1:r)}),ow(iw,{brighter(e){return e=null==e?uw:Math.pow(uw,e),new Aw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?aw:Math.pow(aw,e),new Aw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,o=2*t-r;return new kw(Lw(e>=240?e-240:e+120,o,r),Lw(e,o,r),Lw(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Aw(zw(this.h),Tw(this.s),Tw(this.l),Mw(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 e=Mw(this.opacity);return`${1===e?"hsl(":"hsla("}${zw(this.h)}, ${100*Tw(this.s)}%, ${100*Tw(this.l)}%${1===e?")":`, ${e})`}`}}));var Bw=e=>()=>e;function Dw(e,n){var t=n-e;return t?function(e,n){return function(t){return e+t*n}}(e,t):Bw(isNaN(e)?n:e)}var Rw=function e(n){var t=function(e){return 1==(e=+e)?Dw:function(n,t){return t-n?function(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}(n,t,e):Bw(isNaN(n)?t:n)}}(n);function r(e,n){var r=t((e=Sw(e)).r,(n=Sw(n)).r),o=t(e.g,n.g),i=t(e.b,n.b),a=Dw(e.opacity,n.opacity);return function(n){return e.r=r(n),e.g=o(n),e.b=i(n),e.opacity=a(n),e+""}}return r.gamma=e,r}(1);function Vw(e,n){return e=+e,n=+n,function(t){return e*(1-t)+n*t}}var Hw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yw=new RegExp(Hw.source,"g");function Xw(e,n){var t,r,o,i=Hw.lastIndex=Yw.lastIndex=0,a=-1,u=[],c=[];for(e+="",n+="";(t=Hw.exec(e))&&(r=Yw.exec(n));)(o=r.index)>i&&(o=n.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(t=t[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:Vw(t,r)})),i=Yw.lastIndex;return i<n.length&&(o=n.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?function(e){return function(n){return e(n)+""}}(c[0].x):function(e){return function(){return e}}(n):(n=c.length,function(e){for(var t,r=0;r<n;++r)u[(t=c[r]).i]=t.x(e);return u.join("")})}var Zw,Fw=180/Math.PI,Uw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ww(e,n,t,r,o,i){var a,u,c;return(a=Math.sqrt(e*e+n*n))&&(e/=a,n/=a),(c=e*t+n*r)&&(t-=e*c,r-=n*c),(u=Math.sqrt(t*t+r*r))&&(t/=u,r/=u,c/=u),e*r<n*t&&(e=-e,n=-n,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(n,e)*Fw,skewX:Math.atan(c)*Fw,scaleX:a,scaleY:u}}function Gw(e,n,t,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var u=[],c=[];return i=e(i),a=e(a),function(e,r,o,i,a,u){if(e!==o||r!==i){var c=a.push("translate(",null,n,null,t);u.push({i:c-4,x:Vw(e,o)},{i:c-2,x:Vw(r,i)})}else(o||i)&&a.push("translate("+o+n+i+t)}(i.translateX,i.translateY,a.translateX,a.translateY,u,c),function(e,n,t,i){e!==n?(e-n>180?n+=360:n-e>180&&(e+=360),i.push({i:t.push(o(t)+"rotate(",null,r)-2,x:Vw(e,n)})):n&&t.push(o(t)+"rotate("+n+r)}(i.rotate,a.rotate,u,c),function(e,n,t,i){e!==n?i.push({i:t.push(o(t)+"skewX(",null,r)-2,x:Vw(e,n)}):n&&t.push(o(t)+"skewX("+n+r)}(i.skewX,a.skewX,u,c),function(e,n,t,r,i,a){if(e!==t||n!==r){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:Vw(e,t)},{i:u-2,x:Vw(n,r)})}else 1===t&&1===r||i.push(o(i)+"scale("+t+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,c),i=a=null,function(e){for(var n,t=-1,r=c.length;++t<r;)u[(n=c[t]).i]=n.x(e);return u.join("")}}}var qw=Gw((function(e){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Uw:Ww(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),$w=Gw((function(e){return null==e?Uw:(Zw||(Zw=document.createElementNS("http://www.w3.org/2000/svg","g")),Zw.setAttribute("transform",e),(e=Zw.transform.baseVal.consolidate())?Ww((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Uw)}),", ",")",")");function Kw(e){return((e=Math.exp(e))+1/e)/2}var Qw,Jw,eb=function e(n,t,r){function o(e,o){var i,a,u=e[0],c=e[1],l=e[2],s=o[0],d=o[1],f=o[2],h=s-u,v=d-c,p=h*h+v*v;if(p<1e-12)a=Math.log(f/l)/n,i=function(e){return[u+e*h,c+e*v,l*Math.exp(n*e*a)]};else{var g=Math.sqrt(p),y=(f*f-l*l+r*p)/(2*l*t*g),m=(f*f-l*l-r*p)/(2*f*t*g),w=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(m*m+1)-m);a=(b-w)/n,i=function(e){var r,o=e*a,i=Kw(w),s=l/(t*g)*(i*(r=n*o+w,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(w));return[u+s*h,c+s*v,l*i/Kw(n*o+w)]}}return i.duration=1e3*a*n/Math.SQRT2,i}return o.rho=function(n){var t=Math.max(.001,+n),r=t*t;return e(t,r,r*r)},o}(Math.SQRT2,2,4),nb=0,tb=0,rb=0,ob=1e3,ib=0,ab=0,ub=0,cb="object"==typeof performance&&performance.now?performance:Date,lb="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sb(){return ab||(lb(db),ab=cb.now()+ub)}function db(){ab=0}function fb(){this._call=this._time=this._next=null}function hb(e,n,t){var r=new fb;return r.restart(e,n,t),r}function vb(){ab=(ib=cb.now())+ub,nb=tb=0;try{!function(){sb(),++nb;for(var e,n=Qw;n;)(e=ab-n._time)>=0&&n._call.call(void 0,e),n=n._next;--nb}()}finally{nb=0,function(){for(var e,n,t=Qw,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Qw=n);Jw=e,gb(r)}(),ab=0}}function pb(){var e=cb.now(),n=e-ib;n>ob&&(ub-=n,ib=e)}function gb(e){nb||(tb&&(tb=clearTimeout(tb)),e-ab>24?(e<1/0&&(tb=setTimeout(vb,e-cb.now()-ub)),rb&&(rb=clearInterval(rb))):(rb||(ib=cb.now(),rb=setInterval(pb,ob)),nb=1,lb(vb)))}function yb(e,n,t){var r=new fb;return n=null==n?0:+n,r.restart((t=>{r.stop(),e(t+n)}),n,t),r}fb.prototype=hb.prototype={constructor:fb,restart:function(e,n,t){if("function"!=typeof e)throw new TypeError("callback is not a function");t=(null==t?sb():+t)+(null==n?0:+n),this._next||Jw===this||(Jw?Jw._next=this:Qw=this,Jw=this),this._call=e,this._time=t,gb()},stop:function(){this._call&&(this._call=null,this._time=1/0,gb())}};var mb=my("start","end","cancel","interrupt"),wb=[],bb=0,xb=2,_b=3,Eb=5,Sb=6;function kb(e,n,t,r,o,i){var a=e.__transition;if(a){if(t in a)return}else e.__transition={};!function(e,n,t){var r,o=e.__transition;function i(c){var l,s,d,f;if(1!==t.state)return u();for(l in o)if((f=o[l]).name===t.name){if(f.state===_b)return yb(i);4===f.state?(f.state=Sb,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[l]):+l<n&&(f.state=Sb,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[l])}if(yb((function(){t.state===_b&&(t.state=4,t.timer.restart(a,t.delay,t.time),a(c))})),t.state=xb,t.on.call("start",e,e.__data__,t.index,t.group),t.state===xb){for(t.state=_b,r=new Array(d=t.tween.length),l=0,s=-1;l<d;++l)(f=t.tween[l].value.call(e,e.__data__,t.index,t.group))&&(r[++s]=f);r.length=s+1}}function a(n){for(var o=n<t.duration?t.ease.call(null,n/t.duration):(t.timer.restart(u),t.state=Eb,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);t.state===Eb&&(t.on.call("end",e,e.__data__,t.index,t.group),u())}function u(){for(var r in t.state=Sb,t.timer.stop(),delete o[n],o)return;delete e.__transition}o[n]=t,t.timer=hb((function(e){t.state=1,t.timer.restart(i,t.delay,t.time),t.delay<=e&&i(e-t.delay)}),0,t.time)}(e,t,{name:n,index:r,group:o,on:mb,tween:wb,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:bb})}function Nb(e,n){var t=Mb(e,n);if(t.state>bb)throw new Error("too late; already scheduled");return t}function Cb(e,n){var t=Mb(e,n);if(t.state>_b)throw new Error("too late; already running");return t}function Mb(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ob(e,n){var t,r,o,i=e.__transition,a=!0;if(i){for(o in n=null==n?null:n+"",i)(t=i[o]).name===n?(r=t.state>xb&&t.state<Eb,t.state=Sb,t.timer.stop(),t.on.call(r?"interrupt":"cancel",e,e.__data__,t.index,t.group),delete i[o]):a=!1;a&&delete e.__transition}}function jb(e,n){var t,r;return function(){var o=Cb(this,e),i=o.tween;if(i!==t)for(var a=0,u=(r=t=i).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}o.tween=r}}function Pb(e,n,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=Cb(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var u={name:n,value:t},c=0,l=o.length;c<l;++c)if(o[c].name===n){o[c]=u;break}c===l&&o.push(u)}i.tween=o}}function Ib(e,n,t){var r=e._id;return e.each((function(){var e=Cb(this,r);(e.value||(e.value={}))[n]=t.apply(this,arguments)})),function(e){return Mb(e,r).value[n]}}function Ab(e,n){var t;return("number"==typeof n?Vw:n instanceof xw?Rw:(t=xw(n))?(n=t,Rw):Xw)(e,n)}function zb(e){return function(){this.removeAttribute(e)}}function Tb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lb(e,n,t){var r,o,i=t+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=n(r=a,t)}}function Bb(e,n,t){var r,o,i=t+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=n(r=a,t)}}function Db(e,n,t){var r,o,i;return function(){var a,u,c=t(this);if(null!=c)return(a=this.getAttribute(e))===(u=c+"")?null:a===r&&u===o?i:(o=u,i=n(r=a,c));this.removeAttribute(e)}}function Rb(e,n,t){var r,o,i;return function(){var a,u,c=t(this);if(null!=c)return(a=this.getAttributeNS(e.space,e.local))===(u=c+"")?null:a===r&&u===o?i:(o=u,i=n(r=a,c));this.removeAttributeNS(e.space,e.local)}}function Vb(e,n){var t,r;function o(){var o=n.apply(this,arguments);return o!==r&&(t=(r=o)&&function(e,n){return function(t){this.setAttributeNS(e.space,e.local,n.call(this,t))}}(e,o)),t}return o._value=n,o}function Hb(e,n){var t,r;function o(){var o=n.apply(this,arguments);return o!==r&&(t=(r=o)&&function(e,n){return function(t){this.setAttribute(e,n.call(this,t))}}(e,o)),t}return o._value=n,o}function Yb(e,n){return function(){Nb(this,e).delay=+n.apply(this,arguments)}}function Xb(e,n){return n=+n,function(){Nb(this,e).delay=n}}function Zb(e,n){return function(){Cb(this,e).duration=+n.apply(this,arguments)}}function Fb(e,n){return n=+n,function(){Cb(this,e).duration=n}}var Ub=Im.prototype.constructor;function Wb(e){return function(){this.style.removeProperty(e)}}var Gb=0;function qb(e,n,t,r){this._groups=e,this._parents=n,this._name=t,this._id=r}function $b(){return++Gb}var Kb=Im.prototype;qb.prototype={constructor:qb,select:function(e){var n=this._name,t=this._id;"function"!=typeof e&&(e=Oy(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var u,c,l=r[a],s=l.length,d=i[a]=new Array(s),f=0;f<s;++f)(u=l[f])&&(c=e.call(u,u.__data__,f,l))&&("__data__"in u&&(c.__data__=u.__data__),d[f]=c,kb(d[f],n,t,f,d,Mb(u,t)));return new qb(i,this._parents,n,t)},selectAll:function(e){var n=this._name,t=this._id;"function"!=typeof e&&(e=Py(e));for(var r=this._groups,o=r.length,i=[],a=[],u=0;u<o;++u)for(var c,l=r[u],s=l.length,d=0;d<s;++d)if(c=l[d]){for(var f,h=e.call(c,c.__data__,d,l),v=Mb(c,t),p=0,g=h.length;p<g;++p)(f=h[p])&&kb(f,n,t,p,h,v);i.push(h),a.push(c)}return new qb(i,a,n,t)},selectChild:Kb.selectChild,selectChildren:Kb.selectChildren,filter:function(e){"function"!=typeof e&&(e=Iy(e));for(var n=this._groups,t=n.length,r=new Array(t),o=0;o<t;++o)for(var i,a=n[o],u=a.length,c=r[o]=[],l=0;l<u;++l)(i=a[l])&&e.call(i,i.__data__,l,a)&&c.push(i);return new qb(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,t=e._groups,r=n.length,o=t.length,i=Math.min(r,o),a=new Array(r),u=0;u<i;++u)for(var c,l=n[u],s=t[u],d=l.length,f=a[u]=new Array(d),h=0;h<d;++h)(c=l[h]||s[h])&&(f[h]=c);for(;u<r;++u)a[u]=n[u];return new qb(a,this._parents,this._name,this._id)},selection:function(){return new Ub(this._groups,this._parents)},transition:function(){for(var e=this._name,n=this._id,t=$b(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],c=u.length,l=0;l<c;++l)if(a=u[l]){var s=Mb(a,n);kb(a,e,t,l,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new qb(r,this._parents,e,t)},call:Kb.call,nodes:Kb.nodes,node:Kb.node,size:Kb.size,empty:Kb.empty,each:Kb.each,on:function(e,n){var t=this._id;return arguments.length<2?Mb(this.node(),t).on.on(e):this.each(function(e,n,t){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||"start"===e}))}(n)?Nb:Cb;return function(){var a=i(this,e),u=a.on;u!==r&&(o=(r=u).copy()).on(n,t),a.on=o}}(t,e,n))},attr:function(e,n){var t=Sy(e),r="transform"===t?$w:Ab;return this.attrTween(e,"function"==typeof n?(t.local?Rb:Db)(t,r,Ib(this,"attr."+e,n)):null==n?(t.local?Tb:zb)(t):(t.local?Bb:Lb)(t,r,n))},attrTween:function(e,n){var t="attr."+e;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(null==n)return this.tween(t,null);if("function"!=typeof n)throw new Error;var r=Sy(e);return this.tween(t,(r.local?Vb:Hb)(r,n))},style:function(e,n,t){var r="transform"==(e+="")?qw:Ab;return null==n?this.styleTween(e,function(e,n){var t,r,o;return function(){var i=nm(this,e),a=(this.style.removeProperty(e),nm(this,e));return i===a?null:i===t&&a===r?o:o=n(t=i,r=a)}}(e,r)).on("end.style."+e,Wb(e)):"function"==typeof n?this.styleTween(e,function(e,n,t){var r,o,i;return function(){var a=nm(this,e),u=t(this),c=u+"";return null==u&&(this.style.removeProperty(e),c=u=nm(this,e)),a===c?null:a===r&&c===o?i:(o=c,i=n(r=a,u))}}(e,r,Ib(this,"style."+e,n))).each(function(e,n){var t,r,o,i,a="style."+n,u="end."+a;return function(){var c=Cb(this,e),l=c.on,s=null==c.value[a]?i||(i=Wb(n)):void 0;l===t&&o===s||(r=(t=l).copy()).on(u,o=s),c.on=r}}(this._id,e)):this.styleTween(e,function(e,n,t){var r,o,i=t+"";return function(){var a=nm(this,e);return a===i?null:a===r?o:o=n(r=a,t)}}(e,r,n),t).on("end.style."+e,null)},styleTween:function(e,n,t){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(e,n,t){var r,o;function i(){var i=n.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,n,t){return function(r){this.style.setProperty(e,n.call(this,r),t)}}(e,i,t)),r}return i._value=n,i}(e,n,null==t?"":t))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var n=e(this);this.textContent=null==n?"":n}}(Ib(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;return this.tween(n,function(e){var n,t;function r(){var r=e.apply(this,arguments);return r!==t&&(n=(t=r)&&function(e){return function(n){this.textContent=e.call(this,n)}}(r)),n}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}(this._id))},tween:function(e,n){var t=this._id;if(e+="",arguments.length<2){for(var r,o=Mb(this.node(),t).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==n?jb:Pb)(t,e,n))},delay:function(e){var n=this._id;return arguments.length?this.each(("function"==typeof e?Yb:Xb)(n,e)):Mb(this.node(),n).delay},duration:function(e){var n=this._id;return arguments.length?this.each(("function"==typeof e?Zb:Fb)(n,e)):Mb(this.node(),n).duration},ease:function(e){var n=this._id;return arguments.length?this.each(function(e,n){if("function"!=typeof n)throw new Error;return function(){Cb(this,e).ease=n}}(n,e)):Mb(this.node(),n).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,n){return function(){var t=n.apply(this,arguments);if("function"!=typeof t)throw new Error;Cb(this,e).ease=t}}(this._id,e))},end:function(){var e,n,t=this,r=t._id,o=t.size();return new Promise((function(i,a){var u={value:a},c={value:function(){0==--o&&i()}};t.each((function(){var t=Cb(this,r),o=t.on;o!==e&&((n=(e=o).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(c)),t.on=n})),0===o&&i()}))},[Symbol.iterator]:Kb[Symbol.iterator]};var Qb={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Jb(e,n){for(var t;!(t=e.__transition)||!(t=t[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return t}Im.prototype.interrupt=function(e){return this.each((function(){Ob(this,e)}))},Im.prototype.transition=function(e){var n,t;e instanceof qb?(n=e._id,e=e._name):(n=$b(),(t=Qb).time=sb(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],c=u.length,l=0;l<c;++l)(a=u[l])&&kb(a,e,n,l,u,t||Jb(a,n));return new qb(r,this._parents,e,n)};var ex=e=>()=>e;function nx(e,{sourceEvent:n,target:t,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function tx(e,n,t){this.k=e,this.x=n,this.y=t}tx.prototype={constructor:tx,scale:function(e){return 1===e?this:new tx(this.k*e,this.x,this.y)},translate:function(e,n){return 0===e&0===n?this:new tx(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rx=new tx(1,0,0);function ox(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rx;return e.__zoom}function ix(e){e.stopImmediatePropagation()}function ax(e){e.preventDefault(),e.stopImmediatePropagation()}function ux(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function cx(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function lx(){return this.__zoom||rx}function sx(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dx(){return navigator.maxTouchPoints||"ontouchstart"in this}function fx(e,n,t){var r=e.invertX(n[0][0])-t[0][0],o=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}ox.prototype=tx.prototype;var hx,vx=function(e,n){return e.x!==n.x||e.y!==n.y||e.zoom!==n.k},px=function(e){return{x:e.x,y:e.y,zoom:e.k}},gx=function(e){var n=e.x,t=e.y,r=e.zoom;return rx.translate(n,t).scale(r)},yx=function(e,n){return e.target.closest(".".concat(n))},mx=function(e,n){return 2===n&&Array.isArray(e)&&e.includes(2)},wx=function(e,n){return void 0===n&&(n=0),"number"==typeof n&&n>0?e.transition().duration(n):e},bx=function(e){var n=e.ctrlKey&&Hv()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*n};function xx(e){var n=e.domNode,t=e.minZoom,r=e.maxZoom,o=e.translateExtent,i=e.viewport,a=e.onPanZoom,u=e.onPanZoomStart,c=e.onPanZoomEnd,l=e.onTransformChange,s=e.onDraggingChange,d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=n.getBoundingClientRect(),h=function(){var e,n,t,r=ux,o=cx,i=fx,a=sx,u=dx,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,d=eb,f=my("start","zoom","end"),h=500,v=150,p=0,g=10;function y(e){e.property("__zoom",lx).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",N).filter(u).on("touchstart.zoom",C).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(e,n){return(n=Math.max(c[0],Math.min(c[1],n)))===e.k?e:new tx(n,e.x,e.y)}function w(e,n,t){var r=n[0]-t[0]*e.k,o=n[1]-t[1]*e.k;return r===e.x&&o===e.y?e:new tx(e.k,r,o)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,t,r){e.on("start.zoom",(function(){_(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).event(r).end()})).tween("zoom",(function(){var e=this,i=arguments,a=_(e,i).event(r),u=o.apply(e,i),c=null==t?b(u):"function"==typeof t?t.apply(e,i):t,l=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=e.__zoom,f="function"==typeof n?n.apply(e,i):n,h=d(s.invert(c).concat(l/s.k),f.invert(c).concat(l/f.k));return function(e){if(1===e)e=f;else{var n=h(e),t=l/n[2];e=new tx(t,c[0]-n[0]*t,c[1]-n[1]*t)}a.zoom(null,e)}}))}function _(e,n,t){return!t&&e.__zooming||new E(e,n)}function E(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,n),this.taps=0}function S(e,...n){if(r.apply(this,arguments)){var t=_(this,n).event(e),o=this.__zoom,u=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=zm(e);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===u)return;t.mouse=[s,o.invert(s)],Ob(this),t.start()}ax(e),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),v),t.zoom("mouse",i(w(m(o,u),t.mouse[0],t.mouse[1]),t.extent,l))}}function k(e,...n){if(!t&&r.apply(this,arguments)){var o=e.currentTarget,a=_(this,n,!0).event(e),u=Am(e.view).on("mousemove.zoom",(function(e){if(ax(e),!a.moved){var n=e.clientX-s,t=e.clientY-d;a.moved=n*n+t*t>p}a.event(e).zoom("mouse",i(w(a.that.__zoom,a.mouse[0]=zm(e,o),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(e){u.on("mousemove.zoom mouseup.zoom",null),Vm(e.view,a.moved),ax(e),a.event(e).end()}),!0),c=zm(e,o),s=e.clientX,d=e.clientY;Rm(e.view),ix(e),a.mouse=[c,this.__zoom.invert(c)],Ob(this),a.start()}}function N(e,...n){if(r.apply(this,arguments)){var t=this.__zoom,a=zm(e.changedTouches?e.changedTouches[0]:e,this),u=t.invert(a),c=t.k*(e.shiftKey?.5:2),d=i(w(m(t,c),a,u),o.apply(this,n),l);ax(e),s>0?Am(this).transition().duration(s).call(x,d,a,e):Am(this).call(y.transform,d,a,e)}}function C(t,...o){if(r.apply(this,arguments)){var i,a,u,c,l=t.touches,s=l.length,d=_(this,o,t.changedTouches.length===s).event(t);for(ix(t),a=0;a<s;++a)c=[c=zm(u=l[a],this),this.__zoom.invert(c),u.identifier],d.touch0?d.touch1||d.touch0[2]===c[2]||(d.touch1=c,d.taps=0):(d.touch0=c,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(n=c[0],e=setTimeout((function(){e=null}),h)),Ob(this),d.start())}}function M(e,...n){if(this.__zooming){var t,r,o,a,u=_(this,n).event(e),c=e.changedTouches,s=c.length;for(ax(e),t=0;t<s;++t)o=zm(r=c[t],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=o);if(r=u.that.__zoom,u.touch1){var d=u.touch0[0],f=u.touch0[1],h=u.touch1[0],v=u.touch1[1],p=(p=h[0]-d[0])*p+(p=h[1]-d[1])*p,g=(g=v[0]-f[0])*g+(g=v[1]-f[1])*g;r=m(r,Math.sqrt(p/g)),o=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+v[0])/2,(f[1]+v[1])/2]}else{if(!u.touch0)return;o=u.touch0[0],a=u.touch0[1]}u.zoom("touch",i(w(r,o,a),u.extent,l))}}function O(e,...r){if(this.__zooming){var o,i,a=_(this,r).event(e),u=e.changedTouches,c=u.length;for(ix(e),t&&clearTimeout(t),t=setTimeout((function(){t=null}),h),o=0;o<c;++o)i=u[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=zm(i,this),Math.hypot(n[0]-i[0],n[1]-i[1])<g)){var l=Am(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return y.transform=function(e,n,t,r){var o=e.selection?e.selection():e;o.property("__zoom",lx),e!==o?x(e,n,t,r):o.interrupt().each((function(){_(this,arguments).event(r).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},y.scaleBy=function(e,n,t,r){y.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)}),t,r)},y.scaleTo=function(e,n,t,r){y.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==t?b(e):"function"==typeof t?t.apply(this,arguments):t,u=r.invert(a),c="function"==typeof n?n.apply(this,arguments):n;return i(w(m(r,c),a,u),e,l)}),t,r)},y.translateBy=function(e,n,t,r){y.transform(e,(function(){return i(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof t?t.apply(this,arguments):t),o.apply(this,arguments),l)}),null,r)},y.translateTo=function(e,n,t,r,a){y.transform(e,(function(){var e=o.apply(this,arguments),a=this.__zoom,u=null==r?b(e):"function"==typeof r?r.apply(this,arguments):r;return i(rx.translate(u[0],u[1]).scale(a.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof t?-t.apply(this,arguments):-t),e,l)}),r,a)},E.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,n){return this.mouse&&"mouse"!==e&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var n=Am(this.that).datum();f.call(e,this.that,new nx(e,{sourceEvent:this.sourceEvent,target:y,type:e,transform:this.that.__zoom,dispatch:f}),n)}},y.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:ex(+e),y):a},y.filter=function(e){return arguments.length?(r="function"==typeof e?e:ex(!!e),y):r},y.touchable=function(e){return arguments.length?(u="function"==typeof e?e:ex(!!e),y):u},y.extent=function(e){return arguments.length?(o="function"==typeof e?e:ex([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),y):o},y.scaleExtent=function(e){return arguments.length?(c[0]=+e[0],c[1]=+e[1],y):[c[0],c[1]]},y.translateExtent=function(e){return arguments.length?(l[0][0]=+e[0][0],l[1][0]=+e[1][0],l[0][1]=+e[0][1],l[1][1]=+e[1][1],y):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},y.constrain=function(e){return arguments.length?(i=e,y):i},y.duration=function(e){return arguments.length?(s=+e,y):s},y.interpolate=function(e){return arguments.length?(d=e,y):d},y.on=function(){var e=f.on.apply(f,arguments);return e===f?y:e},y.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,y):Math.sqrt(p)},y.tapDistance=function(e){return arguments.length?(g=+e,y):g},y}().scaleExtent([t,r]).translateExtent(o),v=Am(n).call(h);w({x:i.x,y:i.y,zoom:Ov(i.zoom,t,r)},[[0,0],[f.width,f.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(e,n){v&&(null==h||h.transform(wx(v,null==n?void 0:n.duration),e))}function m(){h.on("zoom",null)}function w(e,n,t){var r=gx(e),o=null==h?void 0:h.constrain()(r,n,t);return o&&y(o),o}return h.wheelDelta(bx),{update:function(e){var n=e.noWheelClassName,t=e.noPanClassName,r=e.onPaneContextMenu,o=e.userSelectionActive,i=e.panOnScroll,f=e.panOnDrag,y=e.panOnScrollMode,w=e.panOnScrollSpeed,b=e.preventScrolling,x=e.zoomOnPinch,_=e.zoomOnScroll,E=e.zoomOnDoubleClick,S=e.zoomActivationKeyPressed,k=e.lib;o&&!d.isZoomingOrPanning&&m();var N=!i||S||o?function(e){var n=e.noWheelClassName,t=e.preventScrolling,r=e.d3ZoomHandler;return function(e,o){if(!t&&"wheel"===e.type&&!e.ctrlKey||yx(e,n))return null;e.preventDefault(),r.call(this,e,o)}}({noWheelClassName:n,preventScrolling:b,d3ZoomHandler:p}):function(e){var n=e.zoomPanValues,t=e.noWheelClassName,r=e.d3Selection,o=e.d3Zoom,i=e.panOnScrollMode,a=e.panOnScrollSpeed,u=e.zoomOnPinch,c=e.onPanZoomStart,l=e.onPanZoom,s=e.onPanZoomEnd;return function(e){if(yx(e,t))return!1;e.preventDefault(),e.stopImmediatePropagation();var d=r.property("__zoom").k||1;if(e.ctrlKey&&u){var f=zm(e),h=bx(e),v=d*Math.pow(2,h);o.scaleTo(r,v,f,e)}else{var p=1===e.deltaMode?20:1,g=i===Wv.Vertical?0:e.deltaX*p,y=i===Wv.Horizontal?0:e.deltaY*p;!Hv()&&e.shiftKey&&i!==Wv.Vertical&&(g=e.deltaY*p,y=0),o.translateBy(r,-g/d*a,-y/d*a,{internal:!0});var m=px(r.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling||(n.isPanScrolling=!0,null==c||c(e,m)),n.isPanScrolling&&(null==l||l(e,m),n.panScrollTimeout=setTimeout((function(){null==s||s(e,m),n.isPanScrolling=!1}),150))}}}({zoomPanValues:d,noWheelClassName:n,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:w,zoomOnPinch:x,onPanZoomStart:u,onPanZoom:a,onPanZoomEnd:c});if(v.on("wheel.zoom",N,{passive:!1}),!o){var C=function(e){var n=e.zoomPanValues,t=e.onDraggingChange,r=e.onPanZoomStart;return function(e){var o,i,a;if(!(null===(o=e.sourceEvent)||void 0===o?void 0:o.internal)){var u=px(e.transform);n.mouseButton=(null===(i=e.sourceEvent)||void 0===i?void 0:i.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=u,"mousedown"===(null===(a=e.sourceEvent)||void 0===a?void 0:a.type)&&t(!0),r&&(null==r||r(e.sourceEvent,u))}}}({zoomPanValues:d,onDraggingChange:s,onPanZoomStart:u});h.on("start",C);var M=function(e){var n=e.zoomPanValues,t=e.panOnDrag,r=e.onPaneContextMenu,o=e.onTransformChange,i=e.onPanZoom;return function(e){var a,u,c;n.usedRightMouseButton=!(!r||!mx(t,null!==(a=n.mouseButton)&&void 0!==a?a:0)),(null===(u=e.sourceEvent)||void 0===u?void 0:u.sync)||o([e.transform.x,e.transform.y,e.transform.k]),i&&!(null===(c=e.sourceEvent)||void 0===c?void 0:c.internal)&&(null==i||i(e.sourceEvent,px(e.transform)))}}({zoomPanValues:d,panOnDrag:f,onPaneContextMenu:!!r,onPanZoom:a,onTransformChange:l});h.on("zoom",M);var O=function(e){var n=e.zoomPanValues,t=e.panOnDrag,r=e.panOnScroll,o=e.onDraggingChange,i=e.onPanZoomEnd,a=e.onPaneContextMenu;return function(e){var u,c;if(!(null===(u=e.sourceEvent)||void 0===u?void 0:u.internal)&&(n.isZoomingOrPanning=!1,a&&mx(t,null!==(c=n.mouseButton)&&void 0!==c?c:0)&&!n.usedRightMouseButton&&e.sourceEvent&&a(e.sourceEvent),n.usedRightMouseButton=!1,o(!1),i&&vx(n.prevViewport,e.transform))){var l=px(e.transform);n.prevViewport=l,clearTimeout(n.timerId),n.timerId=setTimeout((function(){null==i||i(e.sourceEvent,l)}),r?150:0)}}}({zoomPanValues:d,panOnDrag:f,panOnScroll:i,onPaneContextMenu:r,onPanZoomEnd:c,onDraggingChange:s});h.on("end",O)}var j=function(e){var n=e.zoomActivationKeyPressed,t=e.zoomOnScroll,r=e.zoomOnPinch,o=e.panOnDrag,i=e.panOnScroll,a=e.zoomOnDoubleClick,u=e.userSelectionActive,c=e.noWheelClassName,l=e.noPanClassName,s=e.lib;return function(e){var d=n||t,f=r&&e.ctrlKey;if(1===e.button&&"mousedown"===e.type&&(yx(e,"".concat(s,"-flow__node"))||yx(e,"".concat(s,"-flow__edge"))))return!0;if(!(o||d||i||a||r))return!1;if(u)return!1;if(yx(e,c)&&"wheel"===e.type)return!1;if(yx(e,l)&&("wheel"!==e.type||i&&"wheel"===e.type&&!n))return!1;if(!r&&e.ctrlKey&&"wheel"===e.type)return!1;if(!d&&!i&&!f&&"wheel"===e.type)return!1;if(!o&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(o)&&!o.includes(e.button)&&"mousedown"===e.type)return!1;var h=Array.isArray(o)&&o.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&h}}({zoomActivationKeyPressed:S,panOnDrag:f,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:x,userSelectionActive:o,noPanClassName:t,noWheelClassName:n,lib:k});h.filter(j),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(e,n){var t=gx(e);return y(t,n),t},setViewportConstrained:w,getViewport:function(){var e=v?ox(v.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,n){v&&(null==h||h.scaleTo(wx(v,null==n?void 0:n.duration),e))},scaleBy:function(e,n){v&&(null==h||h.scaleBy(wx(v,null==n?void 0:n.duration),e))},setScaleExtent:function(e){null==h||h.scaleExtent(e)},setTranslateExtent:function(e){null==h||h.translateExtent(e)},syncViewport:function(e){if(v){var n=gx(e),t=v.property("__zoom");t.k===e.zoom&&t.x===e.x&&t.y===e.y||null==h||h.transform(v,n,null,{sync:!0})}}}}!function(e){e.Line="line",e.Handle="handle"}(hx||(hx={}));Z(Z({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var _x=yv.error001();function Ex(e,n){var r=t(Y);if(null===r)throw new Error(_x);return V(r,e,n)}function Sx(){var e=t(Y);if(null===e)throw new Error(_x);return r((function(){return{getState:e.getState,setState:e.setState,subscribe:e.subscribe}}),[e])}function kx(e,n){var t,r,o;void 0===n&&(n={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var i=(null==n?void 0:n.elevateNodesOnSelect)?1e3:0;try{for(var a=g(e),u=a.next();!u.done;u=a.next()){var c=y(u.value,2)[1],l=c.parentId;if(l){if(!e.has(l))throw new Error("Parent node ".concat(l," not found"));var s=e.get(l),d=Nx(c,e,f(f({},c.position),{z:(zx(c.zIndex)?c.zIndex:0)+(c.selected?i:0)}),null!==(o=null==s?void 0:s.origin)&&void 0!==o?o:n.nodeOrigin),h=d.x,v=d.y,p=d.z,m=c.internals.positionAbsolute,w=h!==m.x||v!==m.y;(w||p!==c.internals.z)&&(c.internals=f(f({},c.internals),{positionAbsolute:w?{x:h,y:v}:m,z:p}))}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}function Nx(e,n,t,r){var o,i,a,u,c,l;if(void 0===r&&(r=[0,0]),!e.parentId)return t;var s=n.get(e.parentId),d=Cx(s,r).position;return Nx(s,n,{x:(null!==(o=t.x)&&void 0!==o?o:0)+d.x,y:(null!==(i=t.y)&&void 0!==i?i:0)+d.y,z:(null!==(a=s.internals.z)&&void 0!==a?a:0)>(null!==(u=t.z)&&void 0!==u?u:0)?null!==(c=s.internals.z)&&void 0!==c?c:0:null!==(l=t.z)&&void 0!==l?l:0},s.origin||r)}var Cx=function(e,n){void 0===n&&(n=[0,0]);var t=Ax(e),r=t.width,o=t.height,i="internals"in e?e.internals.positionAbsolute:e.position,a=e.origin||n,u=r*a[0],c=o*a[1];return{position:{x:e.position.x-u,y:e.position.y-c},positionAbsolute:{x:i.x-u,y:i.y-c}}};function Mx(e,n,t){var r,o;e.clear(),n.clear();try{for(var i=g(t),a=i.next();!a.done;a=i.next()){var u=a.value,c=u.source,l=u.target,s=u.sourceHandle,d=void 0===s?null:s,f=u.targetHandle,h=void 0===f?null:f,v="".concat(c,"-source-").concat(d),p="".concat(l,"-target-").concat(h),y=e.get(v)||new Map,m=e.get(p)||new Map,w={edgeId:u.id,source:c,target:l,sourceHandle:d,targetHandle:h};n.set(u.id,u),e.set(v,y.set("".concat(l,"-").concat(h),w)),e.set(p,m.set("".concat(c,"-").concat(d),w))}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}function Ox(e,n,t,r){void 0===r&&(r={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var o=new Map(n);n.clear(),t.clear();var i=(null==r?void 0:r.elevateNodesOnSelect)?1e3:0;e.forEach((function(e){var a,u,c=o.get(e.id);if(r.checkEquality&&e===(null==c?void 0:c.internals.userNode)||(c=f(f(f({},r.defaults),e),{measured:{width:null===(a=e.measured)||void 0===a?void 0:a.width,height:null===(u=e.measured)||void 0===u?void 0:u.height},internals:{positionAbsolute:e.position,handleBounds:null==c?void 0:c.internals.handleBounds,z:(zx(e.zIndex)?e.zIndex:0)+(e.selected?i:0),userNode:e}})),n.set(e.id,c),e.parentId){var l=t.get(e.parentId);l?l.push(c):t.set(e.parentId,[c])}})),t.size>0&&kx(n,r)}function jx(e,n,t,r){var o,i,a,u,c,l=[],s=new Map;try{for(var d=g(e),f=d.next();!f.done;f=d.next()){var h=f.value,v=n.get(h.parentId);if(v){var p=null!==(u=null===(a=s.get(h.parentId))||void 0===a?void 0:a.expandedRect)&&void 0!==u?u:Bx(v,null!==(c=v.origin)&&void 0!==c?c:r),y=Hx(p,h.rect);s.set(h.parentId,{expandedRect:y,parent:v})}}}catch(e){o={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}return s.size>0&&s.forEach((function(n,r){var o=n.expandedRect,i=n.parent,a=Cx(i,i.origin).position,u=Ax(i),c=o.x<a.x?Math.round(Math.abs(a.x-o.x)):0,s=o.y<a.y?Math.round(Math.abs(a.y-o.y)):0;if(c>0||s>0){l.push({id:r,type:"position",position:{x:a.x-c,y:a.y-s}});var d=t.get(r);null==d||d.forEach((function(n){e.some((function(e){return e.id===n.id}))||l.push({id:n.id,type:"position",position:{x:n.position.x+c,y:n.position.y+s}})}))}(u.width<o.width||u.height<o.height)&&l.push({id:r,type:"dimensions",setAttributes:!0,dimensions:{width:Math.max(u.width,Math.round(o.width)),height:Math.max(u.height,Math.round(o.height))}})})),l}var Px=function(e,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),Math.min(Math.max(e,n),t)},Ix=function(e,n){return void 0===e&&(e={x:0,y:0}),{x:Px(e.x,n[0][0],n[1][0]),y:Px(e.y,n[0][1],n[1][1])}};function Ax(e){var n,t,r,o,i,a,u,c;return{width:null!==(o=null!==(r=null!==(t=null===(n=e.measured)||void 0===n?void 0:n.width)&&void 0!==t?t:e.width)&&void 0!==r?r:e.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(u=null!==(a=null===(i=e.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:e.height)&&void 0!==u?u:e.initialHeight)&&void 0!==c?c:0}}var zx=function(e){return!isNaN(e)&&isFinite(e)},Tx=function(e,n){return void 0===n&&(n=[1,1]),{x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}},Lx=function(e,n,t,r){var o=e.x,i=e.y,a=y(n,3),u=a[0],c=a[1],l=a[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var s={x:(o-u)/l,y:(i-c)/l};return t?Tx(s,r):s},Bx=function(e,n){var t,r,o,i,a,u;void 0===n&&(n=[0,0]);var c=Cx(e,n).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(t=e.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:e.width)&&void 0!==o?o:0,height:null!==(u=null!==(a=null===(i=e.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:e.height)&&void 0!==u?u:0}},Dx=function(e,n){return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}},Rx=function(e){var n=e.x,t=e.y;return{x:n,y:t,x2:n+e.width,y2:t+e.height}},Vx=function(e){var n=e.x,t=e.y;return{x:n,y:t,width:e.x2-n,height:e.y2-t}},Hx=function(e,n){return Vx(Dx(Rx(e),Rx(n)))};function Yx(e){return o(e)}var Xx=function(e,n){var t=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),r=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(t*r)},Zx=function(e,n,t,r,o,i){var a=n/(e.width*(1+i)),u=t/(e.height*(1+i)),c=Math.min(a,u),l=Px(c,r,o);return{x:n/2-(e.x+e.width/2)*l,y:t/2-(e.y+e.height/2)*l,zoom:l}};function Fx(e){return void 0!==e&&"parent"!==e}var Ux=function(e){var n=e.x,t=e.y,r=e.width,o=e.height,i=e.origin,a=void 0===i?[0,0]:i;return!r||!o||a[0]<0||a[1]<0||a[0]>1||a[1]>1?{x:n,y:t}:{x:n-r*a[0],y:t-o*a[1]}},Wx=function(e){return Gx(e)},Gx=function(e){return"id"in e&&"position"in e&&!("source"in e)&&!("target"in e)};var qx=function(e){return zx(e.width)&&zx(e.height)&&zx(e.x)&&zx(e.y)},$x=function(e){return{width:e.offsetWidth,height:e.offsetHeight}},Kx=["INPUT","SELECT","TEXTAREA"];function Qx(e){var n,t,r=(null===(t=null===(n=e.composedPath)||void 0===n?void 0:n.call(e))||void 0===t?void 0:t[0])||e.target;return Kx.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var Jx=function(e){return"clientX"in e},e_=function(e,n){var t,r,o,i,a=Jx(e),u=a?e.clientX:null===(t=e.touches)||void 0===t?void 0:t[0].clientX,c=a?e.clientY:null===(r=e.touches)||void 0===r?void 0:r[0].clientY;return{x:u-(null!==(o=null==n?void 0:n.left)&&void 0!==o?o:0),y:c-(null!==(i=null==n?void 0:n.top)&&void 0!==i?i:0)}},n_=function(e,n,t,r){void 0===r&&(r=[0,0]);var o=n.querySelectorAll(e);if(!o||!o.length)return null;var i=Array.from(o),a=n.getBoundingClientRect(),u=a.width*r[0],c=a.height*r[1];return i.map((function(e){var n=e.getBoundingClientRect();return f({id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(n.left-a.left-u)/t,y:(n.top-a.top-c)/t},$x(e))}))},t_="undefined"!=typeof document?document:null;function r_(e,n){void 0===e&&(e=null),void 0===n&&(n={target:t_,actInsideInputWithModifier:!0});var t=y(i(!1),2),o=t[0],c=t[1],l=a(!1),s=a(new Set([])),d=y(r((function(){if(null!==e){var n=(Array.isArray(e)?e:[e]).filter((function(e){return"string"==typeof e})).map((function(e){return e.split("+")})),t=n.reduce((function(e,n){return e.concat.apply(e,m([],y(n),!1))}),[]);return[n,t]}return[[],[]]}),[e]),2),f=d[0],h=d[1];return u((function(){var t=(null==n?void 0:n.target)||t_;if(null!==e){var r=function(e){if(l.current=e.ctrlKey||e.metaKey||e.shiftKey,(!l.current||l.current&&!n.actInsideInputWithModifier)&&Qx(e))return!1;var t=i_(e.code,h);s.current.add(e[t]),o_(f,s.current,!1)&&(e.preventDefault(),c(!0))},o=function(e){if((!l.current||l.current&&!n.actInsideInputWithModifier)&&Qx(e))return!1;var t=i_(e.code,h);o_(f,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(e[t]),"Meta"===e.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)}}}),[e,c]),o}function o_(e,n,t){return e.filter((function(e){return t||e.length===n.size})).some((function(e){return e.every((function(e){return n.has(e)}))}))}function i_(e,n){return n.includes(e)?"code":"key"}function a_(e,n){if(Object.is(e,n))return!0;if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[t,r]of e)if(!Object.is(r,n.get(t)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}var u_={position:"absolute",width:"100%",height:"100%",top:0,left:0};var c_=function(e){return{userSelectionActive:e.userSelectionActive,lib:e.lib}};function l_(e){var n=e.onPaneContextMenu,t=e.zoomOnScroll,r=void 0===t||t,o=e.zoomOnPinch,i=void 0===o||o,c=e.panOnScroll,l=void 0!==c&&c,s=e.panOnScrollSpeed,d=void 0===s?.5:s,f=e.panOnScrollMode,h=void 0===f?Wv.Free:f,v=e.zoomOnDoubleClick,p=void 0===v||v,g=e.panOnDrag,y=void 0===g||g,m=e.defaultViewport,w=e.translateExtent,b=e.zoomActivationKeyCode,x=e.preventScrolling,_=void 0===x||x,E=e.children,k=e.noWheelClassName,N=e.noPanClassName,C=e.onViewportChange,M=e.isControlledViewport,O=Sx(),j=a(null),P=Ex(c_,a_),I=P.userSelectionActive,A=P.lib,z=r_(b),T=a();return function(e){var n=Sx();u((function(){var t=function(){var t,r;if(!e.current)return!1;var o=$x(e.current);0!==o.height&&0!==o.width||null===(r=(t=n.getState()).onError)||void 0===r||r.call(t,"004",yv.error004()),n.setState({width:o.width||500,height:o.height||500})};if(e.current){t(),window.addEventListener("resize",t);var r=new ResizeObserver((function(){return t()}));return r.observe(e.current),function(){window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}}),[])}(j),u((function(){if(j.current){var e=O.getState();T.current=xx({domNode:j.current,minZoom:e.minZoom,maxZoom:e.maxZoom,translateExtent:w,viewport:m,onTransformChange:function(e){null==C||C({x:e[0],y:e[1],zoom:e[2]}),M||O.setState({transform:e})},onDraggingChange:function(e){return O.setState({paneDragging:e})},onPanZoomStart:function(e,n){var t=O.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(e,n),null==r||r(n)},onPanZoom:function(e,n){var t=O.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(e,n),null==r||r(n)},onPanZoomEnd:function(e,n){var t=O.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(e,n),null==r||r(n)}});var n=T.current.getViewport(),t=n.x,r=n.y,o=n.zoom;return O.setState({panZoom:T.current,transform:[t,r,o],domNode:j.current.closest(".ink-flow")}),function(){var e;null===(e=T.current)||void 0===e||e.destroy()}}}),[]),u((function(){var e;null===(e=T.current)||void 0===e||e.update({onPaneContextMenu:n,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:d,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:_,noPanClassName:N,userSelectionActive:I,noWheelClassName:k,lib:A})}),[n,r,i,l,d,h,p,y,z,_,N,I,k,A]),S.jsx("div",{className:"ink-flow__renderer",ref:j,style:u_,children:E})}var s_={actInsideInputWithModifier:!1};function d_(e,n){switch(e.type){case"select":n.selected=e.selected;break;case"position":void 0!==e.position&&(n.position=e.position),void 0!==e.dragging&&(n.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(n.measured={width:e.dimensions.width,height:e.dimensions.height},e.setAttributes&&(n.width=e.dimensions.width,n.height=e.dimensions.height)),"boolean"==typeof e.resizing&&(n.resizing=e.resizing)}}function f_(e,n){var t,r,o,i,a,u,c=[],l=new Map;try{for(var s=g(e),d=s.next();!d.done;d=s.next()){if("add"!==(_=d.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(e){t={error:e}}finally{try{d&&!d.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}try{for(var v=g(n),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=f({},y);try{for(var b=(a=void 0,g(m)),x=b.next();!x.done;x=b.next()){var _;d_(_=x.value,w)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(a)throw a.error}}c.push(w)}else c.push(f({},m[0].item))}else c.push(y)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return c}function h_(e,n){return f_(e,n)}function v_(e,n){return f_(e,n)}function p_(e,n){return{id:e,type:"select",selected:n}}function g_(e,n,t){var r,o;void 0===n&&(n=new Set),void 0===t&&(t=!1);var i=[];try{for(var a=g(e),u=a.next();!u.done;u=a.next()){var c=y(u.value,2),l=c[0],s=c[1],d=n.has(l);void 0===s.selected&&!d||s.selected===d||(t&&(s.selected=d),i.push(p_(s.id,d)))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}function y_(e){var n,t,r,o,i,a,u=e.items,c=void 0===u?[]:u,l=e.lookup,s=[],d=new Map(c.map((function(e){return[e.id,e]})));try{for(var f=g(c),h=f.next();!h.done;h=f.next()){var v=h.value,p=l.get(v.id),m=null!==(a=null===(i=null==p?void 0:p.internals)||void 0===i?void 0:i.userNode)&&void 0!==a?a: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(e){n={error:e}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(n)throw n.error}}try{for(var w=g(l),b=w.next();!b.done;b=w.next()){var x=y(b.value,1)[0];void 0===d.get(x)&&s.push({id:x,type:"remove"})}}catch(e){r={error:e}}finally{try{b&&!b.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}function m_(e){return{id:e.id,type:"remove"}}var w_=function(e,n){void 0===n&&(n=[0,0]);var t=Ax(e),r=t.width,o=t.height,i="internals"in e?e.internals.positionAbsolute:e.position,a=e.origin||n,u=r*a[0],c=o*a[1];return{position:{x:e.position.x-u,y:e.position.y-c},positionAbsolute:{x:i.x-u,y:i.y-c}}},b_=function(e,n){if(void 0===n&&(n={nodeOrigin:[0,0]}),0===e.length)return{x:0,y:0,width:0,height:0};var t=e.reduce((function(e,t){var r=function(e,n){var t,r,o,i,a,u;void 0===n&&(n=[0,0]);var c=Cx(e,n).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=e.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:e.width)&&void 0!==o?o:0),y2:s+(null!==(u=null!==(a=null===(i=e.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:e.height)&&void 0!==u?u:0)}}(t,n.nodeOrigin);return Dx(e,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Vx(t)},x_=function(e,n,t,r,o,i){var a,u,c,l,s,d,h,v,p=y(void 0===t?[0,0,1]:t,3),m=p[0],w=p[1],b=p[2];void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=[0,0]);var x=f(f({},Lx(n,[m,w,b])),{width:n.width/b,height:n.height/b}),_=[];try{for(var E=g(e),S=E.next();!S.done;S=E.next()){var k=y(S.value,2)[1],N=k.measured,C=k.selectable,M=void 0===C||C,O=k.hidden,j=void 0!==O&&O,P=null!==(s=null!==(l=null!==(c=N.width)&&void 0!==c?c:k.width)&&void 0!==l?l:k.initialWidth)&&void 0!==s?s:null,I=null!==(v=null!==(h=null!==(d=N.height)&&void 0!==d?d:k.height)&&void 0!==h?h:k.initialHeight)&&void 0!==v?v:null;if(!(o&&!M||j)){var A=Xx(x,Bx(k,i));(null===P||null===I||r&&A>0||A>=(null!=P?P:0)*(null!=I?I:0)||k.dragging)&&_.push(k)}}}catch(e){a={error:e}}finally{try{S&&!S.done&&(u=E.return)&&u.call(E)}finally{if(a)throw a.error}}return _},__=function(e,n){var t=new Set;return e.forEach((function(e){t.add(e.id)})),n.filter((function(e){return t.has(e.source)||t.has(e.target)}))};function E_(e,n){var t,r,o,i=e.nodeLookup,a=e.width,u=e.height,c=e.panZoom,l=e.minZoom,s=e.maxZoom,d=e.nodeOrigin,f=void 0===d?[0,0]:d,h=[],v=(null==n?void 0:n.nodes)?new Set(n.nodes.map((function(e){return e.id}))):null;if(i.forEach((function(e){!(e.measured.width&&e.measured.height&&((null==n?void 0:n.includeHiddenNodes)||!e.hidden))||v&&!v.has(e.id)||h.push(e)})),h.length>0){var p=b_(h,{nodeOrigin:f}),g=p.width>=a||p.height>=u;if("overflow"===(null==n?void 0:n.when)&&!g)return!0;var y=Zx(p,a,u,null!==(t=null==n?void 0:n.minZoom)&&void 0!==t?t:l,null!==(r=null==n?void 0:n.maxZoom)&&void 0!==r?r:s,null!==(o=null==n?void 0:n.padding)&&void 0!==o?o:.1);return c.setViewport(y,{duration:null==n?void 0:n.duration}),!0}return!1}function S_(e){var n=e.nodeId,t=e.nextPosition,r=e.nodeLookup,o=e.nodeOrigin,i=void 0===o?[0,0]:o,a=e.nodeExtent,u=e.onError,c=r.get(n),l=c.parentId?r.get(c.parentId):void 0,s=l?w_(l,l.origin||i).positionAbsolute:{x:0,y:0},d=s.x,f=s.y,h=function(e,n){var t,r,o,i;return n&&"parent"!==n?[n[0],[n[1][0]-(null!==(r=null===(t=e.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),n[1][1]-(null!==(i=null===(o=e.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:n}(c,c.extent||a);if("parent"!==c.extent||c.expandParent)l&&Fx(c.extent)&&(h=[[c.extent[0][0]+d,c.extent[0][1]+f],[c.extent[1][0]+d,c.extent[1][1]+f]]);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=d+v*m[0],b=f+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==u||u("005",yv.error005());var x=Fx(h)?Ix(t,h):t;return{position:{x:x.x-d,y:x.y-f},positionAbsolute:x}}function k_(e){return v(this,arguments,void 0,(function(e){var n,t,r,o,i,a,u,c,l,s,d,f,h,v,y,m,w,b,x,_=e.nodesToRemove,E=void 0===_?[]:_,S=e.edgesToRemove,k=void 0===S?[]:S,N=e.nodes,C=e.edges,M=e.onBeforeDelete;return p(this,(function(e){switch(e.label){case 0:n=new Set(E.map((function(e){return e.id}))),t=[],r=function(e){if(!1===e.deletable)return"continue";var r=n.has(e.id),o=!r&&e.parentId&&t.find((function(n){return n.id===e.parentId}));(r||o)&&t.push(e)};try{for(o=g(N),i=o.next();!i.done;i=o.next())a=i.value,r(a)}catch(e){m={error:e}}finally{try{i&&!i.done&&(w=o.return)&&w.call(o)}finally{if(m)throw m.error}}u=new Set(k.map((function(e){return e.id}))),c=C.filter((function(e){return!1!==e.deletable})),l=__(t,c),s=l,d=function(e){u.has(e.id)&&!s.find((function(n){return n.id===e.id}))&&s.push(e)};try{for(f=g(c),h=f.next();!h.done;h=f.next())v=h.value,d(v)}catch(e){b={error:e}}finally{try{h&&!h.done&&(x=f.return)&&x.call(f)}finally{if(b)throw b.error}}return M?[4,M({nodes:t,edges:s})]:[2,{edges:s,nodes:t}];case 1:return"boolean"==typeof(y=e.sent())?[2,y?{edges:s,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var N_=function(e){return{userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect}};function C_(){var e=Ex(N_,a_),n=e.userSelectionActive,t=e.userSelectionRect;return n&&t?S.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 M_=function(e,n){return function(t){t.target===n.current&&(null==e||e(t))}},O_=function(e){return{userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}};function j_(e){var n=e.isSelecting;e.selectionMode;var t=e.panOnDrag,r=e.onSelectionStart,o=e.onSelectionEnd,i=e.onPaneClick,u=e.onPaneContextMenu,c=e.onPaneScroll,l=e.onPaneMouseEnter,s=e.onPaneMouseMove,d=e.onPaneMouseLeave,f=e.children,h=a(null),v=Sx(),p=a(0),m=a(0),w=a(),b=a(new Map),x=Ex(O_,a_),_=x.userSelectionActive,E=x.elementsSelectable,k=x.dragging,N=function(){v.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},C=function(e){null==i||i(e),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},M=c?function(e){return c(e)}:void 0,j=E&&(n||_);return S.jsxs("div",{className:O(["ink-flow__pane",{draggable:t,dragging:k,selection:n}]),onClick:j?void 0:M_(C,h),onContextMenu:M_((function(e){Array.isArray(t)&&(null==t?void 0:t.includes(2))?e.preventDefault():null==u||u(e)}),h),onWheel:M_(M,h),onMouseEnter:j?void 0:l,onMouseDown:j?function(e){var t,o,i,a,u=v.getState(),c=u.resetSelectedElements,l=u.domNode,s=u.edgeLookup;if(w.current=null==l?void 0:l.getBoundingClientRect(),E&&n&&0===e.button&&e.target===h.current&&w.current){b.current=new Map;try{for(var d=g(s),f=d.next();!f.done;f=d.next()){var p=y(f.value,2),m=p[0],x=p[1];b.current.set(x.source,(null===(i=b.current.get(x.source))||void 0===i?void 0:i.add(m))||new Set([m])),b.current.set(x.target,(null===(a=b.current.get(x.target))||void 0===a?void 0:a.add(m))||new Set([m]))}}catch(e){t={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(t)throw t.error}}var _=e_(e.nativeEvent,w.current),S=_.x,k=_.y;c(),v.setState({userSelectionRect:{width:0,height:0,startX:S,startY:k,x:S,y:k}}),null==r||r(e)}}:void 0,onMouseMove:j?function(e){var t,r,o,i,a=v.getState(),u=a.userSelectionRect,c=a.edgeLookup,l=a.transform,s=a.nodeOrigin,d=a.nodeLookup,f=a.triggerNodeChanges,h=a.triggerEdgeChanges;if(n&&w.current&&u){var y=e_(e.nativeEvent,w.current),x=y.x,_=y.y,E=u.startX,S=u.startY,k={startX:E,startY:S,x:x<E?x:E,y:_<S?_:S,width:Math.abs(x-E),height:Math.abs(_-S)},N=x_(d,k,l,!1,!0,s),C=new Set,M=new Set;try{for(var O=g(N),j=O.next();!j.done;j=O.next()){var P=j.value;M.add(P.id);var I=b.current.get(P.id);if(I)try{for(var A=(o=void 0,g(I)),z=A.next();!z.done;z=A.next()){var T=z.value;C.add(T)}}catch(e){o={error:e}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(e){t={error:e}}finally{try{j&&!j.done&&(r=O.return)&&r.call(O)}finally{if(t)throw t.error}}if(p.current!==M.size)p.current=M.size,f(g_(d,M,!0));if(m.current!==C.size)m.current=C.size,h(g_(c,C));v.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:s,onMouseUp:j?function(e){if(0===e.button){var n=v.getState().userSelectionRect;!_&&n&&e.target===h.current&&(null==C||C(e)),v.setState({nodesSelectionActive:p.current>0}),N(),null==o||o(e)}}:void 0,onMouseLeave:j?function(e){_&&(v.setState({nodesSelectionActive:p.current>0}),null==o||o(e)),N()}:d,ref:h,style:u_,children:[f,S.jsx(C_,{})]})}var P_=function(e){return{nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive}};function I_(e){var n=e.children,t=e.onPaneClick,r=e.onPaneMouseEnter,o=e.onPaneMouseMove,i=e.onPaneMouseLeave,a=e.onPaneContextMenu,c=e.onPaneScroll,l=e.deleteKeyCode,s=e.selectionKeyCode,d=e.selectionOnDrag,f=e.selectionMode,h=e.onSelectionStart,v=e.onSelectionEnd,p=e.multiSelectionKeyCode,g=e.panActivationKeyCode,y=e.zoomActivationKeyCode,m=e.elementsSelectable,w=e.zoomOnScroll,b=e.zoomOnPinch,x=e.panOnScroll,_=e.panOnScrollSpeed,E=e.panOnScrollMode,k=e.zoomOnDoubleClick,N=e.panOnDrag,C=e.defaultViewport,M=e.translateExtent,O=e.minZoom,j=e.maxZoom,P=e.preventScrolling;e.onSelectionContextMenu;var I=e.noWheelClassName,A=e.noPanClassName;e.disableKeyboardA11y;var z=e.onViewportChange,T=e.isControlledViewport,L=Ex(P_);L.nodesSelectionActive;var B=L.userSelectionActive,D=r_(s),R=r_(g),V=R||N,H=R||x,Y=D||B||d&&!0!==V;return function(e){var n=e.deleteKeyCode,t=e.multiSelectionKeyCode,r=Sx(),o=r_(n,s_),i=r_(t);u((function(){if(o){var e=r.getState();e.edges,e.nodes,r.setState({nodesSelectionActive:!1})}}),[o]),u((function(){r.setState({multiSelectionActive:i})}),[i])}({deleteKeyCode:l,multiSelectionKeyCode:p}),S.jsx(l_,{onPaneContextMenu:a,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:_,panOnScrollMode:E,zoomOnDoubleClick:k,panOnDrag:!D&&V,defaultViewport:C,translateExtent:M,minZoom:O,maxZoom:j,zoomActivationKeyCode:y,preventScrolling:P,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:T,children:S.jsx(j_,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:f,children:n})})}I_.displayName="FlowRenderer";var A_=c(I_);function z_(e){var n=y(i(e),2),t=n[0],r=n[1],o=l((function(e){return r((function(n){return h_(e,n)}))}),[]);return[t,r,o]}var T_={x:0,y:0,zoom:1},L_={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},B_={dagre:fp};function D_(e){var n=y(i(e),2),t=n[0],r=n[1],o=Sx(),a=l((function(e){var n=o.getState(),t=n.nodeOrigin,r=n.width,i=n.height,a=n.fitViewDone,u=n.panZoom,c=n.fitViewOnInit,l=n.minZoom,s=n.maxZoom,d=n.fitViewOnInitOptions;if(c&&!a&&u){var f=new Map;e.forEach((function(e){f.set(e.id,e)}));var h=E_({nodeLookup:f,width:r,height:i,panZoom:u,nodeOrigin:t,minZoom:l,maxZoom:s},d);o.setState({fitViewDone:h})}}),[o]),u=l((function(e){var n=o.getState(),t=n.fitViewDone,r=n.centered,i=n.centerConfig,a=n.width,u=n.height,c=n.transform,l=n.panZoom,s=n.nodeOrigin;if(!r&&!t&&i&&l){var d=i.centerByBBox,f=i.centerNodeId;if(f){var h=e.find((function(e){return e.id===f}));if(h)return void function(e){var n=e.node,t=e.height,r=e.width,o=e.zoom,i=void 0===o?1:o,a=e.panZoom,u=Ax(n),c={x:r/2-(n.position.x+u.width/2)*i,y:t/2-(n.position.y+u.height/2)*i};a.setViewport({x:c.x,y:c.y,zoom:i})}({node:h,width:a,height:u,panZoom:l,nodeOrigin:s,zoom:c[2]})}d&&function(e){var n=e.nodes,t=e.nodeOrigin,r=e.height,o=e.width,i=e.zoom,a=void 0===i?1:i,u=e.panZoom,c=b_(n,{nodeOrigin:t}),l={x:o/2-(c.x+c.width/2)*a,y:r/2-(c.y+c.height/2)*a};u.setViewport({x:l.x,y:l.y,zoom:a})}({nodes:e,width:a,height:u,panZoom:l,nodeOrigin:s,zoom:c[2]}),o.setState({centered:!0})}}),[o]),c=l((function(e){var n=o.getState(),t=n.layoutTypes,i=n.layoutConfig,c=void 0===i?L_:i,l=n.edges,s=n.setEdges,d=n.nodeOrigin,h=n.width,v=n.height,p=t[null==c?void 0:c.type]||B_[null==c?void 0:c.type];if(!p)return r(e),void console.error("layout function is not existed");var g=[];e.forEach((function(e){e.data&&(e.data.width=e.measured.width,e.data.height=e.measured.height),g.push(e)}));var y=p(g,l,f({nodeOrigin:d,width:h,height:v},null==c?void 0:c.options)),m=y.nodes,w=y.edges;a(m),u(m),r(m),s(w)}),[o,a,u]),s=l((function(e){var n=v_(e,t),i=function(e,n){if(!e.every((function(e){return e.measured})))return!1;var t=n.reduce((function(e,n){var t;return f(f({},e),((t={})[n.id]=n,t))}),{});return e.some((function(e){var n=Ax(e),r=t[e.id],o=r?Ax(r):{width:0,height:0};return n.width!==o.width||n.height!==o.height}))}(n,t),a=o.getState().autoLayout;i&&a?c(n):r(n)}),[t,c]);return[t,r,s]}var R_="undefined"!=typeof window?s:u;function V_(e){var n=y(i(!1),2),t=n[0],r=n[1],o=y(i((function(){return function(e){var n=[];return{get:function(){return n},reset:function(){n=[]},push:function(t){n.push(t),e()}}}((function(){return r(!0)}))})),1),a=o[0];return R_((function(){if(t){var n=a.get();n.length&&(e(n),a.reset()),r(!1)}else a.reset()}),[t]),a}var H_=n(null);function Y_(e){var n=e.children,t=Sx(),o=l((function(e){var n,r,o=t.getState(),i=o.nodes,a=void 0===i?[]:i,u=o.setNodes,c=o.hasDefaultNodes,l=o.onNodesChange,s=o.nodeLookup,d=a;try{for(var f=g(e),h=f.next();!h.done;h=f.next()){var v=h.value;d="function"==typeof v?v(d):v}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}c?u(d):l&&l(y_({items:d,lookup:s}))}),[]),i=V_(o),a=l((function(e){var n,r,o=t.getState(),i=o.edges,a=void 0===i?[]:i,u=o.setEdges,c=o.hasDefaultEdges,l=o.onEdgesChange,s=o.edgeLookup,d=a;try{for(var f=g(e),h=f.next();!h.done;h=f.next()){var v=h.value;d="function"==typeof v?v(d):v}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}c?u(d):l&&l(y_({items:d,lookup:s}))}),[]),u=V_(a),c=r((function(){return{nodeQueue:i,edgeQueue:u}}),[]);return S.jsx(H_.Provider,{value:c,children:n})}var X_=function(){var e=Sx();return r((function(){return{zoomIn:function(n){var t;return null===(t=e.getState().panZoom)||void 0===t?void 0:t.scaleBy(1.2,{duration:null==n?void 0:n.duration})},zoomOut:function(n){var t;return null===(t=e.getState().panZoom)||void 0===t?void 0:t.scaleBy(1/1.2,{duration:null==n?void 0:n.duration})},zoomTo:function(n,t){var r;return null===(r=e.getState().panZoom)||void 0===r?void 0:r.scaleTo(n,{duration:null==t?void 0:t.duration})},getZoom:function(){return e.getState().transform[2]},setViewport:function(n,t){var r,o,i,a=e.getState(),u=y(a.transform,3),c=u[0],l=u[1],s=u[2],d=a.panZoom;null==d||d.setViewport({x:null!==(r=n.x)&&void 0!==r?r:c,y:null!==(o=n.y)&&void 0!==o?o:l,zoom:null!==(i=n.zoom)&&void 0!==i?i:s},{duration:null==t?void 0:t.duration})},getViewport:function(){var n=y(e.getState().transform,3);return{x:n[0],y:n[1],zoom:n[2]}},fitView:function(n){var t=e.getState(),r=t.nodeLookup,o=t.width,i=t.height,a=t.nodeOrigin,u=t.minZoom,c=t.maxZoom,l=t.panZoom;return!!l&&E_({nodeLookup:r,width:o,height:i,nodeOrigin:a,minZoom:u,maxZoom:c,panZoom:l},n)},setCenter:function(n,t,r){var o=e.getState(),i=o.width,a=o.height,u=o.panZoom,c=o.transform,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:c[2],s=i/2-n*l,d=a/2-t*l;null==u||u.setViewport({x:s,y:d,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(n,t){var r,o=e.getState(),i=o.width,a=o.height,u=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Zx(n,i,a,u,c,null!==(r=null==t?void 0:t.padding)&&void 0!==r?r:.1);null==l||l.setViewport(s,{duration:null==t?void 0:t.duration})},screenToFlowPosition:function(n,t){void 0===t&&(t={snapToGrid:!0});var r=e.getState(),o=r.transform,i=r.snapGrid,a=r.domNode;if(!a)return n;var u=a.getBoundingClientRect(),c=u.x,l=u.y,s={x:n.x-c,y:n.y-l};return Lx(s,o,t.snapToGrid,i)},flowToScreenPosition:function(n){var t=e.getState(),r=t.transform,o=t.domNode;if(!o)return n;var i=o.getBoundingClientRect(),a=i.x,u=i.y,c=function(e,n){var t=e.x,r=e.y,o=y(n,3),i=o[0],a=o[1],u=o[2];return{x:t*u+i,y:r*u+a}}(n,r);return{x:c.x+a,y:c.y+u}}}}),[])},Z_=function(e){return!!e.panZoom};function F_(){var e=this,n=X_(),o=Sx(),i=function(){var e=t(H_);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),a=Ex(Z_);console.log("yk store",o.getState());var u=r((function(){var n=function(e){return o.getState().nodeLookup.get(e)},t=function(e){i.nodeQueue.push(e)},r=function(e){var n,t,r,i,a=o.getState(),u=a.nodeLookup,c=a.nodeOrigin,l=Wx(e)?e:u.get(e.id),s=l.parentId?function(e,n,t,r){var o,i;void 0===r&&(r=[0,0]);for(var a=n,u=f({},e);a;){var c=t.get(n);if(a=null==c?void 0:c.parentId,c){var l=c.origin||r,s=(null!==(o=c.measured.width)&&void 0!==o?o:0)*l[0],d=(null!==(i=c.measured.height)&&void 0!==i?i:0)*l[1];u.x+=c.position.x-s,u.y+=c.position.y-d}}return u}(l.position,l.parentId,u,c):l.position,d={id:l.id,position:s,width:null!==(t=null===(n=l.measured)||void 0===n?void 0:n.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 Bx(d)},a=function(e,n,r){void 0===r&&(r={replace:!1}),t((function(t){return t.map((function(t){if(t.id===e){var o="function"==typeof n?n(t):n;return r.replace&&Wx(o)?o:f(f({},t),o)}return t}))}))};return{getNodes:function(){return o.getState().nodes.map((function(e){return f({},e)}))},getNode:function(e){var t;return null===(t=n(e))||void 0===t?void 0:t.internals.userNode},getInternalNode:n,getEdges:function(){var e=o.getState().edges;return(void 0===e?[]:e).map((function(e){return f({},e)}))},getEdge:function(e){return o.getState().edgeLookup.get(e)},setNodes:t,setEdges:function(e){i.edgeQueue.push(e)},addNodes:function(e){var n=Array.isArray(e)?e:[e];i.nodeQueue.push((function(e){return m(m([],y(e),!1),y(n),!1)}))},addEdges:function(e){var n=Array.isArray(e)?e:[e];i.edgeQueue.push((function(e){return m(m([],y(e),!1),y(n),!1)}))},toObject:function(){var e=o.getState(),n=e.nodes,t=void 0===n?[]:n,r=e.edges,i=void 0===r?[]:r,a=y(e.transform,3),u=a[0],c=a[1],l=a[2];return{nodes:t.map((function(e){return f({},e)})),edges:i.map((function(e){return f({},e)})),viewport:{x:u,y:c,zoom:l}}},deleteElements:function(n){return v(e,[n],void 0,(function(e){var n,t,r,i,a,u,c,l,s,d,f,h,v,g,y,m,w=e.nodes,b=void 0===w?[]:w,x=e.edges,_=void 0===x?[]:x;return p(this,(function(e){switch(e.label){case 0:return n=o.getState(),t=n.nodes,r=n.edges,i=n.onNodesDelete,a=n.onEdgesDelete,u=n.triggerNodeChanges,c=n.triggerEdgeChanges,l=n.onDelete,s=n.onBeforeDelete,[4,k_({nodesToRemove:b,edgesToRemove:_,nodes:t,edges:r,onBeforeDelete:s})];case 1:return d=e.sent(),f=d.nodes,h=d.edges,v=h.length>0,g=f.length>0,v&&(y=h.map(m_),null==a||a(h),c(y)),g&&(m=f.map(m_),null==i||i(f),u(m)),(g||v)&&(null==l||l({nodes:f,edges:h})),[2,{deletedNodes:f,deletedEdges:h}]}}))}))},getIntersectingNodes:function(e,n,t){void 0===n&&(n=!0);var i=qx(e),a=i?e:r(e),u=void 0!==t;return a?(t||o.getState().nodes).filter((function(t){var r=o.getState().nodeLookup.get(t.id);if(r&&!i&&(t.id===e.id||!r.internals.positionAbsolute))return!1;var c=Bx(u?t:r),l=Xx(c,a);return n&&l>0||l>=a.width*a.height})):[]},isNodeIntersecting:function(e,n,t){void 0===t&&(t=!0);var o=qx(e)?e:r(e);if(!o)return!1;var i=Xx(o,n);return t&&i>0||i>=o.width*o.height},updateNode:a,updateNodeData:function(e,n,t){void 0===t&&(t={replace:!1}),a(e,(function(e){var r="function"==typeof n?n(e):n;return t.replace?f(f({},e),{data:r}):f(f({},e),{data:f(f({},e.data),r)})}),t)},checkAllNodeBeMeasured:function(){return o.getState().nodes.every((function(e){return e.measured}))}}}),[]);return r((function(){return f(f(f({},u),n),{viewportInitialized:a})}),[a])}var U_=function(e){return e.updateNodeInternals};var W_=function(e){return function(n){return e?x_(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map((function(e){return e.id})):Array.from(n.nodeLookup.keys())}};var G_=n(null),q_=G_.Provider;G_.Consumer;var $_="ink-flow__node-desc",K_="ink-flow__edge-desc";function Q_(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,o=e.targetY,i=e.sourceControlX,a=e.sourceControlY,u=.125*n+.375*i+.375*e.targetControlX+.125*r,c=.125*t+.375*a+.375*e.targetControlY+.125*o;return[u,c,Math.abs(u-n),Math.abs(c-t)]}function J_(e,n){return e>=0?.5*e:25*n*Math.sqrt(-e)}function eE(e){var n=e.pos,t=e.x1,r=e.y1,o=e.x2,i=e.y2,a=e.c;switch(n){case Kv.Left:return[t-J_(t-o,a),r];case Kv.Right:return[t+J_(o-t,a),r];case Kv.Top:return[t,r-J_(r-i,a)];case Kv.Bottom:return[t,r+J_(i-r,a)]}}function nE(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,o=e.targetY,i=Math.abs(r-n)/2,a=r<n?r+i:r-i,u=Math.abs(o-t)/2;return[a,o<t?o+u:o-u,i,u]}var tE,rE=function(e){var n=e.source,t=e.sourceHandle,r=e.target,o=e.targetHandle;return"xy-edge__".concat(n).concat(t||"","-").concat(r).concat(o||"")};var oE=((tE={})[Kv.Left]={x:-1,y:0},tE[Kv.Right]={x:1,y:0},tE[Kv.Top]={x:0,y:-1},tE[Kv.Bottom]={x:0,y:1},tE),iE=function(e){var n=e.source,t=e.sourcePosition,r=void 0===t?Kv.Bottom:t,o=e.target;return r===Kv.Left||r===Kv.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1}},aE=function(e,n){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))};function uE(e){var n=e.sourceX,t=e.sourceY,r=e.sourcePosition,o=void 0===r?Kv.Bottom:r,i=e.targetX,a=e.targetY,u=e.targetPosition,c=void 0===u?Kv.Top:u,l=e.borderRadius,s=void 0===l?5:l,d=e.centerX,f=e.centerY,h=e.offset,v=y(function(e){var n,t,r,o,i=e.source,a=e.sourcePosition,u=void 0===a?Kv.Bottom:a,c=e.target,l=e.targetPosition,s=void 0===l?Kv.Top:l,d=e.center,f=e.offset,h=oE[u],v=oE[s],p={x:i.x+h.x*f,y:i.y+h.y*f},g={x:c.x+v.x*f,y:c.y+v.y*f},w=iE({source:p,sourcePosition:u,target:g}),b=0!==w.x?"x":"y",x=w[b],_=[],E={x:0,y:0},S={x:0,y:0},k=y(nE({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),N=k[0],C=k[1],M=k[2],O=k[3];if(h[b]*v[b]==-1){r=null!==(n=d.x)&&void 0!==n?n:N,o=null!==(t=d.y)&&void 0!==t?t:C;var j=[{x:r,y:p.y},{x:r,y:g.y}],P=[{x:p.x,y:o},{x:g.x,y:o}];_=h[b]===x?"x"===b?j:P:"x"===b?P:j}else{var I=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(_="x"===b?h.x===x?A:I:h.y===x?I:A,u===s){var z=Math.abs(i[b]-c[b]);if(z<=f){var T=Math.min(f-1,f-z);h[b]===x?E[b]=(p[b]>i[b]?-1:1)*T:S[b]=(g[b]>c[b]?-1:1)*T}}if(u!==s){var L="x"===b?"y":"x",B=h[b]===v[L],D=p[L]>g[L],R=p[L]<g[L];(1===h[b]&&(!B&&D||B&&R)||1!==h[b]&&(!B&&R||B&&D))&&(_="x"===b?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]}({source:{x:n,y:t},sourcePosition:o,target:{x:i,y:a},targetPosition:c,center:{x:d,y:f},offset:void 0===h?20:h}),5),p=v[0],g=v[1],w=v[2],b=v[3],x=v[4],_=p.reduce((function(e,n,t){var r="";return r=t>0&&t<p.length-1?function(e,n,t,r){var o=Math.min(aE(e,n)/2,aE(n,t)/2,r),i=n.x,a=n.y;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return"L".concat(i," ").concat(a);if(e.y===a){var u=e.x<t.x?-1:1,c=e.y<t.y?1:-1;return"L ".concat(i+o*u,",").concat(a,"Q ").concat(i,",").concat(a," ").concat(i,",").concat(a+o*c)}var l=e.x<t.x?1:-1,s=e.y<t.y?-1:1;return"L ".concat(i,",").concat(a+o*s,"Q ").concat(i,",").concat(a," ").concat(i+o*l,",").concat(a)}(p[t-1],n,p[t+1],s):"".concat(0===t?"M":"L").concat(n.x," ").concat(n.y),e+=r}),"");return[_,g,w,b,x]}var cE=function(e){return{connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}};var lE=c(Yx((function(e,n){var r,o,i=e.type,a=void 0===i?"source":i,u=e.position,c=void 0===u?Kv.Top:u,l=e.isValidConnection,s=e.isConnectable,d=void 0===s||s,v=e.isConnectableStart,p=void 0===v||v,g=e.isConnectableEnd,y=void 0===g||g,m=e.id,w=e.onConnect,b=e.children,x=e.className,_=e.onMouseDown,E=e.onTouchStart,k=h(e,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),N=m||null,C="target"===a,M=Sx(),j=t(G_),P=Ex(cE,a_),I=P.connectOnClick,A=P.noPanClassName,z=P.rfId,T=Ex(function(e,n,t){return function(r){var o=r.connectionStartHandle,i=r.connectionEndHandle,a=r.connectionClickStartHandle,u=r.connectionMode,c=r.connectionStatus,l=(null==i?void 0:i.nodeId)===e&&(null==i?void 0:i.handleId)===n&&(null==i?void 0:i.type)===t;return{connectingFrom:(null==o?void 0:o.nodeId)===e&&(null==o?void 0:o.handleId)===n&&(null==o?void 0:o.type)===t,connectingTo:l,clickConnecting:(null==a?void 0:a.nodeId)===e&&(null==a?void 0:a.handleId)===n&&(null==a?void 0:a.type)===t,isPossibleEndHandle:u===Uv.Strict?(null==o?void 0:o.type)!==t:e!==(null==o?void 0:o.nodeId)||n!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(j,N,a),a_),L=T.connectingFrom,B=T.connectingTo,D=T.clickConnecting,R=T.isPossibleEndHandle,V=T.connectionInProcess,H=T.valid;j||null===(o=(r=M.getState()).onError)||void 0===o||o.call(r,"010",yv.error010());var Y=function(e){var n=M.getState(),t=n.defaultEdgeOptions,r=n.onConnect,o=n.hasDefaultEdges,i=f(f({},t),e);if(o){var a=M.getState(),u=a.edges;(0,a.setEdges)(function(e,n){return e.source&&e.target?function(e,n){return n.some((function(n){return!(n.source!==e.source||n.target!==e.target||n.sourceHandle!==e.sourceHandle&&(n.sourceHandle||e.sourceHandle)||n.targetHandle!==e.targetHandle&&(n.targetHandle||e.targetHandle))}))}(t="id"in(r=e)&&"source"in r&&"target"in r?f({},e):f(f({},e),{id:rE(e)}),n)?n:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,n.concat(t)):n;var t,r}(i,u))}null==r||r(i),null==w||w(i)},X=function(e){if(j){var n=Jx(e.nativeEvent);if(p&&(n&&0===e.button||!n)){var t=M.getState();tw.onPointerDown(e.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:C,handleId:N,nodeId:j,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:Y,isValidConnection:l||t.isValidConnection,getTransform:function(){return M.getState().transform},getConnectionStartHandle:function(){return M.getState().connectionStartHandle}})}n?null==_||_(e):null==E||E(e)}};return S.jsx("div",f({"data-handleid":N,"data-nodeid":j,"data-handlepos":c,"data-id":"".concat(z,"-").concat(j,"-").concat(N,"-").concat(a),className:O(["ink-flow__handle","ink-flow__handle-".concat(c),"nodrag",A,x,{source:!C,target:C,connectable:d,connectablestart:p,connectableend:y,clickconnecting:D,connectingfrom:L,connectingto:B,valid:H,connectionindicator:d&&(!V||R)&&(V?y:p)}]),onMouseDown:X,onTouchStart:X,onClick:I?function(e){var n=M.getState(),t=n.onClickConnectStart,r=n.onClickConnectEnd,o=n.connectionClickStartHandle,i=n.connectionMode,u=n.isValidConnection,c=n.lib,s=n.rfId;if(j&&(o||p)){if(!o)return null==t||t(e.nativeEvent,{nodeId:j,handleId:N,handleType:a}),void M.setState({connectionClickStartHandle:{nodeId:j,type:a,handleId:N}});var d=function(e){var n;return(null===(n=e.getRootNode)||void 0===n?void 0:n.call(e))||(null===window||void 0===window?void 0:window.document)}(e.target),f=l||u,h=tw.isValid(e.nativeEvent,{handle:{nodeId:j,id:N,type:a},connectionMode:i,fromNodeId:o.nodeId,fromHandleId:o.handleId||null,fromType:o.type,isValidConnection:f,flowId:s,doc:d,lib:c}),v=h.connection;h.isValid&&v&&Y(v),null==r||r(e),M.setState({connectionClickStartHandle:null})}}:void 0,ref:n},k,{children:b}))})));var sE={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dE={input:function(e){var n=e.data,t=e.isConnectable,r=e.sourcePosition,o=void 0===r?Kv.Bottom:r;return S.jsxs(S.Fragment,{children:[null==n?void 0:n.label,S.jsx(lE,{type:"source",position:o,isConnectable:t})]})},default:function(e){var n=e.data,t=e.isConnectable,r=e.targetPosition,o=void 0===r?Kv.Top:r,i=e.sourcePosition,a=void 0===i?Kv.Bottom:i;return S.jsxs(S.Fragment,{children:[S.jsx(lE,{type:"target",position:o,isConnectable:t}),null==n?void 0:n.label,S.jsx(lE,{type:"source",position:a,isConnectable:t})]})},output:function(e){var n=e.data,t=e.isConnectable,r=e.targetPosition,o=void 0===r?Kv.Top:r;return S.jsxs(S.Fragment,{children:[S.jsx(lE,{type:"target",position:o,isConnectable:t}),null==n?void 0:n.label]})},group:function(){return null}};function fE(e){var n=e.id,t=e.store,r=e.unselect,o=void 0!==r&&r,i=e.nodeRef,a=t.getState(),u=a.addSelectedNodes,c=a.unselectNodesAndEdges,l=a.multiSelectionActive,s=a.nodeLookup,d=a.onError,f=s.get(n);f?(t.setState({nodesSelectionActive:!1}),f.selected?(o||f.selected&&l)&&(c({nodes:[f],edges:[]}),requestAnimationFrame((function(){var e;return null===(e=null==i?void 0:i.current)||void 0===e?void 0:e.blur()}))):u([n])):null==d||d("012",yv.error012(n))}var hE=function(e){return function(n){return n.selected&&(n.draggable||e&&void 0===n.draggable)}};function vE(e){var n,t=e.id,r=e.onClick,o=e.onMouseEnter,c=e.onMouseMove,s=e.onMouseLeave,d=e.onContextMenu,h=e.onDoubleClick,v=e.nodesDraggable,p=e.elementsSelectable,m=e.nodesConnectable,w=e.nodesFocusable,b=e.resizeObserver,x=e.noDragClassName,_=e.noPanClassName,E=e.disableKeyboardA11y,k=e.rfId,N=e.nodeTypes,C=e.nodeExtent,M=e.nodeOrigin,j=e.onError,P=Ex((function(e){var n=e.nodeLookup.get(t),r=e.parentLookup.has(t);return{node:n,internals:n.internals,isParent:r}}),a_),I=P.node,A=P.internals,z=P.isParent,T=I.type||"default",L=(null==N?void 0:N[T])||dE[T];void 0===L&&(null==j||j("003",yv.error003(T)),T="default",L=dE.default);var B=!!(I.draggable||v&&void 0===I.draggable),D=!!(I.selectable||p&&void 0===I.selectable),R=!!(I.connectable||m&&void 0===I.connectable),V=!!(I.focusable||w&&void 0===I.focusable),H=Sx(),Y=function(e){var n,t,r,o,i,a;return void 0!==(null!==(r=null!==(t=null===(n=e.measured)||void 0===n?void 0:n.width)&&void 0!==t?t:e.width)&&void 0!==r?r:e.initialWidth)&&void 0!==(null!==(a=null!==(i=null===(o=e.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:e.height)&&void 0!==a?a:e.initialHeight)}(I),X=function(e){var n=e.node,t=e.nodeType,r=e.hasDimensions,o=e.resizeObserver,i=Sx(),c=a(null),l=a(null),s=a(n.sourcePosition),d=a(n.targetPosition),f=a(t),h=r&&!!n.internals.handleBounds&&!n.hidden;return u((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]),u((function(){return function(){l.current&&(null==o||o.unobserve(l.current),l.current=null)}}),[]),u((function(){if(c.current){var e=f.current!==t,r=s.current!==n.sourcePosition,o=d.current!==n.targetPosition;(e||r||o)&&(f.current=t,s.current=n.sourcePosition,d.current=n.targetPosition,i.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:c.current,force:!0}]])))}}),[n.id,t,n.sourcePosition,n.targetPosition]),c}({node:I,nodeType:T,hasDimensions:Y,resizeObserver:b}),Z=function(e){var n=e.nodeRef,t=e.disabled,r=void 0!==t&&t,o=e.noDragClassName,c=e.handleSelector,l=e.nodeId,s=e.isSelectable,d=Sx(),f=y(i(!1),2),h=f[0],v=f[1],p=a();return u((function(){p.current=$m({getStoreItems:function(){return d.getState()},onNodeMouseDown:function(e){fE({id:e,store:d,nodeRef:n})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),u((function(){var e,t;if(r)null===(e=p.current)||void 0===e||e.destroy();else if(n.current)return null===(t=p.current)||void 0===t||t.update({noDragClassName:o,handleSelector:c,domNode:n.current,isSelectable:s,nodeId:l}),function(){var e;null===(e=p.current)||void 0===e||e.destroy()}}),[o,c,r,s,n,l]),h}({nodeRef:X,disabled:I.hidden||!B,noDragClassName:x,handleSelector:I.dragHandle,nodeId:t,isSelectable:D}),F=function(){var e=Sx(),n=l((function(n){var t,r,o=e.getState(),i=o.nodeExtent,a=o.snapToGrid,u=o.snapGrid,c=o.nodesDraggable,l=o.onError,s=o.updateNodePositions,d=o.nodeLookup,f=o.nodeOrigin,h=new Map,v=hE(c),p=a?u[0]:5,m=a?u[1]:5,w=n.direction.x*p*n.factor,b=n.direction.y*m*n.factor;try{for(var x=g(d),_=x.next();!_.done;_=x.next()){var E=y(_.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+b};a&&(S=Tx(S,u));var k=S_({nodeId:E.id,nextPosition:S,nodeLookup:d,nodeExtent:i,nodeOrigin:f,onError:l}),N=k.position,C=k.positionAbsolute;E.position=N,E.internals.positionAbsolute=C,h.set(E.id,E)}}}catch(e){t={error:e}}finally{try{_&&!_.done&&(r=x.return)&&r.call(x)}finally{if(t)throw t.error}}s(h)}),[]);return n}();if(I.hidden)return null;var U=Ax(I),W=function(e){var n,t,r,o,i,a,u,c,l,s;return void 0===e.internals.handleBounds?{width:null!==(t=null!==(n=e.width)&&void 0!==n?n:e.initialWidth)&&void 0!==t?t:null===(r=e.style)||void 0===r?void 0:r.width,height:null!==(i=null!==(o=e.height)&&void 0!==o?o:e.initialHeight)&&void 0!==i?i:null===(a=e.style)||void 0===a?void 0:a.height}:{width:null!==(u=e.width)&&void 0!==u?u:null===(c=e.style)||void 0===c?void 0:c.width,height:null!==(l=e.height)&&void 0!==l?l:null===(s=e.style)||void 0===s?void 0:s.height}}(I),G=C?Ix(A.positionAbsolute,C):A.positionAbsolute,q=Ux(f(f(f({},G),U),{origin:I.origin||M})),$=D||B||r||o||c||s,K=o?function(e){return o(e,f({},A.userNode))}:void 0,Q=c?function(e){return c(e,f({},A.userNode))}:void 0,J=s?function(e){return s(e,f({},A.userNode))}:void 0,ee=d?function(e){return d(e,f({},A.userNode))}:void 0,ne=h?function(e){return h(e,f({},A.userNode))}:void 0;return S.jsx("div",{className:O(["ink-flow__node","ink-flow__node-".concat(T),(n={},n[_]=B,n),I.className,{selected:I.selected,selectable:D,parent:z,draggable:B,dragging:Z}]),ref:X,style:f(f({zIndex:A.z,transform:"translate(".concat(q.x,"px,").concat(q.y,"px)"),pointerEvents:$?"all":"none",visibility:Y?"visible":"hidden"},I.style),W),"data-id":t,"data-testid":"rf__node-".concat(t),onMouseEnter:K,onMouseMove:Q,onMouseLeave:J,onContextMenu:ee,onClick:function(e){var n=H.getState(),o=n.selectNodesOnDrag,i=n.nodeDragThreshold;D&&(!o||!B||i>0)&&fE({id:t,store:H,nodeRef:X}),r&&r(e,f({},A.userNode))},onDoubleClick:ne,onKeyDown:V?function(e){if(!Qx(e.nativeEvent)&&!E)if(wv.includes(e.key)&&D){var n="Escape"===e.key;fE({id:t,store:H,unselect:n,nodeRef:X})}else B&&I.selected&&Object.prototype.hasOwnProperty.call(sE,e.key)&&(H.setState({ariaLiveMessage:"Moved selected node ".concat(e.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~G.x,", y: ").concat(~~G.y)}),F({direction:sE[e.key],factor:e.shiftKey?4:1}))}:void 0,tabIndex:V?0:void 0,role:V?"button":void 0,"aria-describedby":E?void 0:"".concat($_,"-").concat(k),"aria-label":I.ariaLabel,children:S.jsx(q_,{value:t,children:S.jsx(L,f({id:t,data:I.data,type:T,positionAbsoluteX:G.x,positionAbsoluteY:G.y,selected:I.selected,isConnectable:R,sourcePosition:I.sourcePosition,targetPosition:I.targetPosition,dragging:Z,dragHandle:I.dragHandle,zIndex:A.z},U))})})}var pE=function(e){return{nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError}};function gE(e){var n,t=Ex(pE,a_),r=t.nodesDraggable,o=t.nodesConnectable,a=t.nodesFocusable,c=t.elementsSelectable,s=t.onError,d=Ex(l(W_(n=!1),[n]),a_),f=function(){var e=Ex(U_),n=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(n){var t=new Map;n.forEach((function(e){var n=e.target.getAttribute("data-id");t.set(n,{id:n,nodeElement:e.target})})),e(t)}))})),1),t=n[0];return u((function(){return function(){null==t||t.disconnect()}}),[t]),t}();return S.jsx("div",{className:"ink-flow__nodes",style:u_,children:d.map((function(n){return S.jsx(vE,{id:n,nodeTypes:e.nodeTypes,nodeOrigin:e.nodeOrigin,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:c,onError:s},n)}))})}gE.displayName="NodeRenderer";var yE,mE=c(gE),wE=((yE={})[$v.Arrow]=function(e){var n=e.color,t=void 0===n?"none":n,r=e.strokeWidth,o=void 0===r?1:r;return S.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},yE[$v.ArrowClosed]=function(e){var n=e.color,t=void 0===n?"none":n,r=e.strokeWidth,o=void 0===r?1:r;return S.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},yE);function bE(e,n){if(!e)return"";if("string"==typeof e)return e;var t=n?"".concat(n,"__"):"";return"".concat(t).concat(Object.keys(e).sort().map((function(n){return"".concat(n,"=").concat(e[n])})).join("&"))}var xE=function(e){var n=e.id,t=e.type,o=e.color,i=e.width,a=void 0===i?12.5:i,u=e.height,c=void 0===u?12.5:u,l=e.markerUnits,s=void 0===l?"strokeWidth":l,d=e.strokeWidth,f=e.orient,h=void 0===f?"auto-start-reverse":f,v=function(e){var n=Sx(),t=r((function(){var t,r;return Object.prototype.hasOwnProperty.call(wE,e)?wE[e]:(null===(r=(t=n.getState()).onError)||void 0===r||r.call(t,"009",yv.error009(e)),null)}),[e]);return t}(t);return v?S.jsx("marker",{className:"ink-flow__arrowhead",id:n,markerWidth:"".concat(a),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:S.jsx(v,{color:o,strokeWidth:d})}):null},_E=function(e){var n=e.defaultColor,t=e.rfId,o=Ex((function(e){return e.edges})),i=Ex((function(e){return e.defaultEdgeOptions})),a=r((function(){var e=function(e,n){var t=n.id,r=n.defaultColor,o=n.defaultMarkerStart,i=n.defaultMarkerEnd,a=new Set;return e.reduce((function(e,n){return[n.markerStart||o,n.markerEnd||i].forEach((function(n){if(n&&"object"==typeof n){var o=bE(n,t);a.has(o)||(e.push(f({id:o,color:n.color||r},n)),a.add(o))}})),e}),[]).sort((function(e,n){return e.id.localeCompare(n.id)}))}(o,{id:t,defaultColor:n,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return e}),[o,i,t,n]);return a.length?S.jsx("svg",{className:"ink-flow__marker",children:S.jsx("defs",{children:a.map((function(e){return S.jsx(xE,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id)}))})}):null};_E.displayName="MarkerDefinitions";var EE=c(_E);function SE(e){var n=e.x,t=e.y,r=e.label,o=e.labelStyle,a=void 0===o?{}:o,u=e.labelShowBg,c=void 0===u||u,s=e.labelBgStyle,d=void 0===s?{}:s,v=e.labelBgPadding,p=void 0===v?[2,4]:v,g=e.labelBgBorderRadius,m=void 0===g?2:g,w=e.children,b=e.className,x=h(e,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),_=y(i({x:1,y:0,width:0,height:0}),2),E=_[0],k=_[1],N=O(["ink-flow__edge-textwrapper",b]),C=l((function(e){if(null!==e){var n=e.getBBox();k({x:n.x,y:n.y,width:n.width,height:n.height})}}),[]);return void 0!==r&&r?S.jsxs("g",f({transform:"translate(".concat(n-E.width/2," ").concat(t-E.height/2,")"),className:N,visibility:E.width?"visible":"hidden"},x,{children:[c&&S.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:d,rx:m,ry:m}),S.jsx("text",{className:"ink-flow__edge-text",y:E.height/2,dy:"0.3em",ref:C,style:a,children:r}),w]})):null}SE.displayName="EdgeText";var kE=c(SE);function NE(e){var n=e.id,t=e.path,r=e.labelX,o=e.labelY,i=e.label,a=e.labelStyle,u=e.labelShowBg,c=e.labelBgStyle,l=e.labelBgPadding,s=e.labelBgBorderRadius,d=e.style,f=e.markerEnd,h=e.markerStart,v=e.className,p=e.interactionWidth,g=void 0===p?20:p;return S.jsxs(S.Fragment,{children:[S.jsx("path",{id:n,style:d,d:t,fill:"none",className:O(["ink-flow__edge-path",v]),markerEnd:f,markerStart:h}),g&&S.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&zx(r)&&zx(o)?S.jsx(kE,{x:r,y:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function CE(e){var n=e.pos,t=e.x1,r=e.y1,o=e.x2,i=e.y2;return n===Kv.Left||n===Kv.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function ME(e){var n=e.sourceX,t=e.sourceY,r=e.sourcePosition,o=void 0===r?Kv.Bottom:r,i=e.targetX,a=e.targetY,u=e.targetPosition,c=void 0===u?Kv.Top:u,l=y(CE({pos:o,x1:n,y1:t,x2:i,y2:a}),2),s=l[0],d=l[1],f=y(CE({pos:c,x1:i,y1:a,x2:n,y2:t}),2),h=f[0],v=f[1],p=y(Q_({sourceX:n,sourceY:t,targetX:i,targetY:a,sourceControlX:s,sourceControlY:d,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],b=p[3];return["M".concat(n,",").concat(t," C").concat(s,",").concat(d," ").concat(h,",").concat(v," ").concat(i,",").concat(a),g,m,w,b]}function OE(e){return c((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,a=n.targetY,u=n.sourcePosition,c=void 0===u?Kv.Bottom:u,l=n.targetPosition,s=void 0===l?Kv.Top:l,d=n.label,f=n.labelStyle,h=n.labelShowBg,v=n.labelBgStyle,p=n.labelBgPadding,g=n.labelBgBorderRadius,m=n.style,w=n.markerEnd,b=n.markerStart,x=n.interactionWidth,_=y(ME({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:a,targetPosition:s}),3),E=_[0],k=_[1],N=_[2],C=e.isInternal?void 0:t;return S.jsx(NE,{id:C,path:E,labelX:k,labelY:N,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:b,interactionWidth:x})}))}var jE=OE({isInternal:!1}),PE=OE({isInternal:!0});function IE(e){return c((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,a=n.targetY,u=n.label,c=n.labelStyle,l=n.labelShowBg,s=n.labelBgStyle,d=n.labelBgPadding,f=n.labelBgBorderRadius,h=n.style,v=n.sourcePosition,p=void 0===v?Kv.Bottom:v,g=n.targetPosition,m=void 0===g?Kv.Top:g,w=n.markerEnd,b=n.markerStart,x=n.pathOptions,_=n.interactionWidth,E=y(uE({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:null==x?void 0:x.borderRadius,offset:null==x?void 0:x.offset}),3),k=E[0],N=E[1],C=E[2],M=e.isInternal?void 0:t;return S.jsx(NE,{id:M,path:k,labelX:N,labelY:C,label:u,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:w,markerStart:b,interactionWidth:_})}))}jE.displayName="SimpleBezierEdge",PE.displayName="SimpleBezierEdgeInternal";var AE=IE({isInternal:!1}),zE=IE({isInternal:!0});function TE(e){return c((function(n){var t,o=n.id,i=h(n,["id"]),a=e.isInternal?void 0:o;return S.jsx(AE,f({},i,{id:a,pathOptions:r((function(){var e;return{borderRadius:0,offset:null===(e=i.pathOptions)||void 0===e?void 0:e.offset}}),[null===(t=i.pathOptions)||void 0===t?void 0:t.offset])}))}))}AE.displayName="SmoothStepEdge",zE.displayName="SmoothStepEdgeInternal";var LE=TE({isInternal:!1}),BE=TE({isInternal:!0});function DE(e){return c((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,a=n.targetY,u=n.label,c=n.labelStyle,l=n.labelShowBg,s=n.labelBgStyle,d=n.labelBgPadding,f=n.labelBgBorderRadius,h=n.style,v=n.markerEnd,p=n.markerStart,g=n.interactionWidth,m=y(function(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,o=e.targetY,i=y(nE({sourceX:n,sourceY:t,targetX:r,targetY:o}),4),a=i[0],u=i[1],c=i[2],l=i[3];return["M ".concat(n,",").concat(t,"L ").concat(r,",").concat(o),a,u,c,l]}({sourceX:r,sourceY:o,targetX:i,targetY:a}),3),w=m[0],b=m[1],x=m[2],_=e.isInternal?void 0:t;return S.jsx(NE,{id:_,path:w,labelX:b,labelY:x,label:u,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}LE.displayName="StepEdge",BE.displayName="StepEdgeInternal";var RE=DE({isInternal:!1}),VE=DE({isInternal:!0});function HE(e){return c((function(n){var t=n.id,r=n.sourceX,o=n.sourceY,i=n.targetX,a=n.targetY,u=n.sourcePosition,c=void 0===u?Kv.Bottom:u,l=n.targetPosition,s=void 0===l?Kv.Top:l,d=n.label,f=n.labelStyle,h=n.labelShowBg,v=n.labelBgStyle,p=n.labelBgPadding,g=n.labelBgBorderRadius,m=n.style,w=n.markerEnd,b=n.markerStart,x=n.pathOptions,_=n.interactionWidth,E=y(function(e){var n=e.sourceX,t=e.sourceY,r=e.sourcePosition,o=void 0===r?Kv.Bottom:r,i=e.targetX,a=e.targetY,u=e.targetPosition,c=void 0===u?Kv.Top:u,l=e.curvature,s=void 0===l?.25:l,d=y(eE({pos:o,x1:n,y1:t,x2:i,y2:a,c:s}),2),f=d[0],h=d[1],v=y(eE({pos:c,x1:i,y1:a,x2:n,y2:t,c:s}),2),p=v[0],g=v[1],m=y(Q_({sourceX:n,sourceY:t,targetX:i,targetY:a,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],b=m[1],x=m[2],_=m[3];return["M".concat(n,",").concat(t," C").concat(f,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(a),w,b,x,_]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:a,targetPosition:s,curvature:null==x?void 0:x.curvature}),3),k=E[0],N=E[1],C=E[2],M=e.isInternal?void 0:t;return S.jsx(NE,{id:M,path:k,labelX:N,labelY:C,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:b,interactionWidth:_})}))}RE.displayName="StraightEdge",VE.displayName="StraightEdgeInternal";var YE=HE({isInternal:!1}),XE=HE({isInternal:!0});YE.displayName="BezierEdge",XE.displayName="BezierEdgeInternal";var ZE={default:XE,straight:VE,step:BE,smoothstep:zE,simplebezier:PE},FE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},UE=function(e,n,t){return t===Kv.Left?e-n:t===Kv.Right?e+n:e},WE=function(e,n,t){return t===Kv.Top?e-n:t===Kv.Bottom?e+n:e},GE="ink-flow__edgeupdater";function qE(e){var n=e.position,t=e.centerX,r=e.centerY,o=e.radius,i=void 0===o?10:o,a=e.onMouseDown,u=e.onMouseEnter,c=e.onMouseOut,l=e.type;return S.jsx("circle",{onMouseDown:a,onMouseEnter:u,onMouseOut:c,className:O([GE,"".concat(GE,"-").concat(l)]),cx:UE(t,i,n),cy:WE(r,i,n),r:i,stroke:"transparent",fill:"transparent"})}function $E(e){var n=e.isUpdatable,t=e.edgeUpdaterRadius,r=e.edge,o=e.targetHandleId,i=e.sourceHandleId,a=e.sourceX,u=e.sourceY,c=e.targetX,l=e.targetY,s=e.sourcePosition,d=e.targetPosition,f=e.onEdgeUpdate,h=e.onEdgeUpdateStart,v=e.onEdgeUpdateEnd,p=e.setUpdating,g=e.setUpdateHover,y=Sx(),m=function(e,n){if(0===e.button){var t=y.getState(),a=t.autoPanOnConnect,u=t.domNode,c=t.isValidConnection,l=t.connectionMode,s=t.connectionRadius,d=t.lib,g=t.onConnectStart,m=t.onConnectEnd,w=t.cancelConnection,b=t.nodeLookup,x=t.rfId,_=t.panBy,E=t.updateConnection,S=n?r.target:r.source,k=(n?o:i)||null,N=n?"target":"source",C=n;p(!0),null==h||h(e,r,N);tw.onPointerDown(e.nativeEvent,{autoPanOnConnect:a,connectionMode:l,connectionRadius:s,domNode:u,handleId:k,nodeId:S,nodeLookup:b,isTarget:C,edgeUpdaterType:N,lib:d,flowId:x,cancelConnection:w,panBy:_,isValidConnection:c,onConnect:function(e){return null==f?void 0:f(r,e)},onConnectStart:g,onConnectEnd:m,onEdgeUpdateEnd:function(e){p(!1),null==v||v(e,r,N)},updateConnection:E,getTransform:function(){return y.getState().transform},getConnectionStartHandle:function(){return y.getState().connectionStartHandle}})}},w=function(){return g(!0)},b=function(){return g(!1)};return S.jsxs(S.Fragment,{children:[("source"===n||!0===n)&&S.jsx(qE,{position:s,centerX:a,centerY:u,radius:t,onMouseDown:function(e){return m(e,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===n||!0===n)&&S.jsx(qE,{position:d,centerX:c,centerY:l,radius:t,onMouseDown:function(e){return m(e,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function KE(e){var n;return e&&!(!e.internals.handleBounds&&!(null===(n=e.handles)||void 0===n?void 0:n.length))&&!!(e.measured.width||e.width||e.initialWidth)}function QE(e){var n,t,r,o;if(!e)return null;var i=[],a=[];try{for(var u=g(e),c=u.next();!c.done;c=u.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&&a.push(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(t=u.return)&&t.call(u)}finally{if(n)throw n.error}}return{source:i,target:a}}function JE(e,n,t){var r,o;void 0===t&&(t=null);var i=(null!==(r=null==t?void 0:t.x)&&void 0!==r?r:0)+n.internals.positionAbsolute.x,a=(null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0)+n.internals.positionAbsolute.y,u=null!=t?t:Ax(n),c=u.width,l=u.height;switch(e){case Kv.Top:return[i+c/2,a];case Kv.Right:return[i+c,a+l/2];case Kv.Bottom:return[i+c/2,a+l];case Kv.Left:return[i,a+l/2]}}function eS(e,n){return e&&(n?e.find((function(e){return e.id===n})):e[0])||null}function nS(e){var n=e.id,t=e.edgesFocusable,o=e.edgesUpdatable,u=e.elementsSelectable,c=e.onClick,s=e.onDoubleClick,d=e.onContextMenu,h=e.onMouseEnter,v=e.onMouseMove,p=e.onMouseLeave,g=e.edgeUpdaterRadius,m=e.onEdgeUpdate,w=e.onEdgeUpdateStart,b=e.onEdgeUpdateEnd,x=e.rfId,_=e.edgeTypes,E=e.noPanClassName,k=e.onError,N=e.disableKeyboardA11y,C=Ex((function(e){return e.edgeLookup.get(n)})),M=Ex((function(e){return e.defaultEdgeOptions})),j=(C=M?f(f({},M),C):C).type||"default",P=(null==_?void 0:_[j])||ZE[j];void 0===P&&(null==k||k("011",yv.error011(j)),j="default",P=ZE.default);var I=!!(C.focusable||t&&void 0===C.focusable),A=void 0!==m&&(C.updatable||o&&void 0===C.updatable),z=!!(C.selectable||u&&void 0===C.selectable),T=a(null),L=y(i(!1),2),B=L[0],D=L[1],R=y(i(!1),2),V=R[0],H=R[1],Y=Sx(),X=Ex(l((function(e){var t=e.nodeLookup.get(C.source),r=e.nodeLookup.get(C.target);if(!t||!r)return f({zIndex:C.zIndex},FE);var o=function(e){var n,t,r,o,i,a=e.sourceNode,u=e.targetNode;if(!KE(a)||!KE(u))return null;var c=a.internals.handleBounds||QE(a.handles),l=u.internals.handleBounds||QE(u.handles),s=eS(null!==(n=null==c?void 0:c.source)&&void 0!==n?n:[],e.sourceHandle),d=eS(e.connectionMode===Uv.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:[]),e.targetHandle),f=(null==s?void 0:s.position)||Kv.Bottom,h=(null==d?void 0:d.position)||Kv.Top;if(!s||!d)return null===(i=e.onError)||void 0===i||i.call(e,"008",yv.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;var v=y(JE(f,a,s),2),p=v[0],g=v[1],m=y(JE(h,u,d),2);return{sourceX:p,sourceY:g,targetX:m[0],targetY:m[1],sourcePosition:f,targetPosition:h}}({id:n,sourceNode:t,targetNode:r,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:e.connectionMode,onError:k}),i=function(e){var n=e.sourceNode,t=e.targetNode,r=e.selected,o=void 0!==r&&r,i=e.zIndex,a=void 0===i?0:i,u=e.elevateOnSelect;if(void 0===u||!u)return a;var c=o||t.selected||n.selected,l=Math.max(n.internals.z||0,t.internals.z||0,1e3);return a+(c?l:0)}({selected:C.selected,zIndex:C.zIndex,sourceNode:t,targetNode:r,elevateOnSelect:e.elevateEdgesOnSelect});return f({zIndex:i},o||FE)}),[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),a_),Z=X.zIndex,F=X.sourceX,U=X.sourceY,W=X.targetX,G=X.targetY,q=X.sourcePosition,$=X.targetPosition,K=r((function(){return C.markerStart?"url('#".concat(bE(C.markerStart,x),"')"):void 0}),[C.markerStart,x]),Q=r((function(){return C.markerEnd?"url('#".concat(bE(C.markerEnd,x),"')"):void 0}),[C.markerEnd,x]);if(C.hidden||null===F||null===U||null===W||null===G)return null;var J=s?function(e){s(e,f({},C))}:void 0,ee=d?function(e){d(e,f({},C))}:void 0,ne=h?function(e){h(e,f({},C))}:void 0,te=v?function(e){v(e,f({},C))}:void 0,re=p?function(e){p(e,f({},C))}:void 0;return S.jsx("svg",{style:{zIndex:Z},children:S.jsxs("g",{className:O(["ink-flow__edge","ink-flow__edge-".concat(j),C.className,E,{selected:C.selected,animated:C.animated,inactive:!z&&!c,updating:B,selectable:z}]),onClick:function(e){var t,r=Y.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,a=r.multiSelectionActive;z&&(Y.setState({nodesSelectionActive:!1}),C.selected&&a?(i({nodes:[],edges:[C]}),null===(t=T.current)||void 0===t||t.blur()):o([n])),c&&c(e,C)},onDoubleClick:J,onContextMenu:ee,onMouseEnter:ne,onMouseMove:te,onMouseLeave:re,onKeyDown:I?function(e){var t;if(!N&&wv.includes(e.key)&&z){var r=Y.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===e.key?(null===(t=T.current)||void 0===t||t.blur(),o({edges:[C]})):i([n])}}:void 0,tabIndex:I?0:void 0,role:I?"button":"img","data-id":n,"data-testid":"rf__edge-".concat(n),"aria-label":null===C.ariaLabel?void 0:C.ariaLabel||"Edge from ".concat(C.source," to ").concat(C.target),"aria-describedby":I?"".concat(K_,"-").concat(x):void 0,ref:T,children:[!V&&S.jsx(P,{id:n,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:F,sourceY:U,targetX:W,targetY:G,sourcePosition:q,targetPosition:$,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:K,markerEnd:Q,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),A&&S.jsx($E,{edge:C,isUpdatable:A,edgeUpdaterRadius:g,onEdgeUpdate:m,onEdgeUpdateStart:w,onEdgeUpdateEnd:b,sourceX:F,sourceY:U,targetX:W,targetY:G,sourcePosition:q,targetPosition:$,setUpdateHover:D,setUpdating:H,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle})]})})}var tS=function(e){return{width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError}};function rS(e){var n=e.defaultMarkerColor,t=e.rfId,r=e.noPanClassName,o=e.onEdgeUpdate,i=e.onEdgeContextMenu,a=e.onEdgeMouseEnter,u=e.onEdgeMouseMove,c=e.onEdgeMouseLeave,s=e.onEdgeClick,d=e.edgeTypes,f=Ex(tS,a_),h=f.edgesFocusable,v=f.edgesUpdatable,p=f.elementsSelectable,g=f.onError,y=function(e){var n=Ex(l((function(e){return e.edges.map((function(e){return e.id}))}),[e]),a_);return n}(!1);return S.jsxs("div",{className:"ink-flow__edges",children:[S.jsx(EE,{defaultColor:n,rfId:t}),y.map((function(e){return S.jsx(nS,{id:e,edgesFocusable:h,edgesUpdatable:v,elementsSelectable:p,noPanClassName:r,onEdgeUpdate:o,onContextMenu:i,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:s,rfId:t,onError:g,edgeTypes:d},e)}))]})}rS.displayName="EdgeRenderer";var oS,iS=c(rS),aS=function(e){return"translate(".concat(e.transform[0],"px,").concat(e.transform[1],"px) scale(").concat(e.transform[2],")")};function uS(e){var n=e.children,t=Ex(aS);return S.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:n})}var cS=((oS={})[Kv.Left]=Kv.Right,oS[Kv.Right]=Kv.Left,oS[Kv.Top]=Kv.Bottom,oS[Kv.Bottom]=Kv.Top,oS),lS=function(e){var n,t,r=e.nodeId,o=e.handleType,i=e.style,a=e.type,u=void 0===a?qv.Bezier:a,c=e.CustomComponent,s=e.connectionStatus,d=Ex(l((function(e){var n;return{fromNode:e.nodeLookup.get(r),handleId:null===(n=e.connectionStartHandle)||void 0===n?void 0:n.handleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode}}),[r]),a_),h=d.fromNode,v=d.handleId,p=d.toX,g=d.toY,m=d.connectionMode,w=null==h?void 0:h.internals.handleBounds,b=null==w?void 0:w[o];if(m===Uv.Loose&&(b=b||(null==w?void 0:w["source"===o?"target":"source"])),!h||!b)return null;var x=v?b.find((function(e){return e.id===v})):b[0],_=x?x.x+x.width/2:(null!==(n=h.measured.width)&&void 0!==n?n:0)/2,E=x?x.y+x.height/2:null!==(t=h.measured.height)&&void 0!==t?t:0,k=h.internals.positionAbsolute.x+_,N=h.internals.positionAbsolute.y+E,C=null==x?void 0:x.position,M=C?cS[C]:null;if(!C||!M)return null;if(c)return S.jsx(c,{connectionLineType:u,connectionLineStyle:i,fromNode:h,fromHandle:x,fromX:k,fromY:N,toX:p,toY:g,fromPosition:C,toPosition:M,connectionStatus:s});var O="",j={sourceX:k,sourceY:N,sourcePosition:C,targetX:p,targetY:g,targetPosition:M};return O=u===qv.Bezier?y(tp(j),1)[0]:u===qv.Step?y(dp(f(f({},j),{borderRadius:0})),1)[0]:u===qv.SmoothStep?y(dp(j),1)[0]:u===qv.SimpleBezier?y(ME(j),1)[0]:"M".concat(k,",").concat(N," ").concat(p,",").concat(g),S.jsx("path",{d:O,fill:"none",className:"react-flow__connection-path",style:i})};lS.displayName="ConnectionLine";var sS=function(e){var n,t;return{nodeId:null===(n=e.connectionStartHandle)||void 0===n?void 0:n.nodeId,handleType:null===(t=e.connectionStartHandle)||void 0===t?void 0:t.type,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height}};function dS(e){var n=e.containerStyle,t=e.style,r=e.type,o=e.component,i=Ex(sS,a_),a=i.nodeId,u=i.handleType,c=i.nodesConnectable,l=i.width,s=i.height,d=i.connectionStatus;return!!(a&&u&&l&&c)?S.jsx("svg",{style:n,width:l,height:s,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:O(["react-flow__connection",d]),children:S.jsx(lS,{nodeId:a,handleType:u,style:t,type:r,CustomComponent:o,connectionStatus:d})})}):null}function fS(e){var n=e.onNodeClick,t=e.onNodeDoubleClick,r=e.onNodeMouseEnter,o=e.onNodeMouseMove,i=e.onNodeMouseLeave,a=e.onNodeContextMenu,u=e.onEdgeClick,c=e.onEdgeDoubleClick,l=e.onEdgeMouseEnter,s=e.onEdgeMouseMove,d=e.onEdgeMouseLeave,f=e.onEdgeContextMenu,h=e.rfId,v=e.minZoom,p=e.maxZoom,g=e.noPanClassName,y=e.noDragClassName,m=e.nodeOrigin,w=e.viewport,b=e.disableKeyboardA11y,x=e.translateExtent,_=e.defaultViewport,E=e.nodeTypes,k=e.edgeTypes,N=e.elementsSelectable,C=e.defaultMarkerColor,M=e.connectionLineType,O=e.connectionLineStyle,j=e.connectionLineComponent,P=e.connectionLineContainerStyle,I=e.onPaneClick,A=e.onPaneContextMenu,z=e.onPaneMouseEnter,T=e.onPaneMouseMove,L=e.onPaneMouseLeave,B=e.onPaneScroll;return S.jsx(A_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:b,translateExtent:x,defaultViewport:_,elementsSelectable:N,onPaneClick:I,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:T,onPaneMouseLeave:L,onPaneScroll:B,children:S.jsxs(uS,{children:[S.jsx(iS,{rfId:h,edgeTypes:k,noPanClassName:g,onEdgeClick:u,onEdgeDoubleClick:c,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:d,onEdgeContextMenu:f,defaultMarkerColor:C}),S.jsx(dS,{style:O,type:M,component:j,containerStyle:P}),S.jsx("div",{className:"ink-flow__edgelabel-renderer"}),S.jsx(mE,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:n,onNodeDoubleClick:t,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:a}),S.jsx("div",{className:"ink-flow__viewport-portal"})]})})}fS.displayName="GraphView";var hS=c(fS),vS=function(e){var n,t,r=void 0===e?{}:e,o=r.nodes,i=r.edges,a=r.defaultNodes,u=r.defaultEdges;r.width,r.height,r.fitView;var c=new Map,l=new Map,s=new Map,d=new Map,f=null!==(n=null!=u?u:i)&&void 0!==n?n:[],h=null!==(t=null!=a?a:o)&&void 0!==t?t:[];Mx(s,d,f),Ox(h,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:h,nodeLookup:c,parentLookup:l,edges:f,edgeLookup:d,connectionLookup:s,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==a,hasDefaultEdges:void 0!==u,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:mv,nodeExtent:mv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Uv.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:L_,layoutTypes:{},centerConfig:{},centered:!1,lib:"react",debug:!1}},pS=function(e){var n,t,r=e.nodes,o=e.edges,i=e.defaultNodes,a=e.defaultEdges,u=e.width,c=e.height,l=e.fitView;return n=function(e,n){return f(f({},vS({nodes:r,edges:o,width:u,height:c,fitView:l,defaultNodes:i,defaultEdges:a})),{setNodes:function(t){var r=n();Ox(t,r.nodeLookup,r.parentLookup,{nodeOrigin:r.nodeOrigin,elevateNodesOnSelect:r.elevateNodesOnSelect,checkEquality:!0}),e({nodes:t})},setEdges:function(t){var r=n();Mx(r.connectionLookup,r.edgeLookup,t),e({edges:t})},setDefaultNodesAndEdges:function(t,r){t&&((0,n().setNodes)(t),e({hasDefaultNodes:!0})),r&&((0,n().setEdges)(r),e({hasDefaultEdges:!0}))},updateNodeInternals:function(e){var t=n(),r=t.triggerNodeChanges,o=t.nodeLookup,i=t.parentLookup,a=t.domNode,u=t.nodeOrigin,c=t.debug,l=function(e,n,t,r,o){var i=null==r?void 0:r.querySelector(".xyflow__viewport"),a=!1;if(!i)return{changes:[],updatedInternals:a};var u=[],c=window.getComputedStyle(i),l=new window.DOMMatrixReadOnly(c.transform).m22,s=[];if(e.forEach((function(e){var t=n.get(e.id);if(null==t?void 0:t.hidden)n.set(t.id,f(f({},t),{internals:f(f({},t.internals),{handleBounds:void 0})})),a=!0;else if(t){var r=$x(e.nodeElement),i=t.measured.width!==r.width||t.measured.height!==r.height;if(r.width&&r.height&&(i||!t.internals.handleBounds||e.force)){var c=f(f({},t),{measured:r,internals:f(f({},t.internals),{handleBounds:{source:n_(".source",e.nodeElement,l,t.origin||o),target:n_(".target",e.nodeElement,l,t.origin||o)}})});n.set(t.id,c),a=!0,i&&(u.push({id:c.id,type:"dimensions",dimensions:r}),c.expandParent&&c.parentId&&s.push({id:c.id,parentId:c.parentId,rect:Bx(c,c.origin||o)}))}}})),s.length>0){var d=jx(s,n,t,o);u.push.apply(u,m([],y(d),!1))}return{changes:u,updatedInternals:a}}(e,o,i,a,u),s=l.changes;l.updatedInternals&&(kx(o,{nodeOrigin:u}),(null==s?void 0:s.length)>0&&(c&&console.log("Ink Flow: trigger node changes",s),null==r||r(s)))},updateNodePositions:function(e,t){var r,o;void 0===t&&(t=!1);var i=[],a=[];try{for(var u=g(e),c=u.next();!c.done;c=u.next()){var l=y(c.value,2),s=l[0],d=l[1],h={id:s,type:"position",position:d.position,dragging:t};(null==d?void 0:d.expandParent)&&(null==d?void 0:d.parentId)&&h.position&&(i.push({id:s,parentId:d.parentId,rect:f(f({},d.internals.positionAbsolute),{width:d.measured.width,height:d.measured.height})}),h.position.x=Math.max(0,h.position.x),h.position.y=Math.max(0,h.position.y)),a.push(h)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}if(i.length>0){var v=n(),p=jx(i,v.nodeLookup,v.parentLookup);a.push.apply(a,m([],y(p),!1))}n().triggerNodeChanges(a)},triggerNodeChanges:function(e){var t=n(),r=t.onNodesChange,o=t.setNodes,i=t.nodes,a=t.hasDefaultNodes,u=t.debug;(null==e?void 0:e.length)&&(a&&o(v_(e,i)),u&&console.log("Ink Flow: trigger node changes",e),null==r||r(e))},triggerEdgeChanges:function(e){var t=n(),r=t.onEdgesChange,o=t.setEdges,i=t.edges,a=t.hasDefaultEdges,u=t.debug;(null==e?void 0:e.length)&&(a&&o(h_(e,i)),u&&console.log("Ink Flow: trigger edge changes",e),null==r||r(e))},addSelectedNodes:function(e){var t=n(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,a=t.triggerNodeChanges,u=t.triggerEdgeChanges;r?a(e.map((function(e){return p_(e,!0)}))):(a(g_(i,new Set(m([],y(e),!1)),!0)),u(g_(o)))},addSelectedEdges:function(e){var t=n(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,a=t.triggerNodeChanges,u=t.triggerEdgeChanges;r?u(e.map((function(e){return p_(e,!0)}))):(u(g_(o,new Set(m([],y(e),!1)))),a(g_(i,new Set,!0)))},unselectNodesAndEdges:function(e){var t=void 0===e?{}:e,r=t.nodes,o=t.edges,i=n(),a=i.edges,u=i.nodes,c=i.triggerNodeChanges,l=i.triggerEdgeChanges,s=o||a,d=(r||u).map((function(e){return e.selected=!1,p_(e.id,!1)})),f=s.map((function(e){return p_(e.id,!1)}));c(d),l(f)},setMinZoom:function(t){var r=n(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([t,i]),e({minZoom:t})},setMaxZoom:function(t){var r=n(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,t]),e({maxZoom:t})},setTranslateExtent:function(t){var r;null===(r=n().panZoom)||void 0===r||r.setTranslateExtent(t),e({translateExtent:t})},resetSelectedElements:function(){var e=n(),t=e.edges,r=e.nodes,o=e.triggerNodeChanges,i=e.triggerEdgeChanges,a=r.reduce((function(e,n){return n.selected?m(m([],y(e),!1),[p_(n.id,!1)],!1):e}),[]),u=t.reduce((function(e,n){return n.selected?m(m([],y(e),!1),[p_(n.id,!1)],!1):e}),[]);o(a),i(u)},setNodeExtent:function(t){var r,o,i=n().nodeLookup;try{for(var a=g(i),u=a.next();!u.done;u=a.next()){var c=y(u.value,2)[1],l=Ix(c.position,t);i.set(c.id,f(f({},c),{internals:f(f({},c.internals),{positionAbsolute:l})}))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}e({nodeExtent:t})},panBy:function(e){var t=n(),r=t.transform,o=t.width,i=t.height;return function(e){var n=e.delta,t=e.panZoom,r=e.transform,o=e.translateExtent,i=e.width,a=e.height;if(!t||!n.x&&!n.y)return!1;var u=t.setViewportConstrained({x:r[0]+n.x,y:r[1]+n.y,zoom:r[2]},[[0,0],[i,a]],o);return!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2])}({delta:e,panZoom:t.panZoom,transform:r,translateExtent:t.translateExtent,width:o,height:i})},cancelConnection:function(){return e({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(t){var r,o=n().connectionPosition,i=f(f({},t),{connectionPosition:null!==(r=t.connectionPosition)&&void 0!==r?r:o});e(i)},reset:function(){return e(f({},vS()))}})},t=Object.is,n?H(n,t):H};function gS(e){var n=e.initialNodes,t=e.initialEdges,r=e.defaultNodes,o=e.defaultEdges,a=e.initialWidth,u=e.initialHeight,c=e.fitView,l=e.children,s=y(i((function(){return pS({nodes:n,edges:t,defaultNodes:r,defaultEdges:o,width:a,height:u,fitView:c})})),1)[0];return S.jsx(X,{value:s,children:S.jsx(Y_,{children:l})})}function yS(e){var n=e.children,r=e.nodes,o=e.edges,i=e.defaultNodes,a=e.defaultEdges,u=e.width,c=e.height,l=e.fitView;return t(Y)?S.jsx(S.Fragment,{children:n}):S.jsx(gS,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:a,initialWidth:u,initialHeight:c,fitView:l,children:n})}var mS=m(m([],y(["nodes","edges","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions","nodeOrigin","autoLayout","layoutConfig","centerConfig","layoutTypes"]),!1),["rfId"],!1),wS=function(e){return{setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}},bS={translateExtent:mv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function xS(e){var n=Ex(wS,a_),t=n.setNodes,r=n.setEdges,o=n.setMinZoom,i=n.setMaxZoom,c=n.setTranslateExtent,l=n.setNodeExtent,s=n.reset,d=n.setDefaultNodesAndEdges,f=Sx();u((function(){return d(e.defaultNodes,e.defaultEdges),function(){h.current=bS,s()}}),[]);var h=a(bS);return u((function(){var n,a,u;try{for(var s=g(mS),d=s.next();!d.done;d=s.next()){var v=d.value,p=e[v];p!==h.current[v]&&(void 0!==e[v]&&("nodes"===v?t(p):"edges"===v?r(p):"minZoom"===v?o(p):"maxZoom"===v?i(p):"translateExtent"===v?c(p):"nodeExtent"===v?l(p):"fitView"===v?f.setState({fitViewOnInit:p}):"fitViewOptions"===v?f.setState({fitViewOnInitOptions:p}):f.setState(((u={})[v]=p,u))))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(a=s.return)&&a.call(s)}finally{if(n)throw n.error}}h.current=e}),mS.map((function(n){return e[n]}))),null}var _S={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var ES=Yx((function(e,n){var t=e.nodes,r=e.edges,o=e.translateExtent,i=void 0===o?mv:o,a=e.defaultViewport,u=void 0===a?T_:a,c=e.minZoom,l=void 0===c?.5:c,s=e.maxZoom,d=void 0===s?2:s,v=e.defaultMarkerColor,p=void 0===v?"#b1b1b7":v,g=e.nodeOrigin,y=e.noDragClassName,m=e.noPanClassName,w=e.disableKeyboardA11y,b=e.nodeTypes,x=e.edgeTypes;e.connectionMode;var _=e.connectionLineType,E=void 0===_?qv.Bezier:_,k=e.connectionLineStyle,N=e.connectionLineComponent,C=e.connectionLineContainerStyle,M=e.onNodeClick,j=e.onNodeDoubleClick,P=e.onNodeMouseEnter,I=e.onNodeMouseMove,A=e.onNodeMouseLeave,z=e.onNodeContextMenu,T=e.onEdgeClick,L=e.onEdgeMouseEnter,B=e.onEdgeMouseMove,D=e.onEdgeMouseLeave,R=e.onEdgeContextMenu,V=e.onEdgeDoubleClick,H=e.onNodesChange,Y=e.onEdgesChange,X=e.fitView,Z=e.fitViewOptions,F=e.nodeExtent,U=e.nodesDraggable,W=e.children,G=e.id,q=e.width,$=e.height,K=e.onPaneClick,Q=e.onPaneContextMenu,J=e.onPaneMouseEnter,ee=e.onPaneMouseMove,ne=e.onPaneMouseLeave,te=e.onPaneScroll,re=e.elementsSelectable,oe=void 0===re||re,ie=e.autoLayout,ae=void 0!==ie&&ie,ue=e.layoutConfig,ce=void 0===ue?L_:ue,le=e.centerConfig,se=void 0===le?{}:le,de=e.layoutTypes,fe=void 0===de?{}:de,he=h(e,["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","onNodesChange","onEdgesChange","fitView","fitViewOptions","nodeExtent","nodesDraggable","children","id","width","height","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoLayout","layoutConfig","centerConfig","layoutTypes"]),ve=G||"1";return S.jsx("div",f({},he,{ref:n,style:f({},_S),className:O(["ink-flow"]),"data-testid":"rf__wrapper",id:G,children:S.jsxs(yS,{nodes:t,edges:r,width:q,height:$,fitView:X,children:[S.jsx(hS,{onNodeClick:M,onNodeMouseEnter:P,onNodeMouseMove:I,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:j,onEdgeClick:T,onEdgeMouseEnter:L,onEdgeMouseMove:B,onEdgeMouseLeave:D,onEdgeContextMenu:R,onEdgeDoubleClick:V,rfId:ve,nodeTypes:b,edgeTypes:x,minZoom:l,maxZoom:d,nodeOrigin:g,noDragClassName:y,noPanClassName:m,disableKeyboardA11y:w,translateExtent:i,defaultMarkerColor:p,connectionLineType:E,connectionLineStyle:k,connectionLineComponent:N,connectionLineContainerStyle:C,defaultViewport:u,onPaneClick:K,onPaneContextMenu:Q,onPaneMouseEnter:J,onPaneMouseMove:ee,onPaneMouseLeave:ne,onPaneScroll:te}),S.jsx(xS,{nodes:t,edges:r,rfId:ve,onNodesChange:H,onEdgesChange:Y,fitView:X,fitViewOptions:Z,nodeExtent:F,nodesDraggable:U,elementsSelectable:oe,minZoom:l,maxZoom:d,nodeOrigin:g,autoLayout:ae,layoutConfig:ce,layoutTypes:fe,centerConfig:se}),W]})}))}));function SS(){return S.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.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 kS(){return S.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.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 NS(){return S.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.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 CS(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 MS(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 OS(e){var n=e.children,t=e.className,r=h(e,["children","className"]);return S.jsx("button",f({type:"button",className:O(["ink-flow__controls-button",t])},r,{children:n}))}var jS=function(e){return e.userSelectionActive?"none":"all"};function PS(e){var n=e.position,t=void 0===n?"top-left":n,r=e.children,o=e.className,i=e.style,a=h(e,["position","children","className","style"]),u=Ex(jS),c="".concat(t).split("-");return S.jsx("div",f({className:O(m(["ink-flow__panel",o],y(c),!1)),style:f(f({},i),{pointerEvents:u})},a,{children:r}))}var IS=function(e){return{isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}};function AS(e){var n=e.style,t=e.showZoom,r=void 0===t||t,o=e.showFitView,i=void 0===o||o,a=e.showInteractive,u=void 0===a||a,c=e.fitViewOptions,l=e.onZoomIn,s=e.onZoomOut,d=e.onFitView,f=e.onInteractiveChange,h=e.className,v=e.children,p=e.position,g=void 0===p?"bottom-left":p,y=e.orientation,m=void 0===y?"vertical":y,w=e["aria-label"],b=void 0===w?"Ink Flow controls":w,x=Sx(),_=Ex(IS,a_),E=_.isInteractive,k=_.minZoomReached,N=_.maxZoomReached,C=F_(),M=C.zoomIn,j=C.zoomOut,P=C.fitView,I="horizontal"===m?"horizontal":"vertical";return S.jsxs(PS,{className:O(["ink-flow__controls",I,h]),position:g,style:n,"data-testid":"rf__controls","aria-label":b,children:[i&&S.jsx(OS,{className:"ink-flow__controls-fitview",onClick:function(){P(c),null==d||d()},"aria-label":"fit view",children:S.jsx(NS,{})}),r&&S.jsxs("div",{className:"ink-flow__controls-zoom",children:[S.jsx(OS,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:N,children:S.jsx(SS,{})}),S.jsx(OS,{onClick:function(){j(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:k,children:S.jsx(kS,{})})]}),u&&S.jsx(OS,{className:"ink-flow__controls-interactive",onClick:function(){x.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==f||f(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?S.jsx(MS,{}):S.jsx(CS,{})}),v]})}AS.displayName="Controls";var zS,TS,LS=c(AS);function BS(e){var n=e.dimensions,t=e.lineWidth,r=e.variant,o=e.className;return S.jsx("path",{strokeWidth:t,d:"M".concat(n[0]/2," 0 V").concat(n[1]," M0 ").concat(n[1]/2," H").concat(n[0]),className:O(["react-flow__background-pattern",r,o])})}function DS(e){var n=e.radius,t=e.className;return S.jsx("circle",{cx:n,cy:n,r:n,className:O(["react-flow__background-pattern","dots",t])})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(zS||(zS={}));var RS=((TS={})[zS.Dots]=1,TS[zS.Lines]=1,TS[zS.Cross]=6,TS),VS=function(e){return{transform:e.transform,patternId:"pattern-".concat(e.rfId)}};function HS(e){var n=e.id,t=e.variant,r=void 0===t?zS.Dots:t,o=e.gap,i=void 0===o?20:o,u=e.size,c=e.lineWidth,l=void 0===c?1:c,s=e.offset,d=void 0===s?2:s,h=e.color,v=e.bgColor,p=e.style,g=e.className,y=e.patternClassName,m=a(null),w=Ex(VS,a_),b=w.transform,x=w.patternId,_=u||RS[r],E=r===zS.Dots,k=r===zS.Cross,N=Array.isArray(i)?i:[i,i],C=[N[0]*b[2]||1,N[1]*b[2]||1],M=_*b[2],j=k?[M,M]:C,P=E?[M/d,M/d]:[j[0]/d,j[1]/d],I="".concat(x).concat(n||"");return S.jsxs("svg",{className:O(["ink-flow__background",g]),style:f(f(f({},p),u_),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[S.jsx("pattern",{id:I,x:b[0]%C[0],y:b[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(P[0],",-").concat(P[1],")"),children:E?S.jsx(DS,{radius:M/d,className:y}):S.jsx(BS,{dimensions:j,lineWidth:l,variant:r,className:y})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(I,")")})]})}HS.displayName="Background";var YS=c(HS),XS=function(e){var n;return null===(n=e.domNode)||void 0===n?void 0:n.querySelector(".ink-flow__edgelabel-renderer")};function ZS(e){var n=e.children,t=Ex(XS);return t?d(n,t):null}export{YS as Background,zS as BackgroundVariant,NE as BaseEdge,qv as ConnectionLineType,Uv as ConnectionMode,OS as ControlButton,LS as Controls,ZS as EdgeLabelRenderer,lE as Handle,gS as InkFlowProvider,$v as MarkerType,Wv as PanOnScrollMode,Kv as Position,Gv as SelectionMode,AE as SmoothStepEdge,LE as StepEdge,ap as addEdge,fp as dagreLayout,ES as default,Jv as getBezierEdgeCenter,tp as getBezierPath,Cv as getConnectedEdges,rp as getEdgeCenter,Ev as getIncomers,kv as getNodesBounds,_v as getOutgoers,dp as getSmoothStepPath,cp as getStraightPath,Vv as getViewportForBounds,up as updateEdge,z_ as useEdgesState,F_ as useInkFlow,D_ as useNodesState,Ex as useStore,Sx as useStoreApi};
16
+ */I.exports=function(){if(O)return P;O=1;var t=n,e=L(),r="function"==typeof Object.is?Object.is:function(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t},o=e.useSyncExternalStore,i=t.useRef,u=t.useEffect,a=t.useMemo,c=t.useDebugValue;return P.useSyncExternalStoreWithSelector=function(n,t,e,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 t=d.value;if(s(t,n))return i=t}return i=n}if(t=i,r(o,n))return t;var e=l(n);return void 0!==s&&s(t,e)?t:(o=n,i=e)}var o,i,u=!1,a=void 0===e?null:e;return[function(){return n(t())},null===a?void 0:function(){return n(a())}]}),[t,e,l,s]);var h=o(n,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),c(h),h},P}();var T=b(I.exports);const B=n=>{let t;const e=new Set,r=(n,r)=>{const o="function"==typeof n?n(t):n;if(!Object.is(o,t)){const n=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),e.forEach((e=>e(t,n)))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>u,subscribe:n=>(e.add(n),()=>e.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."),e.clear()}},u=t=n(r,o,i);return i},{useDebugValue:D}=n,{useSyncExternalStoreWithSelector:R}=T,V=n=>n;function H(n,t=V,e){const r=R(n.subscribe,n.getState,n.getServerState||n.getInitialState,t,e);return D(r),r}const Y=(n,t)=>{const e=(n=>n?B(n):B)(n),r=(n,r=t)=>H(e,n,r);return Object.assign(r,e),r};var Z=t(null),X=Z.Provider,U=function(){return U=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},U.apply(this,arguments)};function F(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.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(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function $(n,t,e){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var G,q,K,Q,J,nn,tn,en,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,wn,bn,_n,xn,En,Sn,kn,Cn,Nn,Mn,On,jn,In,Pn,An,zn,Ln,Tn,Bn,Dn,Rn,Vn,Hn,Yn,Zn,Xn,Un,Fn,Wn,$n,Gn,qn,Kn,Qn,Jn,nt,tt,et,rt,ot,it,ut,at,ct,lt,st,ft,dt,ht,vt,pt,gt,yt,mt,wt,bt,_t,xt,Et,St,kt,Ct,Nt,Mt,Ot,jt,It,Pt,At,zt,Lt,Tt,Bt,Dt,Rt,Vt,Ht,Yt,Zt,Xt,Ut,Ft,Wt,$t,Gt,qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Kt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Qt(){return Q?K:(Q=1,K=function(n,t){return n===t||n!=n&&t!=t})}function Jt(){if(nn)return J;nn=1;var n=Qt();return J=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1},J}function ne(){if(fn)return sn;fn=1;var n=q?G:(q=1,G=function(){this.__data__=[],this.size=0}),t=function(){if(en)return tn;en=1;var n=Jt(),t=Array.prototype.splice;return tn=function(e){var r=this.__data__,o=n(r,e);return!(o<0||(o==r.length-1?r.pop():t.call(r,o,1),--this.size,0))}}(),e=function(){if(on)return rn;on=1;var n=Jt();return rn=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}}(),r=function(){if(an)return un;an=1;var n=Jt();return un=function(t){return n(this.__data__,t)>-1}}(),o=function(){if(ln)return cn;ln=1;var n=Jt();return cn=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,sn=i}function te(){if(_n)return bn;_n=1;var n="object"==typeof qt&&qt&&qt.Object===Object&&qt;return bn=n}function ee(){if(En)return xn;En=1;var n=te(),t="object"==typeof self&&self&&self.Object===Object&&self,e=n||t||Function("return this")();return xn=e}function re(){if(kn)return Sn;kn=1;var n=ee().Symbol;return Sn=n}function oe(){if(In)return jn;In=1;var n=re(),t=function(){if(Nn)return Cn;Nn=1;var n=re(),t=Object.prototype,e=t.hasOwnProperty,r=t.toString,o=n?n.toStringTag:void 0;return Cn=function(n){var t=e.call(n,o),i=n[o];try{n[o]=void 0;var u=!0}catch(n){}var a=r.call(n);return u&&(t?n[o]=i:delete n[o]),a}}(),e=function(){if(On)return Mn;On=1;var n=Object.prototype.toString;return Mn=function(t){return n.call(t)}}(),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)?t(n):e(n)}}function ie(){return An?Pn:(An=1,Pn=function(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)})}function ue(){if(Ln)return zn;Ln=1;var n=oe(),t=ie();return zn=function(e){if(!t(e))return!1;var r=n(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function ae(){if(Hn)return Vn;Hn=1;var n=Function.prototype.toString;return Vn=function(t){if(null!=t){try{return n.call(t)}catch(n){}try{return t+""}catch(n){}}return""}}function ce(){if(Wn)return Fn;Wn=1;var n=function(){if(Zn)return Yn;Zn=1;var n=ue(),t=function(){if(Rn)return Dn;Rn=1;var n,t=function(){if(Bn)return Tn;Bn=1;var n=ee()["__core-js_shared__"];return Tn=n}(),e=(n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Dn=function(n){return!!e&&e in n}}(),e=ie(),r=ae(),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 Yn=function(i){return!(!e(i)||t(i))&&(n(i)?l:o).test(r(i))}}(),t=Un?Xn:(Un=1,Xn=function(n,t){return null==n?void 0:n[t]});return Fn=function(e,r){var o=t(e,r);return n(o)?o:void 0}}function le(){if(Gn)return $n;Gn=1;var n=ce()(ee(),"Map");return $n=n}function se(){if(Kn)return qn;Kn=1;var n=ce()(Object,"create");return qn=n}function fe(){if(pt)return vt;pt=1;var n=ht?dt:(ht=1,dt=function(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n});return vt=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}}function de(){if(kt)return St;kt=1;var n=function(){if(ft)return st;ft=1;var n=function(){if(lt)return ct;lt=1;var n=function(){if(Jn)return Qn;Jn=1;var n=se();return Qn=function(){this.__data__=n?n(null):{},this.size=0}}(),t=tt?nt:(tt=1,nt=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}),e=function(){if(rt)return et;rt=1;var n=se(),t=Object.prototype.hasOwnProperty;return et=function(e){var r=this.__data__;if(n){var o=r[e];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(r,e)?r[e]:void 0}}(),r=function(){if(it)return ot;it=1;var n=se(),t=Object.prototype.hasOwnProperty;return ot=function(e){var r=this.__data__;return n?void 0!==r[e]:t.call(r,e)}}(),o=function(){if(at)return ut;at=1;var n=se();return ut=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,ct=i}(),t=ne(),e=le();return st=function(){this.size=0,this.__data__={hash:new n,map:new(e||t),string:new n}}}(),t=function(){if(yt)return gt;yt=1;var n=fe();return gt=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}}(),e=function(){if(wt)return mt;wt=1;var n=fe();return mt=function(t){return n(this,t).get(t)}}(),r=function(){if(_t)return bt;_t=1;var n=fe();return bt=function(t){return n(this,t).has(t)}}(),o=function(){if(Et)return xt;Et=1;var n=fe();return xt=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,St=i}function he(){if(Ot)return Mt;Ot=1;var n=ne(),t=function(){if(hn)return dn;hn=1;var n=ne();return dn=function(){this.__data__=new n,this.size=0}}(),e=pn?vn:(pn=1,vn=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}),r=yn?gn:(yn=1,gn=function(n){return this.__data__.get(n)}),o=wn?mn:(wn=1,mn=function(n){return this.__data__.has(n)}),i=function(){if(Nt)return Ct;Nt=1;var n=ne(),t=le(),e=de();return Ct=function(r,o){var i=this.__data__;if(i instanceof n){var u=i.__data__;if(!t||u.length<199)return u.push([r,o]),this.size=++i.size,this;i=this.__data__=new e(u)}return i.set(r,o),this.size=i.size,this}}();function u(t){var e=this.__data__=new n(t);this.size=e.size}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=r,u.prototype.has=o,u.prototype.set=i,Mt=u}function ve(){return It||(It=1,jt=function(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&!1!==t(n[e],e,n););return n}),jt}function pe(){if(At)return Pt;At=1;var n=ce(),t=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(n){}}();return Pt=t}function ge(){if(Lt)return zt;Lt=1;var n=pe();return zt=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}}function ye(){if(Bt)return Tt;Bt=1;var n=ge(),t=Qt(),e=Object.prototype.hasOwnProperty;return Tt=function(r,o,i){var u=r[o];e.call(r,o)&&t(u,i)&&(void 0!==i||o in r)||n(r,o,i)}}function me(){if(Rt)return Dt;Rt=1;var n=ye(),t=ge();return Dt=function(e,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],e[l],l,o,e):void 0;void 0===s&&(s=e[l]),u?t(o,l,s):n(o,l,s)}return o}}function we(){return Zt?Yt:(Zt=1,Yt=function(n){return null!=n&&"object"==typeof n})}function be(){if(Wt)return Ft;Wt=1;var n=function(){if(Ut)return Xt;Ut=1;var n=oe(),t=we();return Xt=function(e){return t(e)&&"[object Arguments]"==n(e)}}(),t=we(),e=Object.prototype,r=e.hasOwnProperty,o=e.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return t(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return Ft=i}function _e(){if(Gt)return $t;Gt=1;var n=Array.isArray;return $t=n}var xe,Ee,Se,ke,Ce,Ne,Me,Oe,je,Ie,Pe,Ae={exports:{}};function ze(){return Se||(Se=1,function(n,t){var e=ee(),r=Ee?xe:(Ee=1,xe=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&n&&!n.nodeType&&n,u=i&&i.exports===o?e.Buffer:void 0,a=(u?u.isBuffer:void 0)||r;n.exports=a}(Ae,Ae.exports)),Ae.exports}function Le(){if(Ce)return ke;Ce=1;var n=/^(?:0|[1-9]\d*)$/;return ke=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}}function Te(){return Me?Ne:(Me=1,Ne=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Be(){return Pe?Ie:(Pe=1,Ie=function(n){return function(t){return n(t)}})}var De,Re,Ve,He,Ye,Ze,Xe,Ue,Fe,We,$e,Ge,qe,Ke,Qe,Je,nr,tr,er,rr,or,ir,ur,ar,cr,lr,sr,fr={exports:{}};function dr(){return De||(De=1,n=fr,t=fr.exports,e=te(),r=t&&!t.nodeType&&t,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r&&e.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(n){}}(),n.exports=u),fr.exports;var n,t,e,r,o,i,u}function hr(){if(Ve)return Re;Ve=1;var n=function(){if(je)return Oe;je=1;var n=oe(),t=Te(),e=we(),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,Oe=function(o){return e(o)&&t(o.length)&&!!r[n(o)]}}(),t=Be(),e=dr(),r=e&&e.isTypedArray,o=r?t(r):n;return Re=o}function vr(){if(Ye)return He;Ye=1;var n=Ht?Vt:(Ht=1,Vt=function(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}),t=be(),e=_e(),r=ze(),o=Le(),i=hr(),u=Object.prototype.hasOwnProperty;return He=function(a,c){var l=e(a),s=!l&&t(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 pr(){if(Xe)return Ze;Xe=1;var n=Object.prototype;return Ze=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}}function gr(){return Fe||(Fe=1,Ue=function(n,t){return function(e){return n(t(e))}}),Ue}function yr(){if(qe)return Ge;qe=1;var n=pr(),t=function(){if($e)return We;$e=1;var n=gr()(Object.keys,Object);return We=n}(),e=Object.prototype.hasOwnProperty;return Ge=function(r){if(!n(r))return t(r);var o=[];for(var i in Object(r))e.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function mr(){if(Qe)return Ke;Qe=1;var n=ue(),t=Te();return Ke=function(e){return null!=e&&t(e.length)&&!n(e)}}function wr(){if(nr)return Je;nr=1;var n=vr(),t=yr(),e=mr();return Je=function(r){return e(r)?n(r):t(r)}}function br(){if(cr)return ar;cr=1;var n=vr(),t=function(){if(ur)return ir;ur=1;var n=ie(),t=pr(),e=or?rr:(or=1,rr=function(n){var t=[];if(null!=n)for(var e in Object(n))t.push(e);return t}),r=Object.prototype.hasOwnProperty;return ir=function(o){if(!n(o))return e(o);var i=t(o),u=[];for(var a in o)("constructor"!=a||!i&&r.call(o,a))&&u.push(a);return u}}(),e=mr();return ar=function(r){return e(r)?n(r,!0):t(r)}}var _r,xr,Er,Sr,kr,Cr,Nr,Mr,Or,jr,Ir,Pr,Ar,zr,Lr,Tr,Br,Dr,Rr,Vr,Hr,Yr,Zr,Xr,Ur,Fr,Wr,$r,Gr,qr,Kr,Qr,Jr,no,to,eo,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,bo,_o,xo,Eo,So,ko,Co,No,Mo,Oo,jo,Io,Po,Ao,zo,Lo,To,Bo,Do,Ro,Vo,Ho,Yo,Zo,Xo,Uo,Fo,Wo,$o,Go,qo,Ko,Qo,Jo,ni,ti,ei,ri,oi,ii,ui,ai,ci,li,si,fi,di,hi,vi,pi,gi,yi,mi,wi,bi,_i,xi,Ei,Si,ki,Ci,Ni,Mi,Oi,ji,Ii,Pi,Ai,zi,Li,Ti,Bi,Di,Ri,Vi,Hi,Yi,Zi,Xi,Ui,Fi,Wi,$i,Gi,qi,Ki,Qi,Ji,nu,tu,eu,ru,ou,iu,uu,au,cu,lu,su,fu,du,hu,vu,pu,gu,yu,mu,wu,bu,_u,xu,Eu,Su,ku,Cu,Nu,Mu,Ou,ju,Iu,Pu,Au,zu,Lu,Tu,Bu,Du,Ru,Vu,Hu,Yu,Zu,Xu,Uu,Fu,Wu,$u,Gu,qu,Ku,Qu,Ju,na,ta,ea,ra,oa,ia,ua,aa,ca,la,sa,fa,da,ha,va,pa,ga,ya,ma,wa,ba,_a,xa,Ea,Sa,ka,Ca,Na,Ma,Oa,ja,Ia,Pa,Aa,za,La,Ta,Ba,Da,Ra,Va,Ha,Ya,Za,Xa,Ua,Fa,Wa,$a,Ga,qa,Ka,Qa,Ja,nc,tc,ec,rc,oc,ic,uc,ac,cc,lc,sc,fc,dc,hc,vc,pc,gc,yc,mc,wc,bc,_c,xc,Ec,Sc,kc,Cc,Nc,Mc,Oc,jc,Ic,Pc={exports:{}};function Ac(){return _r||(_r=1,function(n,t){var e=ee(),r=t&&!t.nodeType&&t,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?e.Buffer:void 0,u=i?i.allocUnsafe:void 0;n.exports=function(n,t){if(t)return n.slice();var e=n.length,r=u?u(e):new n.constructor(e);return n.copy(r),r}}(Pc,Pc.exports)),Pc.exports}function zc(){return Er||(Er=1,xr=function(n,t){var e=-1,r=n.length;for(t||(t=Array(r));++e<r;)t[e]=n[e];return t}),xr}function Lc(){return kr||(kr=1,Sr=function(n,t){for(var e=-1,r=null==n?0:n.length,o=0,i=[];++e<r;){var u=n[e];t(u,e,n)&&(i[o++]=u)}return i}),Sr}function Tc(){return Nr?Cr:(Nr=1,Cr=function(){return[]})}function Bc(){if(Or)return Mr;Or=1;var n=Lc(),t=Tc(),e=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Mr=r?function(t){return null==t?[]:(t=Object(t),n(r(t),(function(n){return e.call(t,n)})))}:t}function Dc(){return Ar||(Ar=1,Pr=function(n,t){for(var e=-1,r=t.length,o=n.length;++e<r;)n[o+e]=t[e];return n}),Pr}function Rc(){if(Lr)return zr;Lr=1;var n=gr()(Object.getPrototypeOf,Object);return zr=n}function Vc(){if(Br)return Tr;Br=1;var n=Dc(),t=Rc(),e=Bc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)n(o,e(r)),r=t(r);return o}:r}function Hc(){if(Hr)return Vr;Hr=1;var n=Dc(),t=_e();return Vr=function(e,r,o){var i=r(e);return t(e)?i:n(i,o(e))}}function Yc(){if(Zr)return Yr;Zr=1;var n=Hc(),t=Bc(),e=wr();return Yr=function(r){return n(r,e,t)}}function Zc(){if(Kr)return qr;Kr=1;var n=ce()(ee(),"Set");return qr=n}function Xc(){if(to)return no;to=1;var n=function(){if(Wr)return Fr;Wr=1;var n=ce()(ee(),"DataView");return Fr=n}(),t=le(),e=function(){if(Gr)return $r;Gr=1;var n=ce()(ee(),"Promise");return $r=n}(),r=Zc(),o=function(){if(Jr)return Qr;Jr=1;var n=ce()(ee(),"WeakMap");return Qr=n}(),i=oe(),u=ae(),a="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",d=u(n),h=u(t),v=u(e),p=u(r),g=u(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=f||t&&y(new t)!=a||e&&y(e.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var t=i(n),e="[object Object]"==t?n.constructor:void 0,r=e?u(e):"";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 t}),no=y}function Uc(){if(io)return oo;io=1;var n=ee().Uint8Array;return oo=n}function Fc(){if(ao)return uo;ao=1;var n=Uc();return uo=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}}function Wc(){if(go)return po;go=1;var n=Fc();return po=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}}function $c(){if(bo)return wo;bo=1;var n=ie(),t=Object.create,e=function(){function e(){}return function(r){if(!n(r))return{};if(t)return t(r);e.prototype=r;var o=new e;return e.prototype=void 0,o}}();return wo=e}function Gc(){if(xo)return _o;xo=1;var n=$c(),t=Rc(),e=pr();return _o=function(r){return"function"!=typeof r.constructor||e(r)?{}:n(t(r))}}function qc(){if(Po)return Io;Po=1;var n=he(),t=ve(),e=ye(),r=function(){if(er)return tr;er=1;var n=me(),t=wr();return tr=function(e,r){return e&&n(r,t(r),e)}}(),o=function(){if(sr)return lr;sr=1;var n=me(),t=br();return lr=function(e,r){return e&&n(r,t(r),e)}}(),i=Ac(),u=zc(),a=function(){if(Ir)return jr;Ir=1;var n=me(),t=Bc();return jr=function(e,r){return n(e,t(e),r)}}(),c=function(){if(Rr)return Dr;Rr=1;var n=me(),t=Vc();return Dr=function(e,r){return n(e,t(e),r)}}(),l=Yc(),s=function(){if(Ur)return Xr;Ur=1;var n=Hc(),t=Vc(),e=br();return Xr=function(r){return n(r,e,t)}}(),f=Xc(),d=function(){if(ro)return eo;ro=1;var n=Object.prototype.hasOwnProperty;return eo=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r},eo}(),h=function(){if(mo)return yo;mo=1;var n=Fc(),t=function(){if(lo)return co;lo=1;var n=Fc();return co=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}}(),e=function(){if(fo)return so;fo=1;var n=/\w*$/;return so=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}}(),r=function(){if(vo)return ho;vo=1;var n=re(),t=n?n.prototype:void 0,e=t?t.valueOf:void 0;return ho=function(n){return e?Object(e.call(n)):{}}}(),o=Wc();return yo=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 t(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 e(i);case"[object Symbol]":return r(i)}}}(),v=Gc(),p=_e(),g=ze(),y=function(){if(Co)return ko;Co=1;var n=function(){if(So)return Eo;So=1;var n=Xc(),t=we();return Eo=function(e){return t(e)&&"[object Map]"==n(e)}}(),t=Be(),e=dr(),r=e&&e.isMap,o=r?t(r):n;return ko=o}(),m=ie(),w=function(){if(jo)return Oo;jo=1;var n=function(){if(Mo)return No;Mo=1;var n=Xc(),t=we();return No=function(e){return t(e)&&"[object Set]"==n(e)}}(),t=Be(),e=dr(),r=e&&e.isSet,o=r?t(r):n;return Oo=o}(),b=wr(),_=br(),x="[object Arguments]",E="[object Function]",S="[object Object]",k={};return k[x]=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,j,I,P){var A,z=1&M,L=2&M,T=4&M;if(O&&(A=I?O(N,j,I,P):O(N)),void 0!==A)return A;if(!m(N))return N;var B=p(N);if(B){if(A=d(N),!z)return u(N,A)}else{var D=f(N),R=D==E||"[object GeneratorFunction]"==D;if(g(N))return i(N,z);if(D==S||D==x||R&&!I){if(A=L||R?{}:v(N),!z)return L?c(N,o(A,N)):a(N,r(A,N))}else{if(!k[D])return I?N:{};A=h(N,D,z)}}P||(P=new n);var V=P.get(N);if(V)return V;P.set(N,A),w(N)?N.forEach((function(n){A.add(C(n,M,O,n,N,P))})):y(N)&&N.forEach((function(n,t){A.set(t,C(n,M,O,t,N,P))}));var H=B?void 0:(T?L?s:l:L?_:b)(N);return t(H||N,(function(n,t){H&&(n=N[t=n]),e(A,t,C(n,M,O,t,N,P))})),A},Io}function Kc(){if(zo)return Ao;zo=1;var n=qc();return Ao=function(t){return n(t,4)}}function Qc(){return To?Lo:(To=1,Lo=function(n){return function(){return n}})}function Jc(){if(Vo)return Ro;Vo=1;var n=(Do?Bo:(Do=1,Bo=function(n){return function(t,e,r){for(var o=-1,i=Object(t),u=r(t),a=u.length;a--;){var c=u[n?a:++o];if(!1===e(i[c],c,i))break}return t}}))();return Ro=n}function nl(){if(Yo)return Ho;Yo=1;var n=Jc(),t=wr();return Ho=function(e,r){return e&&n(e,r,t)}}function tl(){if(Fo)return Uo;Fo=1;var n=nl(),t=function(){if(Xo)return Zo;Xo=1;var n=mr();return Zo=function(t,e){return function(r,o){if(null==r)return r;if(!n(r))return t(r,o);for(var i=r.length,u=e?i:-1,a=Object(r);(e?u--:++u<i)&&!1!==o(a[u],u,a););return r}}}()(n);return Uo=t}function el(){return $o?Wo:($o=1,Wo=function(n){return n})}function rl(){if(qo)return Go;qo=1;var n=el();return Go=function(t){return"function"==typeof t?t:n}}function ol(){if(Qo)return Ko;Qo=1;var n=ve(),t=tl(),e=rl(),r=_e();return Ko=function(o,i){return(r(o)?n:t)(o,e(i))}}function il(){return ni?Jo:(ni=1,Jo=ol())}function ul(){if(ci)return ai;ci=1;var n=de(),t=oi?ri:(oi=1,ri=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),e=ui?ii:(ui=1,ii=function(n){return this.__data__.has(n)});function r(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}return r.prototype.add=r.prototype.push=t,r.prototype.has=e,ai=r}function al(){return di?fi:(di=1,fi=function(n,t){return n.has(t)})}function cl(){if(vi)return hi;vi=1;var n=ul(),t=(si||(si=1,li=function(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}),li),e=al();return hi=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(!t(o,(function(n,t){if(!e(g,t)&&(y===n||a(y,n,i,u,c)))return g.push(t)}))){p=!1;break}}else if(y!==m&&!a(y,m,i,u,c)){p=!1;break}}return c.delete(r),c.delete(o),p},hi}function ll(){return mi||(mi=1,yi=function(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=n})),e}),yi}function sl(){if(Si)return Ei;Si=1;var n=he(),t=cl(),e=function(){if(bi)return wi;bi=1;var n=re(),t=Uc(),e=Qt(),r=cl(),o=gi?pi:(gi=1,pi=function(n){var t=-1,e=Array(n.size);return n.forEach((function(n,r){e[++t]=[r,n]})),e}),i=ll(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return wi=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 t(n),new t(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return e(+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(xi)return _i;xi=1;var n=Yc(),t=Object.prototype.hasOwnProperty;return _i=function(e,r,o,i,u,a){var c=1&o,l=n(e),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:t.call(r,d)))return!1}var h=a.get(e),v=a.get(r);if(h&&v)return h==r&&v==e;var p=!0;a.set(e,r),a.set(r,e);for(var g=c;++f<s;){var y=e[d=l[f]],m=r[d];if(i)var w=c?i(m,y,d,r,e,a):i(y,m,d,e,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 b=e.constructor,_=r.constructor;b==_||!("constructor"in e)||!("constructor"in r)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(e),a.delete(r),p}}(),o=Xc(),i=_e(),u=ze(),a=hr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return Ei=function(d,h,v,p,g,y){var m=i(d),w=i(h),b=m?l:o(d),_=w?l:o(h),x=(b=b==c?s:b)==s,E=(_=_==c?s:_)==s,S=b==_;if(S&&u(d)){if(!u(h))return!1;m=!0,x=!1}if(S&&!x)return y||(y=new n),m||a(d)?t(d,h,v,p,g,y):e(d,h,b,v,p,g,y);if(!(1&v)){var k=x&&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 fl(){if(Ci)return ki;Ci=1;var n=sl(),t=we();return ki=function e(r,o,i,u,a){return r===o||(null==r||null==o||!t(r)&&!t(o)?r!=r&&o!=o:n(r,o,i,u,e,a))},ki}function dl(){if(ji)return Oi;ji=1;var n=ie();return Oi=function(t){return t==t&&!n(t)}}function hl(){return zi?Ai:(zi=1,Ai=function(n,t){return function(e){return null!=e&&e[n]===t&&(void 0!==t||n in Object(e))}})}function vl(){if(Di)return Bi;Di=1;var n=oe(),t=we();return Bi=function(e){return"symbol"==typeof e||t(e)&&"[object Symbol]"==n(e)}}function pl(){if(Vi)return Ri;Vi=1;var n=_e(),t=vl(),e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Ri=function(o,i){if(n(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||r.test(o)||!e.test(o)||null!=i&&o in Object(i)}}function gl(){return $i||($i=1,Wi=function(n,t){for(var e=-1,r=null==n?0:n.length,o=Array(r);++e<r;)o[e]=t(n[e],e,n);return o}),Wi}function yl(){if(Qi)return Ki;Qi=1;var n=function(){if(qi)return Gi;qi=1;var n=re(),t=gl(),e=_e(),r=vl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return Gi=function n(o){if("string"==typeof o)return o;if(e(o))return t(o,n)+"";if(r(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},Gi}();return Ki=function(t){return null==t?"":n(t)}}function ml(){if(nu)return Ji;nu=1;var n=_e(),t=pl(),e=function(){if(Fi)return Ui;Fi=1;var n=function(){if(Xi)return Zi;Xi=1;var n=function(){if(Yi)return Hi;Yi=1;var n=de();function t(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,t=r?r.apply(this,n):n[0],i=o.cache;if(i.has(t))return i.get(t);var u=e.apply(this,n);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||n),o}return t.Cache=n,Hi=t}();return Zi=function(t){var e=n(t,(function(n){return 500===r.size&&r.clear(),n})),r=e.cache;return e}}(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(t,(function(n,t,o,i){r.push(o?i.replace(e,"$1"):t||n)})),r}));return Ui=r}(),r=yl();return Ji=function(o,i){return n(o)?o:t(o,i)?[o]:e(r(o))}}function wl(){if(eu)return tu;eu=1;var n=vl();return tu=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}}function bl(){if(ou)return ru;ou=1;var n=ml(),t=wl();return ru=function(e,r){for(var o=0,i=(r=n(r,e)).length;null!=e&&o<i;)e=e[t(r[o++])];return o&&o==i?e:void 0}}function _l(){if(su)return lu;su=1;var n=ml(),t=be(),e=_e(),r=Le(),o=Te(),i=wl();return lu=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)&&(e(u)||t(u))}}function xl(){if(du)return fu;du=1;var n=cu?au:(cu=1,au=function(n,t){return null!=n&&t in Object(n)}),t=_l();return fu=function(e,r){return null!=e&&t(e,r,n)}}function El(){return gu?pu:(gu=1,pu=function(n){return function(t){return null==t?void 0:t[n]}})}function Sl(){if(xu)return _u;xu=1;var n=function(){if(Ti)return Li;Ti=1;var n=function(){if(Mi)return Ni;Mi=1;var n=he(),t=fl();return Ni=function(e,r,o,i){var u=o.length,a=u,c=!i;if(null==e)return!a;for(e=Object(e);u--;){var l=o[u];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++u<a;){var s=(l=o[u])[0],f=e[s],d=l[1];if(c&&l[2]){if(void 0===f&&!(s in e))return!1}else{var h=new n;if(i)var v=i(f,d,s,e,r,h);if(!(void 0===v?t(d,f,3,i,h):v))return!1}}return!0}}(),t=function(){if(Pi)return Ii;Pi=1;var n=dl(),t=wr();return Ii=function(e){for(var r=t(e),o=r.length;o--;){var i=r[o],u=e[i];r[o]=[i,u,n(u)]}return r}}(),e=hl();return Li=function(r){var o=t(r);return 1==o.length&&o[0][2]?e(o[0][0],o[0][1]):function(t){return t===r||n(t,r,o)}}}(),t=function(){if(vu)return hu;vu=1;var n=fl(),t=function(){if(uu)return iu;uu=1;var n=bl();return iu=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}}(),e=xl(),r=pl(),o=dl(),i=hl(),u=wl();return hu=function(a,c){return r(a)&&o(c)?i(u(a),c):function(r){var o=t(r,a);return void 0===o&&o===c?e(r,a):n(c,o,3)}}}(),e=el(),r=_e(),o=function(){if(bu)return wu;bu=1;var n=El(),t=function(){if(mu)return yu;mu=1;var n=bl();return yu=function(t){return function(e){return n(e,t)}}}(),e=pl(),r=wl();return wu=function(o){return e(o)?n(r(o)):t(o)}}();return _u=function(i){return"function"==typeof i?i:null==i?e:"object"==typeof i?r(i)?t(i[0],i[1]):n(i):o(i)}}function kl(){if(Su)return Eu;Su=1;var n=Lc(),t=function(){if(ei)return ti;ei=1;var n=tl();return ti=function(t,e){var r=[];return n(t,(function(n,t,o){e(n,t,o)&&r.push(n)})),r}}(),e=Sl(),r=_e();return Eu=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function Cl(){if(Mu)return Nu;Mu=1;var n=function(){if(Cu)return ku;Cu=1;var n=Object.prototype.hasOwnProperty;return ku=function(t,e){return null!=t&&n.call(t,e)}}(),t=_l();return Nu=function(e,r){return null!=e&&t(e,r,n)}}function Nl(){if(ju)return Ou;ju=1;var n=yr(),t=Xc(),e=be(),r=_e(),o=mr(),i=ze(),u=pr(),a=hr(),c=Object.prototype.hasOwnProperty;return Ou=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||a(l)||e(l)))return!l.length;var s=t(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(u(l))return!n(l).length;for(var f in l)if(c.call(l,f))return!1;return!0}}function Ml(){return Pu?Iu:(Pu=1,Iu=function(n){return void 0===n})}function Ol(){if(zu)return Au;zu=1;var n=tl(),t=mr();return Au=function(e,r){var o=-1,i=t(e)?Array(e.length):[];return n(e,(function(n,t,e){i[++o]=r(n,t,e)})),i}}function jl(){if(Tu)return Lu;Tu=1;var n=gl(),t=Sl(),e=Ol(),r=_e();return Lu=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function Il(){if(Yu)return Hu;Yu=1;var n=(Du||(Du=1,Bu=function(n,t,e,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);return e}),Bu),t=tl(),e=Sl(),r=Vu?Ru:(Vu=1,Ru=function(n,t,e,r,o){return o(n,(function(n,o,i){e=r?(r=!1,n):t(e,n,o,i)})),e}),o=_e();return Hu=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,e(u,4),a,l,t)},Hu}function Pl(){if(na)return Ju;na=1;var n=yr(),t=Xc(),e=mr(),r=function(){if(Xu)return Zu;Xu=1;var n=oe(),t=_e(),e=we();return Zu=function(r){return"string"==typeof r||!t(r)&&e(r)&&"[object String]"==n(r)}}(),o=function(){if(Qu)return Ku;Qu=1;var n=function(){if(Fu)return Uu;Fu=1;var n=El()("length");return Uu=n}(),t=function(){if($u)return Wu;$u=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Wu=function(t){return n.test(t)}}(),e=function(){if(qu)return Gu;qu=1;var n="\\ud800-\\udfff",t="["+n+"]",e="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+e+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+c+a+")*",s="(?:"+[o+e+"?",e,i,u,t].join("|")+")",f=RegExp(r+"(?="+r+")|"+s+l,"g");return Gu=function(n){for(var t=f.lastIndex=0;f.test(n);)++t;return t}}();return Ku=function(r){return t(r)?e(r):n(r)}}();return Ju=function(i){if(null==i)return 0;if(e(i))return r(i)?o(i):i.length;var u=t(i);return"[object Map]"==u||"[object Set]"==u?i.size:n(i).length}}function Al(){if(ea)return ta;ea=1;var n=ve(),t=$c(),e=nl(),r=Sl(),o=Rc(),i=_e(),u=ze(),a=ue(),c=ie(),l=hr();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)?t(o(s)):{}}return(v?n:e)(s,(function(n,t,e){return f(d,n,t,e)})),d}}function zl(){if(ua)return ia;ua=1;var n=Dc(),t=function(){if(oa)return ra;oa=1;var n=re(),t=be(),e=_e(),r=n?n.isConcatSpreadable:void 0;return ra=function(n){return e(n)||t(n)||!!(r&&n&&n[r])}}();return ia=function e(r,o,i,u,a){var c=-1,l=r.length;for(i||(i=t),a||(a=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?e(s,o-1,i,u,a):n(a,s):u||(a[a.length]=s)}return a},ia}function Ll(){if(sa)return la;sa=1;var n=ca?aa:(ca=1,aa=function(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}),t=Math.max;return la=function(e,r,o){return r=t(void 0===r?e.length-1:r,0),function(){for(var i=arguments,u=-1,a=t(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(e,this,l)}},la}function Tl(){if(ga)return pa;ga=1;var n=function(){if(da)return fa;da=1;var n=Qc(),t=pe(),e=el();return fa=t?function(e,r){return t(e,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:e}(),t=function(){if(va)return ha;va=1;var n=Date.now;return ha=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},ha}(),e=t(n);return pa=e}function Bl(){if(ma)return ya;ma=1;var n=el(),t=Ll(),e=Tl();return ya=function(r,o){return e(t(r,o,n),r+"")},ya}function Dl(){return ba||(ba=1,wa=function(n,t,e,r){for(var o=n.length,i=e+(r?1:-1);r?i--:++i<o;)if(t(n[i],i,n))return i;return-1}),wa}function Rl(){if(Ta)return La;Ta=1;var n=ul(),t=function(){if(Ma)return Na;Ma=1;var n=function(){if(Ca)return ka;Ca=1;var n=Dl(),t=xa?_a:(xa=1,_a=function(n){return n!=n}),e=(Sa||(Sa=1,Ea=function(n,t,e){for(var r=e-1,o=n.length;++r<o;)if(n[r]===t)return r;return-1}),Ea);return ka=function(r,o,i){return o==o?e(r,o,i):n(r,t,i)},ka}();return Na=function(t,e){return!(null==t||!t.length)&&n(t,e,0)>-1},Na}(),e=(ja||(ja=1,Oa=function(n,t,e){for(var r=-1,o=null==n?0:n.length;++r<o;)if(e(t,n[r]))return!0;return!1}),Oa),r=al(),o=function(){if(za)return Aa;za=1;var n=Zc(),t=Pa?Ia:(Pa=1,Ia=function(){}),e=ll(),r=n&&1/e(new n([,-0]))[1]==1/0?function(t){return new n(t)}:t;return Aa=r}(),i=ll();return La=function(u,a,c){var l=-1,s=t,f=u.length,d=!0,h=[],v=h;if(c)d=!1,s=e;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},La}function Vl(){if(Da)return Ba;Da=1;var n=mr(),t=we();return Ba=function(e){return t(e)&&n(e)}}function Hl(){if(Va)return Ra;Va=1;var n=zl(),t=Bl(),e=Rl(),r=Vl(),o=t((function(t){return e(n(t,1,r,!0))}));return Ra=o}function Yl(){if(Xa)return Za;Xa=1;var n=function(){if(Ya)return Ha;Ya=1;var n=gl();return Ha=function(t,e){return n(e,(function(n){return t[n]}))}}(),t=wr();return Za=function(e){return null==e?[]:n(e,t(e))}}function Zl(){if(Fa)return Ua;var n;Fa=1;try{n={clone:Kc(),constant:Qc(),each:il(),filter:kl(),has:Cl(),isArray:_e(),isEmpty:Nl(),isFunction:ue(),isUndefined:Ml(),keys:wr(),map:jl(),reduce:Il(),size:Pl(),transform:Al(),union:Hl(),values:Yl()}}catch(n){}return n||(n=window._),Ua=n}function Xl(){if($a)return Wa;$a=1;var n=Zl();Wa=e;var t="\0";function e(e){this._isDirected=!n.has(e,"directed")||e.directed,this._isMultigraph=!!n.has(e,"multigraph")&&e.multigraph,this._isCompound=!!n.has(e,"compound")&&e.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[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(n,t){n[t]?n[t]++:n[t]=1}function o(n,t){--n[t]||delete n[t]}function i(t,e,r,o){var i=""+e,u=""+r;if(!t&&i>u){var a=i;i=u,u=a}return i+""+u+""+(n.isUndefined(o)?"\0":o)}function u(n,t){return i(n,t.v,t.w,t.name)}return e.prototype._nodeCount=0,e.prototype._edgeCount=0,e.prototype.isDirected=function(){return this._isDirected},e.prototype.isMultigraph=function(){return this._isMultigraph},e.prototype.isCompound=function(){return this._isCompound},e.prototype.setGraph=function(n){return this._label=n,this},e.prototype.graph=function(){return this._label},e.prototype.setDefaultNodeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultNodeLabelFn=t,this},e.prototype.nodeCount=function(){return this._nodeCount},e.prototype.nodes=function(){return n.keys(this._nodes)},e.prototype.sources=function(){var t=this;return n.filter(this.nodes(),(function(e){return n.isEmpty(t._in[e])}))},e.prototype.sinks=function(){var t=this;return n.filter(this.nodes(),(function(e){return n.isEmpty(t._out[e])}))},e.prototype.setNodes=function(t,e){var r=arguments,o=this;return n.each(t,(function(n){r.length>1?o.setNode(n,e):o.setNode(n)})),this},e.prototype.setNode=function(e,r){return n.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=t,this._children[e]={},this._children[t][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},e.prototype.node=function(n){return this._nodes[n]},e.prototype.hasNode=function(t){return n.has(this._nodes,t)},e.prototype.removeNode=function(t){var e=this;if(n.has(this._nodes,t)){var r=function(n){e.removeEdge(e._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],n.each(this.children(t),(function(n){e.setParent(n)})),delete this._children[t]),n.each(n.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],n.each(n.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},e.prototype.setParent=function(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(r))r=t;else{for(var o=r+="";!n.isUndefined(o);o=this.parent(o))if(o===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this},e.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},e.prototype.parent=function(n){if(this._isCompound){var e=this._parent[n];if(e!==t)return e}},e.prototype.children=function(e){if(n.isUndefined(e)&&(e=t),this._isCompound){var r=this._children[e];if(r)return n.keys(r)}else{if(e===t)return this.nodes();if(this.hasNode(e))return[]}},e.prototype.predecessors=function(t){var e=this._preds[t];if(e)return n.keys(e)},e.prototype.successors=function(t){var e=this._sucs[t];if(e)return n.keys(e)},e.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return n.union(e,this.successors(t))},e.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},e.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),n.each(this._edgeObjs,(function(n){e.hasNode(n.v)&&e.hasNode(n.w)&&e.setEdge(n,r.edge(n))}));var o={};function i(n){var t=r.parent(n);return void 0===t||e.hasNode(t)?(o[n]=t,t):t in o?o[t]:i(t)}return this._isCompound&&n.each(e.nodes(),(function(n){e.setParent(n,i(n))})),e},e.prototype.setDefaultEdgeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultEdgeLabelFn=t,this},e.prototype.edgeCount=function(){return this._edgeCount},e.prototype.edges=function(){return n.values(this._edgeObjs)},e.prototype.setPath=function(t,e){var r=this,o=arguments;return n.reduce(t,(function(n,t){return o.length>1?r.setEdge(n,t,e):r.setEdge(n,t),t})),this},e.prototype.setEdge=function(){var t,e,o,u,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,o=c.name,2===arguments.length&&(u=arguments[1],a=!0)):(t=c,e=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),t=""+t,e=""+e,n.isUndefined(o)||(o=""+o);var l=i(this._isDirected,t,e,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(t),this.setNode(e),this._edgeLabels[l]=a?u:this._defaultEdgeLabelFn(t,e,o);var s=function(n,t,e,r){var o=""+t,i=""+e;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,t,e,o);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[l]=s,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=s,this._out[t][l]=s,this._edgeCount++,this},e.prototype.edge=function(n,t,e){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,t,e);return this._edgeLabels[r]},e.prototype.hasEdge=function(t,e,r){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,t,e,r);return n.has(this._edgeLabels,o)},e.prototype.removeEdge=function(n,t,e){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,t,e),a=this._edgeObjs[r];return a&&(n=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[t],n),o(this._sucs[n],t),delete this._in[t][r],delete this._out[n][r],this._edgeCount--),this},e.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var o=n.values(r);return e?n.filter(o,(function(n){return n.v===e})):o}},e.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var o=n.values(r);return e?n.filter(o,(function(n){return n.w===e})):o}},e.prototype.nodeEdges=function(n,t){var e=this.inEdges(n,t);if(e)return e.concat(this.outEdges(n,t))},Wa}function Ul(){if(nc)return Ja;nc=1;var n=Zl(),t=Xl();function e(t){return n.map(t.nodes(),(function(e){var r=t.node(e),o=t.parent(e),i={v:e};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(t){return n.map(t.edges(),(function(e){var r=t.edge(e),o={v:e.v,w:e.w};return n.isUndefined(e.name)||(o.name=e.name),n.isUndefined(r)||(o.value=r),o}))}return Ja={write:function(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:e(t),edges:r(t)};return n.isUndefined(t.graph())||(o.value=n.clone(t.graph())),o},read:function(e){var r=new t(e.options).setGraph(e.value);return n.each(e.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(e.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Fl(){if(ec)return tc;ec=1;var n=Zl();return tc=function(t){var e,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,e.push(o),n.each(t.successors(o),i),n.each(t.predecessors(o),i))}return n.each(t.nodes(),(function(n){e=[],i(n),e.length&&o.push(e)})),o},tc}function Wl(){if(oc)return rc;oc=1;var n=Zl();function t(){this._arr=[],this._keyIndices={}}return rc=t,t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},t.prototype.has=function(t){return n.has(this._keyIndices,t)},t.prototype.priority=function(n){var t=this._keyIndices[n];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!n.has(r,t)){var o=this._arr,i=o.length;return r[t]=i,o.push({key:t,priority:e}),this._decrease(i),!0}return!1},t.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},t.prototype.decrease=function(n,t){var e=this._keyIndices[n];if(t>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[e].priority+" New: "+t);this._arr[e].priority=t,this._decrease(e)},t.prototype._heapify=function(n){var t=this._arr,e=2*n,r=e+1,o=n;e<t.length&&(o=t[e].priority<t[o].priority?e:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},t.prototype._decrease=function(n){for(var t,e=this._arr,r=e[n].priority;0!==n&&!(e[t=n>>1].priority<r);)this._swap(n,t),n=t},t.prototype._swap=function(n,t){var e=this._arr,r=this._keyIndices,o=e[n],i=e[t];e[n]=i,e[t]=o,r[i.key]=n,r[o.key]=t},rc}function $l(){if(uc)return ic;uc=1;var n=Zl(),t=Wl();ic=function(n,r,o,i){return function(n,e,r,o){var i,u,a={},c=new t,l=function(n){var t=n.v!==i?n.v:n.w,e=a[t],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<e.distance&&(e.distance=l,e.predecessor=i,c.decrease(t,l))};for(n.nodes().forEach((function(n){var t=n===e?0:Number.POSITIVE_INFINITY;a[n]={distance:t},c.add(n,t)}));c.size()>0&&(i=c.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return a}(n,String(r),o||e,i||function(t){return n.outEdges(t)})};var e=n.constant(1);return ic}function Gl(){if(cc)return ac;cc=1;var n=$l(),t=Zl();return ac=function(e,r,o){return t.transform(e.nodes(),(function(t,i){t[i]=n(e,i,r,o)}),{})}}function ql(){if(sc)return lc;sc=1;var n=Zl();return lc=function(t){var e=0,r=[],o={},i=[];function u(a){var c=o[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach((function(t){n.has(o,t)?o[t].onStack&&(c.lowlink=Math.min(c.lowlink,o[t].index)):(u(t),c.lowlink=Math.min(c.lowlink,o[t].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 t.nodes().forEach((function(t){n.has(o,t)||u(t)})),i},lc}function Kl(){if(dc)return fc;dc=1;var n=Zl(),t=ql();return fc=function(e){return n.filter(t(e),(function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])}))}}function Ql(){if(vc)return hc;vc=1;var n=Zl();hc=function(n,e,r){return function(n,t,e){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(t){n!==t&&(r[n][t]={distance:Number.POSITIVE_INFINITY})})),e(n).forEach((function(e){var o=e.v===n?e.w:e.v,i=t(e);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var t=r[n];o.forEach((function(e){var i=r[e];o.forEach((function(e){var r=i[n],o=t[e],u=i[e],a=r.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)}))}))})),r}(n,e||t,r||function(t){return n.outEdges(t)})};var t=n.constant(1);return hc}function Jl(){if(gc)return pc;gc=1;var n=Zl();function t(t){var r={},o={},i=[];if(n.each(t.sinks(),(function u(a){if(n.has(o,a))throw new e;n.has(r,a)||(o[a]=!0,r[a]=!0,n.each(t.predecessors(a),u),delete o[a],i.push(a))})),n.size(r)!==t.nodeCount())throw new e;return i}function e(){}return pc=t,t.CycleException=e,e.prototype=new Error,pc}function ns(){if(mc)return yc;mc=1;var n=Jl();return yc=function(t){try{n(t)}catch(t){if(t instanceof n.CycleException)return!1;throw t}return!0}}function ts(){if(bc)return wc;bc=1;var n=Zl();function t(e,r,o,i,u,a){n.has(i,r)||(i[r]=!0,o||a.push(r),n.each(u(r),(function(n){t(e,n,o,i,u,a)})),o&&a.push(r))}return wc=function(e,r,o){n.isArray(r)||(r=[r]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),u=[],a={};return n.each(r,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);t(e,n,"post"===o,a,i,u)})),u},wc}function es(){if(xc)return _c;xc=1;var n=ts();return _c=function(t,e){return n(t,e,"post")}}function rs(){if(Sc)return Ec;Sc=1;var n=ts();return Ec=function(t,e){return n(t,e,"pre")}}function os(){if(Cc)return kc;Cc=1;var n=Zl(),t=Xl(),e=Wl();return kc=function(r,o){var i,u=new t,a={},c=new e;function l(n){var t=n.v===i?n.w:n.v,e=c.priority(t);if(void 0!==e){var r=o(n);r<e&&(a[t]=i,c.decrease(t,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},kc}try{Ic=function(){if(jc)return Oc;jc=1;var n=Qa?Ka:(Qa=1,Ka={Graph:Xl(),version:qa?Ga:(qa=1,Ga="2.1.8")});return Oc={Graph:n.Graph,json:Ul(),alg:Mc?Nc:(Mc=1,Nc={components:Fl(),dijkstra:$l(),dijkstraAll:Gl(),findCycles:Kl(),floydWarshall:Ql(),isAcyclic:ns(),postorder:es(),preorder:rs(),prim:os(),tarjan:ql(),topsort:Jl()}),version:n.version}}()}catch(U){}Ic||(Ic=window.graphlib);var is,us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,ws,bs,_s,xs,Es,Ss,ks,Cs,Ns,Ms,Os,js,Is,Ps,As,zs,Ls,Ts,Bs,Ds,Rs,Vs,Hs,Ys,Zs,Xs,Us,Fs,Ws,$s,Gs,qs,Ks,Qs,Js,nf,tf,ef,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,wf,bf,_f,xf,Ef,Sf,kf,Cf,Nf,Mf,Of,jf,If,Pf,Af,zf,Lf,Tf,Bf,Df,Rf,Vf,Hf,Yf,Zf,Xf,Uf=Ic;function Ff(){if(cs)return as;cs=1;var n=Qt(),t=mr(),e=Le(),r=ie();return as=function(o,i,u){if(!r(u))return!1;var a=typeof i;return!!("number"==a?t(u)&&e(i,u.length):"string"==a&&i in u)&&n(u[i],o)}}function Wf(){if(bs)return ws;bs=1;var n=function(){if(ms)return ys;ms=1;var n=function(){if(gs)return ps;gs=1;var n=function(){if(vs)return hs;vs=1;var n=/\s/;return hs=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}}(),t=/^\s+/;return ps=function(e){return e?e.slice(0,n(e)+1).replace(t,""):e}}(),t=ie(),e=vl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return ys=function(a){if("number"==typeof a)return a;if(e(a))return NaN;if(t(a)){var c="function"==typeof a.valueOf?a.valueOf():a;a=t(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}}(),t=1/0;return ws=function(e){return e?(e=n(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}function $f(){if(Ms)return Ns;Ms=1;var n=zl();return Ns=function(t){return null!=t&&t.length?n(t,1):[]}}function Gf(){if(Ts)return Ls;Ts=1;var n=vl();return Ls=function(t,e,r){for(var o=-1,i=t.length;++o<i;){var u=t[o],a=e(u);if(null!=a&&(void 0===c?a==a&&!n(a):r(a,c)))var c=a,l=u}return l},Ls}function qf(){if(Ys)return Hs;Ys=1;var n=ge(),t=Qt();return Hs=function(e,r,o){(void 0!==o&&!t(e[r],o)||void 0===o&&!(r in e))&&n(e,r,o)}}function Kf(){return Fs?Us:(Fs=1,Us=function(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]})}function Qf(){return of?rf:(of=1,rf=function(n,t){return n<t})}function Jf(){if(Lf)return zf;Lf=1;var n=gl(),t=bl(),e=Sl(),r=Ol(),o=(Of||(Of=1,Mf=function(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}),Mf),i=Be(),u=function(){if(Af)return Pf;Af=1;var n=function(){if(If)return jf;If=1;var n=vl();return jf=function(t,e){if(t!==e){var r=void 0!==t,o=null===t,i=t==t,u=n(t),a=void 0!==e,c=null===e,l=e==e,s=n(e);if(!c&&!s&&!u&&t>e||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&t<e||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}}();return Pf=function(t,e,r){for(var o=-1,i=t.criteria,u=e.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 t.index-e.index}}(),a=el(),c=_e();return zf=function(l,s,f){s=s.length?n(s,(function(n){return c(n)?function(e){return t(e,1===n.length?n[0]:n)}:n})):[a];var d=-1;s=n(s,i(e));var h=r(l,(function(t,e,r){return{criteria:n(s,(function(n){return n(t)})),index:++d,value:t}}));return o(h,(function(n,t){return u(n,t,f)}))}}try{Xf={cloneDeep:function(){if(us)return is;us=1;var n=qc();return is=function(t){return n(t,5)}}(),constant:Qc(),defaults:function(){if(ss)return ls;ss=1;var n=Bl(),t=Qt(),e=Ff(),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&&e(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||t(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return ls=u}(),each:il(),filter:kl(),find:function(){if(Cs)return ks;Cs=1;var n=function(){if(ds)return fs;ds=1;var n=Sl(),t=mr(),e=wr();return fs=function(r){return function(o,i,u){var a=Object(o);if(!t(o)){var c=n(i,3);o=e(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(Ss)return Es;Ss=1;var n=Dl(),t=Sl(),e=function(){if(xs)return _s;xs=1;var n=Wf();return _s=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}}(),r=Math.max;return Es=function(o,i,u){var a=null==o?0:o.length;if(!a)return-1;var c=null==u?0:e(u);return c<0&&(c=r(a+c,0)),n(o,t(i,3),c)},Es}());return ks=n}(),flatten:$f(),forEach:ol(),forIn:function(){if(js)return Os;js=1;var n=Jc(),t=rl(),e=br();return Os=function(r,o){return null==r?r:n(r,t(o),e)}}(),has:Cl(),isUndefined:Ml(),last:(Ps||(Ps=1,Is=function(n){var t=null==n?0:n.length;return t?n[t-1]:void 0}),Is),map:jl(),mapValues:function(){if(zs)return As;zs=1;var n=ge(),t=nl(),e=Sl();return As=function(r,o){var i={};return o=e(o,3),t(r,(function(t,e,r){n(i,e,o(t,e,r))})),i}}(),max:function(){if(Vs)return Rs;Vs=1;var n=Gf(),t=Ds?Bs:(Ds=1,Bs=function(n,t){return n>t}),e=el();return Rs=function(r){return r&&r.length?n(r,e,t):void 0},Rs}(),merge:function(){if(ef)return tf;ef=1;var n=function(){if(Qs)return Ks;Qs=1;var n=he(),t=qf(),e=Jc(),r=function(){if(qs)return Gs;qs=1;var n=qf(),t=Ac(),e=Wc(),r=zc(),o=Gc(),i=be(),u=_e(),a=Vl(),c=ze(),l=ue(),s=ie(),f=function(){if(Xs)return Zs;Xs=1;var n=oe(),t=Rc(),e=we(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return Zs=function(r){if(!e(r)||"[object Object]"!=n(r))return!1;var o=t(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=hr(),h=Kf(),v=function(){if($s)return Ws;$s=1;var n=me(),t=br();return Ws=function(e){return n(e,t(e))}}();return Gs=function(p,g,y,m,w,b,_){var x=h(p,y),E=h(g,y),S=_.get(E);if(S)n(p,y,S);else{var k=b?b(x,E,y+"",p,g,_):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(x)?k=x:a(x)?k=r(x):M?(C=!1,k=t(E,!0)):O?(C=!1,k=e(E,!0)):k=[]:f(E)||i(E)?(k=x,i(x)?k=v(x):s(x)&&!l(x)||(k=o(E))):C=!1}C&&(_.set(E,k),w(k,E,m,b,_),_.delete(E)),n(p,y,k)}}}(),o=ie(),i=br(),u=Kf();return Ks=function a(c,l,s,f,d){c!==l&&e(l,(function(e,i){if(d||(d=new n),o(e))r(c,l,i,s,a,f,d);else{var h=f?f(u(c,i),e,i+"",c,l,d):void 0;void 0===h&&(h=e),t(c,i,h)}}),i)},Ks}(),t=function(){if(nf)return Js;nf=1;var n=Bl(),t=Ff();return Js=function(e){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=e.length>3&&"function"==typeof u?(i--,u):void 0,a&&t(r[0],r[1],a)&&(u=i<3?void 0:u,i=1),n=Object(n);++o<i;){var c=r[o];c&&e(n,c,o,u)}return n}))}}()((function(t,e,r){n(t,e,r)}));return tf=t}(),min:function(){if(af)return uf;af=1;var n=Gf(),t=Qf(),e=el();return uf=function(r){return r&&r.length?n(r,e,t):void 0},uf}(),minBy:function(){if(lf)return cf;lf=1;var n=Gf(),t=Sl(),e=Qf();return cf=function(r,o){return r&&r.length?n(r,t(o,2),e):void 0},cf}(),now:function(){if(ff)return sf;ff=1;var n=ee();return sf=function(){return n.Date.now()}}(),pick:function(){if(_f)return bf;_f=1;var n=function(){if(yf)return gf;yf=1;var n=function(){if(pf)return vf;pf=1;var n=bl(),t=function(){if(hf)return df;hf=1;var n=ye(),t=ml(),e=Le(),r=ie(),o=wl();return df=function(i,u,a,c){if(!r(i))return i;for(var l=-1,s=(u=t(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:e(u[l+1])?[]:{})}n(d,h,v),d=d[h]}return i}}(),e=ml();return vf=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)&&t(c,e(l,r),s)}return c}}(),t=xl();return gf=function(e,r){return n(e,r,(function(n,r){return t(e,r)}))}}(),t=function(){if(wf)return mf;wf=1;var n=$f(),t=Ll(),e=Tl();return mf=function(r){return e(t(r,void 0,n),r+"")}}()((function(t,e){return null==t?{}:n(t,e)}));return bf=t}(),range:function(){if(Nf)return Cf;Nf=1;var n=function(){if(kf)return Sf;kf=1;var n=function(){if(Ef)return xf;Ef=1;var n=Math.ceil,t=Math.max;return xf=function(e,r,o,i){for(var u=-1,a=t(n((r-e)/(o||1)),0),c=Array(a);a--;)c[i?a:++u]=e,e+=o;return c},xf}(),t=Ff(),e=Wf();return Sf=function(r){return function(o,i,u){return u&&"number"!=typeof u&&t(o,i,u)&&(i=u=void 0),o=e(o),void 0===i?(i=o,o=0):i=e(i),u=void 0===u?o<i?1:-1:e(u),n(o,i,u,r)}},Sf}()();return Cf=n}(),reduce:Il(),sortBy:function(){if(Bf)return Tf;Bf=1;var n=zl(),t=Jf(),e=Bl(),r=Ff(),o=e((function(e,o){if(null==e)return[];var i=o.length;return i>1&&r(e,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(e,n(o,1),[])}));return Tf=o}(),uniqueId:function(){if(Rf)return Df;Rf=1;var n=yl(),t=0;return Df=function(e){var r=++t;return n(e)+r},Df}(),values:Yl(),zipObject:function(){if(Zf)return Yf;Zf=1;var n=ye(),t=Hf?Vf:(Hf=1,Vf=function(n,t,e){for(var r=-1,o=n.length,i=t.length,u={};++r<o;){var a=r<i?t[r]:void 0;e(u,n[r],a)}return u});return Yf=function(e,r){return t(e||[],r||[],n)}}()}}catch(U){}Xf||(Xf=window._);var nd=Xf,td=ed;function ed(){var n={};n._next=n._prev=n,this._sentinel=n}function rd(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function od(n,t){if("_next"!==n&&"_prev"!==n)return t}ed.prototype.dequeue=function(){var n=this._sentinel,t=n._prev;if(t!==n)return rd(t),t},ed.prototype.enqueue=function(n){var t=this._sentinel;n._prev&&n._next&&rd(n),n._next=t._next,t._next._prev=n,t._next=n,n._prev=t},ed.prototype.toString=function(){for(var n=[],t=this._sentinel,e=t._prev;e!==t;)n.push(JSON.stringify(e,od)),e=e._prev;return"["+n.join(", ")+"]"};var id=nd,ud=Uf.Graph,ad=td,cd=id.constant(1);function ld(n,t,e,r,o){var i=o?[]:void 0;return id.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,sd(t,e,a)})),id.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,sd(t,e,u)})),n.removeNode(r.v),i}function sd(n,t,e){e.out?e.in?n[e.out-e.in+t].enqueue(e):n[n.length-1].enqueue(e):n[0].enqueue(e)}var fd=nd,dd=function(n,t){if(n.nodeCount()<=1)return[];var e=function(n,t){var e=new ud,r=0,o=0;id.forEach(n.nodes(),(function(n){e.setNode(n,{v:n,in:0,out:0})})),id.forEach(n.edges(),(function(n){var i=e.edge(n.v,n.w)||0,u=t(n),a=i+u;e.setEdge(n.v,n.w,a),o=Math.max(o,e.node(n.v).out+=u),r=Math.max(r,e.node(n.w).in+=u)}));var i=id.range(o+r+3).map((function(){return new ad})),u=r+1;return id.forEach(e.nodes(),(function(n){sd(i,u,e.node(n))})),{graph:e,buckets:i,zeroIdx:u}}(n,t||cd),r=function(n,t,e){for(var r,o=[],i=t[t.length-1],u=t[0];n.nodeCount();){for(;r=u.dequeue();)ld(n,t,e,r);for(;r=i.dequeue();)ld(n,t,e,r);if(n.nodeCount())for(var a=t.length-2;a>0;--a)if(r=t[a].dequeue()){o=o.concat(ld(n,t,e,r,!0));break}}return o}(e.graph,e.buckets,e.zeroIdx);return id.flatten(id.map(r,(function(t){return n.outEdges(t.v,t.w)})),!0)},hd={run:function(n){var t="greedy"===n.graph().acyclicer?dd(n,function(n){return function(t){return n.edge(t).weight}}(n)):function(n){var t=[],e={},r={};return fd.forEach(n.nodes(),(function o(i){fd.has(r,i)||(r[i]=!0,e[i]=!0,fd.forEach(n.outEdges(i),(function(n){fd.has(e,n.w)?t.push(n):o(n.w)})),delete e[i])})),t}(n);fd.forEach(t,(function(t){var e=n.edge(t);n.removeEdge(t),e.forwardName=t.name,e.reversed=!0,n.setEdge(t.w,t.v,e,fd.uniqueId("rev"))}))},undo:function(n){fd.forEach(n.edges(),(function(t){var e=n.edge(t);if(e.reversed){n.removeEdge(t);var r=e.forwardName;delete e.reversed,delete e.forwardName,n.setEdge(t.w,t.v,e,r)}}))}},vd=nd,pd=Uf.Graph,gd={addDummyNode:yd,simplify:function(n){var t=(new pd).setGraph(n.graph());return vd.forEach(n.nodes(),(function(e){t.setNode(e,n.node(e))})),vd.forEach(n.edges(),(function(e){var r=t.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);t.setEdge(e.v,e.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),t},asNonCompoundGraph:function(n){var t=new pd({multigraph:n.isMultigraph()}).setGraph(n.graph());return vd.forEach(n.nodes(),(function(e){n.children(e).length||t.setNode(e,n.node(e))})),vd.forEach(n.edges(),(function(e){t.setEdge(e,n.edge(e))})),t},successorWeights:function(n){var t=vd.map(n.nodes(),(function(t){var e={};return vd.forEach(n.outEdges(t),(function(t){e[t.w]=(e[t.w]||0)+n.edge(t).weight})),e}));return vd.zipObject(n.nodes(),t)},predecessorWeights:function(n){var t=vd.map(n.nodes(),(function(t){var e={};return vd.forEach(n.inEdges(t),(function(t){e[t.v]=(e[t.v]||0)+n.edge(t).weight})),e}));return vd.zipObject(n.nodes(),t)},intersectRect:function(n,t){var e,r,o=n.x,i=n.y,u=t.x-o,a=t.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),e=l*u/a,r=l):(u<0&&(c=-c),e=c,r=c*a/u),{x:o+e,y:i+r}},buildLayerMatrix:function(n){var t=vd.map(vd.range(md(n)+1),(function(){return[]}));return vd.forEach(n.nodes(),(function(e){var r=n.node(e),o=r.rank;vd.isUndefined(o)||(t[o][r.order]=e)})),t},normalizeRanks:function(n){var t=vd.min(vd.map(n.nodes(),(function(t){return n.node(t).rank})));vd.forEach(n.nodes(),(function(e){var r=n.node(e);vd.has(r,"rank")&&(r.rank-=t)}))},removeEmptyRanks:function(n){var t=vd.min(vd.map(n.nodes(),(function(t){return n.node(t).rank}))),e=[];vd.forEach(n.nodes(),(function(r){var o=n.node(r).rank-t;e[o]||(e[o]=[]),e[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;vd.forEach(e,(function(t,e){vd.isUndefined(t)&&e%o!=0?--r:r&&vd.forEach(t,(function(t){n.node(t).rank+=r}))}))},addBorderNode:function(n,t,e,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=r),yd(n,"border",o,t)},maxRank:md,partition:function(n,t){var e={lhs:[],rhs:[]};return vd.forEach(n,(function(n){t(n)?e.lhs.push(n):e.rhs.push(n)})),e},time:function(n,t){var e=vd.now();try{return t()}finally{console.log(n+" time: "+(vd.now()-e)+"ms")}},notime:function(n,t){return t()}};function yd(n,t,e,r){var o;do{o=vd.uniqueId(r)}while(n.hasNode(o));return e.dummy=t,n.setNode(o,e),o}function md(n){return vd.max(vd.map(n.nodes(),(function(t){var e=n.node(t).rank;if(!vd.isUndefined(e))return e})))}var wd=nd,bd=gd,_d={run:function(n){n.graph().dummyChains=[],wd.forEach(n.edges(),(function(t){!function(n,t){var e,r,o,i=t.v,u=n.node(i).rank,a=t.w,c=n.node(a).rank,l=t.name,s=n.edge(t),f=s.labelRank;if(c!==u+1){for(n.removeEdge(t),o=0,++u;u<c;++o,++u)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:t,rank:u},e=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,e,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(e),i=e;n.setEdge(i,a,{weight:s.weight},l)}}(n,t)}))},undo:function(n){wd.forEach(n.graph().dummyChains,(function(t){var e,r=n.node(t),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)e=n.successors(t)[0],n.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=e,r=n.node(t)}))}},xd=nd,Ed=function(n){var t={};xd.forEach(n.sources(),(function e(r){var o=n.node(r);if(xd.has(t,r))return o.rank;t[r]=!0;var i=xd.min(xd.map(n.outEdges(r),(function(t){return e(t.w)-n.edge(t).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},Sd=function(n,t){return n.node(t.w).rank-n.node(t.v).rank-n.edge(t).minlen},kd=nd,Cd=Uf.Graph,Nd=Sd,Md=function(n){var t,e,r=new Cd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Od(r,n)<i;)t=jd(r,n),e=r.hasNode(t.v)?Nd(n,t):-Nd(n,t),Id(r,n,e);return r};function Od(n,t){return kd.forEach(n.nodes(),(function e(r){kd.forEach(t.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||Nd(t,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),e(u))}))})),n.nodeCount()}function jd(n,t){return kd.minBy(t.edges(),(function(e){if(n.hasNode(e.v)!==n.hasNode(e.w))return Nd(t,e)}))}function Id(n,t,e){kd.forEach(n.nodes(),(function(n){t.node(n).rank+=e}))}var Pd=nd,Ad=Md,zd=Sd,Ld=Ed,Td=Uf.alg.preorder,Bd=Uf.alg.postorder,Dd=gd.simplify,Rd=Vd;function Vd(n){n=Dd(n),Ld(n);var t,e=Ad(n);for(Zd(e),Hd(e,n);t=Ud(e);)Wd(e,n,t,Fd(e,n,t))}function Hd(n,t){var e=Bd(n,n.nodes());e=e.slice(0,e.length-1),Pd.forEach(e,(function(e){!function(n,t,e){var r=n.node(e).parent;n.edge(e,r).cutvalue=Yd(n,t,e)}(n,t,e)}))}function Yd(n,t,e){var r=n.node(e).parent,o=!0,i=t.edge(e,r),u=0;return i||(o=!1,i=t.edge(r,e)),u=i.weight,Pd.forEach(t.nodeEdges(e),(function(i){var a,c,l=i.v===e,s=l?i.w:i.v;if(s!==r){var f=l===o,d=t.edge(i).weight;if(u+=f?d:-d,a=e,c=s,n.hasEdge(a,c)){var h=n.edge(e,s).cutvalue;u+=f?-h:h}}})),u}function Zd(n,t){arguments.length<2&&(t=n.nodes()[0]),Xd(n,{},1,t)}function Xd(n,t,e,r,o){var i=e,u=n.node(r);return t[r]=!0,Pd.forEach(n.neighbors(r),(function(o){Pd.has(t,o)||(e=Xd(n,t,e,o,r))})),u.low=i,u.lim=e++,o?u.parent=o:delete u.parent,e}function Ud(n){return Pd.find(n.edges(),(function(t){return n.edge(t).cutvalue<0}))}function Fd(n,t,e){var r=e.v,o=e.w;t.hasEdge(r,o)||(r=e.w,o=e.v);var i=n.node(r),u=n.node(o),a=i,c=!1;i.lim>u.lim&&(a=u,c=!0);var l=Pd.filter(t.edges(),(function(t){return c===$d(n,n.node(t.v),a)&&c!==$d(n,n.node(t.w),a)}));return Pd.minBy(l,(function(n){return zd(t,n)}))}function Wd(n,t,e,r){var o=e.v,i=e.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Zd(n),Hd(n,t),function(n,t){var e=Pd.find(n.nodes(),(function(n){return!t.node(n).parent})),r=Td(n,e);r=r.slice(1),Pd.forEach(r,(function(e){var r=n.node(e).parent,o=t.edge(e,r),i=!1;o||(o=t.edge(r,e),i=!0),t.node(e).rank=t.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,t)}function $d(n,t,e){return e.low<=t.lim&&t.lim<=e.lim}Vd.initLowLimValues=Zd,Vd.initCutValues=Hd,Vd.calcCutValue=Yd,Vd.leaveEdge=Ud,Vd.enterEdge=Fd,Vd.exchangeEdges=Wd;var Gd=Ed,qd=Md,Kd=Rd,Qd=Gd;var Jd=nd,nh=nd,th=gd,eh={run:function(n){var t=th.addDummyNode(n,"root",{},"_root"),e=function(n){var t={};function e(r,o){var i=n.children(r);i&&i.length&&nh.forEach(i,(function(n){e(n,o+1)})),t[r]=o}return nh.forEach(n.children(),(function(n){e(n,1)})),t}(n),r=nh.max(nh.values(e))-1,o=2*r+1;n.graph().nestingRoot=t,nh.forEach(n.edges(),(function(t){n.edge(t).minlen*=o}));var i=function(n){return nh.reduce(n.edges(),(function(t,e){return t+n.edge(e).weight}),0)}(n)+1;nh.forEach(n.children(),(function(u){rh(n,t,o,i,r,e,u)})),n.graph().nodeRankFactor=o},cleanup:function(n){var t=n.graph();n.removeNode(t.nestingRoot),delete t.nestingRoot,nh.forEach(n.edges(),(function(t){n.edge(t).nestingEdge&&n.removeEdge(t)}))}};function rh(n,t,e,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,nh.forEach(a,(function(a){rh(n,t,e,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(t,c,{weight:0,minlen:o+i[u]})}else u!==t&&n.setEdge(t,u,{weight:0,minlen:e})}var oh=nd,ih=gd;function uh(n,t,e,r,o,i){var u={width:0,height:0,rank:i,borderType:t},a=o[t][i-1],c=ih.addDummyNode(n,"border",u,e);o[t][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var ah=nd,ch={adjust:function(n){var t=n.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||lh(n)},undo:function(n){var t=n.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(n){ah.forEach(n.nodes(),(function(t){fh(n.node(t))})),ah.forEach(n.edges(),(function(t){var e=n.edge(t);ah.forEach(e.points,fh),ah.has(e,"y")&&fh(e)}))}(n),"lr"!==t&&"rl"!==t||(function(n){ah.forEach(n.nodes(),(function(t){dh(n.node(t))})),ah.forEach(n.edges(),(function(t){var e=n.edge(t);ah.forEach(e.points,dh),ah.has(e,"x")&&dh(e)}))}(n),lh(n))}};function lh(n){ah.forEach(n.nodes(),(function(t){sh(n.node(t))})),ah.forEach(n.edges(),(function(t){sh(n.edge(t))}))}function sh(n){var t=n.width;n.width=n.height,n.height=t}function fh(n){n.y=-n.y}function dh(n){var t=n.x;n.x=n.y,n.y=t}var hh=nd,vh=nd;function ph(n,t,e){for(var r=vh.zipObject(e,vh.map(e,(function(n,t){return t}))),o=vh.flatten(vh.map(t,(function(t){return vh.sortBy(vh.map(n.outEdges(t),(function(t){return{pos:r[t.w],weight:n.edge(t).weight}})),"pos")})),!0),i=1;i<e.length;)i<<=1;var u=2*i-1;i-=1;var a=vh.map(new Array(u),(function(){return 0})),c=0;return vh.forEach(o.forEach((function(n){var t=n.pos+i;a[t]+=n.weight;for(var e=0;t>0;)t%2&&(e+=a[t+1]),a[t=t-1>>1]+=n.weight;c+=n.weight*e}))),c}var gh=nd,yh=nd,mh=nd,wh=gd;function bh(n,t,e){for(var r;t.length&&(r=mh.last(t)).i<=e;)t.pop(),n.push(r.vs),e++;return e}var _h=nd,xh=nd,Eh=Uf.Graph,Sh=nd,kh=nd,Ch=function(n){var t={},e=hh.filter(n.nodes(),(function(t){return!n.children(t).length})),r=hh.max(hh.map(e,(function(t){return n.node(t).rank}))),o=hh.map(hh.range(r+1),(function(){return[]}));var i=hh.sortBy(e,(function(t){return n.node(t).rank}));return hh.forEach(i,(function e(r){if(!hh.has(t,r)){t[r]=!0;var i=n.node(r);o[i.rank].push(r),hh.forEach(n.successors(r),e)}})),o},Nh=function(n,t){for(var e=0,r=1;r<t.length;++r)e+=ph(n,t[r-1],t[r]);return e},Mh=function n(t,e,r,o){var i=t.children(e),u=t.node(e),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,t){return gh.map(t,(function(t){var e=n.inEdges(t);if(e.length){var r=gh.reduce(e,(function(t,e){var r=n.edge(e),o=n.node(e.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}}))}(t,i);_h.forEach(s,(function(e){if(t.children(e.v).length){var i=n(t,e.v,r,o);l[e.v]=i,_h.has(i,"barycenter")&&(u=e,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,t){var e={};return yh.forEach(n,(function(n,t){var r=e[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:t};yh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),yh.forEach(t.edges(),(function(n){var t=e[n.v],r=e[n.w];yh.isUndefined(t)||yh.isUndefined(r)||(r.indegree++,t.out.push(e[n.w]))})),function(n){var t=[];function e(n){return function(t){t.merged||(yh.isUndefined(t.barycenter)||yh.isUndefined(n.barycenter)||t.barycenter>=n.barycenter)&&function(n,t){var e=0,r=0;n.weight&&(e+=n.barycenter*n.weight,r+=n.weight),t.weight&&(e+=t.barycenter*t.weight,r+=t.weight),n.vs=t.vs.concat(n.vs),n.barycenter=e/r,n.weight=r,n.i=Math.min(t.i,n.i),t.merged=!0}(n,t)}}function r(t){return function(e){e.in.push(t),0==--e.indegree&&n.push(e)}}for(;n.length;){var o=n.pop();t.push(o),yh.forEach(o.in.reverse(),e(o)),yh.forEach(o.out,r(o))}return yh.map(yh.filter(t,(function(n){return!n.merged})),(function(n){return yh.pick(n,["vs","i","barycenter","weight"])}))}(yh.filter(e,(function(n){return!n.indegree})))}(s,r);!function(n,t){_h.forEach(n,(function(n){n.vs=_h.flatten(n.vs.map((function(n){return t[n]?t[n].vs:n})),!0)}))}(f,l);var d=function(n,t){var e,r=wh.partition(n,(function(n){return mh.has(n,"barycenter")})),o=r.lhs,i=mh.sortBy(r.rhs,(function(n){return-n.i})),u=[],a=0,c=0,l=0;o.sort((e=!!t,function(n,t){return n.barycenter<t.barycenter?-1:n.barycenter>t.barycenter?1:e?t.i-n.i:n.i-t.i})),l=bh(u,i,l),mh.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:mh.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),t.predecessors(a).length)){var h=t.node(t.predecessors(a)[0]),v=t.node(t.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},Oh=function(n,t,e){var r=function(n){for(var t;n.hasNode(t=xh.uniqueId("_root")););return t}(n),o=new Eh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(t){return n.node(t)}));return xh.forEach(n.nodes(),(function(i){var u=n.node(i),a=n.parent(i);(u.rank===t||u.minRank<=t&&t<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||r),xh.forEach(n[e](i),(function(t){var e=t.v===i?t.w:t.v,r=o.edge(e,i),u=xh.isUndefined(r)?0:r.weight;o.setEdge(e,i,{weight:n.edge(t).weight+u})})),xh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[t],borderRight:u.borderRight[t]}))})),o},jh=Uf.Graph,Ih=gd;function Ph(n,t,e){return kh.map(t,(function(t){return Oh(n,t,e)}))}function Ah(n,t){var e=new jh;kh.forEach(n,(function(n){var r=n.graph().root,o=Mh(n,r,e,t);kh.forEach(o.vs,(function(t,e){n.node(t).order=e})),function(n,t,e){var r,o={};Sh.forEach(e,(function(e){for(var i,u,a=n.parent(e);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=r,r=a),u&&u!==a)return void t.setEdge(u,a);a=i}}))}(n,e,o.vs)}))}function zh(n,t){kh.forEach(t,(function(t){kh.forEach(t,(function(t,e){n.node(t).order=e}))}))}var Lh=nd,Th=Uf.Graph,Bh=gd;function Dh(n,t,e){if(t>e){var r=t;t=e,e=r}var o=n[t];o||(n[t]=o={}),o[e]=!0}function Rh(n,t,e){if(t>e){var r=t;t=e,e=r}return Lh.has(n[t],e)}var Vh=nd,Hh=gd,Yh=function(n){var t,e=Bh.buildLayerMatrix(n),r=Lh.merge(function(n,t){var e={};return Lh.reduce(t,(function(t,r){var o=0,i=0,u=t.length,a=Lh.last(r);return Lh.forEach(r,(function(t,c){var l=function(n,t){if(n.node(t).dummy)return Lh.find(n.predecessors(t),(function(t){return n.node(t).dummy}))}(n,t),s=l?n.node(l).order:u;(l||t===a)&&(Lh.forEach(r.slice(i,c+1),(function(t){Lh.forEach(n.predecessors(t),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(t).dummy||Dh(e,r,t)}))})),i=c+1,o=s)})),r})),e}(n,e),function(n,t){var e={};function r(t,r,o,i,u){var a;Lh.forEach(Lh.range(r,o),(function(r){a=t[r],n.node(a).dummy&&Lh.forEach(n.predecessors(a),(function(t){var r=n.node(t);r.dummy&&(r.order<i||r.order>u)&&Dh(e,t,a)}))}))}return Lh.reduce(t,(function(t,e){var o,i=-1,u=0;return Lh.forEach(e,(function(a,c){if("border"===n.node(a).dummy){var l=n.predecessors(a);l.length&&(o=n.node(l[0]).order,r(e,u,c,i,o),u=c,i=o)}r(e,u,e.length,o,t.length)})),e})),e}(n,e)),o={};Lh.forEach(["u","d"],(function(i){t="u"===i?e:Lh.values(e).reverse(),Lh.forEach(["l","r"],(function(e){"r"===e&&(t=Lh.map(t,(function(n){return Lh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,t,e,r){var o={},i={},u={};return Lh.forEach(t,(function(n){Lh.forEach(n,(function(n,t){o[n]=n,i[n]=n,u[n]=t}))})),Lh.forEach(t,(function(n){var t=-1;Lh.forEach(n,(function(n){var a=r(n);if(a.length){a=Lh.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&&t<u[f]&&!Rh(e,n,f)&&(i[f]=n,i[n]=o[n]=o[f],t=u[f])}}}))})),{root:o,align:i}}(0,t,r,u),c=function(n,t,e,r,o){var i={},u=function(n,t,e,r){var o=new Th,i=n.graph(),u=function(n,t,e){return function(r,o,i){var u,a=r.node(o),c=r.node(i),l=0;if(l+=a.width/2,Lh.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(l+=e?u:-u),u=0,l+=(a.dummy?t:n)/2,l+=(c.dummy?t:n)/2,l+=c.width/2,Lh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(l+=e?u:-u),u=0,l}}(i.nodesep,i.edgesep,r);return Lh.forEach(t,(function(t){var r;Lh.forEach(t,(function(t){var i=e[t];if(o.setNode(i),r){var a=e[r],c=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,t,r),c||0))}r=t}))})),o}(n,t,e,o),a=o?"borderLeft":"borderRight";function c(n,t){for(var e=u.nodes(),r=e.pop(),o={};r;)o[r]?n(r):(o[r]=!0,e.push(r),e=e.concat(t(r))),r=e.pop()}return c((function(n){i[n]=u.inEdges(n).reduce((function(n,t){return Math.max(n,i[t.v]+u.edge(t))}),0)}),u.predecessors.bind(u)),c((function(t){var e=u.outEdges(t).reduce((function(n,t){return Math.min(n,i[t.w]-u.edge(t))}),Number.POSITIVE_INFINITY),r=n.node(t);e!==Number.POSITIVE_INFINITY&&r.borderType!==a&&(i[t]=Math.max(i[t],e))}),u.successors.bind(u)),Lh.forEach(r,(function(n){i[n]=i[e[n]]})),i}(n,t,a.root,a.align,"r"===e);"r"===e&&(c=Lh.mapValues(c,(function(n){return-n}))),o[i+e]=c}))}));var i=function(n,t){return Lh.minBy(Lh.values(t),(function(t){var e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Lh.forIn(t,(function(t,o){var i=function(n,t){return n.node(t).width}(n,o)/2;e=Math.max(t+i,e),r=Math.min(t-i,r)})),e-r}))}(n,o);return function(n,t){var e=Lh.values(t),r=Lh.min(e),o=Lh.max(e);Lh.forEach(["u","d"],(function(e){Lh.forEach(["l","r"],(function(i){var u,a=e+i,c=n[a];if(c!==t){var l=Lh.values(c);(u="l"===i?r-Lh.min(l):o-Lh.max(l))&&(n[a]=Lh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,t){return Lh.mapValues(n.ul,(function(e,r){if(t)return n[t.toLowerCase()][r];var o=Lh.sortBy(Lh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Zh=nd,Xh=hd,Uh=_d,Fh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Kd(n)}(n);break;case"tight-tree":!function(n){Gd(n),qd(n)}(n);break;case"longest-path":Qd(n)}},Wh=gd.normalizeRanks,$h=function(n){var t=function(n){var t={},e=0;return Jd.forEach(n.children(),(function r(o){var i=e;Jd.forEach(n.children(o),r),t[o]={low:i,lim:e++}})),t}(n);Jd.forEach(n.graph().dummyChains,(function(e){for(var r=n.node(e),o=r.edgeObj,i=function(n,t,e,r){var o,i,u=[],a=[],c=Math.min(t[e].low,t[r].low),l=Math.max(t[e].lim,t[r].lim);o=e;do{o=n.parent(o),u.push(o)}while(o&&(t[o].low>c||l>t[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,t,o.v,o.w),u=i.path,a=i.lca,c=0,l=u[c],s=!0;e!==o.w;){if(r=n.node(e),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(e,l),e=n.successors(e)[0]}}))},Gh=gd.removeEmptyRanks,qh=eh,Kh=function(n){oh.forEach(n.children(),(function t(e){var r=n.children(e),o=n.node(e);if(r.length&&oh.forEach(r,t),oh.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)uh(n,"borderLeft","_bl",e,o,i),uh(n,"borderRight","_br",e,o,i)}}))},Qh=ch,Jh=function(n){var t=Ih.maxRank(n),e=Ph(n,kh.range(1,t+1),"inEdges"),r=Ph(n,kh.range(t-1,-1,-1),"outEdges"),o=Ch(n);zh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Ah(a%2?e:r,a%4>=2),o=Ih.buildLayerMatrix(n);var l=Nh(n,o);l<u&&(c=0,i=kh.cloneDeep(o),u=l)}zh(n,i)},nv=function(n){(function(n){var t=Hh.buildLayerMatrix(n),e=n.graph().ranksep,r=0;Vh.forEach(t,(function(t){var o=Vh.max(Vh.map(t,(function(t){return n.node(t).height})));Vh.forEach(t,(function(t){n.node(t).y=r+o/2})),r+=o+e}))})(n=Hh.asNonCompoundGraph(n)),Vh.forEach(Yh(n),(function(t,e){n.node(e).x=t}))},tv=gd,ev=Uf.Graph,rv=["nodesep","edgesep","ranksep","marginx","marginy"],ov={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},iv=["acyclicer","ranker","rankdir","align"],uv=["width","height"],av={width:0,height:0},cv=["minlen","weight","width","height","labeloffset"],lv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sv=["labelpos"];function fv(n,t){return Zh.mapValues(Zh.pick(n,t),Number)}function dv(n){var t={};return Zh.forEach(n,(function(n,e){t[e.toLowerCase()]=n})),t}var hv=nd,vv=gd,pv=Uf.Graph,gv={debugOrdering:function(n){var t=vv.buildLayerMatrix(n),e=new pv({compound:!0,multigraph:!0}).setGraph({});return hv.forEach(n.nodes(),(function(t){e.setNode(t,{label:t}),e.setParent(t,"layer"+n.node(t).rank)})),hv.forEach(n.edges(),(function(n){e.setEdge(n.v,n.w,{},n.name)})),hv.forEach(t,(function(n,t){var r="layer"+t;e.setNode(r,{rank:"same"}),hv.reduce(n,(function(n,t){return e.setEdge(n,t,{style:"invis"}),t}))})),e}},yv=Kt({graphlib:Uf,layout:function(n,t){var e=t&&t.debugTiming?tv.time:tv.notime;e("layout",(function(){var t=e(" buildLayoutGraph",(function(){return function(n){var t=new ev({multigraph:!0,compound:!0}),e=dv(n.graph());return t.setGraph(Zh.merge({},ov,fv(e,rv),Zh.pick(e,iv))),Zh.forEach(n.nodes(),(function(e){var r=dv(n.node(e));t.setNode(e,Zh.defaults(fv(r,uv),av)),t.setParent(e,n.parent(e))})),Zh.forEach(n.edges(),(function(e){var r=dv(n.edge(e));t.setEdge(e,Zh.merge({},lv,fv(r,cv),Zh.pick(r,sv)))})),t}(n)}));e(" runLayout",(function(){!function(n,t){t(" makeSpaceForEdgeLabels",(function(){!function(n){var t=n.graph();t.ranksep/=2,Zh.forEach(n.edges(),(function(e){var r=n.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),t(" removeSelfEdges",(function(){!function(n){Zh.forEach(n.edges(),(function(t){if(t.v===t.w){var e=n.node(t.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:t,label:n.edge(t)}),n.removeEdge(t)}}))}(n)})),t(" acyclic",(function(){Xh.run(n)})),t(" nestingGraph.run",(function(){qh.run(n)})),t(" rank",(function(){Fh(tv.asNonCompoundGraph(n))})),t(" injectEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);if(e.width&&e.height){var r=n.node(t.v),o={rank:(n.node(t.w).rank-r.rank)/2+r.rank,e:t};tv.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),t(" removeEmptyRanks",(function(){Gh(n)})),t(" nestingGraph.cleanup",(function(){qh.cleanup(n)})),t(" normalizeRanks",(function(){Wh(n)})),t(" assignRankMinMax",(function(){!function(n){var t=0;Zh.forEach(n.nodes(),(function(e){var r=n.node(e);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,t=Zh.max(t,r.maxRank))})),n.graph().maxRank=t}(n)})),t(" removeEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){var e=n.node(t);"edge-proxy"===e.dummy&&(n.edge(e.e).labelRank=e.rank,n.removeNode(t))}))}(n)})),t(" normalize.run",(function(){Uh.run(n)})),t(" parentDummyChains",(function(){$h(n)})),t(" addBorderSegments",(function(){Kh(n)})),t(" order",(function(){Jh(n)})),t(" insertSelfEdges",(function(){!function(n){var t=tv.buildLayerMatrix(n);Zh.forEach(t,(function(t){var e=0;Zh.forEach(t,(function(t,r){var o=n.node(t);o.order=r+e,Zh.forEach(o.selfEdges,(function(t){tv.addDummyNode(n,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:r+ ++e,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(n)})),t(" adjustCoordinateSystem",(function(){Qh.adjust(n)})),t(" position",(function(){nv(n)})),t(" positionSelfEdges",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){var e=n.node(t);if("selfedge"===e.dummy){var r=n.node(e.e.v),o=r.x+r.width/2,i=r.y,u=e.x-o,a=r.height/2;n.setEdge(e.e,e.label),n.removeNode(t),e.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}],e.label.x=e.x,e.label.y=e.y}}))}(n)})),t(" removeBorderNodes",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){if(n.children(t).length){var e=n.node(t),r=n.node(e.borderTop),o=n.node(e.borderBottom),i=n.node(Zh.last(e.borderLeft)),u=n.node(Zh.last(e.borderRight));e.width=Math.abs(u.x-i.x),e.height=Math.abs(o.y-r.y),e.x=i.x+e.width/2,e.y=r.y+e.height/2}})),Zh.forEach(n.nodes(),(function(t){"border"===n.node(t).dummy&&n.removeNode(t)}))}(n)})),t(" normalize.undo",(function(){Uh.undo(n)})),t(" fixupEdgeLabelCoords",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);if(Zh.has(e,"x"))switch("l"!==e.labelpos&&"r"!==e.labelpos||(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset}}))}(n)})),t(" undoCoordinateSystem",(function(){Qh.undo(n)})),t(" translateGraph",(function(){!function(n){var t=Number.POSITIVE_INFINITY,e=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;t=Math.min(t,i-a/2),e=Math.max(e,i+a/2),r=Math.min(r,u-c/2),o=Math.max(o,u+c/2)}Zh.forEach(n.nodes(),(function(t){c(n.node(t))})),Zh.forEach(n.edges(),(function(t){var e=n.edge(t);Zh.has(e,"x")&&c(e)})),t-=u,r-=a,Zh.forEach(n.nodes(),(function(e){var o=n.node(e);o.x-=t,o.y-=r})),Zh.forEach(n.edges(),(function(e){var o=n.edge(e);Zh.forEach(o.points,(function(n){n.x-=t,n.y-=r})),Zh.has(o,"x")&&(o.x-=t),Zh.has(o,"y")&&(o.y-=r)})),i.width=e-t+u,i.height=o-r+a}(n)})),t(" assignNodeIntersects",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e,r,o=n.edge(t),i=n.node(t.v),u=n.node(t.w);o.points?(e=o.points[0],r=o.points[o.points.length-1]):(o.points=[],e=u,r=i),o.points.unshift(tv.intersectRect(i,e)),o.points.push(tv.intersectRect(u,r))}))}(n)})),t(" reversePoints",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);e.reversed&&e.points.reverse()}))}(n)})),t(" acyclic.undo",(function(){Xh.undo(n)}))}(t,e)})),e(" updateInputGraph",(function(){!function(n,t){Zh.forEach(n.nodes(),(function(e){var r=n.node(e),o=t.node(e);r&&(r.x=o.x,r.y=o.y,t.children(e).length&&(r.width=o.width,r.height=o.height))})),Zh.forEach(n.edges(),(function(e){var r=n.edge(e),o=t.edge(e);r.points=o.points,Zh.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=t.graph().width,n.graph().height=t.graph().height}(n,t)}))}))},debug:gv,util:{time:gd.time,notime:gd.notime},version:"0.8.5"}),mv=function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},wv=function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},bv=function(){return"The Ink Flow parent container needs a width and a height to render the graph."},_v=function(){return"Only child nodes can use a parent extent."},xv=function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},Ev=function(n,t){var e=t.id,r=t.sourceHandle,o=t.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(e,".")},Sv=function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},kv=function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},Cv=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.')},Nv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mv=["Enter"," ","Escape"],Ov=.5,jv=2,Iv=[0,0],Pv=function(n,t,e){if(!n.id)return[];var r=new Set;return e.forEach((function(t){t.source===n.id&&r.add(t.target)})),t.filter((function(n){return r.has(n.id)}))},Av=function(n,t,e){if(!n.id)return[];var r=new Set;return e.forEach((function(t){t.target===n.id&&r.add(t.source)})),t.filter((function(n){return r.has(n.id)}))},zv=function(n,t){void 0===t&&(t=[0,0]);var e=Kv(n),r=e.width,o=e.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||t,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}}},Lv=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var e=n.reduce((function(n,e){var r=Xv(e,t.nodeOrigin);return Yv(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zv(e)},Tv=function(n,t){var e=new Set;return n.forEach((function(n){e.add(n.id)})),t.filter((function(n){return e.has(n.source)||e.has(n.target)}))};function Bv(n){var t=n.nodeId,e=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(t),l=c.parentId?r.get(c.parentId):void 0,s=l?zv(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,t){var e,r,o,i;return t&&"parent"!==t?[t[0],[t[1][0]-(null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:0),t[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:t}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&qv(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],b=d+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==a||a("005",_v());var _=qv(h)?Rv(e,h):e;return{position:{x:_.x-f,y:_.y-d},positionAbsolute:_}}var Dv=function(n,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),Math.min(Math.max(n,t),e)},Rv=function(n,t){return void 0===n&&(n={x:0,y:0}),{x:Dv(n.x,t[0][0],t[1][0]),y:Dv(n.y,t[0][1],t[1][1])}},Vv=function(n,t,e){return n<t?Dv(Math.abs(n-t),1,50)/50:n>e?-Dv(Math.abs(n-e),1,50)/50:0},Hv=function(n,t){return[20*Vv(n.x,35,t.width-35),20*Vv(n.y,35,t.height-35)]},Yv=function(n,t){return{x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x2,t.x2),y2:Math.max(n.y2,t.y2)}},Zv=function(n){var t=n.x,e=n.y;return{x:t,y:e,width:n.x2-t,height:n.y2-e}},Xv=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=zv(n,t).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.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)}},Uv=function(n,t){return void 0===t&&(t=[1,1]),{x:t[0]*Math.round(n.x/t[0]),y:t[1]*Math.round(n.y/t[1])}},Fv=function(n,t,e,r){var o=n.x,i=n.y,u=W(t,3),a=u[0],c=u[1],l=u[2];void 0===e&&(e=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return e?Uv(s,r):s},Wv=function(n,t){var e=n.x,r=n.y,o=W(t,3),i=o[0],u=o[1],a=o[2];return{x:e*a+i,y:r*a+u}},$v=function(n,t,e,r,o,i){var u=t/(n.width*(1+i)),a=e/(n.height*(1+i)),c=Math.min(u,a),l=Dv(c,r,o);return{x:t/2-(n.x+n.width/2)*l,y:e/2-(n.y+n.height/2)*l,zoom:l}},Gv=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 qv(n){return void 0!==n&&"parent"!==n}function Kv(n){var t,e,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e: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 Qv={x:0,y:0};function Jv(n,t){var e=t.snapGrid,r=void 0===e?[0,0]:e,o=t.snapToGrid,i=void 0!==o&&o,u=t.transform,a=up(n),c=a.x,l=a.y,s=Fv({x:c,y:l},u),f=i?Uv(s,r):s,d=f.x,h=f.y;return U({xSnapped:d,ySnapped:h},s)}var np,tp,ep,rp,op,ip,up=function(n,t){var e,r,o,i,u=function(n){return"clientX"in n}(n),a=u?n.clientX:null===(e=n.touches)||void 0===e?void 0:e[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==t?void 0:t.left)&&void 0!==o?o:0),y:c-(null!==(i=null==t?void 0:t.top)&&void 0!==i?i:0)}};function ap(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*t+.375*i+.375*n.targetControlX+.125*r,c=.125*e+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-t),Math.abs(c-e)]}function cp(n,t){return n>=0?.5*n:25*t*Math.sqrt(-n)}function lp(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(t){case ip.Left:return[e-cp(e-o,u),r];case ip.Right:return[e+cp(o-e,u),r];case ip.Top:return[e,r-cp(r-i,u)];case ip.Bottom:return[e,r+cp(i-r,u)]}}function sp(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.curvature,s=void 0===l?.25:l,f=W(lp({pos:o,x1:t,y1:e,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=W(lp({pos:c,x1:i,y1:u,x2:t,y2:e,c:s}),2),p=v[0],g=v[1],y=W(ap({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],b=y[2],_=y[3];return["M".concat(t,",").concat(e," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),m,w,b,_]}function fp(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-t)/2,u=r<t?r+i:r-i,a=Math.abs(o-e)/2;return[u,o<e?o+a:o-a,i,a]}!function(n){n.Strict="strict",n.Loose="loose"}(np||(np={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(tp||(tp={})),function(n){n.Partial="partial",n.Full="full"}(ep||(ep={})),function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(rp||(rp={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(op||(op={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(ip||(ip={}));var dp,hp=function(n){var t=n.source,e=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(t).concat(e||"","-").concat(r).concat(o||"")},vp=function(n,t){return n.source&&n.target?function(n,t){return t.some((function(t){return!(t.source!==n.source||t.target!==n.target||t.sourceHandle!==n.sourceHandle&&(t.sourceHandle||n.sourceHandle)||t.targetHandle!==n.targetHandle&&(t.targetHandle||n.targetHandle))}))}(e=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?U({},n):U(U({},n),{id:hp(n)}),t)?t:(null===e.sourceHandle&&delete e.sourceHandle,null===e.targetHandle&&delete e.targetHandle,t.concat(e)):t;var e},pp=function(n,t,e,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(e[r[o]]=n[r[o]])}return e}(n,["id"]);if(!t.source||!t.target)return e;if(!e.find((function(t){return t.id===n.id})))return e;var u=U(U({},i),{id:r.shouldReplaceId?hp(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle});return e.filter((function(n){return n.id!==o})).concat(u)};function gp(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=W(fp({sourceX:t,sourceY:e,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(t,",").concat(e,"L ").concat(r,",").concat(o),u,a,c,l]}var yp=((dp={})[ip.Left]={x:-1,y:0},dp[ip.Right]={x:1,y:0},dp[ip.Top]={x:0,y:-1},dp[ip.Bottom]={x:0,y:1},dp),mp=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};function wp(n){var t,e,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?ip.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?ip.Top:l,f=n.center,d=n.offset,h=yp[a],v=yp[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 t=n.source,e=n.sourcePosition,r=void 0===e?ip.Bottom:e,o=n.target;return r===ip.Left||r===ip.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.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],b=[],_={x:0,y:0},x={x:0,y:0},E=W(fp({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!==(t=f.x)&&void 0!==t?t:S,o=null!==(e=f.y)&&void 0!==e?e:k;var M=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];b=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var j=[{x:p.x,y:g.y}],I=[{x:g.x,y:p.y}];if(b="x"===m?h.x===w?I:j:h.y===w?j:I,a===s){var P=Math.abs(i[m]-c[m]);if(P<=d){var A=Math.min(d-1,d-P);h[m]===w?_[m]=(p[m]>i[m]?-1:1)*A:x[m]=(g[m]>c[m]?-1:1)*A}}if(a!==s){var z="x"===m?"y":"x",L=h[m]===v[z],T=p[z]>g[z],B=p[z]<g[z];(1===h[m]&&(!L&&T||L&&B)||1!==h[m]&&(!L&&B||L&&T))&&(b="x"===m?j:I)}var D={x:p.x+_.x,y:p.y+_.y},R={x:g.x+x.x,y:g.y+x.y};Math.max(Math.abs(D.x-b[0].x),Math.abs(R.x-b[0].x))>=Math.max(Math.abs(D.y-b[0].y),Math.abs(R.y-b[0].y))?(r=(D.x+R.x)/2,o=b[0].y):(r=b[0].x,o=(D.y+R.y)/2)}return[$($([i,{x:p.x+_.x,y:p.y+_.y}],W(b),!1),[{x:g.x+x.x,y:g.y+x.y},c],!1),r,o,C,N]}function bp(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=W(wp({source:{x:t,y:e},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,t,e){return n+(e>0&&e<p.length-1?function(n,t,e,r){var o=Math.min(mp(n,t)/2,mp(t,e)/2,r),i=t.x,u=t.y;if(n.x===i&&i===e.x||n.y===u&&u===e.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<e.x?-1:1,c=n.y<e.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<e.x?1:-1,s=n.y<e.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[e-1],t,p[e+1],s):"".concat(0===e?"M":"L").concat(t.x," ").concat(t.y))}),""),g,y,m,w]}function _p(n,t,e){var r=(null==e?void 0:e.rankdir)||"TB",o=new yv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(U({rankdir:r},e));var i=n.map((function(n){return U({},n)}));i.forEach((function(n){var t,e;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(t=n.data)||void 0===t?void 0:t.width)||200,i=(null===(e=n.data)||void 0===e?void 0:e.height)||56;o.setNode(n.id,{width:r,height:i})})),t.forEach((function(n){o.setEdge(n.source,n.target)})),yv.layout(o),i.forEach((function(n){var t=o.node(n.id),e="bottom",i="top";switch(r){case"TB":default:e="bottom",i="top";break;case"BT":e="top",i="bottom";break;case"LR":e="right",i="left";break;case"RL":e="left",i="right"}n.targetPosition=i,n.sourcePosition=e,n.position={x:t.x-t.width/2,y:t.y-t.height/2}}));var u=function(n){var t=n.centerNodeId,e=n.containerHeight,r=void 0===e?0:e,o=n.containerWidth,i=void 0===o?0:o,u=n.centerByBBox,a=n.nodes,c=n.nodeOrigin,l=void 0===c?Iv:c;if(!t&&!u||!r||!i)return Qv;if(null==t?void 0:t.trim()){var s=null==a?void 0:a.find((function(n){return n.id===(null==t?void 0:t.trim())}));if(s){var f=function(n,t){if(!n)return Qv;var e=Kv(n),r=e.width,o=e.height,i=r*t[0],u=o*t[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,t){if(!(null==n?void 0:n.length))return Qv;var e=Lv(n,{nodeOrigin:t}),r=e.x,o=e.y;return{x:r+e.width/2,y:o+e.height/2}}(a,l),{x:i/2-f.x,y:r/2-f.y}):Qv}({centerByBBox:null==e?void 0:e.centerByBBox,centerNodeId:null==e?void 0:e.centerNodeId,nodes:i,containerWidth:null==e?void 0:e.width,containerHeight:null==e?void 0:e.height,nodeOrigin:null==e?void 0:e.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==e?void 0:e.width)&&(null==e?void 0:e.height)&&e.fitViewOptions&&(f=function(n,t){var e=t||{},r=e.minZoom,o=void 0===r?Ov:r,i=e.maxZoom,u=void 0===i?jv:i,a=e.padding,c=void 0===a?.1:a,l=e.nodeOrigin,s=void 0===l?Iv:l,f=e.width,d=e.height,h=Lv(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:$v(h,f,d,o,u,c),overflowBoundary:v}}(i,U({width:e.width,height:e.height,nodeOrigin:e.nodeOrigin},e.fitViewOptions))),{nodes:i,edges:t,transform:f.transform,overflowBoundary:f.overflowBoundary}}var xp={assign:Object.assign,getHeight:function(n,t,e,r){return void 0===r&&(r="height"),"center"===e?(n[r]+t[r])/2:n.height}},Ep=xp,Sp={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 t=n.label||" ";return n.width||18*t.split("").length}};function kp(n,t){var e=this;if(e.vgap=e.hgap=0,n instanceof kp)return n;e.data=n;var r=t.getHGap(n),o=t.getVGap(n);return e.preH=t.getPreH(n),e.preV=t.getPreV(n),e.width=t.getWidth(n),e.height=t.getHeight(n),e.width+=e.preH,e.height+=e.preV,e.id=t.getId(n),e.x=e.y=0,e.depth=0,e.children||(e.children=[]),e.addGap(r,o),e}Ep.assign(kp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,t){var e=this;e.hgap+=n,e.vgap+=t,e.width+=2*n,e.height+=2*t},eachNode:function(n){for(var t,e=[this];t=e.shift();)n(t),e=t.children.concat(e)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var t,e=[this];t=e.shift();)n(t),e=e.concat(t.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(t){n.left=Math.min(n.left,t.x),n.top=Math.min(n.top,t.y),n.width=Math.max(n.width,t.x+t.width),n.height=Math.max(n.height,t.y+t.height)})),n},translate:function(n,t){void 0===n&&(n=0),void 0===t&&(t=0),this.eachNode((function(e){e.x+=n,e.y+=t,e.x+=e.preH,e.y+=e.preV}))},right2left:function(){var n=this,t=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-t.left)-n.width})),n.translate(t.width,0)},bottom2top:function(){var n=this,t=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-t.top)-n.height})),n.translate(0,t.height)}});var Cp=function(n,t,e){void 0===t&&(t={});var r,o=new kp(n,t=Ep.assign({},Sp,t)),i=[o];if(!e&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var u=t.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 kp(u[c],t);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Np=Cp,Mp=function(){function n(n,t){void 0===t&&(t={}),this.options=t,this.rootNode=Np(n,t)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),Op=Mp;function jp(n,t,e,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=t||0,o.y=e||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 Ip(n,t,e){e?n.y+=t:n.x+=t,n.children.forEach((function(n){Ip(n,t,e)}))}function Pp(n,t){var e=t?n.y:n.x;return n.children.forEach((function(n){e=Math.min(Pp(n,t),e)})),e}function Ap(n,t){Ip(n,-Pp(n,t),t)}function zp(n,t,e){e?t.y=n.x:t.x=n.x,n.c.forEach((function(n,r){zp(n,t.children[r],e)}))}function Lp(n,t,e){void 0===e&&(e=0),t?(n.x=e,e+=n.width):(n.y=e,e+=n.height),n.children.forEach((function(n){Lp(n,t,e)}))}jp.fromNode=function(n,t){if(!n)return null;var e=[];return n.children.forEach((function(n){e.push(jp.fromNode(n,t))})),t?new jp(n.height,n.width,n.x,e):new jp(n.width,n.height,n.y,e)};var Tp=Cp,Bp=function(n,t){for(var e=Tp(n.data,t,!0),r=Tp(n.data,t,!0),o=n.children.length,i=Math.round(o/2),u=t.getSide||function(n,t){return t<i?"right":"left"},a=0;a<o;a++){var c=n.children[a];"right"===u(c,a)?r.children.push(c):e.children.push(c)}return e.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:e,right:r}},Dp=Bp,Rp=["LR","RL","TB","BT","H","V"],Vp=["LR","RL","H"],Hp=Rp[0],Yp=function(n,t,e){var r=t.direction||Hp;if(t.isHorizontal=function(n){return Vp.indexOf(n)>-1}(r),r&&-1===Rp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Rp[0])e(n,t);else if(r===Rp[1])e(n,t),n.right2left();else if(r===Rp[2])e(n,t);else if(r===Rp[3])e(n,t),n.bottom2top();else if(r===Rp[4]||r===Rp[5]){var o=Dp(n,t),i=o.left,u=o.right;e(i,t),e(u,t),t.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();t.isHorizontal?a.top<0&&n.translate(0,-a.top):a.left<0&&n.translate(-a.left,0)}var c=t.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,t){if(t.radial){var e=t.isHorizontal?["x","y"]:["y","x"],r=e[0],o=e[1],i={x:1/0,y:1/0},u={x:-1/0,y:-1/0},a=0;n.DFTraverse((function(n){a++;var t=n.x,e=n.y;i.x=Math.min(i.x,t),i.y=Math.min(i.y,e),u.x=Math.max(u.x,t),u.y=Math.max(u.y,e)}));var c=u[o]-i[o];if(0===c)return;var l=2*Math.PI/a;n.DFTraverse((function(t){var e=(t[o]-i[o])/c*(2*Math.PI-l)+l,u=t[r]-n[r];t.x=Math.cos(e)*u,t.y=Math.sin(e)*u}))}}(n,t),n};function Zp(n,t){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Zp(n,t)}var Xp=function(n,t){void 0===t&&(t={});var e=t.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,t,e){for(var r=n.c[t-1],o=r.mod,l=n.c[t],s=l.mod;null!==r&&null!==l;){c(r)>e.low&&(e=e.nxt);var f=o+r.prelim+r.w-(s+l.prelim);f>0&&(s+=f,i(n,t,e.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,t,e,r){var o=n.c[0].el;o.tl=e;var i=r-e.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[t].el,n.c[0].msel=n.c[t].msel}(n,t,l,s):r&&!l&&function(n,t,e,r){var o=n.c[t].er;o.tr=e;var i=r-e.mod-n.c[t].mser;o.mod+=i,o.prelim-=i,n.c[t].er=n.c[t-1].er,n.c[t].mser=n.c[t-1].mser}(n,t,r,o)}function i(n,t,e,r){n.c[t].mod+=r,n.c[t].msel+=r,n.c[t].mser+=r,function(n,t,e,r){if(e!==t-1){var o=t-e;n.c[e+1].shift+=r/o,n.c[t].shift-=r/o,n.c[t].change-=r-r/o}}(n,t,e,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,t,e){for(;null!==e&&n>=e.low;)e=e.nxt;return{low:n,index:t,nxt:e}}Lp(n,e);var s=jp.fromNode(n,e);return function n(t){if(0!==t.cs){n(t.c[0]);for(var e=l(c(t.c[0].el),0,null),i=1;i<t.cs;++i){n(t.c[i]);var u=c(t.c[i].er);o(t,i,e),e=l(u,i,e)}!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}(t),r(t)}else r(t)}(s),function n(t,e){e+=t.mod,t.x=t.prelim+e,function(n){for(var t=0,e=0,r=0;r<n.cs;r++)e+=(t+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=e}(t);for(var r=0;r<t.cs;r++)n(t.c[r],e)}(s,0),zp(s,n,e),Ap(n,e),n},Up=Yp,Fp=xp,Wp=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,Zp(e,r),t.prototype.execute=function(){return Up(this.rootNode,this.options,Xp)},t}(Op),$p={},Gp=xp;function qp(n,t){void 0===t&&(t=[]);var e=this;e.x=e.y=0,e.leftChild=e.rightChild=null,e.height=0,e.children=t}var Kp={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Qp(n,t,e){e?(t.x=n.x,t.y=n.y):(t.x=n.y,t.y=n.x),n.children.forEach((function(n,r){Qp(n,t.children[r],e)}))}function Jp(n,t){return Jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Jp(n,t)}var ng=function(n,t){void 0===t&&(t={}),t=Gp.assign({},Kp,t);var e,r=0,o=function n(t){if(!t)return null;t.width=0,t.depth&&t.depth>r&&(r=t.depth);var e=t.children,o=e.length,i=new qp(t.height,[]);return e.forEach((function(t,e){var r=n(t);i.children.push(r),0===e&&(i.leftChild=r),e===o-1&&(i.rightChild=r)})),i.originNode=t,i.isLeaf=t.isLeaf(),i}(n);return function n(t){if(t.isLeaf||0===t.children.length)t.drawingDepth=r;else{var e=t.children.map((function(t){return n(t)})),o=Math.min.apply(null,e);t.drawingDepth=o-1}return t.drawingDepth}(o),function n(r){r.x=r.drawingDepth*t.rankSep,r.isLeaf?(r.y=0,e&&(r.y=e.y+e.height+t.nodeSep,r.originNode.parent!==e.originNode.parent&&(r.y+=t.subTreeSep)),e=r):(r.children.forEach((function(t){n(t)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Qp(o,n,t.isHorizontal),n},tg=Yp,eg=xp,rg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,Jp(e,r),t.prototype.execute=function(){var n=this;return n.rootNode.width=0,tg(n.rootNode,n.options,ng)},t}(Op),og={},ig=xp;function ug(n,t){return ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},ug(n,t)}var ag=Op,cg=function(n,t,e,r){var o=null;n.eachNode((function(n){!function(n,t,e,r,o){var i=("function"==typeof e?e(n):e)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=t?t.y:0)}catch(n){}if(n.x+=i,t){if(n.y=t.y+ig.getHeight(t,n,o),t.parent&&n.parent.id!==t.parent.id){var u=t.parent,a=u.y+ig.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,t,e,r),o=n}))},lg=Bp,sg=xp,fg=["LR","RL","H"],dg=fg[0],hg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,ug(e,r),t.prototype.execute=function(){var n=this.options,t=this.rootNode;n.isHorizontal=!0;var e=n.indent,r=void 0===e?20:e,o=n.dropCap,i=void 0===o||o,u=n.direction,a=void 0===u?dg:u,c=n.align;if(a&&-1===fg.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===fg[0])cg(t,r,i,c);else if(a===fg[1])cg(t,r,i,c),t.right2left();else if(a===fg[2]){var l=lg(t,n),s=l.left,f=l.right;cg(s,r,i,c),s.right2left(),cg(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),t.x=f.x-t.width/2}return t},t}(ag),vg={},pg=xp;function gg(n,t){var e=0;return n.children.length?n.children.forEach((function(n){e+=gg(n,t)})):e=n.height,n._subTreeSep=t.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,e)+2*n._subTreeSep,n.totalHeight}function yg(n){var t=n.children,e=t.length;if(e){t.forEach((function(n){yg(n)}));var r=t[0],o=t[e-1],i=o.y-r.y+o.height,u=0;if(t.forEach((function(n){u+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==t.length||n.height>u){var a=n.y+(n.height-i)/2-r.y;t.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 mg={getSubTreeSep:function(){return 0}};function wg(n,t){return wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},wg(n,t)}var bg=function(n,t){void 0===t&&(t={}),t=pg.assign({},mg,t),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,gg(n,t),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var t=n.children,e=t.length;if(e){var r=t[0];if(r.startY=n.startY+n._subTreeSep,1===e)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<e;o++){var i=t[o];i.startY=t[o-1].startY+t[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),yg(n)},_g=Yp,xg=xp,Eg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,wg(e,r),t.prototype.execute=function(){return _g(this.rootNode,this.options,bg)},t}(Op),Sg={};Kt({compactBox:function(n,t){return t=Fp.assign({},$p,t),new Wp(n,t).execute()},dendrogram:function(n,t){return t=eg.assign({},og,t),new rg(n,t).execute()},indented:function(n,t){return t=sg.assign({},vg,t),new hg(n,t).execute()},mindmap:function(n,t){return t=xg.assign({},Sg,t),new Eg(n,t).execute()}});var kg={value:()=>{}};function Cg(){for(var n,t=0,e=arguments.length,r={};t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Ng(r)}function Ng(n){this._=n}function Mg(n,t){for(var e,r=0,o=n.length;r<o;++r)if((e=n[r]).name===t)return e.value}function Og(n,t,e){for(var r=0,o=n.length;r<o;++r)if(n[r].name===t){n[r]=kg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=e&&n.push({name:t,value:e}),n}Ng.prototype=Cg.prototype={constructor:Ng,on:function(n,t){var e,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var t="",e=n.indexOf(".");if(e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}}))),u=-1,a=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++u<a;)if(e=(n=i[u]).type)o[e]=Og(o[e],n.name,t);else if(null==t)for(e in o)o[e]=Og(o[e],n.name,null);return this}for(;++u<a;)if((e=(n=i[u]).type)&&(e=Mg(o[e],n.name)))return e},copy:function(){var n={},t=this._;for(var e in t)n[e]=t[e].slice();return new Ng(n)},call:function(n,t){if((e=arguments.length-2)>0)for(var e,r,o=new Array(e),i=0;i<e;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,e=(r=this._[n]).length;i<e;++i)r[i].value.apply(t,o)},apply:function(n,t,e){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(t,e)}};var jg="http://www.w3.org/1999/xhtml",Ig={svg:"http://www.w3.org/2000/svg",xhtml:jg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pg(n){var t=n+="",e=t.indexOf(":");return e>=0&&"xmlns"!==(t=n.slice(0,e))&&(n=n.slice(e+1)),Ig.hasOwnProperty(t)?{space:Ig[t],local:n}:n}function Ag(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===jg&&t.documentElement.namespaceURI===jg?t.createElement(n):t.createElementNS(e,n)}}function zg(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Lg(n){var t=Pg(n);return(t.local?zg:Ag)(t)}function Tg(){}function Bg(n){return null==n?Tg:function(){return this.querySelector(n)}}function Dg(){return[]}function Rg(n){return null==n?Dg:function(){return this.querySelectorAll(n)}}function Vg(n){return function(){return this.matches(n)}}function Hg(n){return function(t){return t.matches(n)}}var Yg=Array.prototype.find;function Zg(){return this.firstElementChild}var Xg=Array.prototype.filter;function Ug(){return Array.from(this.children)}function Fg(n){return new Array(n.length)}function Wg(n,t){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=t}function $g(n,t,e,r,o,i){for(var u,a=0,c=t.length,l=i.length;a<l;++a)(u=t[a])?(u.__data__=i[a],r[a]=u):e[a]=new Wg(n,i[a]);for(;a<c;++a)(u=t[a])&&(o[a]=u)}function Gg(n,t,e,r,o,i,u){var a,c,l,s=new Map,f=t.length,d=i.length,h=new Array(f);for(a=0;a<f;++a)(c=t[a])&&(h[a]=l=u.call(c,c.__data__,a,t)+"",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)):e[a]=new Wg(n,i[a]);for(a=0;a<f;++a)(c=t[a])&&s.get(h[a])===c&&(o[a]=c)}function qg(n){return n.__data__}function Kg(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function Qg(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function Jg(n){return function(){this.removeAttribute(n)}}function ny(n){return function(){this.removeAttributeNS(n.space,n.local)}}function ty(n,t){return function(){this.setAttribute(n,t)}}function ey(n,t){return function(){this.setAttributeNS(n.space,n.local,t)}}function ry(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}}function oy(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}function iy(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function uy(n){return function(){this.style.removeProperty(n)}}function ay(n,t,e){return function(){this.style.setProperty(n,t,e)}}function cy(n,t,e){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}}function ly(n,t){return n.style.getPropertyValue(t)||iy(n).getComputedStyle(n,null).getPropertyValue(t)}function sy(n){return function(){delete this[n]}}function fy(n,t){return function(){this[n]=t}}function dy(n,t){return function(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}}function hy(n){return n.trim().split(/^|\s+/)}function vy(n){return n.classList||new py(n)}function py(n){this._node=n,this._names=hy(n.getAttribute("class")||"")}function gy(n,t){for(var e=vy(n),r=-1,o=t.length;++r<o;)e.add(t[r])}function yy(n,t){for(var e=vy(n),r=-1,o=t.length;++r<o;)e.remove(t[r])}function my(n){return function(){gy(this,n)}}function wy(n){return function(){yy(this,n)}}function by(n,t){return function(){(t.apply(this,arguments)?gy:yy)(this,n)}}function _y(){this.textContent=""}function xy(n){return function(){this.textContent=n}}function Ey(n){return function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}}function Sy(){this.innerHTML=""}function ky(n){return function(){this.innerHTML=n}}function Cy(n){return function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ny(){this.nextSibling&&this.parentNode.appendChild(this)}function My(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oy(){return null}function jy(){var n=this.parentNode;n&&n.removeChild(this)}function Iy(){var n=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function Py(){var n=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function Ay(n){return function(){var t=this.__on;if(t){for(var e,r=0,o=-1,i=t.length;r<i;++r)e=t[r],n.type&&e.type!==n.type||e.name!==n.name?t[++o]=e:this.removeEventListener(e.type,e.listener,e.options);++o?t.length=o:delete this.__on}}}function zy(n,t,e){return function(){var r,o=this.__on,i=function(n){return function(t){n.call(this,t,this.__data__)}}(t);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=e),void(r.value=t);this.addEventListener(n.type,i,e),r={type:n.type,name:n.name,value:t,listener:i,options:e},o?o.push(r):this.__on=[r]}}function Ly(n,t,e){var r=iy(n),o=r.CustomEvent;"function"==typeof o?o=new o(t,e):(o=r.document.createEvent("Event"),e?(o.initEvent(t,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(t,!1,!1)),n.dispatchEvent(o)}function Ty(n,t){return function(){return Ly(this,n,t)}}function By(n,t){return function(){return Ly(this,n,t.apply(this,arguments))}}Wg.prototype={constructor:Wg,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,t){return this._parent.insertBefore(n,t)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},py.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var Dy=[null];function Ry(n,t){this._groups=n,this._parents=t}function Vy(){return new Ry([[document.documentElement]],Dy)}function Hy(n){return"string"==typeof n?new Ry([[document.querySelector(n)]],[document.documentElement]):new Ry([[n]],Dy)}function Yy(n,t){if(n=function(n){let t;for(;t=n.sourceEvent;)n=t;return n}(n),void 0===t&&(t=n.currentTarget),t){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}}return[n.pageX,n.pageY]}Ry.prototype=Vy.prototype={constructor:Ry,select:function(n){"function"!=typeof n&&(n=Bg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u,a=t[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 Ry(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(t=n.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(n):Rg(n);for(var t=this._groups,e=t.length,r=[],o=[],i=0;i<e;++i)for(var u,a=t[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 Ry(r,o)},selectChild:function(n){return this.select(null==n?Zg:function(n){return function(){return Yg.call(this.children,n)}}("function"==typeof n?n:Hg(n)))},selectChildren:function(n){return this.selectAll(null==n?Ug:function(n){return function(){return Xg.call(this.children,n)}}("function"==typeof n?n:Hg(n)))},filter:function(n){"function"!=typeof n&&(n=Vg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u=t[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 Ry(r,this._parents)},data:function(n,t){if(!arguments.length)return Array.from(this,qg);var e,r=t?Gg:$g,o=this._parents,i=this._groups;"function"!=typeof n&&(e=n,n=function(){return e});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=Kg(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,t);for(var m,w,b=0,_=0;b<p;++b)if(m=g[b]){for(b>=_&&(_=b+1);!(w=y[_])&&++_<p;);m._next=w||null}}return(a=new Ry(a,o))._enter=c,a._exit=l,a},enter:function(){return new Ry(this._enter||this._groups.map(Fg),this._parents)},exit:function(){return new Ry(this._exit||this._groups.map(Fg),this._parents)},join:function(n,t,e){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=t&&(o=t(o))&&(o=o.selection()),null==e?i.remove():e(i),r&&o?r.merge(o).order():o},merge:function(n){for(var t=n.selection?n.selection():n,e=this._groups,r=t._groups,o=e.length,i=r.length,u=Math.min(o,i),a=new Array(o),c=0;c<u;++c)for(var l,s=e[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]=e[c];return new Ry(a,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,t=-1,e=n.length;++t<e;)for(var r,o=n[t],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 t(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}n||(n=Qg);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i){for(var u,a=e[i],c=a.length,l=o[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(l[s]=u);l.sort(t)}return new Ry(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,t=0,e=n.length;t<e;++t)for(var r=n[t],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 t of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var o,i=t[e],u=0,a=i.length;u<a;++u)(o=i[u])&&n.call(o,o.__data__,u,i);return this},attr:function(n,t){var e=Pg(n);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==t?e.local?ny:Jg:"function"==typeof t?e.local?oy:ry:e.local?ey:ty)(e,t))},style:function(n,t,e){return arguments.length>1?this.each((null==t?uy:"function"==typeof t?cy:ay)(n,t,null==e?"":e)):ly(this.node(),n)},property:function(n,t){return arguments.length>1?this.each((null==t?sy:"function"==typeof t?dy:fy)(n,t)):this.node()[n]},classed:function(n,t){var e=hy(n+"");if(arguments.length<2){for(var r=vy(this.node()),o=-1,i=e.length;++o<i;)if(!r.contains(e[o]))return!1;return!0}return this.each(("function"==typeof t?by:t?my:wy)(e,t))},text:function(n){return arguments.length?this.each(null==n?_y:("function"==typeof n?Ey:xy)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Sy:("function"==typeof n?Cy:ky)(n)):this.node().innerHTML},raise:function(){return this.each(Ny)},lower:function(){return this.each(My)},append:function(n){var t="function"==typeof n?n:Lg(n);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(n,t){var e="function"==typeof n?n:Lg(n),r=null==t?Oy:"function"==typeof t?t:Bg(t);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(jy)},clone:function(n){return this.select(n?Py:Iy)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,t,e){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var t="",e=n.indexOf(".");return e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),{type:n,name:t}}))}(n+""),u=i.length;if(!(arguments.length<2)){for(a=t?zy:Ay,r=0;r<u;++r)this.each(a(i[r],t,e));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,t){return this.each(("function"==typeof t?By:Ty)(n,t))},[Symbol.iterator]:function*(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var r,o=n[t],i=0,u=o.length;i<u;++i)(r=o[i])&&(yield r)}};const Zy={passive:!1},Xy={capture:!0,passive:!1};function Uy(n){n.stopImmediatePropagation()}function Fy(n){n.preventDefault(),n.stopImmediatePropagation()}function Wy(n){var t=n.document.documentElement,e=Hy(n).on("dragstart.drag",Fy,Xy);"onselectstart"in t?e.on("selectstart.drag",Fy,Xy):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $y(n,t){var e=n.document.documentElement,r=Hy(n).on("dragstart.drag",null);t&&(r.on("click.drag",Fy,Xy),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Gy=n=>()=>n;function qy(n,{sourceEvent:t,subject:e,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:t,enumerable:!0,configurable:!0},subject:{value:e,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 Ky(n){return!n.ctrlKey&&!n.button}function Qy(){return this.parentNode}function Jy(n,t){return null==t?{x:n.x,y:n.y}:t}function nm(){return navigator.maxTouchPoints||"ontouchstart"in this}function tm(n,t){if(!n.parentId)return!1;var e=t.get(n.parentId);return!!e&&(!!e.selected||tm(e,t))}function em(n,t,e){var r=n;do{if(null==r?void 0:r.matches(t))return!0;if(r===e)return!1;r=r.parentElement}while(r);return!1}function rm(n){var t,e,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=F(u),s=l.next();!s.done;s=l.next()){var f=W(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(U(U({},v),{position:h.position}))}}catch(n){t={error:n}}finally{try{s&&!s.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}if(!i)return[c[0],c];var p=a.get(i).internals.userNode;return[U(U({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function om(n){var t=n.onNodeMouseDown,e=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,t){var r,i,a=n.x,l=n.y,s=e(),f=s.nodeLookup,d=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,w=s.onError,b=s.updateNodePositions;u={x:a,y:l};var _=!1,x={x:0,y:0,x2:0,y2:0};if(c.size>1&&d){var E=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var e={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==t.filter||t.filter(n)){var r=Xv(n,t.nodeOrigin);e=Yv(e,r)}})),Zv(e)}(c,{nodeOrigin:p});x=function(n){var t=n.x,e=n.y;return{x:t,y:e,x2:t+n.width,y2:e+n.height}}(E)}try{for(var S=F(c),k=S.next();!k.done;k=S.next()){var C=W(k.value,2),N=C[0],M=C[1],O={x:a-M.distance.x,y:l-M.distance.y};v&&(O=Uv(O,h));var j=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!M.extent){var I=M.internals.positionAbsolute,P=I.x-x.x+d[0][0],A=I.x+M.measured.width-x.x2+d[1][0];j=[[P,I.y-x.y+d[0][1]],[A,I.y+M.measured.height-x.y2+d[1][1]]]}var z=Bv({nodeId:N,nextPosition:O,nodeLookup:f,nodeExtent:j,nodeOrigin:p,onError:w}),L=z.position,T=z.positionAbsolute;_=_||M.position.x!==L.x||M.position.y!==L.y,M.position=L,M.internals.positionAbsolute=T}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(_&&(b(c,!0),t&&(o||g||!m&&y))){var B=W(rm({nodeId:m,dragItems:c,nodeLookup:f}),2),D=B[0],R=B[1];null==o||o(t,c,D,R),null==g||g(t,D,R),m||null==y||y(t,R)}}function b(){var n,t;if(f){var r=W(Hv(s,f),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=e(),l=c.transform,d=c.panBy;u.x=(null!==(n=u.x)&&void 0!==n?n:0)-o/l[2],u.y=(null!==(t=u.y)&&void 0!==t?t:0)-i/l[2],d({x:o,y:i})&&w(u,null)}a=requestAnimationFrame(b)}}function _(n){var o,i=e(),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,b=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||b(),y&&p&&m&&(null==t||t(m));var _=Jv(n.sourceEvent,{transform:f,snapGrid:h,snapToGrid:v});if(u=_,c=function(n,t,e,r){var o,i,u,a,c=new Map;try{for(var l=F(n),s=l.next();!s.done;s=l.next()){var f=W(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!tm(h,n))&&(h.draggable||t&&void 0===h.draggable)){var v=n.get(d);v&&c.set(d,{id:d,position:v.position||{x:0,y:0},distance:{x:e.x-v.internals.positionAbsolute.x,y:e.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,_,m),c.size>0&&(r||g||!m&&w)){var x=W(rm({nodeId:m,dragItems:c,nodeLookup:a}),2),E=x[0],S=x[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==w||w(n.sourceEvent,S)}}h=Hy(g);var x=function(){var n,t,e,r,o=Ky,i=Qy,u=Jy,a=nm,c={},l=Cg("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,Zy).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&&(Hy(u.view).on("mousemove.drag",v,Xy).on("mouseup.drag",p,Xy),Wy(u.view),Uy(u),e=!1,n=u.clientX,t=u.clientY,c("start",u))}}function v(r){if(Fy(r),!e){var o=r.clientX-n,i=r.clientY-t;e=o*o+i*i>f}c.mouse("drag",r)}function p(n){Hy(n.view).on("mousemove.drag mouseup.drag",null),$y(n.view,e),Fy(n),c.mouse("end",n)}function g(n,t){if(o.call(this,n,t)){var e,r,u=n.changedTouches,a=i.call(this,n,t),c=u.length;for(e=0;e<c;++e)(r=w(this,a,n,t,u[e].identifier,u[e]))&&(Uy(n),r("start",n,u[e]))}}function y(n){var t,e,r=n.changedTouches,o=r.length;for(t=0;t<o;++t)(e=c[r[t].identifier])&&(Fy(n),e("drag",n,r[t]))}function m(n){var t,e,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=c[o[t].identifier])&&(Uy(n),e("end",n,o[t]))}function w(n,t,e,r,o,i){var a,f,h,v=l.copy(),p=Yy(i||e,t);if(null!=(h=u.call(n,new qy("beforestart",{sourceEvent:e,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 e(i,u,l){var g,y=p;switch(i){case"start":c[o]=e,g=s++;break;case"end":delete c[o],--s;case"drag":p=Yy(l||u,t),g=s}v.call(i,n,new qy(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:Gy(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:Gy(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:Gy(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:Gy(!!n),d):a},d.on=function(){var n=l.on.apply(l,arguments);return n===l?d:n},d.clickDistance=function(n){return arguments.length?(f=(n=+n)*n,d):Math.sqrt(f)},d}().on("start",(function(n){var t=e(),r=t.domNode,o=t.nodeDragThreshold,i=t.transform,a=t.snapGrid,c=t.snapToGrid;0===o&&_(n);var l=Jv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=up(n.sourceEvent,f)})).on("drag",(function(n){var t,r,o=e(),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,b()),!d){var y=g.xSnapped-(null!==(t=u.x)&&void 0!==t?t:0),m=g.ySnapped-(null!==(r=u.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&_(n)}(u.x!==g.xSnapped||u.y!==g.ySnapped)&&c&&d&&(s=up(n.sourceEvent,f),w(g,n.sourceEvent))})).on("end",(function(n){if(d&&(l=!1,d=!1,cancelAnimationFrame(a),c.size>0)){var t=e(),r=t.nodeLookup,o=t.updateNodePositions,u=t.onNodeDragStop,s=t.onSelectionDragStop;if(o(c,!1),i||u||!m&&s){var f=W(rm({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 t=n.target;return!n.button&&(!v||!em(t,".".concat(v),g))&&(!p||em(t,p,g))}));h.call(x)},destroy:function(){null==h||h.on(".drag",null)}}}function im(n,t,e,r){return(t[e]||[]).reduce((function(t,o){return"".concat(n.id,"-").concat(o.id,"-").concat(e)!==r&&t.push({id:o.id||null,type:e,nodeId:n.id,x:n.internals.positionAbsolute.x+o.x+o.width/2,y:n.internals.positionAbsolute.y+o.y+o.height/2}),t}),[])}function um(n,t){return n||((null==t?void 0:t.classList.contains("target"))?"target":(null==t?void 0:t.classList.contains("source"))?"source":null)}qy.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var am=function(){return!0},cm=null;function lm(n,t){var e=t.handle,r=t.connectionMode,o=t.fromNodeId,i=t.fromHandleId,u=t.fromType,a=t.doc,c=t.lib,l=t.flowId,s=t.isValidConnection,f=void 0===s?am:s,d="target"===u,h=e?a.querySelector(".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==e?void 0:e.nodeId,"-").concat(null==e?void 0:e.id,"-").concat(null==e?void 0:e.type,'"]')):null,v=up(n),p=v.x,g=v.y,y=a.elementFromPoint(p,g),m=(null==y?void 0:y.classList.contains("".concat(c,"-flow__handle")))?y:h,w={handleDomNode:m,isValid:!1,connection:null,endHandle:null};if(m){var b=um(void 0,m),_=m.getAttribute("data-nodeid"),x=m.getAttribute("data-handleid"),E=m.classList.contains("connectable"),S=m.classList.contains("connectableend");if(!_)return w;var k={source:d?_:o,sourceHandle:d?x:i,target:d?o:_,targetHandle:d?i:x};w.connection=k,E&&S&&(r===np.Strict?d&&"source"===b||!d&&"target"===b:_!==o||x!==i)&&(w.endHandle={nodeId:_,handleId:x,type:b},w.isValid=f(k))}return w}var sm={onPointerDown:function(n,t){var e,r=t.connectionMode,o=t.connectionRadius,i=t.handleId,u=t.nodeId,a=t.edgeUpdaterType,c=t.isTarget,l=t.domNode,s=t.nodeLookup,f=t.lib,d=t.autoPanOnConnect,h=t.flowId,v=t.panBy,p=t.cancelConnection,g=t.onConnectStart,y=t.onConnect,m=t.onConnectEnd,w=t.isValidConnection,b=void 0===w?am:w,_=t.onEdgeUpdateEnd,x=t.updateConnection,E=t.getTransform,S=t.getConnectionStartHandle,k=function(n){var t;return(null===(t=n.getRootNode)||void 0===t?void 0:t.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),C=0,N=up(n),M=N.x,O=N.y,j=null==k?void 0:k.elementFromPoint(M,O),I=um(a,j),P=null==l?void 0:l.getBoundingClientRect();if(P&&I){var A=up(n,P),z=!1,L=null,T=!1,B=null,D=function(n){var t,e,r=n.nodeLookup,o=n.nodeId,i=n.handleId,u=n.handleType,a=[];try{for(var c=F(r),l=c.next();!l.done;l=c.next()){var s=W(l.value,2)[1];if(s.internals.handleBounds){var f="".concat(o,"-").concat(i,"-").concat(u),d=im(s,s.internals.handleBounds,"source",f),h=im(s,s.internals.handleBounds,"target",f);a.push.apply(a,$($([],W(d),!1),W(h),!1))}}}catch(n){t={error:n}}finally{try{l&&!l.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}return a}({nodeLookup:s,nodeId:u,handleId:i,handleType:I});x({connectionPosition:A,connectionStatus:null,connectionStartHandle:cm={nodeId:u,handleId:i,type:I},connectionEndHandle:null}),null==g||g(n,{nodeId:u,handleId:i,handleType:I}),k.addEventListener("mousemove",V),k.addEventListener("mouseup",H),k.addEventListener("touchmove",V),k.addEventListener("touchend",H)}function R(){if(d&&P){var n=W(Hv(A,P),2),t=n[0],e=n[1];v({x:t,y:e}),C=requestAnimationFrame(R)}}function V(n){S()||H(n);var t=E();A=up(n,P),e=function(n,t,e){var r,o,i=[],u=1/0;try{for(var a=F(e),c=a.next();!c.done;c=a.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));s<=t&&(s<u?i=[l]:s===u&&i.push(l),u=s)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i.length?1===i.length?i[0]:i.find((function(n){return"target"===n.type}))||i[0]:null}(Fv(A,t,!1,[1,1]),o,D),z||(R(),z=!0);var a,l,s,d=lm(n,{handle:e,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:b,doc:k,lib:f,flowId:h});B=d.handleDomNode,L=d.connection,T=d.isValid,x({connectionStartHandle:cm,connectionPosition:e&&T?Wv({x:e.x,y:e.y},t):A,connectionStatus:(a=!!e,l=T,s=null,l?s="valid":a&&!l&&(s="invalid"),s),connectionEndHandle:d.endHandle})}function H(n){(e||B)&&L&&T&&(null==y||y(L)),null==m||m(n),a&&(null==_||_(n)),p(),cancelAnimationFrame(C),z=!1,T=!1,L=null,B=null,cm=null,k.removeEventListener("mousemove",V),k.removeEventListener("mouseup",H),k.removeEventListener("touchmove",V),k.removeEventListener("touchend",H)}},isValid:lm};function fm(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function dm(n,t){var e=Object.create(n.prototype);for(var r in t)e[r]=t[r];return e}function hm(){}var vm=.7,pm=1/vm,gm="\\s*([+-]?\\d+)\\s*",ym="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wm=/^#([0-9a-f]{3,8})$/,bm=new RegExp(`^rgb\\(${gm},${gm},${gm}\\)$`),_m=new RegExp(`^rgb\\(${mm},${mm},${mm}\\)$`),xm=new RegExp(`^rgba\\(${gm},${gm},${gm},${ym}\\)$`),Em=new RegExp(`^rgba\\(${mm},${mm},${mm},${ym}\\)$`),Sm=new RegExp(`^hsl\\(${ym},${mm},${mm}\\)$`),km=new RegExp(`^hsla\\(${ym},${mm},${mm},${ym}\\)$`),Cm={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 Nm(){return this.rgb().formatHex()}function Mm(){return this.rgb().formatRgb()}function Om(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=wm.exec(n))?(e=t[1].length,t=parseInt(t[1],16),6===e?jm(t):3===e?new Am(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===e?Im(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===e?Im(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=bm.exec(n))?new Am(t[1],t[2],t[3],1):(t=_m.exec(n))?new Am(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=xm.exec(n))?Im(t[1],t[2],t[3],t[4]):(t=Em.exec(n))?Im(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Sm.exec(n))?Rm(t[1],t[2]/100,t[3]/100,1):(t=km.exec(n))?Rm(t[1],t[2]/100,t[3]/100,t[4]):Cm.hasOwnProperty(n)?jm(Cm[n]):"transparent"===n?new Am(NaN,NaN,NaN,0):null}function jm(n){return new Am(n>>16&255,n>>8&255,255&n,1)}function Im(n,t,e,r){return r<=0&&(n=t=e=NaN),new Am(n,t,e,r)}function Pm(n,t,e,r){return 1===arguments.length?((o=n)instanceof hm||(o=Om(o)),o?new Am((o=o.rgb()).r,o.g,o.b,o.opacity):new Am):new Am(n,t,e,null==r?1:r);var o}function Am(n,t,e,r){this.r=+n,this.g=+t,this.b=+e,this.opacity=+r}function zm(){return`#${Dm(this.r)}${Dm(this.g)}${Dm(this.b)}`}function Lm(){const n=Tm(this.opacity);return`${1===n?"rgb(":"rgba("}${Bm(this.r)}, ${Bm(this.g)}, ${Bm(this.b)}${1===n?")":`, ${n})`}`}function Tm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Bm(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Dm(n){return((n=Bm(n))<16?"0":"")+n.toString(16)}function Rm(n,t,e,r){return r<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new Hm(n,t,e,r)}function Vm(n){if(n instanceof Hm)return new Hm(n.h,n.s,n.l,n.opacity);if(n instanceof hm||(n=Om(n)),!n)return new Hm;if(n instanceof Hm)return n;var t=(n=n.rgb()).r/255,e=n.g/255,r=n.b/255,o=Math.min(t,e,r),i=Math.max(t,e,r),u=NaN,a=i-o,c=(i+o)/2;return a?(u=t===i?(e-r)/a+6*(e<r):e===i?(r-t)/a+2:(t-e)/a+4,a/=c<.5?i+o:2-i-o,u*=60):a=c>0&&c<1?0:u,new Hm(u,a,c,n.opacity)}function Hm(n,t,e,r){this.h=+n,this.s=+t,this.l=+e,this.opacity=+r}function Ym(n){return(n=(n||0)%360)<0?n+360:n}function Zm(n){return Math.max(0,Math.min(1,n||0))}function Xm(n,t,e){return 255*(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)}fm(hm,Om,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Nm,formatHex:Nm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Vm(this).formatHsl()},formatRgb:Mm,toString:Mm}),fm(Am,Pm,dm(hm,{brighter(n){return n=null==n?pm:Math.pow(pm,n),new Am(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?vm:Math.pow(vm,n),new Am(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Am(Bm(this.r),Bm(this.g),Bm(this.b),Tm(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:zm,formatHex:zm,formatHex8:function(){return`#${Dm(this.r)}${Dm(this.g)}${Dm(this.b)}${Dm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Lm,toString:Lm})),fm(Hm,(function(n,t,e,r){return 1===arguments.length?Vm(n):new Hm(n,t,e,null==r?1:r)}),dm(hm,{brighter(n){return n=null==n?pm:Math.pow(pm,n),new Hm(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?vm:Math.pow(vm,n),new Hm(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,o=2*e-r;return new Am(Xm(n>=240?n-240:n+120,o,r),Xm(n,o,r),Xm(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new Hm(Ym(this.h),Zm(this.s),Zm(this.l),Tm(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=Tm(this.opacity);return`${1===n?"hsl(":"hsla("}${Ym(this.h)}, ${100*Zm(this.s)}%, ${100*Zm(this.l)}%${1===n?")":`, ${n})`}`}}));var Um=n=>()=>n;function Fm(n,t){var e=t-n;return e?function(n,t){return function(e){return n+e*t}}(n,e):Um(isNaN(n)?t:n)}var Wm=function n(t){var e=function(n){return 1==(n=+n)?Fm:function(t,e){return e-t?function(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(r){return Math.pow(n+r*t,e)}}(t,e,n):Um(isNaN(t)?e:t)}}(t);function r(n,t){var r=e((n=Pm(n)).r,(t=Pm(t)).r),o=e(n.g,t.g),i=e(n.b,t.b),u=Fm(n.opacity,t.opacity);return function(t){return n.r=r(t),n.g=o(t),n.b=i(t),n.opacity=u(t),n+""}}return r.gamma=n,r}(1);function $m(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}var Gm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qm=new RegExp(Gm.source,"g");function Km(n,t){var e,r,o,i=Gm.lastIndex=qm.lastIndex=0,u=-1,a=[],c=[];for(n+="",t+="";(e=Gm.exec(n))&&(r=qm.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),a[u]?a[u]+=o:a[++u]=o),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:$m(e,r)})),i=qm.lastIndex;return i<t.length&&(o=t.slice(i),a[u]?a[u]+=o:a[++u]=o),a.length<2?c[0]?function(n){return function(t){return n(t)+""}}(c[0].x):function(n){return function(){return n}}(t):(t=c.length,function(n){for(var e,r=0;r<t;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}var Qm,Jm=180/Math.PI,nw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tw(n,t,e,r,o,i){var u,a,c;return(u=Math.sqrt(n*n+t*t))&&(n/=u,t/=u),(c=n*e+t*r)&&(e-=n*c,r-=t*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),n*r<t*e&&(n=-n,t=-t,c=-c,u=-u),{translateX:o,translateY:i,rotate:Math.atan2(t,n)*Jm,skewX:Math.atan(c)*Jm,scaleX:u,scaleY:a}}function ew(n,t,e,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,t,null,e);a.push({i:c-4,x:$m(n,o)},{i:c-2,x:$m(r,i)})}else(o||i)&&u.push("translate("+o+t+i+e)}(i.translateX,i.translateY,u.translateX,u.translateY,a,c),function(n,t,e,i){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:$m(n,t)})):t&&e.push(o(e)+"rotate("+t+r)}(i.rotate,u.rotate,a,c),function(n,t,e,i){n!==t?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:$m(n,t)}):t&&e.push(o(e)+"skewX("+t+r)}(i.skewX,u.skewX,a,c),function(n,t,e,r,i,u){if(n!==e||t!==r){var a=i.push(o(i)+"scale(",null,",",null,")");u.push({i:a-4,x:$m(n,e)},{i:a-2,x:$m(t,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,u.scaleX,u.scaleY,a,c),i=u=null,function(n){for(var t,e=-1,r=c.length;++e<r;)a[(t=c[e]).i]=t.x(n);return a.join("")}}}var rw=ew((function(n){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return t.isIdentity?nw:tw(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),ow=ew((function(n){return null==n?nw:(Qm||(Qm=document.createElementNS("http://www.w3.org/2000/svg","g")),Qm.setAttribute("transform",n),(n=Qm.transform.baseVal.consolidate())?tw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):nw)}),", ",")",")");function iw(n){return((n=Math.exp(n))+1/n)/2}var uw,aw,cw=function n(t,e,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)/t,i=function(n){return[a+n*h,c+n*v,l*Math.exp(t*n*u)]};else{var g=Math.sqrt(p),y=(d*d-l*l+r*p)/(2*l*e*g),m=(d*d-l*l-r*p)/(2*d*e*g),w=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(m*m+1)-m);u=(b-w)/t,i=function(n){var r,o=n*u,i=iw(w),s=l/(e*g)*(i*(r=t*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/iw(t*o+w)]}}return i.duration=1e3*u*t/Math.SQRT2,i}return o.rho=function(t){var e=Math.max(.001,+t),r=e*e;return n(e,r,r*r)},o}(Math.SQRT2,2,4),lw=0,sw=0,fw=0,dw=0,hw=0,vw=0,pw="object"==typeof performance&&performance.now?performance:Date,gw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function yw(){return hw||(gw(mw),hw=pw.now()+vw)}function mw(){hw=0}function ww(){this._call=this._time=this._next=null}function bw(n,t,e){var r=new ww;return r.restart(n,t,e),r}function _w(){hw=(dw=pw.now())+vw,lw=sw=0;try{!function(){yw(),++lw;for(var n,t=uw;t;)(n=hw-t._time)>=0&&t._call.call(void 0,n),t=t._next;--lw}()}finally{lw=0,function(){for(var n,t,e=uw,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:uw=t);aw=n,Ew(r)}(),hw=0}}function xw(){var n=pw.now(),t=n-dw;t>1e3&&(vw-=t,dw=n)}function Ew(n){lw||(sw&&(sw=clearTimeout(sw)),n-hw>24?(n<1/0&&(sw=setTimeout(_w,n-pw.now()-vw)),fw&&(fw=clearInterval(fw))):(fw||(dw=pw.now(),fw=setInterval(xw,1e3)),lw=1,gw(_w)))}function Sw(n,t,e){var r=new ww;return t=null==t?0:+t,r.restart((e=>{r.stop(),n(e+t)}),t,e),r}ww.prototype=bw.prototype={constructor:ww,restart:function(n,t,e){if("function"!=typeof n)throw new TypeError("callback is not a function");e=(null==e?yw():+e)+(null==t?0:+t),this._next||aw===this||(aw?aw._next=this:uw=this,aw=this),this._call=n,this._time=e,Ew()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ew())}};var kw=Cg("start","end","cancel","interrupt"),Cw=[];function Nw(n,t,e,r,o,i){var u=n.__transition;if(u){if(e in u)return}else n.__transition={};!function(n,t,e){var r,o=n.__transition;function i(c){var l,s,f,d;if(1!==e.state)return a();for(l in o)if((d=o[l]).name===e.name){if(3===d.state)return Sw(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<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",n,n.__data__,d.index,d.group),delete o[l])}if(Sw((function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(c))})),e.state=2,e.on.call("start",n,n.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(f=e.tween.length),l=0,s=-1;l<f;++l)(d=e.tween[l].value.call(n,n.__data__,e.index,e.group))&&(r[++s]=d);r.length=s+1}}function u(t){for(var o=t<e.duration?e.ease.call(null,t/e.duration):(e.timer.restart(a),e.state=5,1),i=-1,u=r.length;++i<u;)r[i].call(n,o);5===e.state&&(e.on.call("end",n,n.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete o[t],o)return;delete n.__transition}o[t]=e,e.timer=bw((function(n){e.state=1,e.timer.restart(i,e.delay,e.time),e.delay<=n&&i(n-e.delay)}),0,e.time)}(n,e,{name:t,index:r,group:o,on:kw,tween:Cw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Mw(n,t){var e=jw(n,t);if(e.state>0)throw new Error("too late; already scheduled");return e}function Ow(n,t){var e=jw(n,t);if(e.state>3)throw new Error("too late; already running");return e}function jw(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Iw(n,t){var e,r,o,i=n.__transition,u=!0;if(i){for(o in t=null==t?null:t+"",i)(e=i[o]).name===t?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",n,n.__data__,e.index,e.group),delete i[o]):u=!1;u&&delete n.__transition}}function Pw(n,t){var e,r;return function(){var o=Ow(this,n),i=o.tween;if(i!==e)for(var u=0,a=(r=e=i).length;u<a;++u)if(r[u].name===t){(r=r.slice()).splice(u,1);break}o.tween=r}}function Aw(n,t,e){var r,o;if("function"!=typeof e)throw new Error;return function(){var i=Ow(this,n),u=i.tween;if(u!==r){o=(r=u).slice();for(var a={name:t,value:e},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function zw(n,t,e){var r=n._id;return n.each((function(){var n=Ow(this,r);(n.value||(n.value={}))[t]=e.apply(this,arguments)})),function(n){return jw(n,r).value[t]}}function Lw(n,t){var e;return("number"==typeof t?$m:t instanceof Om?Wm:(e=Om(t))?(t=e,Wm):Km)(n,t)}function Tw(n){return function(){this.removeAttribute(n)}}function Bw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Dw(n,t,e){var r,o,i=e+"";return function(){var u=this.getAttribute(n);return u===i?null:u===r?o:o=t(r=u,e)}}function Rw(n,t,e){var r,o,i=e+"";return function(){var u=this.getAttributeNS(n.space,n.local);return u===i?null:u===r?o:o=t(r=u,e)}}function Vw(n,t,e){var r,o,i;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttribute(n))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=t(r=u,c));this.removeAttribute(n)}}function Hw(n,t,e){var r,o,i;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttributeNS(n.space,n.local))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=t(r=u,c));this.removeAttributeNS(n.space,n.local)}}function Yw(n,t){var e,r;function o(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&function(n,t){return function(e){this.setAttributeNS(n.space,n.local,t.call(this,e))}}(n,o)),e}return o._value=t,o}function Zw(n,t){var e,r;function o(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&function(n,t){return function(e){this.setAttribute(n,t.call(this,e))}}(n,o)),e}return o._value=t,o}function Xw(n,t){return function(){Mw(this,n).delay=+t.apply(this,arguments)}}function Uw(n,t){return t=+t,function(){Mw(this,n).delay=t}}function Fw(n,t){return function(){Ow(this,n).duration=+t.apply(this,arguments)}}function Ww(n,t){return t=+t,function(){Ow(this,n).duration=t}}var $w=Vy.prototype.constructor;function Gw(n){return function(){this.style.removeProperty(n)}}var qw=0;function Kw(n,t,e,r){this._groups=n,this._parents=t,this._name=e,this._id=r}function Qw(){return++qw}var Jw=Vy.prototype;Kw.prototype={constructor:Kw,select:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=Bg(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,Nw(f[d],t,e,d,f,jw(a,e)));return new Kw(i,this._parents,t,e)},selectAll:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=Rg(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=jw(c,e),p=0,g=h.length;p<g;++p)(d=h[p])&&Nw(d,t,e,p,h,v);i.push(h),u.push(c)}return new Kw(i,u,t,e)},selectChild:Jw.selectChild,selectChildren:Jw.selectChildren,filter:function(n){"function"!=typeof n&&(n=Vg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u=t[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 Kw(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var t=this._groups,e=n._groups,r=t.length,o=e.length,i=Math.min(r,o),u=new Array(r),a=0;a<i;++a)for(var c,l=t[a],s=e[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]=t[a];return new Kw(u,this._parents,this._name,this._id)},selection:function(){return new $w(this._groups,this._parents)},transition:function(){for(var n=this._name,t=this._id,e=Qw(),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=jw(u,t);Nw(u,n,e,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Kw(r,this._parents,n,e)},call:Jw.call,nodes:Jw.nodes,node:Jw.node,size:Jw.size,empty:Jw.empty,each:Jw.each,on:function(n,t){var e=this._id;return arguments.length<2?jw(this.node(),e).on.on(n):this.each(function(n,t,e){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var t=n.indexOf(".");return t>=0&&(n=n.slice(0,t)),!n||"start"===n}))}(t)?Mw:Ow;return function(){var u=i(this,n),a=u.on;a!==r&&(o=(r=a).copy()).on(t,e),u.on=o}}(e,n,t))},attr:function(n,t){var e=Pg(n),r="transform"===e?ow:Lw;return this.attrTween(n,"function"==typeof t?(e.local?Hw:Vw)(e,r,zw(this,"attr."+n,t)):null==t?(e.local?Bw:Tw)(e):(e.local?Rw:Dw)(e,r,t))},attrTween:function(n,t){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;var r=Pg(n);return this.tween(e,(r.local?Yw:Zw)(r,t))},style:function(n,t,e){var r="transform"==(n+="")?rw:Lw;return null==t?this.styleTween(n,function(n,t){var e,r,o;return function(){var i=ly(this,n),u=(this.style.removeProperty(n),ly(this,n));return i===u?null:i===e&&u===r?o:o=t(e=i,r=u)}}(n,r)).on("end.style."+n,Gw(n)):"function"==typeof t?this.styleTween(n,function(n,t,e){var r,o,i;return function(){var u=ly(this,n),a=e(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=ly(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=t(r=u,a))}}(n,r,zw(this,"style."+n,t))).each(function(n,t){var e,r,o,i,u="style."+t,a="end."+u;return function(){var c=Ow(this,n),l=c.on,s=null==c.value[u]?i||(i=Gw(t)):void 0;l===e&&o===s||(r=(e=l).copy()).on(a,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,t,e){var r,o,i=e+"";return function(){var u=ly(this,n);return u===i?null:u===r?o:o=t(r=u,e)}}(n,r,t),e).on("end.style."+n,null)},styleTween:function(n,t,e){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(n,t,e){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,t,e){return function(r){this.style.setProperty(n,t.call(this,r),e)}}(n,i,e)),r}return i._value=t,i}(n,t,null==e?"":e))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var t=n(this);this.textContent=null==t?"":t}}(zw(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==n)return this.tween(t,null);if("function"!=typeof n)throw new Error;return this.tween(t,function(n){var t,e;function r(){var r=n.apply(this,arguments);return r!==e&&(t=(e=r)&&function(n){return function(t){this.textContent=n.call(this,t)}}(r)),t}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}(this._id))},tween:function(n,t){var e=this._id;if(n+="",arguments.length<2){for(var r,o=jw(this.node(),e).tween,i=0,u=o.length;i<u;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==t?Pw:Aw)(e,n,t))},delay:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?Xw:Uw)(t,n)):jw(this.node(),t).delay},duration:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?Fw:Ww)(t,n)):jw(this.node(),t).duration},ease:function(n){var t=this._id;return arguments.length?this.each(function(n,t){if("function"!=typeof t)throw new Error;return function(){Ow(this,n).ease=t}}(t,n)):jw(this.node(),t).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,t){return function(){var e=t.apply(this,arguments);if("function"!=typeof e)throw new Error;Ow(this,n).ease=e}}(this._id,n))},end:function(){var n,t,e=this,r=e._id,o=e.size();return new Promise((function(i,u){var a={value:u},c={value:function(){0==--o&&i()}};e.each((function(){var e=Ow(this,r),o=e.on;o!==n&&((t=(n=o).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),e.on=t})),0===o&&i()}))},[Symbol.iterator]:Jw[Symbol.iterator]};var nb={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function tb(n,t){for(var e;!(e=n.__transition)||!(e=e[t]);)if(!(n=n.parentNode))throw new Error(`transition ${t} not found`);return e}Vy.prototype.interrupt=function(n){return this.each((function(){Iw(this,n)}))},Vy.prototype.transition=function(n){var t,e;n instanceof Kw?(t=n._id,n=n._name):(t=Qw(),(e=nb).time=yw(),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])&&Nw(u,n,t,l,a,e||tb(u,t));return new Kw(r,this._parents,n,t)};var eb=n=>()=>n;function rb(n,{sourceEvent:t,target:e,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function ob(n,t,e){this.k=n,this.x=t,this.y=e}ob.prototype={constructor:ob,scale:function(n){return 1===n?this:new ob(this.k*n,this.x,this.y)},translate:function(n,t){return 0===n&0===t?this:new ob(this.k,this.x+this.k*n,this.y+this.k*t)},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 ib=new ob(1,0,0);function ub(n){for(;!n.__zoom;)if(!(n=n.parentNode))return ib;return n.__zoom}function ab(n){n.stopImmediatePropagation()}function cb(n){n.preventDefault(),n.stopImmediatePropagation()}function lb(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function sb(){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 fb(){return this.__zoom||ib}function db(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function hb(){return navigator.maxTouchPoints||"ontouchstart"in this}function vb(n,t,e){var r=n.invertX(t[0][0])-e[0][0],o=n.invertX(t[1][0])-e[1][0],i=n.invertY(t[0][1])-e[0][1],u=n.invertY(t[1][1])-e[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))}ub.prototype=ob.prototype;var pb,gb=function(n){return{x:n.x,y:n.y,zoom:n.k}},yb=function(n){var t=n.x,e=n.y,r=n.zoom;return ib.translate(t,e).scale(r)},mb=function(n,t){return n.target.closest(".".concat(t))},wb=function(n,t){return 2===t&&Array.isArray(n)&&n.includes(2)},bb=function(n,t){return void 0===t&&(t=0),"number"==typeof t&&t>0?n.transition().duration(t):n},_b=function(n){var t=n.ctrlKey&&Gv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*t};function xb(n){var t=n.domNode,e=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=t.getBoundingClientRect(),h=function(){var n,t,e,r=lb,o=sb,i=vb,u=db,a=hb,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=cw,d=Cg("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",fb).on("wheel.zoom",x,{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,t){return(t=Math.max(c[0],Math.min(c[1],t)))===n.k?n:new ob(t,n.x,n.y)}function y(n,t,e){var r=t[0]-e[0]*n.k,o=t[1]-e[1]*n.k;return r===n.x&&o===n.y?n:new ob(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,t,e,r){n.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=b(n,i).event(r),a=o.apply(n,i),c=null==e?m(a):"function"==typeof e?e.apply(n,i):e,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=n.__zoom,d="function"==typeof t?t.apply(n,i):t,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 t=h(n),e=l/t[2];n=new ob(e,c[0]-t[0]*e,c[1]-t[1]*e)}u.zoom(null,n)}}))}function b(n,t,e){return!e&&n.__zooming||new _(n,t)}function _(n,t){this.that=n,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,t),this.taps=0}function x(n,...t){if(r.apply(this,arguments)){var e=b(this,t).event(n),o=this.__zoom,a=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,u.apply(this,arguments)))),s=Yy(n);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=o.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(o.k===a)return;e.mouse=[s,o.invert(s)],Iw(this),e.start()}cb(n),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),150),e.zoom("mouse",i(y(g(o,a),e.mouse[0],e.mouse[1]),e.extent,l))}}function E(n,...t){if(!e&&r.apply(this,arguments)){var o=n.currentTarget,u=b(this,t,!0).event(n),a=Hy(n.view).on("mousemove.zoom",(function(n){if(cb(n),!u.moved){var t=n.clientX-s,e=n.clientY-f;u.moved=t*t+e*e>h}u.event(n).zoom("mouse",i(y(u.that.__zoom,u.mouse[0]=Yy(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),$y(n.view,u.moved),cb(n),u.event(n).end()}),!0),c=Yy(n,o),s=n.clientX,f=n.clientY;Wy(n.view),ab(n),u.mouse=[c,this.__zoom.invert(c)],Iw(this),u.start()}}function S(n,...t){if(r.apply(this,arguments)){var e=this.__zoom,u=Yy(n.changedTouches?n.changedTouches[0]:n,this),a=e.invert(u),c=e.k*(n.shiftKey?.5:2),f=i(y(g(e,c),u,a),o.apply(this,t),l);cb(n),s>0?Hy(this).transition().duration(s).call(w,f,u,n):Hy(this).call(p.transform,f,u,n)}}function k(e,...o){if(r.apply(this,arguments)){var i,u,a,c,l=e.touches,s=l.length,f=b(this,o,e.changedTouches.length===s).event(e);for(ab(e),u=0;u<s;++u)c=[c=Yy(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&&(t=c[0],n=setTimeout((function(){n=null}),500)),Iw(this),f.start())}}function C(n,...t){if(this.__zooming){var e,r,o,u,a=b(this,t).event(n),c=n.changedTouches,s=c.length;for(cb(n),e=0;e<s;++e)o=Yy(r=c[e],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=b(this,r).event(n),a=n.changedTouches,c=a.length;for(ab(n),e&&clearTimeout(e),e=setTimeout((function(){e=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=Yy(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<v)){var l=Hy(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return p.transform=function(n,t,e,r){var o=n.selection?n.selection():n;o.property("__zoom",fb),n!==o?w(n,t,e,r):o.interrupt().each((function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},p.scaleBy=function(n,t,e,r){p.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),e,r)},p.scaleTo=function(n,t,e,r){p.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,u=null==e?m(n):"function"==typeof e?e.apply(this,arguments):e,a=r.invert(u),c="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,c),u,a),n,l)}),e,r)},p.translateBy=function(n,t,e,r){p.transform(n,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof e?e.apply(this,arguments):e),o.apply(this,arguments),l)}),null,r)},p.translateTo=function(n,t,e,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(ib.translate(a[0],a[1]).scale(u.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof e?-e.apply(this,arguments):-e),n,l)}),r,u)},_.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,t){return this.mouse&&"mouse"!==n&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var t=Hy(this.that).datum();d.call(n,this.that,new rb(n,{sourceEvent:this.sourceEvent,target:p,type:n,transform:this.that.__zoom,dispatch:d}),t)}},p.wheelDelta=function(n){return arguments.length?(u="function"==typeof n?n:eb(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:eb(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:eb(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:eb([[+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([e,r]).translateExtent(o),v=Hy(t).call(h);w({x:i.x,y:i.y,zoom:Dv(i.zoom,e,r)},[[0,0],[d.width,d.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,t){v&&(null==h||h.transform(bb(v,null==t?void 0:t.duration),n))}function m(){h.on("zoom",null)}function w(n,t,e){var r=yb(n),o=null==h?void 0:h.constrain()(r,t,e);return o&&y(o),o}return h.wheelDelta(_b),{update:function(n){var t=n.noWheelClassName,e=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,d=n.panOnDrag,y=n.panOnScrollMode,w=n.panOnScrollSpeed,b=n.preventScrolling,_=n.zoomOnPinch,x=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!f.isZoomingOrPanning&&m();var C=!i||S||o?function(n){var t=n.noWheelClassName,e=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!e&&"wheel"===n.type&&!n.ctrlKey||mb(n,t))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:t,preventScrolling:b,d3ZoomHandler:p}):function(n){var t=n.zoomPanValues,e=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(mb(n,e))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=Yy(n),h=_b(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===tp.Vertical?0:n.deltaX*p,y=i===tp.Horizontal?0:n.deltaY*p;!Gv()&&n.shiftKey&&i!==tp.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=gb(r.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling||(t.isPanScrolling=!0,null==c||c(n,m)),t.isPanScrolling&&(null==l||l(n,m),t.panScrollTimeout=setTimeout((function(){null==s||s(n,m),t.isPanScrolling=!1}),150))}}}({zoomPanValues:f,noWheelClassName:t,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:w,zoomOnPinch:_,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var N=function(n){var t=n.zoomPanValues,e=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=gb(n.transform);t.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,"mousedown"===(null===(u=n.sourceEvent)||void 0===u?void 0:u.type)&&e(!0),r&&(null==r||r(n.sourceEvent,a))}}}({zoomPanValues:f,onDraggingChange:s,onPanZoomStart:a});h.on("start",N);var M=function(n){var t=n.zoomPanValues,e=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var u,a,c;t.usedRightMouseButton=!(!r||!wb(e,null!==(u=t.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,gb(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",M);var O=function(n){var t=n.zoomPanValues,e=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)&&(t.isZoomingOrPanning=!1,u&&wb(e,null!==(c=t.mouseButton)&&void 0!==c?c:0)&&!t.usedRightMouseButton&&n.sourceEvent&&u(n.sourceEvent),t.usedRightMouseButton=!1,o(!1),i&&(l=t.prevViewport,s=n.transform,l.x!==s.x||l.y!==s.y||l.zoom!==s.k))){var f=gb(n.transform);t.prevViewport=f,clearTimeout(t.timerId),t.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 j=function(n){var t=n.zoomActivationKeyPressed,e=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=t||e,d=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(mb(n,"".concat(s,"-flow__node"))||mb(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(mb(n,c)&&"wheel"===n.type)return!1;if(mb(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!t))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:x,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:_,userSelectionActive:o,noPanClassName:e,noWheelClassName:t,lib:k});h.filter(j),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,t){var e=yb(n);return y(e,t),e},setViewportConstrained:w,getViewport:function(){var n=v?ub(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,t){v&&(null==h||h.scaleTo(bb(v,null==t?void 0:t.duration),n))},scaleBy:function(n,t){v&&(null==h||h.scaleBy(bb(v,null==t?void 0:t.duration),n))},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var t=yb(n),e=v.property("__zoom");e.k===n.zoom&&e.x===n.x&&e.y===n.y||null==h||h.transform(v,t,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(pb||(pb={}));U(U({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var Eb=mv();function Sb(n,t){var r=e(Z);if(null===r)throw new Error(Eb);return H(r,n,t)}function kb(){var n=e(Z);if(null===n)throw new Error(Eb);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}function Cb(n,t){var e,r,o;void 0===t&&(t={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var i=(null==t?void 0:t.elevateNodesOnSelect)?1e3:0;try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=c.parentId;if(l){if(!n.has(l))throw new Error("Parent node ".concat(l," not found"));var s=n.get(l),f=Nb(c,n,d(d({},c.position),{z:(Lb(c.zIndex)?c.zIndex:0)+(c.selected?i:0)}),null!==(o=null==s?void 0:s.origin)&&void 0!==o?o:t.nodeOrigin),h=f.x,v=f.y,p=f.z,m=c.internals.positionAbsolute,w=h!==m.x||v!==m.y;(w||p!==c.internals.z)&&(c.internals=d(d({},c.internals),{positionAbsolute:w?{x:h,y:v}:m,z:p}))}}}catch(n){e={error:n}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}function Nb(n,t,e,r){var o,i,u,a,c,l;if(void 0===r&&(r=[0,0]),!n.parentId)return e;var s=t.get(n.parentId),f=Mb(s,r).position;return Nb(s,t,{x:(null!==(o=e.x)&&void 0!==o?o:0)+f.x,y:(null!==(i=e.y)&&void 0!==i?i:0)+f.y,z:(null!==(u=s.internals.z)&&void 0!==u?u:0)>(null!==(a=e.z)&&void 0!==a?a:0)?null!==(c=s.internals.z)&&void 0!==c?c:0:null!==(l=e.z)&&void 0!==l?l:0},s.origin||r)}var Mb=function(n,t){void 0===t&&(t=[0,0]);var e=zb(n),r=e.width,o=e.height,i=("internals"in n?n.internals.positionAbsolute:n.position)||{x:0,y:0},u=n.origin||t,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 Ob(n,t,e){var r,o;n.clear(),t.clear();try{for(var i=g(e),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};t.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}}}function jb(n,t,e,r){void 0===r&&(r={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var o=new Map(t);t.clear(),e.clear();var i=(null==r?void 0:r.elevateNodesOnSelect)?1e3:0;n.forEach((function(n){var u,a,c,l,s=o.get(n.id);if(r.checkEquality&&n===(null==s?void 0:s.internals.userNode)||(s=d(d(d({},r.defaults),n),{measured:{width:null!==(a=null===(u=n.measured)||void 0===u?void 0:u.width)&&void 0!==a?a:0,height:null!==(l=null===(c=n.measured)||void 0===c?void 0:c.height)&&void 0!==l?l:0},internals:{positionAbsolute:n.position||{x:0,y:0},handleBounds:null==s?void 0:s.internals.handleBounds,z:(Lb(n.zIndex)?n.zIndex:0)+(n.selected?i:0),userNode:n}})),t.set(n.id,s),n.parentId){var f=e.get(n.parentId);f?f.push(s):e.set(n.parentId,[s])}})),e.size>0&&Cb(t,r)}function Ib(n,t,e,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=t.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:Db(v,null!==(c=v.origin)&&void 0!==c?c:r),y=Yb(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(t,r){var o=t.expandedRect,i=t.parent,u=Mb(i,i.origin).position,a=zb(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=e.get(r);null==f||f.forEach((function(t){n.some((function(n){return n.id===t.id}))||l.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.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}var Pb=function(n,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),Math.min(Math.max(n,t),e)},Ab=function(n,t){return void 0===n&&(n={x:0,y:0}),{x:Pb(n.x,t[0][0],t[1][0]),y:Pb(n.y,t[0][1],t[1][1])}};function zb(n){var t,e,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e: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 Lb=function(n){return!isNaN(n)&&isFinite(n)},Tb=function(n,t){return void 0===t&&(t=[1,1]),{x:t[0]*Math.round(n.x/t[0]),y:t[1]*Math.round(n.y/t[1])}},Bb=function(n,t,e,r){var o=n.x,i=n.y,u=y(t,3),a=u[0],c=u[1],l=u[2];void 0===e&&(e=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return e?Tb(s,r):s},Db=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=Mb(n,t).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.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}},Rb=function(n,t){return{x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x2,t.x2),y2:Math.max(n.y2,t.y2)}},Vb=function(n){var t=n.x,e=n.y;return{x:t,y:e,x2:t+n.width,y2:e+n.height}},Hb=function(n){var t=n.x,e=n.y;return{x:t,y:e,width:n.x2-t,height:n.y2-e}},Yb=function(n,t){return Hb(Rb(Vb(n),Vb(t)))};function Zb(n){return o(n)}var Xb=function(n,t){var e=Math.max(0,Math.min(n.x+n.width,t.x+t.width)-Math.max(n.x,t.x)),r=Math.max(0,Math.min(n.y+n.height,t.y+t.height)-Math.max(n.y,t.y));return Math.ceil(e*r)},Ub=function(n,t,e,r,o,i){var u=t/(n.width*(1+i)),a=e/(n.height*(1+i)),c=Math.min(u,a),l=Pb(c,r,o);return{x:t/2-(n.x+n.width/2)*l,y:e/2-(n.y+n.height/2)*l,zoom:l}};function Fb(n){return void 0!==n&&"parent"!==n}var Wb=function(n){return $b(n)},$b=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};var Gb=function(n){return Lb(n.width)&&Lb(n.height)&&Lb(n.x)&&Lb(n.y)},qb=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},Kb=["INPUT","SELECT","TEXTAREA"];function Qb(n){var t,e,r=(null===(e=null===(t=n.composedPath)||void 0===t?void 0:t.call(n))||void 0===e?void 0:e[0])||n.target;return Kb.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var Jb=function(n){return"clientX"in n},n_=function(n,t){var e,r,o,i,u=Jb(n),a=u?n.clientX:null===(e=n.touches)||void 0===e?void 0:e[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==t?void 0:t.left)&&void 0!==o?o:0),y:c-(null!==(i=null==t?void 0:t.top)&&void 0!==i?i:0)}},t_=function(n,t,e,r){void 0===r&&(r=[0,0]);var o=t.querySelectorAll(n);if(!o||!o.length)return null;var i=Array.from(o),u=t.getBoundingClientRect(),a=u.width*r[0],c=u.height*r[1];return i.map((function(n){var t=n.getBoundingClientRect();return d({id:n.getAttribute("data-handleid"),position:n.getAttribute("data-handlepos"),x:(t.left-u.left-a)/e,y:(t.top-u.top-c)/e},qb(n))}))},e_="undefined"!=typeof document?document:null;function r_(n,t){void 0===n&&(n=null),void 0===t&&(t={target:e_,actInsideInputWithModifier:!0});var e=y(i(!1),2),o=e[0],c=e[1],l=u(!1),s=u(new Set([])),f=y(r((function(){if(null!==n){var t=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),e=t.reduce((function(n,t){return n.concat.apply(n,m([],y(t),!1))}),[]);return[t,e]}return[[],[]]}),[n]),2),d=f[0],h=f[1];return a((function(){var e=(null==t?void 0:t.target)||e_;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!t.actInsideInputWithModifier)&&Qb(n))return!1;var e=i_(n.code,h);s.current.add(n[e]),o_(d,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!t.actInsideInputWithModifier)&&Qb(n))return!1;var e=i_(n.code,h);o_(d,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[e]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==e||e.addEventListener("keydown",r),null==e||e.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==e||e.removeEventListener("keydown",r),null==e||e.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function o_(n,t,e){return n.filter((function(n){return e||n.length===t.size})).some((function(n){return n.every((function(n){return t.has(n)}))}))}function i_(n,t){return t.includes(n)?"code":"key"}function u_(n,t){if(Object.is(n,t))return!0;if("object"!=typeof n||null===n||"object"!=typeof t||null===t)return!1;if(n instanceof Map&&t instanceof Map){if(n.size!==t.size)return!1;for(const[e,r]of n)if(!Object.is(r,t.get(e)))return!1;return!0}if(n instanceof Set&&t instanceof Set){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}const e=Object.keys(n);if(e.length!==Object.keys(t).length)return!1;for(const r of e)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(n[r],t[r]))return!1;return!0}var a_={position:"absolute",width:"100%",height:"100%",top:0,left:0};var c_=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function l_(n){var t=n.onPaneContextMenu,e=n.zoomOnScroll,r=void 0===e||e,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?tp.Free:d,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,b=n.zoomActivationKeyCode,_=n.preventScrolling,x=void 0===_||_,E=n.children,S=n.noWheelClassName,C=n.noPanClassName,N=n.onViewportChange,M=n.isControlledViewport,O=kb(),j=u(null),I=Sb(c_,u_),P=I.userSelectionActive,A=I.lib,z=r_(b),L=u();return function(n){var t=kb();a((function(){var e=function(){var e,r;if(!n.current)return!1;var o=qb(n.current);0!==o.height&&0!==o.width||null===(r=(e=t.getState()).onError)||void 0===r||r.call(e,"004",bv()),t.setState({width:o.width||500,height:o.height||500})};if(n.current){e(),window.addEventListener("resize",e);var r=new ResizeObserver((function(){return e()}));return r.observe(n.current),function(){window.removeEventListener("resize",e),r&&n.current&&r.unobserve(n.current)}}}),[])}(j),a((function(){if(j.current){var n=O.getState();L.current=xb({domNode:j.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,t){var e=O.getState(),r=e.onViewportChangeStart,o=e.onMoveStart;null==o||o(n,t),null==r||r(t)},onPanZoom:function(n,t){var e=O.getState(),r=e.onViewportChange,o=e.onMove;null==o||o(n,t),null==r||r(t)},onPanZoomEnd:function(n,t){var e=O.getState(),r=e.onViewportChangeEnd,o=e.onMoveEnd;null==o||o(n,t),null==r||r(t)}});var t=L.current.getViewport(),e=t.x,r=t.y,o=t.zoom;return O.setState({panZoom:L.current,transform:[e,r,o],domNode:j.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:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:f,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:x,noPanClassName:C,userSelectionActive:P,noWheelClassName:S,lib:A})}),[t,r,i,l,f,h,p,y,z,x,C,P,S,A]),k.jsx("div",{className:"ink-flow__renderer",ref:j,style:a_,children:E})}var s_={actInsideInputWithModifier:!1};function f_(n,t){switch(n.type){case"select":t.selected=n.selected;break;case"position":void 0!==n.position&&(t.position=n.position),void 0!==n.dragging&&(t.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(t.measured={width:n.dimensions.width,height:n.dimensions.height},n.setAttributes&&(t.width=n.dimensions.width,t.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(t.resizing=n.resizing)}}function d_(n,t){var e,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"!==(x=f.value).type)if("remove"===x.type||"replace"===x.type)l.set(x.id,[x]);else{var h=l.get(x.id);h?h.push(x):l.set(x.id,[x])}else c.push(x.item)}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}try{for(var v=g(t),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 b=(u=void 0,g(m)),_=b.next();!_.done;_=b.next()){var x;f_(x=_.value,w)}}catch(n){u={error:n}}finally{try{_&&!_.done&&(a=b.return)&&a.call(b)}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 h_(n,t){return{id:n,type:"select",selected:t}}function v_(n,t,e){var r,o;void 0===t&&(t=new Set),void 0===e&&(e=!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=t.has(l);void 0===s.selected&&!f||s.selected===f||(e&&(s.selected=f),i.push(h_(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 p_(n){var t,e,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){t={error:n}}finally{try{h&&!h.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}try{for(var w=g(l),b=w.next();!b.done;b=w.next()){var _=y(b.value,1)[0];void 0===f.get(_)&&s.push({id:_,type:"remove"})}}catch(n){r={error:n}}finally{try{b&&!b.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}function g_(n){return{id:n.id,type:"remove"}}var y_=function(n,t){void 0===t&&(t=[0,0]);var e=zb(n),r=e.width,o=e.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||t,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}}},m_=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var e=n.reduce((function(n,e){var r=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=Mb(n,t).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.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)}}(e,t.nodeOrigin);return Rb(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hb(e)},w_=function(n,t,e,r,o,i){var u,a,c,l,s,f,h,v,p=y(void 0===e?[0,0,1]:e,3),m=p[0],w=p[1],b=p[2];void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=[0,0]);var _=d(d({},Bb(t,[m,w,b])),{width:t.width/b,height:t.height/b}),x=[];try{for(var E=g(n),S=E.next();!S.done;S=E.next()){var k=y(S.value,2)[1],C=k.measured,N=k.selectable,M=void 0===N||N,O=k.hidden,j=void 0!==O&&O,I=null!==(s=null!==(l=null!==(c=C.width)&&void 0!==c?c:k.width)&&void 0!==l?l:k.initialWidth)&&void 0!==s?s:null,P=null!==(v=null!==(h=null!==(f=C.height)&&void 0!==f?f:k.height)&&void 0!==h?h:k.initialHeight)&&void 0!==v?v:null;if(!(o&&!M||j)){var A=Xb(_,Db(k,i));(null===I||null===P||r&&A>0||A>=(null!=I?I:0)*(null!=P?P:0)||k.dragging)&&x.push(k)}}}catch(n){u={error:n}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(u)throw u.error}}return x};function b_(n,t){var e,r,o,i=n.nodeLookup,u=n.width,a=n.height,c=n.panZoom,l=n.minZoom,s=n.maxZoom,f=n.nodeOrigin,d=void 0===f?[0,0]:f,h=[],v=(null==t?void 0:t.nodes)?new Set(t.nodes.map((function(n){return n.id}))):null;if(i.forEach((function(n){!(n.measured.width&&n.measured.height&&((null==t?void 0:t.includeHiddenNodes)||!n.hidden))||v&&!v.has(n.id)||h.push(n)})),h.length>0){var p=m_(h,{nodeOrigin:d}),g=p.width>=u||p.height>=a;if("overflow"===(null==t?void 0:t.when)&&!g)return!0;var y=Ub(p,u,a,null!==(e=null==t?void 0:t.minZoom)&&void 0!==e?e:l,null!==(r=null==t?void 0:t.maxZoom)&&void 0!==r?r:s,null!==(o=null==t?void 0:t.padding)&&void 0!==o?o:.1);return c.setViewport(y,{duration:null==t?void 0:t.duration}),!0}return!1}function __(n){var t=n.nodeId,e=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(t),l=c.parentId?r.get(c.parentId):void 0,s=l?y_(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,t){var e,r,o,i;return t&&"parent"!==t?[t[0],[t[1][0]-(null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:0),t[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:t}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Fb(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],b=d+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==a||a("005",_v());var _=Fb(h)?Ab(e,h):e;return{position:{x:_.x-f,y:_.y-d},positionAbsolute:_}}function x_(n){return v(this,arguments,void 0,(function(n){var t,e,r,o,i,u,a,c,l,s,f,d,h,v,y,m,w,b,_,x=n.nodesToRemove,E=void 0===x?[]:x,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:t=new Set(E.map((function(n){return n.id}))),e=[],r=function(n){if(!1===n.deletable)return"continue";var r=t.has(n.id),o=!r&&n.parentId&&e.find((function(t){return t.id===n.parentId}));(r||o)&&e.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,t){var e=new Set;return n.forEach((function(n){e.add(n.id)})),t.filter((function(n){return e.has(n.source)||e.has(n.target)}))}(e,c),s=l,f=function(n){a.has(n.id)&&!s.find((function(t){return t.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){b={error:n}}finally{try{h&&!h.done&&(_=d.return)&&_.call(d)}finally{if(b)throw b.error}}return M?[4,M({nodes:e,edges:s})]:[2,{edges:s,nodes:e}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:e}:{edges:[],nodes:[]}]:[2,y]}}))}))}var E_=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function S_(){var n=Sb(E_,u_),t=n.userSelectionActive,e=n.userSelectionRect;return t&&e?k.jsx("div",{className:"ink-flow__selection ink-flow__container",style:{width:e.width,height:e.height,transform:"translate(".concat(e.x,"px, ").concat(e.y,"px)")}}):null}var k_=function(n,t){return function(e){e.target===t.current&&(null==n||n(e))}},C_=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function N_(n){var t=n.isSelecting;n.selectionMode;var e=n.panOnDrag,r=n.onSelectionStart,o=n.onSelectionEnd,i=n.onPaneClick,a=n.onPaneContextMenu,c=n.onPaneScroll,l=n.onPaneMouseEnter,s=n.onPaneMouseMove,f=n.onPaneMouseLeave,d=n.children,h=u(null),v=kb(),p=u(0),m=u(0),w=u(),b=u(new Map),_=Sb(C_,u_),x=_.userSelectionActive,E=_.elementsSelectable,S=_.dragging,C=function(){v.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},N=function(n){null==i||i(n),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},M=c?function(n){return c(n)}:void 0,O=E&&(t||x);return k.jsxs("div",{className:j(["ink-flow__pane",{draggable:e,dragging:S,selection:t}]),onClick:O?void 0:k_(N,h),onContextMenu:k_((function(n){Array.isArray(e)&&(null==e?void 0:e.includes(2))?n.preventDefault():null==a||a(n)}),h),onWheel:k_(M,h),onMouseEnter:O?void 0:l,onMouseDown:O?function(n){var e,o,i,u,a=v.getState(),c=a.resetSelectedElements,l=a.domNode,s=a.edgeLookup;if(w.current=null==l?void 0:l.getBoundingClientRect(),E&&t&&0===n.button&&n.target===h.current&&w.current){b.current=new Map;try{for(var f=g(s),d=f.next();!d.done;d=f.next()){var p=y(d.value,2),m=p[0],_=p[1];b.current.set(_.source,(null===(i=b.current.get(_.source))||void 0===i?void 0:i.add(m))||new Set([m])),b.current.set(_.target,(null===(u=b.current.get(_.target))||void 0===u?void 0:u.add(m))||new Set([m]))}}catch(n){e={error:n}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(e)throw e.error}}var x=n_(n.nativeEvent,w.current),S=x.x,k=x.y;c(),v.setState({userSelectionRect:{width:0,height:0,startX:S,startY:k,x:S,y:k}}),null==r||r(n)}}:void 0,onMouseMove:O?function(n){var e,r,o,i,u=v.getState(),a=u.userSelectionRect,c=u.edgeLookup,l=u.transform,s=u.nodeOrigin,f=u.nodeLookup,d=u.triggerNodeChanges,h=u.triggerEdgeChanges;if(t&&w.current&&a){var y=n_(n.nativeEvent,w.current),_=y.x,x=y.y,E=a.startX,S=a.startY,k={startX:E,startY:S,x:_<E?_:E,y:x<S?x:S,width:Math.abs(_-E),height:Math.abs(x-S)},C=w_(f,k,l,!1,!0,s),N=new Set,M=new Set;try{for(var O=g(C),j=O.next();!j.done;j=O.next()){var I=j.value;M.add(I.id);var P=b.current.get(I.id);if(P)try{for(var A=(o=void 0,g(P)),z=A.next();!z.done;z=A.next()){var L=z.value;N.add(L)}}catch(n){o={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(n){e={error:n}}finally{try{j&&!j.done&&(r=O.return)&&r.call(O)}finally{if(e)throw e.error}}if(p.current!==M.size)p.current=M.size,d(v_(f,M,!0));if(m.current!==N.size)m.current=N.size,h(v_(c,N));v.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:s,onMouseUp:O?function(n){if(0===n.button){var t=v.getState().userSelectionRect;!x&&t&&n.target===h.current&&(null==N||N(n)),v.setState({nodesSelectionActive:p.current>0}),C(),null==o||o(n)}}:void 0,onMouseLeave:O?function(n){x&&(v.setState({nodesSelectionActive:p.current>0}),null==o||o(n)),C()}:f,ref:h,style:a_,children:[d,k.jsx(S_,{})]})}var M_=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function O_(n){var t=n.children,e=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,b=n.zoomOnPinch,_=n.panOnScroll,x=n.panOnScrollSpeed,E=n.panOnScrollMode,S=n.zoomOnDoubleClick,C=n.panOnDrag,N=n.defaultViewport,M=n.translateExtent,O=n.minZoom,j=n.maxZoom,I=n.preventScrolling;n.onSelectionContextMenu;var P=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,L=n.isControlledViewport,T=Sb(M_);T.nodesSelectionActive;var B=T.userSelectionActive,D=r_(s),R=r_(g),V=R||C,H=R||_,Y=D||B||f&&!0!==V;return function(n){var t=n.deleteKeyCode,e=n.multiSelectionKeyCode,r=kb(),o=r_(t,s_),i=r_(e);a((function(){if(o){var n=r.getState();n.edges,n.nodes,r.setState({nodesSelectionActive:!1})}}),[o]),a((function(){r.setState({multiSelectionActive:i})}),[i])}({deleteKeyCode:l,multiSelectionKeyCode:p}),k.jsx(l_,{onPaneContextMenu:u,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:x,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!D&&V,defaultViewport:N,translateExtent:M,minZoom:O,maxZoom:j,zoomActivationKeyCode:y,preventScrolling:I,noWheelClassName:P,noPanClassName:A,onViewportChange:z,isControlledViewport:L,children:k.jsx(N_,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:d,children:t})})}O_.displayName="FlowRenderer";var j_=c(O_);function I_(n){var t=y(i(n),2);return[t[0],t[1]]}function P_(n){var t=y(i(n),2);return[t[0],t[1]]}var A_="undefined"!=typeof window?l:a;function z_(n){var t=y(i(!1),2),e=t[0],r=t[1],o=y(i((function(){return function(n){var t=[];return{get:function(){return t},reset:function(){t=[]},push:function(e){t.push(e),n()}}}((function(){return r(!0)}))})),1),u=o[0];return A_((function(){if(e){var t=u.get();t.length&&(n(t),u.reset()),r(!1)}else u.reset()}),[e]),u}var L_=t(null);function T_(n){var t=n.children,e=kb(),o=s((function(n){var t,r,o=e.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){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}a&&a({changes:p_({items:l,lookup:c}),userNodes:l})}),[]),i=z_(o),u=s((function(n){var t,r,o=e.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){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}a&&a({changes:p_({items:l,lookup:c}),userEdges:l})}),[]),a=z_(u),c=r((function(){return{nodeQueue:i,edgeQueue:a}}),[]);return k.jsx(L_.Provider,{value:c,children:t})}var B_=function(){var n=kb();return r((function(){return{zoomIn:function(t){var e;return null===(e=n.getState().panZoom)||void 0===e?void 0:e.scaleBy(1.2,{duration:null==t?void 0:t.duration})},zoomOut:function(t){var e;return null===(e=n.getState().panZoom)||void 0===e?void 0:e.scaleBy(1/1.2,{duration:null==t?void 0:t.duration})},zoomTo:function(t,e){var r;return null===(r=n.getState().panZoom)||void 0===r?void 0:r.scaleTo(t,{duration:null==e?void 0:e.duration})},getZoom:function(){return n.getState().transform[2]},setViewport:function(t,e){var r,o,i,u=n.getState(),a=y(u.transform,3),c=a[0],l=a[1],s=a[2],f=u.panZoom;null==f||f.setViewport({x:null!==(r=t.x)&&void 0!==r?r:c,y:null!==(o=t.y)&&void 0!==o?o:l,zoom:null!==(i=t.zoom)&&void 0!==i?i:s},{duration:null==e?void 0:e.duration})},getViewport:function(){var t=y(n.getState().transform,3);return{x:t[0],y:t[1],zoom:t[2]}},fitView:function(t){var e=n.getState(),r=e.nodeLookup,o=e.width,i=e.height,u=e.nodeOrigin,a=e.minZoom,c=e.maxZoom,l=e.panZoom;return!!l&&b_({nodeLookup:r,width:o,height:i,nodeOrigin:u,minZoom:a,maxZoom:c,panZoom:l},t)},setCenter:function(t,e,r){var o=n.getState(),i=o.width,u=o.height,a=o.panZoom,c=o.transform,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:c[2],s=i/2-t*l,f=u/2-e*l;null==a||a.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(t,e){var r,o=n.getState(),i=o.width,u=o.height,a=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Ub(t,i,u,a,c,null!==(r=null==e?void 0:e.padding)&&void 0!==r?r:.1);null==l||l.setViewport(s,{duration:null==e?void 0:e.duration})},screenToFlowPosition:function(t,e){void 0===e&&(e={snapToGrid:!0});var r=n.getState(),o=r.transform,i=r.snapGrid,u=r.domNode;if(!u)return t;var a=u.getBoundingClientRect(),c=a.x,l=a.y,s={x:t.x-c,y:t.y-l};return Bb(s,o,e.snapToGrid,i)},flowToScreenPosition:function(t){var e=n.getState(),r=e.transform,o=e.domNode;if(!o)return t;var i=o.getBoundingClientRect(),u=i.x,a=i.y,c=function(n,t){var e=n.x,r=n.y,o=y(t,3),i=o[0],u=o[1],a=o[2];return{x:e*a+i,y:r*a+u}}(t,r);return{x:c.x+u,y:c.y+a}}}}),[])},D_=function(n){return!!n.panZoom};function R_(){var n=this,t=B_(),o=kb(),i=function(){var n=e(L_);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),u=Sb(D_);console.log("yk store",o.getState());var a=r((function(){var t=function(n){return o.getState().nodeLookup.get(n)},e=function(n){i.nodeQueue.push(n)},r=function(n){var t,e,r,i,u=o.getState(),a=u.nodeLookup,c=u.nodeOrigin,l=Wb(n)?n:a.get(n.id),s=l.parentId?function(n,t,e,r){var o,i;void 0===r&&(r=[0,0]);for(var u=t,a=d({},n);u;){var c=e.get(t);if(u=null==c?void 0:c.parentId,c){var l=c.origin||r,s=(null!==(o=c.measured.width)&&void 0!==o?o:0)*l[0],f=(null!==(i=c.measured.height)&&void 0!==i?i:0)*l[1];a.x+=c.position.x-s,a.y+=c.position.y-f}}return a}(l.position,l.parentId,a,c):l.position,f={id:l.id,position:s,width:null!==(e=null===(t=l.measured)||void 0===t?void 0:t.width)&&void 0!==e?e: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 Db(f)},u=function(n,t,r){void 0===r&&(r={replace:!1}),e((function(e){return e.map((function(e){if(e.id===n){var o="function"==typeof t?t(e):t;return r.replace&&Wb(o)?o:d(d({},e),o)}return e}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var e;return null===(e=t(n))||void 0===e?void 0:e.internals.userNode},getInternalNode:t,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:e,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var t=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return m(m([],y(n),!1),y(t),!1)}))},addEdges:function(n){var t=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return m(m([],y(n),!1),y(t),!1)}))},toObject:function(){var n=o.getState(),t=n.nodes,e=void 0===t?[]:t,r=n.edges,i=void 0===r?[]:r,u=y(n.transform,3),a=u[0],c=u[1],l=u[2];return{nodes:e.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:a,y:c,zoom:l}}},deleteElements:function(t){return v(n,[t],void 0,(function(n){var t,e,r,i,u,a,c,l,s,f,d,h,v,g,y,m,w=n.nodes,b=void 0===w?[]:w,_=n.edges,x=void 0===_?[]:_;return p(this,(function(n){switch(n.label){case 0:return t=o.getState(),e=t.nodes,r=t.edges,i=t.onNodesDelete,u=t.onEdgesDelete,a=t.triggerNodeChanges,c=t.triggerEdgeChanges,l=t.onDelete,s=t.onBeforeDelete,[4,x_({nodesToRemove:b,edgesToRemove:x,nodes:e,edges:r,onBeforeDelete:s})];case 1:return f=n.sent(),d=f.nodes,h=f.edges,v=h.length>0,g=d.length>0,v&&(y=h.map(g_),null==u||u(h),c(y)),g&&(m=d.map(g_),null==i||i(d),a(m)),(g||v)&&(null==l||l({nodes:d,edges:h})),[2,{deletedNodes:d,deletedEdges:h}]}}))}))},getIntersectingNodes:function(n,t,e){void 0===t&&(t=!0);var i=Gb(n),u=i?n:r(n),a=void 0!==e;return u?(e||o.getState().nodes).filter((function(e){var r=o.getState().nodeLookup.get(e.id);if(r&&!i&&(e.id===n.id||!r.internals.positionAbsolute))return!1;var c=Db(a?e:r),l=Xb(c,u);return t&&l>0||l>=u.width*u.height})):[]},isNodeIntersecting:function(n,t,e){void 0===e&&(e=!0);var o=Gb(n)?n:r(n);if(!o)return!1;var i=Xb(o,t);return e&&i>0||i>=o.width*o.height},updateNode:u,updateNodeData:function(n,t,e){void 0===e&&(e={replace:!1}),u(n,(function(n){var r="function"==typeof t?t(n):t;return e.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),e)}}}),[]);return r((function(){return d(d(d({},a),t),{viewportInitialized:u})}),[u])}var V_=function(n){return n.updateNodeInternals};function H_(n){var t=Sb(s(function(n){return function(t){return n?w_(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map((function(n){return n.id})):Array.from(t.nodeLookup.keys())}}(n),[n]),u_);return t}var Y_=t(null),Z_=Y_.Provider;Y_.Consumer;function X_(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*t+.375*i+.375*n.targetControlX+.125*r,c=.125*e+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-t),Math.abs(c-e)]}function U_(n,t){return n>=0?.5*n:25*t*Math.sqrt(-n)}function F_(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(t){case ip.Left:return[e-U_(e-o,u),r];case ip.Right:return[e+U_(o-e,u),r];case ip.Top:return[e,r-U_(r-i,u)];case ip.Bottom:return[e,r+U_(i-r,u)]}}function W_(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-t)/2,u=r<t?r+i:r-i,a=Math.abs(o-e)/2;return[u,o<e?o+a:o-a,i,a]}var $_,G_=function(n){var t=n.source,e=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(t).concat(e||"","-").concat(r).concat(o||"")};var q_=(($_={})[ip.Left]={x:-1,y:0},$_[ip.Right]={x:1,y:0},$_[ip.Top]={x:0,y:-1},$_[ip.Bottom]={x:0,y:1},$_),K_=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};function Q_(n){var t,e,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?ip.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?ip.Top:l,f=n.center,d=n.offset,h=q_[a],v=q_[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 t=n.source,e=n.sourcePosition,r=void 0===e?ip.Bottom:e,o=n.target;return r===ip.Left||r===ip.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),b=0!==w.x?"x":"y",_=w[b],x=[],E={x:0,y:0},S={x:0,y:0},k=y(W_({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[b]*v[b]==-1){r=null!==(t=f.x)&&void 0!==t?t:C,o=null!==(e=f.y)&&void 0!==e?e:N;var j=[{x:r,y:p.y},{x:r,y:g.y}],I=[{x:p.x,y:o},{x:g.x,y:o}];x=h[b]===_?"x"===b?j:I:"x"===b?I:j}else{var P=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(x="x"===b?h.x===_?A:P:h.y===_?P:A,a===s){var z=Math.abs(i[b]-c[b]);if(z<=d){var L=Math.min(d-1,d-z);h[b]===_?E[b]=(p[b]>i[b]?-1:1)*L:S[b]=(g[b]>c[b]?-1:1)*L}}if(a!==s){var T="x"===b?"y":"x",B=h[b]===v[T],D=p[T]>g[T],R=p[T]<g[T];(1===h[b]&&(!B&&D||B&&R)||1!==h[b]&&(!B&&R||B&&D))&&(x="x"===b?P: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-x[0].x),Math.abs(H.x-x[0].x))>=Math.max(Math.abs(V.y-x[0].y),Math.abs(H.y-x[0].y))?(r=(V.x+H.x)/2,o=x[0].y):(r=x[0].x,o=(V.y+H.y)/2)}return[m(m([i,{x:p.x+E.x,y:p.y+E.y}],y(x),!1),[{x:g.x+S.x,y:g.y+S.y},c],!1),r,o,M,O]}function J_(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=y(Q_({source:{x:t,y:e},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],b=v[4],_=p.reduce((function(n,t,e){var r="";return r=e>0&&e<p.length-1?function(n,t,e,r){var o=Math.min(K_(n,t)/2,K_(t,e)/2,r),i=t.x,u=t.y;if(n.x===i&&i===e.x||n.y===u&&u===e.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<e.x?-1:1,c=n.y<e.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<e.x?1:-1,s=n.y<e.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[e-1],t,p[e+1],s):"".concat(0===e?"M":"L").concat(t.x," ").concat(t.y),n+=r}),"");return[_,g,m,w,b]}var nx=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var tx=c(Zb((function(n,t){var r,o,i=n.type,u=void 0===i?"source":i,a=n.position,c=void 0===a?ip.Top:a,l=n.isValidConnection,s=n.isConnectable,f=void 0===s||s,v=n.isConnectableStart,p=void 0===v||v,g=n.isConnectableEnd,y=void 0===g||g,m=n.id,w=n.onConnect,b=n.children,_=n.className,x=n.onMouseDown,E=n.onTouchStart,S=h(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),C=m||null,N="target"===u,M=kb(),O=e(Y_),I=Sb(nx,u_),P=I.connectOnClick,A=I.noPanClassName,z=I.rfId,L=Sb(function(n,t,e){return function(r){var o=r.connectionStartHandle,i=r.connectionEndHandle,u=r.connectionClickStartHandle,a=r.connectionMode,c=r.connectionStatus,l=(null==i?void 0:i.nodeId)===n&&(null==i?void 0:i.handleId)===t&&(null==i?void 0:i.type)===e;return{connectingFrom:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.handleId)===t&&(null==o?void 0:o.type)===e,connectingTo:l,clickConnecting:(null==u?void 0:u.nodeId)===n&&(null==u?void 0:u.handleId)===t&&(null==u?void 0:u.type)===e,isPossibleEndHandle:a===np.Strict?(null==o?void 0:o.type)!==e:n!==(null==o?void 0:o.nodeId)||t!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(O,C,u),u_),T=L.connectingFrom,B=L.connectingTo,D=L.clickConnecting,R=L.isPossibleEndHandle,V=L.connectionInProcess,H=L.valid;O||null===(o=(r=M.getState()).onError)||void 0===o||o.call(r,"010",Sv());var Y=function(n){var t=M.getState(),e=t.defaultEdgeOptions,r=t.onConnect,o=t.hasDefaultEdges,i=d(d({},e),n);if(o){var u=M.getState(),a=u.edges;(0,u.setEdges)(function(n,t){return n.source&&n.target?function(n,t){return t.some((function(t){return!(t.source!==n.source||t.target!==n.target||t.sourceHandle!==n.sourceHandle&&(t.sourceHandle||n.sourceHandle)||t.targetHandle!==n.targetHandle&&(t.targetHandle||n.targetHandle))}))}(e="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:G_(n)}),t)?t:(null===e.sourceHandle&&delete e.sourceHandle,null===e.targetHandle&&delete e.targetHandle,t.concat(e)):t;var e,r}(i,a))}null==r||r(i),null==w||w(i)},Z=function(n){if(O){var t=Jb(n.nativeEvent);if(p&&(t&&0===n.button||!t)){var e=M.getState();sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:e.autoPanOnConnect,connectionMode:e.connectionMode,connectionRadius:e.connectionRadius,domNode:e.domNode,nodeLookup:e.nodeLookup,lib:e.lib,isTarget:N,handleId:C,nodeId:O,flowId:e.rfId,panBy:e.panBy,cancelConnection:e.cancelConnection,onConnectStart:e.onConnectStart,onConnectEnd:e.onConnectEnd,updateConnection:e.updateConnection,onConnect:Y,isValidConnection:l||e.isValidConnection,getTransform:function(){return M.getState().transform},getConnectionStartHandle:function(){return M.getState().connectionStartHandle}})}t?null==x||x(n):null==E||E(n)}};return k.jsx("div",d({"data-handleid":C,"data-nodeid":O,"data-handlepos":c,"data-id":"".concat(z,"-").concat(O,"-").concat(C,"-").concat(u),className:j(["ink-flow__handle","ink-flow__handle-".concat(c),"nodrag",A,_,{source:!N,target:N,connectable:f,connectablestart:p,connectableend:y,clickconnecting:D,connectingfrom:T,connectingto:B,valid:H,connectionindicator:f&&(!V||R)&&(V?y:p)}]),onMouseDown:Z,onTouchStart:Z,onClick:P?function(n){var t=M.getState(),e=t.onClickConnectStart,r=t.onClickConnectEnd,o=t.connectionClickStartHandle,i=t.connectionMode,a=t.isValidConnection,c=t.lib,s=t.rfId;if(O&&(o||p)){if(!o)return null==e||e(n.nativeEvent,{nodeId:O,handleId:C,handleType:u}),void M.setState({connectionClickStartHandle:{nodeId:O,type:u,handleId:C}});var f=function(n){var t;return(null===(t=n.getRootNode)||void 0===t?void 0:t.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),d=l||a,h=sm.isValid(n.nativeEvent,{handle:{nodeId:O,id:C,type:u},connectionMode:i,fromNodeId:o.nodeId,fromHandleId:o.handleId||null,fromType:o.type,isValidConnection:d,flowId:s,doc:f,lib:c}),v=h.connection;h.isValid&&v&&Y(v),null==r||r(n),M.setState({connectionClickStartHandle:null})}}:void 0,ref:t},S,{children:b}))})));var ex={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rx={input:function(n){var t=n.data,e=n.isConnectable,r=n.sourcePosition,o=void 0===r?ip.Bottom:r;return k.jsxs(k.Fragment,{children:[null==t?void 0:t.label,k.jsx(tx,{type:"source",position:o,isConnectable:e})]})},default:function(n){var t=n.data,e=n.isConnectable,r=n.targetPosition,o=void 0===r?ip.Top:r,i=n.sourcePosition,u=void 0===i?ip.Bottom:i;return k.jsxs(k.Fragment,{children:[k.jsx(tx,{type:"target",position:o,isConnectable:e}),null==t?void 0:t.label,k.jsx(tx,{type:"source",position:u,isConnectable:e})]})},output:function(n){var t=n.data,e=n.isConnectable,r=n.targetPosition,o=void 0===r?ip.Top:r;return k.jsxs(k.Fragment,{children:[k.jsx(tx,{type:"target",position:o,isConnectable:e}),null==t?void 0:t.label]})},group:function(){return null}};function ox(n){var t=n.id,e=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,u=e.getState(),a=u.addSelectedNodes,c=u.unselectNodesAndEdges,l=u.multiSelectionActive,s=u.nodeLookup,f=u.onError,d=s.get(t);d?(e.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([t])):null==f||f("012",Cv(t))}function ix(n){var t,e=n.id,r=n.onClick,o=n.onMouseEnter,c=n.onMouseMove,l=n.onMouseLeave,f=n.onContextMenu,h=n.onDoubleClick,v=n.nodesDraggable,p=n.elementsSelectable,m=n.nodesConnectable,w=n.nodesFocusable,b=n.resizeObserver,_=n.noDragClassName,x=n.noPanClassName,E=n.disableKeyboardA11y,S=n.rfId,C=n.nodeTypes,N=n.nodeExtent,M=n.nodeOrigin,O=n.onError,I=Sb((function(n){var t=n.nodeLookup.get(e),r=n.parentLookup.has(e);return{node:t,internals:t.internals,isParent:r}}),u_),P=I.node,A=I.internals,z=I.isParent,L=P.type||"default",T=(null==C?void 0:C[L])||rx[L];void 0===T&&(null==O||O("003",wv(L)),L="default",T=rx.default);var B=!!(P.draggable||v&&void 0===P.draggable),D=!!(P.selectable||p&&void 0===P.selectable),R=!!(P.connectable||m&&void 0===P.connectable),V=!!(P.focusable||w&&void 0===P.focusable),H=kb(),Y=function(n){var t,e,r,o,i,u;return void 0!==(null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e: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)}(P),Z=function(n){var t=n.node,e=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=kb(),c=u(null),l=u(null),s=u(t.sourcePosition),f=u(t.targetPosition),d=u(e),h=r&&!!t.internals.handleBounds&&!t.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!==e,r=s.current!==t.sourcePosition,o=f.current!==t.targetPosition;(n||r||o)&&(d.current=e,s.current=t.sourcePosition,f.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}}),[t.id,e,t.sourcePosition,t.targetPosition]),c}({node:P,nodeType:L,hasDimensions:Y,resizeObserver:b}),X=function(n){var t=n.nodeRef,e=n.disabled,r=void 0!==e&&e,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,f=kb(),d=y(i(!1),2),h=d[0],v=d[1],p=u();return a((function(){p.current=om({getStoreItems:function(){return f.getState()},onNodeMouseDown:function(n){ox({id:n,store:f,nodeRef:t})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),a((function(){var n,e;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(t.current)return null===(e=p.current)||void 0===e||e.update({noDragClassName:o,handleSelector:c,domNode:t.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,t,l]),h}({nodeRef:Z,disabled:P.hidden||!B,noDragClassName:_,handleSelector:P.dragHandle,nodeId:e,isSelectable:D}),U=function(){var n=kb(),t=s((function(t){var e,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(t){return t.selected&&(t.draggable||n&&void 0===t.draggable)}}(c),p=u?a[0]:5,m=u?a[1]:5,w=t.direction.x*p*t.factor,b=t.direction.y*m*t.factor;try{for(var _=g(f),x=_.next();!x.done;x=_.next()){var E=y(x.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+b};u&&(S=Tb(S,a));var k=__({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){e={error:n}}finally{try{x&&!x.done&&(r=_.return)&&r.call(_)}finally{if(e)throw e.error}}s(h)}),[]);return t}();if(P.hidden)return null;var F=zb(P),W=function(n){var t,e,r,o,i,u,a,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(e=null!==(t=n.width)&&void 0!==t?t:n.initialWidth)&&void 0!==e?e: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}}(P),$=(N?Ab(A.positionAbsolute,N):A.positionAbsolute)||{x:0,y:0},G=function(n){var t=n.x,e=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:t,y:e}:{x:t-r*u[0],y:e-o*u[1]}}(d(d(d({},$),F),{origin:P.origin||M})),q=D||B||r||o||c||l,K=o?function(n){return o(n,d({},A.userNode))}:void 0,Q=c?function(n){return c(n,d({},A.userNode))}:void 0,J=l?function(n){return l(n,d({},A.userNode))}:void 0,nn=f?function(n){return f(n,d({},A.userNode))}:void 0,tn=h?function(n){return h(n,d({},A.userNode))}:void 0;return k.jsx("div",{className:j(["ink-flow__node","ink-flow__node-".concat(L),(t={},t[x]=B,t),P.className,{selected:P.selected,selectable:D,parent:z,draggable:B,dragging:X}]),ref:Z,style:d(d({zIndex:A.z,transform:"translate(".concat(G.x,"px,").concat(G.y,"px)"),pointerEvents:q?"all":"none",visibility:Y?"visible":"hidden"},P.style),W),"data-id":e,"data-testid":"rf__node-".concat(e),onMouseEnter:K,onMouseMove:Q,onMouseLeave:J,onContextMenu:nn,onClick:function(n){var t=H.getState(),o=t.selectNodesOnDrag,i=t.nodeDragThreshold;D&&(!o||!B||i>0)&&ox({id:e,store:H,nodeRef:Z}),r&&r(n,d({},A.userNode))},onDoubleClick:tn,onKeyDown:V?function(n){if(!Qb(n.nativeEvent)&&!E)if(Mv.includes(n.key)&&D){var t="Escape"===n.key;ox({id:e,store:H,unselect:t,nodeRef:Z})}else B&&P.selected&&Object.prototype.hasOwnProperty.call(ex,n.key)&&(H.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~$.x,", y: ").concat(~~$.y)}),U({direction:ex[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:V?0:void 0,role:V?"button":void 0,"aria-describedby":E?void 0:"".concat("ink-flow__node-desc","-").concat(S),"aria-label":P.ariaLabel,children:k.jsx(Z_,{value:e,children:k.jsx(T,d({id:e,data:P.data,type:L,positionAbsoluteX:$.x,positionAbsoluteY:$.y,selected:P.selected,isConnectable:R,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:X,dragHandle:P.dragHandle,zIndex:A.z},F))})})}var ux=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function ax(n){var t=Sb(ux,u_),e=t.nodesDraggable,r=t.nodesConnectable,o=t.nodesFocusable,u=t.elementsSelectable,c=t.onError,l=H_(!1),s=function(){var n=Sb(V_),t=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(t){var e=new Map;t.forEach((function(n){var t=n.target.getAttribute("data-id");e.set(t,{id:t,nodeElement:n.target})})),n(e)}))})),1),e=t[0];return a((function(){return function(){null==e||e.disconnect()}}),[e]),e}();return k.jsx("div",{className:"ink-flow__nodes",style:a_,children:l.map((function(t){return k.jsx(ix,{id:t,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:e,nodesConnectable:r,nodesFocusable:o,elementsSelectable:u,onError:c},t)}))})}ax.displayName="NodeRenderer";var cx,lx=c(ax),sx=((cx={})[op.Arrow]=function(n){var t=n.color,e=void 0===t?"none":t,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},cx[op.ArrowClosed]=function(n){var t=n.color,e=void 0===t?"none":t,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cx);function fx(n,t){if(!n)return"";if("string"==typeof n)return n;var e=t?"".concat(t,"__"):"";return"".concat(e).concat(Object.keys(n).sort().map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"))}var dx=function(n){var t=n.id,e=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 t=kb(),e=r((function(){var e,r;return Object.prototype.hasOwnProperty.call(sx,n)?sx[n]:(null===(r=(e=t.getState()).onError)||void 0===r||r.call(e,"009",xv(n)),null)}),[n]);return e}(e);return v?k.jsx("marker",{className:"ink-flow__arrowhead",id:t,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:k.jsx(v,{color:o,strokeWidth:f})}):null},hx=function(n){var t=n.defaultColor,e=n.rfId,o=Sb((function(n){return n.edges})),i=Sb((function(n){return n.defaultEdgeOptions})),u=r((function(){var n=function(n,t){var e=t.id,r=t.defaultColor,o=t.defaultMarkerStart,i=t.defaultMarkerEnd,u=new Set;return n.reduce((function(n,t){return[t.markerStart||o,t.markerEnd||i].forEach((function(t){if(t&&"object"==typeof t){var o=fx(t,e);u.has(o)||(n.push(d({id:o,color:t.color||r},t)),u.add(o))}})),n}),[]).sort((function(n,t){return n.id.localeCompare(t.id)}))}(o,{id:e,defaultColor:t,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,e,t]);return u.length?k.jsx("svg",{className:"ink-flow__marker",children:k.jsx("defs",{children:u.map((function(n){return k.jsx(dx,{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};hx.displayName="MarkerDefinitions";var vx=c(hx);function px(n){var t=n.x,e=n.y,r=n.label,o=n.labelStyle,u=void 0===o?{}:o,a=n.labelShowBg,c=void 0===a||a,l=n.labelBgStyle,f=void 0===l?{}:l,v=n.labelBgPadding,p=void 0===v?[2,4]:v,g=n.labelBgBorderRadius,m=void 0===g?2:g,w=n.children,b=n.className,_=h(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),x=y(i({x:1,y:0,width:0,height:0}),2),E=x[0],S=x[1],C=j(["ink-flow__edge-textwrapper",b]),N=s((function(n){if(null!==n){var t=n.getBBox();S({x:t.x,y:t.y,width:t.width,height:t.height})}}),[]);return void 0!==r&&r?k.jsxs("g",d({transform:"translate(".concat(t-E.width/2," ").concat(e-E.height/2,")"),className:C,visibility:E.width?"visible":"hidden"},_,{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}px.displayName="EdgeText";var gx=c(px);function yx(n){var t=n.id,e=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:t,style:f,d:e,fill:"none",className:j(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),g&&k.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&Lb(r)&&Lb(o)?k.jsx(gx,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function mx(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2;return t===ip.Left||t===ip.Right?[.5*(e+o),r]:[e,.5*(r+i)]}function wx(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=y(mx({pos:o,x1:t,y1:e,x2:i,y2:u}),2),s=l[0],f=l[1],d=y(mx({pos:c,x1:i,y1:u,x2:t,y2:e}),2),h=d[0],v=d[1],p=y(X_({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:s,sourceControlY:f,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],b=p[3];return["M".concat(t,",").concat(e," C").concat(s,",").concat(f," ").concat(h,",").concat(v," ").concat(i,",").concat(u),g,m,w,b]}function bx(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.sourcePosition,c=void 0===a?ip.Bottom:a,l=t.targetPosition,s=void 0===l?ip.Top:l,f=t.label,d=t.labelStyle,h=t.labelShowBg,v=t.labelBgStyle,p=t.labelBgPadding,g=t.labelBgBorderRadius,m=t.style,w=t.markerEnd,b=t.markerStart,_=t.interactionWidth,x=y(wx({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s}),3),E=x[0],S=x[1],C=x[2],N=n.isInternal?void 0:e;return k.jsx(yx,{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:b,interactionWidth:_})}))}var _x=bx({isInternal:!1}),xx=bx({isInternal:!0});function Ex(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.label,c=t.labelStyle,l=t.labelShowBg,s=t.labelBgStyle,f=t.labelBgPadding,d=t.labelBgBorderRadius,h=t.style,v=t.sourcePosition,p=void 0===v?ip.Bottom:v,g=t.targetPosition,m=void 0===g?ip.Top:g,w=t.markerEnd,b=t.markerStart,_=t.pathOptions,x=t.interactionWidth,E=y(J_({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:u,targetPosition:m,borderRadius:null==_?void 0:_.borderRadius,offset:null==_?void 0:_.offset}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:e;return k.jsx(yx,{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:b,interactionWidth:x})}))}_x.displayName="SimpleBezierEdge",xx.displayName="SimpleBezierEdgeInternal";var Sx=Ex({isInternal:!1}),kx=Ex({isInternal:!0});function Cx(n){return c((function(t){var e,o=t.id,i=h(t,["id"]),u=n.isInternal?void 0:o;return k.jsx(Sx,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===(e=i.pathOptions)||void 0===e?void 0:e.offset])}))}))}Sx.displayName="SmoothStepEdge",kx.displayName="SmoothStepEdgeInternal";var Nx=Cx({isInternal:!1}),Mx=Cx({isInternal:!0});function Ox(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.label,c=t.labelStyle,l=t.labelShowBg,s=t.labelBgStyle,f=t.labelBgPadding,d=t.labelBgBorderRadius,h=t.style,v=t.markerEnd,p=t.markerStart,g=t.interactionWidth,m=y(function(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=y(W_({sourceX:t,sourceY:e,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(t,",").concat(e,"L ").concat(r,",").concat(o),u,a,c,l]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=m[0],b=m[1],_=m[2],x=n.isInternal?void 0:e;return k.jsx(yx,{id:x,path:w,labelX:b,labelY:_,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}Nx.displayName="StepEdge",Mx.displayName="StepEdgeInternal";var jx=Ox({isInternal:!1}),Ix=Ox({isInternal:!0});function Px(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.sourcePosition,c=void 0===a?ip.Bottom:a,l=t.targetPosition,s=void 0===l?ip.Top:l,f=t.label,d=t.labelStyle,h=t.labelShowBg,v=t.labelBgStyle,p=t.labelBgPadding,g=t.labelBgBorderRadius,m=t.style,w=t.markerEnd,b=t.markerStart,_=t.pathOptions,x=t.interactionWidth,E=y(function(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.curvature,s=void 0===l?.25:l,f=y(F_({pos:o,x1:t,y1:e,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=y(F_({pos:c,x1:i,y1:u,x2:t,y2:e,c:s}),2),p=v[0],g=v[1],m=y(X_({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],b=m[1],_=m[2],x=m[3];return["M".concat(t,",").concat(e," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),w,b,_,x]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s,curvature:null==_?void 0:_.curvature}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:e;return k.jsx(yx,{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:b,interactionWidth:x})}))}jx.displayName="StraightEdge",Ix.displayName="StraightEdgeInternal";var Ax=Px({isInternal:!1}),zx=Px({isInternal:!0});Ax.displayName="BezierEdge",zx.displayName="BezierEdgeInternal";var Lx={default:zx,straight:Ix,step:Mx,smoothstep:kx,simplebezier:xx},Tx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Bx=function(n,t,e){return e===ip.Left?n-t:e===ip.Right?n+t:n},Dx=function(n,t,e){return e===ip.Top?n-t:e===ip.Bottom?n+t:n},Rx="ink-flow__edgeupdater";function Vx(n){var t=n.position,e=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:j([Rx,"".concat(Rx,"-").concat(l)]),cx:Bx(e,i,t),cy:Dx(r,i,t),r:i,stroke:"transparent",fill:"transparent"})}function Hx(n){var t=n.isUpdatable,e=n.edgeUpdaterRadius,r=n.edge,o=n.targetHandleId,i=n.sourceHandleId,u=n.sourceX,a=n.sourceY,c=n.targetX,l=n.targetY,s=n.sourcePosition,f=n.targetPosition,d=n.onEdgeUpdate,h=n.onEdgeUpdateStart,v=n.onEdgeUpdateEnd,p=n.setUpdating,g=n.setUpdateHover,y=kb(),m=function(n,t){if(0===n.button){var e=y.getState(),u=e.autoPanOnConnect,a=e.domNode,c=e.isValidConnection,l=e.connectionMode,s=e.connectionRadius,f=e.lib,g=e.onConnectStart,m=e.onConnectEnd,w=e.cancelConnection,b=e.nodeLookup,_=e.rfId,x=e.panBy,E=e.updateConnection,S=t?r.target:r.source,k=(t?o:i)||null,C=t?"target":"source",N=t;p(!0),null==h||h(n,r,C);sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:u,connectionMode:l,connectionRadius:s,domNode:a,handleId:k,nodeId:S,nodeLookup:b,isTarget:N,edgeUpdaterType:C,lib:f,flowId:_,cancelConnection:w,panBy:x,isValidConnection:c,onConnect:function(n){return null==d?void 0:d(r,n)},onConnectStart:g,onConnectEnd:m,onEdgeUpdateEnd:function(n){p(!1),null==v||v(n,r,C)},updateConnection:E,getTransform:function(){return y.getState().transform},getConnectionStartHandle:function(){return y.getState().connectionStartHandle}})}},w=function(){return g(!0)},b=function(){return g(!1)};return k.jsxs(k.Fragment,{children:[("source"===t||!0===t)&&k.jsx(Vx,{position:s,centerX:u,centerY:a,radius:e,onMouseDown:function(n){return m(n,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===t||!0===t)&&k.jsx(Vx,{position:f,centerX:c,centerY:l,radius:e,onMouseDown:function(n){return m(n,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function Yx(n){var t;return n&&!(!n.internals.handleBounds&&!(null===(t=n.handles)||void 0===t?void 0:t.length))&&!!(n.measured.width||n.width||n.initialWidth)}function Zx(n){var t,e,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){t={error:n}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{source:i,target:u}}function Xx(n,t,e){var r,o;void 0===e&&(e=null);var i=(null!==(r=null==e?void 0:e.x)&&void 0!==r?r:0)+t.internals.positionAbsolute.x,u=(null!==(o=null==e?void 0:e.y)&&void 0!==o?o:0)+t.internals.positionAbsolute.y,a=null!=e?e:zb(t),c=a.width,l=a.height;switch(n){case ip.Top:return[i+c/2,u];case ip.Right:return[i+c,u+l/2];case ip.Bottom:return[i+c/2,u+l];case ip.Left:return[i,u+l/2]}}function Ux(n,t){return n&&(t?n.find((function(n){return n.id===t})):n[0])||null}function Fx(n){var t=n.id,e=n.edgesFocusable,o=n.edgesUpdatable,a=n.elementsSelectable,c=n.onClick,l=n.onDoubleClick,f=n.onContextMenu,h=n.onMouseEnter,v=n.onMouseMove,p=n.onMouseLeave,g=n.edgeUpdaterRadius,m=n.onEdgeUpdate,w=n.onEdgeUpdateStart,b=n.onEdgeUpdateEnd,_=n.rfId,x=n.edgeTypes,E=n.noPanClassName,S=n.onError,C=n.disableKeyboardA11y,N=Sb((function(n){return n.edgeLookup.get(t)})),M=Sb((function(n){return n.defaultEdgeOptions})),O=(N=M?d(d({},M),N):N).type||"default",I=(null==x?void 0:x[O])||Lx[O];void 0===I&&(null==S||S("011",kv(O)),O="default",I=Lx.default);var P=!!(N.focusable||e&&void 0===N.focusable),A=void 0!==m&&(N.updatable||o&&void 0===N.updatable),z=!!(N.selectable||a&&void 0===N.selectable),L=u(null),T=y(i(!1),2),B=T[0],D=T[1],R=y(i(!1),2),V=R[0],H=R[1],Y=kb(),Z=Sb(s((function(n){var e=n.nodeLookup.get(N.source),r=n.nodeLookup.get(N.target);if(!e||!r)return d({zIndex:N.zIndex},Tx);var o=function(n){var t,e,r,o,i,u=n.sourceNode,a=n.targetNode;if(!Yx(u)||!Yx(a))return null;var c=u.internals.handleBounds||Zx(u.handles),l=a.internals.handleBounds||Zx(a.handles),s=Ux(null!==(t=null==c?void 0:c.source)&&void 0!==t?t:[],n.sourceHandle),f=Ux(n.connectionMode===np.Strict?null!==(e=null==l?void 0:l.target)&&void 0!==e?e:[]:(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)||ip.Bottom,h=(null==f?void 0:f.position)||ip.Top;if(!s||!f)return null===(i=n.onError)||void 0===i||i.call(n,"008",Ev(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=y(Xx(d,u,s),2),p=v[0],g=v[1],m=y(Xx(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:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:n.connectionMode,onError:S}),i=function(n){var t=n.sourceNode,e=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||e.selected||t.selected,l=Math.max(t.internals.z||0,e.internals.z||0,1e3);return u+(c?l:0)}({selected:N.selected,zIndex:N.zIndex,sourceNode:e,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||Tx)}),[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),u_),X=Z.zIndex,U=Z.sourceX,F=Z.sourceY,W=Z.targetX,$=Z.targetY,G=Z.sourcePosition,q=Z.targetPosition,K=r((function(){return N.markerStart?"url('#".concat(fx(N.markerStart,_),"')"):void 0}),[N.markerStart,_]),Q=r((function(){return N.markerEnd?"url('#".concat(fx(N.markerEnd,_),"')"):void 0}),[N.markerEnd,_]);if(N.hidden||null===U||null===F||null===W||null===$)return null;var J=l?function(n){l(n,d({},N))}:void 0,nn=f?function(n){f(n,d({},N))}:void 0,tn=h?function(n){h(n,d({},N))}:void 0,en=v?function(n){v(n,d({},N))}:void 0,rn=p?function(n){p(n,d({},N))}:void 0;return k.jsx("svg",{style:{zIndex:X},children:k.jsxs("g",{className:j(["ink-flow__edge","ink-flow__edge-".concat(O),N.className,E,{selected:N.selected,animated:N.animated,inactive:!z&&!c,updating:B,selectable:z}]),onClick:function(n){var e,r=Y.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,u=r.multiSelectionActive;z&&(Y.setState({nodesSelectionActive:!1}),N.selected&&u?(i({nodes:[],edges:[N]}),null===(e=L.current)||void 0===e||e.blur()):o([t])),c&&c(n,N)},onDoubleClick:J,onContextMenu:nn,onMouseEnter:tn,onMouseMove:en,onMouseLeave:rn,onKeyDown:P?function(n){var e;if(!C&&Mv.includes(n.key)&&z){var r=Y.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(e=L.current)||void 0===e||e.blur(),o({edges:[N]})):i([t])}}:void 0,tabIndex:P?0:void 0,role:P?"button":"img","data-id":t,"data-testid":"rf__edge-".concat(t),"aria-label":null===N.ariaLabel?void 0:N.ariaLabel||"Edge from ".concat(N.source," to ").concat(N.target),"aria-describedby":P?"".concat("ink-flow__edge-desc","-").concat(_):void 0,ref:L,children:[!V&&k.jsx(I,{id:t,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:U,sourceY:F,targetX:W,targetY:$,sourcePosition:G,targetPosition:q,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:K,markerEnd:Q,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),A&&k.jsx(Hx,{edge:N,isUpdatable:A,edgeUpdaterRadius:g,onEdgeUpdate:m,onEdgeUpdateStart:w,onEdgeUpdateEnd:b,sourceX:U,sourceY:F,targetX:W,targetY:$,sourcePosition:G,targetPosition:q,setUpdateHover:D,setUpdating:H,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle})]})})}var Wx=function(n){return{width:n.width,height:n.height,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function $x(n){var t=n.defaultMarkerColor,e=n.rfId,r=n.noPanClassName,o=n.onEdgeUpdate,i=n.onEdgeContextMenu,u=n.onEdgeMouseEnter,a=n.onEdgeMouseMove,c=n.onEdgeMouseLeave,l=n.onEdgeClick,f=n.edgeTypes,d=Sb(Wx,u_),h=d.edgesFocusable,v=d.edgesUpdatable,p=d.elementsSelectable,g=d.onError,y=function(n){var t=Sb(s((function(n){return n.edges.map((function(n){return n.id}))}),[n]),u_);return t}(!1);return k.jsxs("div",{className:"ink-flow__edges",children:[k.jsx(vx,{defaultColor:t,rfId:e}),y.map((function(n){return k.jsx(Fx,{id:n,edgesFocusable:h,edgesUpdatable:v,elementsSelectable:p,noPanClassName:r,onEdgeUpdate:o,onContextMenu:i,onMouseEnter:u,onMouseMove:a,onMouseLeave:c,onClick:l,rfId:e,onError:g,edgeTypes:f},n)}))]})}$x.displayName="EdgeRenderer";var Gx,qx=c($x),Kx=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function Qx(n){var t=n.children,e=Sb(Kx);return k.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:e},children:t})}var Jx=((Gx={})[ip.Left]=ip.Right,Gx[ip.Right]=ip.Left,Gx[ip.Top]=ip.Bottom,Gx[ip.Bottom]=ip.Top,Gx),nE=function(n){var t,e,r=n.nodeId,o=n.handleType,i=n.style,u=n.type,a=void 0===u?rp.Bezier:u,c=n.CustomComponent,l=n.connectionStatus,f=Sb(s((function(n){var t;return{fromNode:n.nodeLookup.get(r),handleId:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.handleId,toX:(n.connectionPosition.x-n.transform[0])/n.transform[2],toY:(n.connectionPosition.y-n.transform[1])/n.transform[2],connectionMode:n.connectionMode}}),[r]),u_),h=f.fromNode,v=f.handleId,p=f.toX,g=f.toY,m=f.connectionMode,w=null==h?void 0:h.internals.handleBounds,b=null==w?void 0:w[o];if(m===np.Loose&&(b=b||(null==w?void 0:w["source"===o?"target":"source"])),!h||!b)return null;var _=v?b.find((function(n){return n.id===v})):b[0],x=_?_.x+_.width/2:(null!==(t=h.measured.width)&&void 0!==t?t:0)/2,E=_?_.y+_.height/2:null!==(e=h.measured.height)&&void 0!==e?e:0,S=h.internals.positionAbsolute.x+x,C=h.internals.positionAbsolute.y+E,N=null==_?void 0:_.position,M=N?Jx[N]:null;if(!N||!M)return null;if(c)return k.jsx(c,{connectionLineType:a,connectionLineStyle:i,fromNode:h,fromHandle:_,fromX:S,fromY:C,toX:p,toY:g,fromPosition:N,toPosition:M,connectionStatus:l});var O="",j={sourceX:S,sourceY:C,sourcePosition:N,targetX:p,targetY:g,targetPosition:M};return O=a===rp.Bezier?y(sp(j),1)[0]:a===rp.Step?y(bp(d(d({},j),{borderRadius:0})),1)[0]:a===rp.SmoothStep?y(bp(j),1)[0]:a===rp.SimpleBezier?y(wx(j),1)[0]:"M".concat(S,",").concat(C," ").concat(p,",").concat(g),k.jsx("path",{d:O,fill:"none",className:"react-flow__connection-path",style:i})};nE.displayName="ConnectionLine";var tE=function(n){var t,e;return{nodeId:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.nodeId,handleType:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.type,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height}};function eE(n){var t=n.containerStyle,e=n.style,r=n.type,o=n.component,i=Sb(tE,u_),u=i.nodeId,a=i.handleType,c=i.nodesConnectable,l=i.width,s=i.height,f=i.connectionStatus;return!!(u&&a&&l&&c)?k.jsx("svg",{style:t,width:l,height:s,className:"react-flow__connectionline react-flow__container",children:k.jsx("g",{className:j(["react-flow__connection",f]),children:k.jsx(nE,{nodeId:u,handleType:a,style:e,type:r,CustomComponent:o,connectionStatus:f})})}):null}function rE(n){var t=n.onNodeClick,e=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,b=n.disableKeyboardA11y,_=n.translateExtent,x=n.defaultViewport,E=n.nodeTypes,S=n.edgeTypes,C=n.elementsSelectable,N=n.defaultMarkerColor,M=n.connectionLineType,O=n.connectionLineStyle,j=n.connectionLineComponent,I=n.connectionLineContainerStyle,P=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,T=n.onPaneMouseLeave,B=n.onPaneScroll;return k.jsx(j_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:b,translateExtent:_,defaultViewport:x,elementsSelectable:C,onPaneClick:P,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:T,onPaneScroll:B,children:k.jsxs(Qx,{children:[k.jsx(qx,{rfId:h,edgeTypes:S,noPanClassName:g,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,onEdgeContextMenu:d,defaultMarkerColor:N}),k.jsx(eE,{style:O,type:M,component:j,containerStyle:I}),k.jsx("div",{className:"ink-flow__edgelabel-renderer"}),k.jsx(lx,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:t,onNodeDoubleClick:e,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),k.jsx("div",{className:"ink-flow__viewport-portal"})]})})}rE.displayName="GraphView";var oE=c(rE),iE={x:0,y:0,zoom:1},uE={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},aE=function(n){var t,e,r=void 0===n?{}:n,o=r.nodes,i=r.edges,u=r.defaultNodes,a=r.defaultEdges;r.width,r.height,r.fitView;var c=new Map,l=new Map,s=new Map,f=new Map,d=null!==(t=null!=a?a:i)&&void 0!==t?t:[],h=null!==(e=null!=u?u:o)&&void 0!==e?e:[];Ob(s,f,d),jb(h,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:h,nodeLookup:c,parentLookup:l,edges:d,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Nv,nodeExtent:Nv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:np.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:uE,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"react",debug:!1}},cE={dagre:_p};var lE={exports:{}};
17
+ /**
18
+ * @license
19
+ * Lodash <https://lodash.com/>
20
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
21
+ * Released under MIT license <https://lodash.com/license>
22
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
24
+ */!function(n,t){(function(){var e,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]",b="[object Date]",_="[object Error]",x="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",N="[object Promise]",M="[object RegExp]",O="[object Set]",j="[object String]",I="[object Symbol]",P="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",T="[object Float64Array]",B="[object Int8Array]",D="[object Int16Array]",R="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",Z="[object Uint32Array]",X=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(W.source),q=RegExp($.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\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,bn=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xn=/($^)/,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",jn="\\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",In="['’]",Pn="["+Sn+"]",An="["+jn+"]",zn="["+kn+"]",Ln="\\d+",Tn="["+Cn+"]",Bn="["+Nn+"]",Dn="[^"+Sn+jn+Ln+Cn+Nn+Mn+"]",Rn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+Mn+"]",Xn="\\u200d",Un="(?:"+Bn+"|"+Dn+")",Fn="(?:"+Zn+"|"+Dn+")",Wn="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Rn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Xn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Tn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,Pn].join("|")+")",nt=RegExp(In,"g"),tt=RegExp(zn,"g"),et=RegExp(Rn+"(?="+Rn+")|"+Jn+Kn,"g"),rt=RegExp([Zn+"?"+Bn+"+"+Wn+"(?="+[An,Zn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Zn+Un,"$"].join("|")+")",Zn+"?"+Un+"+"+Wn,Zn+"+"+$n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ln,Qn].join("|"),"g"),ot=RegExp("["+Xn+Sn+kn+On+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ut=["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"],at=-1,ct={};ct[L]=ct[T]=ct[B]=ct[D]=ct[R]=ct[V]=ct[H]=ct[Y]=ct[Z]=!0,ct[g]=ct[y]=ct[A]=ct[m]=ct[z]=ct[b]=ct[_]=ct[x]=ct[S]=ct[k]=ct[C]=ct[M]=ct[O]=ct[j]=ct[P]=!1;var lt={};lt[g]=lt[y]=lt[A]=lt[z]=lt[m]=lt[b]=lt[L]=lt[T]=lt[B]=lt[D]=lt[R]=lt[S]=lt[k]=lt[C]=lt[M]=lt[O]=lt[j]=lt[I]=lt[V]=lt[H]=lt[Y]=lt[Z]=!0,lt[_]=lt[x]=lt[P]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,ht="object"==typeof w&&w&&w.Object===Object&&w,vt="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||vt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&n&&!n.nodeType&&n,mt=yt&&yt.exports===gt,wt=mt&&ht.process,bt=function(){try{var n=yt&&yt.require&&yt.require("util").types;return n||wt&&wt.binding&&wt.binding("util")}catch(n){}}(),_t=bt&&bt.isArrayBuffer,xt=bt&&bt.isDate,Et=bt&&bt.isMap,St=bt&&bt.isRegExp,kt=bt&&bt.isSet,Ct=bt&&bt.isTypedArray;function Nt(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Mt(n,t,e,r){for(var o=-1,i=null==n?0:n.length;++o<i;){var u=n[o];t(r,u,e(u),n)}return r}function Ot(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&!1!==t(n[e],e,n););return n}function jt(n,t){for(var e=null==n?0:n.length;e--&&!1!==t(n[e],e,n););return n}function It(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(!t(n[e],e,n))return!1;return!0}function Pt(n,t){for(var e=-1,r=null==n?0:n.length,o=0,i=[];++e<r;){var u=n[e];t(u,e,n)&&(i[o++]=u)}return i}function At(n,t){return!!(null==n?0:n.length)&&Zt(n,t,0)>-1}function zt(n,t,e){for(var r=-1,o=null==n?0:n.length;++r<o;)if(e(t,n[r]))return!0;return!1}function Lt(n,t){for(var e=-1,r=null==n?0:n.length,o=Array(r);++e<r;)o[e]=t(n[e],e,n);return o}function Tt(n,t){for(var e=-1,r=t.length,o=n.length;++e<r;)n[o+e]=t[e];return n}function Bt(n,t,e,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);return e}function Dt(n,t,e,r){var o=null==n?0:n.length;for(r&&o&&(e=n[--o]);o--;)e=t(e,n[o],o,n);return e}function Rt(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}var Vt=Wt("length");function Ht(n,t,e){var r;return e(n,(function(n,e,o){if(t(n,e,o))return r=e,!1})),r}function Yt(n,t,e,r){for(var o=n.length,i=e+(r?1:-1);r?i--:++i<o;)if(t(n[i],i,n))return i;return-1}function Zt(n,t,e){return t==t?function(n,t,e){var r=e-1,o=n.length;for(;++r<o;)if(n[r]===t)return r;return-1}(n,t,e):Yt(n,Ut,e)}function Xt(n,t,e,r){for(var o=e-1,i=n.length;++o<i;)if(r(n[o],t))return o;return-1}function Ut(n){return n!=n}function Ft(n,t){var e=null==n?0:n.length;return e?qt(n,t)/e:h}function Wt(n){return function(t){return null==t?e:t[n]}}function $t(n){return function(t){return null==n?e:n[t]}}function Gt(n,t,e,r,o){return o(n,(function(n,o,i){e=r?(r=!1,n):t(e,n,o,i)})),e}function qt(n,t){for(var r,o=-1,i=n.length;++o<i;){var u=t(n[o]);u!==e&&(r=r===e?u:r+u)}return r}function Kt(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}function Qt(n){return n?n.slice(0,pe(n)+1).replace(un,""):n}function Jt(n){return function(t){return n(t)}}function ne(n,t){return Lt(t,(function(t){return n[t]}))}function te(n,t){return n.has(t)}function ee(n,t){for(var e=-1,r=n.length;++e<r&&Zt(t,n[e],0)>-1;);return e}function re(n,t){for(var e=n.length;e--&&Zt(t,n[e],0)>-1;);return e}var oe=$t({"À":"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"}),ie=$t({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ue(n){return"\\"+st[n]}function ae(n){return ot.test(n)}function ce(n){var t=-1,e=Array(n.size);return n.forEach((function(n,r){e[++t]=[r,n]})),e}function le(n,t){return function(e){return n(t(e))}}function se(n,t){for(var e=-1,r=n.length,o=0,u=[];++e<r;){var a=n[e];a!==t&&a!==i||(n[e]=i,u[o++]=e)}return u}function fe(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=n})),e}function de(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=[n,n]})),e}function he(n){return ae(n)?function(n){var t=et.lastIndex=0;for(;et.test(n);)++t;return t}(n):Vt(n)}function ve(n){return ae(n)?function(n){return n.match(et)||[]}(n):function(n){return n.split("")}(n)}function pe(n){for(var t=n.length;t--&&an.test(n.charAt(t)););return t}var ge=$t({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var ye=function n(t){var w,an=(t=null==t?pt:ye.defaults(pt.Object(),t,ye.pick(pt,ut))).Array,Sn=t.Date,kn=t.Error,Cn=t.Function,Nn=t.Math,Mn=t.Object,On=t.RegExp,jn=t.String,In=t.TypeError,Pn=an.prototype,An=Cn.prototype,zn=Mn.prototype,Ln=t["__core-js_shared__"],Tn=An.toString,Bn=zn.hasOwnProperty,Dn=0,Rn=(w=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Vn=zn.toString,Hn=Tn.call(Mn),Yn=pt._,Zn=On("^"+Tn.call(Bn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xn=mt?t.Buffer:e,Un=t.Symbol,Fn=t.Uint8Array,Wn=Xn?Xn.allocUnsafe:e,$n=le(Mn.getPrototypeOf,Mn),Gn=Mn.create,qn=zn.propertyIsEnumerable,Kn=Pn.splice,Qn=Un?Un.isConcatSpreadable:e,Jn=Un?Un.iterator:e,et=Un?Un.toStringTag:e,ot=function(){try{var n=hi(Mn,"defineProperty");return n({},"",{}),n}catch(n){}}(),st=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Sn&&Sn.now!==pt.Date.now&&Sn.now,vt=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Nn.ceil,yt=Nn.floor,wt=Mn.getOwnPropertySymbols,bt=Xn?Xn.isBuffer:e,Vt=t.isFinite,$t=Pn.join,me=le(Mn.keys,Mn),we=Nn.max,be=Nn.min,_e=Sn.now,xe=t.parseInt,Ee=Nn.random,Se=Pn.reverse,ke=hi(t,"DataView"),Ce=hi(t,"Map"),Ne=hi(t,"Promise"),Me=hi(t,"Set"),Oe=hi(t,"WeakMap"),je=hi(Mn,"create"),Ie=Oe&&new Oe,Pe={},Ae=Ri(ke),ze=Ri(Ce),Le=Ri(Ne),Te=Ri(Me),Be=Ri(Oe),De=Un?Un.prototype:e,Re=De?De.valueOf:e,Ve=De?De.toString:e;function He(n){if(ea(n)&&!Uu(n)&&!(n instanceof Ue)){if(n instanceof Xe)return n;if(Bn.call(n,"__wrapped__"))return Vi(n)}return new Xe(n)}var Ye=function(){function n(){}return function(t){if(!ta(t))return{};if(Gn)return Gn(t);n.prototype=t;var r=new n;return n.prototype=e,r}}();function Ze(){}function Xe(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=e}function Ue(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Fe(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function We(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function $e(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function Ge(n){var t=-1,e=null==n?0:n.length;for(this.__data__=new $e;++t<e;)this.add(n[t])}function qe(n){var t=this.__data__=new We(n);this.size=t.size}function Ke(n,t){var e=Uu(n),r=!e&&Xu(n),o=!e&&!r&&Gu(n),i=!e&&!r&&!o&&sa(n),u=e||r||o||i,a=u?Kt(n.length,jn):[],c=a.length;for(var l in n)!t&&!Bn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||bi(l,c))||a.push(l);return a}function Qe(n){var t=n.length;return t?n[Gr(0,t-1)]:e}function Je(n,t){return Ti(Io(n),cr(t,0,n.length))}function nr(n){return Ti(Io(n))}function tr(n,t,r){(r!==e&&!Hu(n[t],r)||r===e&&!(t in n))&&ur(n,t,r)}function er(n,t,r){var o=n[t];Bn.call(n,t)&&Hu(o,r)&&(r!==e||t in n)||ur(n,t,r)}function rr(n,t){for(var e=n.length;e--;)if(Hu(n[e][0],t))return e;return-1}function or(n,t,e,r){return hr(n,(function(n,o,i){t(r,n,e(n),i)})),r}function ir(n,t){return n&&Po(t,Pa(t),n)}function ur(n,t,e){"__proto__"==t&&ot?ot(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function ar(n,t){for(var r=-1,o=t.length,i=an(o),u=null==n;++r<o;)i[r]=u?e:Na(n,t[r]);return i}function cr(n,t,r){return n==n&&(r!==e&&(n=n<=r?n:r),t!==e&&(n=n>=t?n:t)),n}function lr(n,t,r,o,i,u){var a,c=1&t,l=2&t,s=4&t;if(r&&(a=i?r(n,o,i,u):r(n)),a!==e)return a;if(!ta(n))return n;var f=Uu(n);if(f){if(a=function(n){var t=n.length,e=new n.constructor(t);t&&"string"==typeof n[0]&&Bn.call(n,"index")&&(e.index=n.index,e.input=n.input);return e}(n),!c)return Io(n,a)}else{var d=gi(n),h=d==x||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,t){return Po(n,pi(n),t)}(n,function(n,t){return n&&Po(t,Aa(t),n)}(a,n)):function(n,t){return Po(n,vi(n),t)}(n,ir(a,n))}else{if(!lt[d])return i?n:{};a=function(n,t,e){var r=n.constructor;switch(t){case A:return Co(n);case m:case b:return new r(+n);case z:return function(n,t){var e=t?Co(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}(n,e);case L:case T:case B:case D:case R:case V:case H:case Y:case Z:return No(n,e);case S:return new r;case k:case j:return new r(n);case M:return function(n){var t=new n.constructor(n.source,pn.exec(n));return t.lastIndex=n.lastIndex,t}(n);case O:return new r;case I:return o=n,Re?Mn(Re.call(o)):{}}var o}(n,d,c)}}u||(u=new qe);var v=u.get(n);if(v)return v;u.set(n,a),aa(n)?n.forEach((function(e){a.add(lr(e,t,r,e,n,u))})):ra(n)&&n.forEach((function(e,o){a.set(o,lr(e,t,r,o,n,u))}));var p=f?e:(s?l?ui:ii:l?Aa:Pa)(n);return Ot(p||n,(function(e,o){p&&(e=n[o=e]),er(a,o,lr(e,t,r,o,n,u))})),a}function sr(n,t,r){var o=r.length;if(null==n)return!o;for(n=Mn(n);o--;){var i=r[o],u=t[i],a=n[i];if(a===e&&!(i in n)||!u(a))return!1}return!0}function fr(n,t,o){if("function"!=typeof n)throw new In(r);return Pi((function(){n.apply(e,o)}),t)}function dr(n,t,e,r){var o=-1,i=At,u=!0,a=n.length,c=[],l=t.length;if(!a)return c;e&&(t=Lt(t,Jt(e))),r?(i=zt,u=!1):t.length>=200&&(i=te,u=!1,t=new Ge(t));n:for(;++o<a;){var s=n[o],f=null==e?s:e(s);if(s=r||0!==s?s:0,u&&f==f){for(var d=l;d--;)if(t[d]===f)continue n;c.push(s)}else i(t,f,r)||c.push(s)}return c}He.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:He}},He.prototype=Ze.prototype,He.prototype.constructor=He,Xe.prototype=Ye(Ze.prototype),Xe.prototype.constructor=Xe,Ue.prototype=Ye(Ze.prototype),Ue.prototype.constructor=Ue,Fe.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Fe.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Fe.prototype.get=function(n){var t=this.__data__;if(je){var r=t[n];return r===o?e:r}return Bn.call(t,n)?t[n]:e},Fe.prototype.has=function(n){var t=this.__data__;return je?t[n]!==e:Bn.call(t,n)},Fe.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=je&&t===e?o:t,this},We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(n){var t=this.__data__,e=rr(t,n);return!(e<0)&&(e==t.length-1?t.pop():Kn.call(t,e,1),--this.size,!0)},We.prototype.get=function(n){var t=this.__data__,r=rr(t,n);return r<0?e:t[r][1]},We.prototype.has=function(n){return rr(this.__data__,n)>-1},We.prototype.set=function(n,t){var e=this.__data__,r=rr(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this},$e.prototype.clear=function(){this.size=0,this.__data__={hash:new Fe,map:new(Ce||We),string:new Fe}},$e.prototype.delete=function(n){var t=fi(this,n).delete(n);return this.size-=t?1:0,t},$e.prototype.get=function(n){return fi(this,n).get(n)},$e.prototype.has=function(n){return fi(this,n).has(n)},$e.prototype.set=function(n,t){var e=fi(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this},Ge.prototype.add=Ge.prototype.push=function(n){return this.__data__.set(n,o),this},Ge.prototype.has=function(n){return this.__data__.has(n)},qe.prototype.clear=function(){this.__data__=new We,this.size=0},qe.prototype.delete=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e},qe.prototype.get=function(n){return this.__data__.get(n)},qe.prototype.has=function(n){return this.__data__.has(n)},qe.prototype.set=function(n,t){var e=this.__data__;if(e instanceof We){var r=e.__data__;if(!Ce||r.length<199)return r.push([n,t]),this.size=++e.size,this;e=this.__data__=new $e(r)}return e.set(n,t),this.size=e.size,this};var hr=Lo(_r),vr=Lo(xr,!0);function pr(n,t){var e=!0;return hr(n,(function(n,r,o){return e=!!t(n,r,o)})),e}function gr(n,t,r){for(var o=-1,i=n.length;++o<i;){var u=n[o],a=t(u);if(null!=a&&(c===e?a==a&&!la(a):r(a,c)))var c=a,l=u}return l}function yr(n,t){var e=[];return hr(n,(function(n,r,o){t(n,r,o)&&e.push(n)})),e}function mr(n,t,e,r,o){var i=-1,u=n.length;for(e||(e=wi),o||(o=[]);++i<u;){var a=n[i];t>0&&e(a)?t>1?mr(a,t-1,e,r,o):Tt(o,a):r||(o[o.length]=a)}return o}var wr=To(),br=To(!0);function _r(n,t){return n&&wr(n,t,Pa)}function xr(n,t){return n&&br(n,t,Pa)}function Er(n,t){return Pt(t,(function(t){return Qu(n[t])}))}function Sr(n,t){for(var r=0,o=(t=_o(t,n)).length;null!=n&&r<o;)n=n[Di(t[r++])];return r&&r==o?n:e}function kr(n,t,e){var r=t(n);return Uu(n)?r:Tt(r,e(n))}function Cr(n){return null==n?n===e?"[object Undefined]":"[object Null]":et&&et in Mn(n)?function(n){var t=Bn.call(n,et),r=n[et];try{n[et]=e;var o=!0}catch(n){}var i=Vn.call(n);o&&(t?n[et]=r:delete n[et]);return i}(n):function(n){return Vn.call(n)}(n)}function Nr(n,t){return n>t}function Mr(n,t){return null!=n&&Bn.call(n,t)}function Or(n,t){return null!=n&&t in Mn(n)}function jr(n,t,r){for(var o=r?zt:At,i=n[0].length,u=n.length,a=u,c=an(u),l=1/0,s=[];a--;){var f=n[a];a&&t&&(f=Lt(f,Jt(t))),l=be(f.length,l),c[a]=!r&&(t||i>=120&&f.length>=120)?new Ge(a&&f):e}f=n[0];var d=-1,h=c[0];n:for(;++d<i&&s.length<l;){var v=f[d],p=t?t(v):v;if(v=r||0!==v?v:0,!(h?te(h,p):o(s,p,r))){for(a=u;--a;){var g=c[a];if(!(g?te(g,p):o(n[a],p,r)))continue n}h&&h.push(p),s.push(v)}}return s}function Ir(n,t,r){var o=null==(n=Oi(n,t=_o(t,n)))?n:n[Di(Ki(t))];return null==o?e:Nt(o,n,r)}function Pr(n){return ea(n)&&Cr(n)==g}function Ar(n,t,r,o,i){return n===t||(null==n||null==t||!ea(n)&&!ea(t)?n!=n&&t!=t:function(n,t,r,o,i,u){var a=Uu(n),c=Uu(t),l=a?y:gi(n),s=c?y:gi(t),f=(l=l==g?C:l)==C,d=(s=s==g?C:s)==C,h=l==s;if(h&&Gu(n)){if(!Gu(t))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new qe),a||sa(n)?ri(n,t,r,o,i,u):function(n,t,e,r,o,i,u){switch(e){case z:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case A:return!(n.byteLength!=t.byteLength||!i(new Fn(n),new Fn(t)));case m:case b:case k:return Hu(+n,+t);case _:return n.name==t.name&&n.message==t.message;case M:case j:return n==t+"";case S:var a=ce;case O:var c=1&r;if(a||(a=fe),n.size!=t.size&&!c)return!1;var l=u.get(n);if(l)return l==t;r|=2,u.set(n,t);var s=ri(a(n),a(t),r,o,i,u);return u.delete(n),s;case I:if(Re)return Re.call(n)==Re.call(t)}return!1}(n,t,l,r,o,i,u);if(!(1&r)){var v=f&&Bn.call(n,"__wrapped__"),p=d&&Bn.call(t,"__wrapped__");if(v||p){var w=v?n.value():n,x=p?t.value():t;return u||(u=new qe),i(w,x,r,o,u)}}if(!h)return!1;return u||(u=new qe),function(n,t,r,o,i,u){var a=1&r,c=ii(n),l=c.length,s=ii(t),f=s.length;if(l!=f&&!a)return!1;var d=l;for(;d--;){var h=c[d];if(!(a?h in t:Bn.call(t,h)))return!1}var v=u.get(n),p=u.get(t);if(v&&p)return v==t&&p==n;var g=!0;u.set(n,t),u.set(t,n);var y=a;for(;++d<l;){var m=n[h=c[d]],w=t[h];if(o)var b=a?o(w,m,h,t,n,u):o(m,w,h,n,t,u);if(!(b===e?m===w||i(m,w,r,o,u):b)){g=!1;break}y||(y="constructor"==h)}if(g&&!y){var _=n.constructor,x=t.constructor;_==x||!("constructor"in n)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(g=!1)}return u.delete(n),u.delete(t),g}(n,t,r,o,i,u)}(n,t,r,o,Ar,i))}function zr(n,t,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===e&&!(l in n))return!1}else{var d=new qe;if(o)var h=o(s,f,l,n,t,d);if(!(h===e?Ar(f,s,3,o,d):h))return!1}}return!0}function Lr(n){return!(!ta(n)||(t=n,Rn&&Rn in t))&&(Qu(n)?Zn:mn).test(Ri(n));var t}function Tr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Uu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Br(n){if(!ki(n))return me(n);var t=[];for(var e in Mn(n))Bn.call(n,e)&&"constructor"!=e&&t.push(e);return t}function Dr(n){if(!ta(n))return function(n){var t=[];if(null!=n)for(var e in Mn(n))t.push(e);return t}(n);var t=ki(n),e=[];for(var r in n)("constructor"!=r||!t&&Bn.call(n,r))&&e.push(r);return e}function Rr(n,t){return n<t}function Vr(n,t){var e=-1,r=Wu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++e]=t(n,o,i)})),r}function Hr(n){var t=di(n);return 1==t.length&&t[0][2]?Ni(t[0][0],t[0][1]):function(e){return e===n||zr(e,n,t)}}function Yr(n,t){return xi(n)&&Ci(t)?Ni(Di(n),t):function(r){var o=Na(r,n);return o===e&&o===t?Ma(r,n):Ar(t,o,3)}}function Zr(n,t,r,o,i){n!==t&&wr(t,(function(u,a){if(i||(i=new qe),ta(u))!function(n,t,r,o,i,u,a){var c=ji(n,r),l=ji(t,r),s=a.get(l);if(s)return void tr(n,r,s);var f=u?u(c,l,r+"",n,t,a):e,d=f===e;if(d){var h=Uu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Uu(c)?f=c:$u(c)?f=Io(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=No(l,!0)):f=[]:ia(l)||Xu(l)?(f=c,Xu(c)?f=ma(c):ta(c)&&!Qu(c)||(f=mi(l))):d=!1}d&&(a.set(l,f),i(f,l,o,u,a),a.delete(l));tr(n,r,f)}(n,t,a,r,Zr,o,i);else{var c=o?o(ji(n,a),u,a+"",n,t,i):e;c===e&&(c=u),tr(n,a,c)}}),Aa)}function Xr(n,t){var r=n.length;if(r)return bi(t+=t<0?r:0,r)?n[t]:e}function Ur(n,t,e){t=t.length?Lt(t,(function(n){return Uu(n)?function(t){return Sr(t,1===n.length?n[0]:n)}:n})):[oc];var r=-1;t=Lt(t,Jt(si()));var o=Vr(n,(function(n,e,o){var i=Lt(t,(function(t){return t(n)}));return{criteria:i,index:++r,value:n}}));return function(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}(o,(function(n,t){return function(n,t,e){var r=-1,o=n.criteria,i=t.criteria,u=o.length,a=e.length;for(;++r<u;){var c=Mo(o[r],i[r]);if(c)return r>=a?c:c*("desc"==e[r]?-1:1)}return n.index-t.index}(n,t,e)}))}function Fr(n,t,e){for(var r=-1,o=t.length,i={};++r<o;){var u=t[r],a=Sr(n,u);e(a,u)&&no(i,_o(u,n),a)}return i}function Wr(n,t,e,r){var o=r?Xt:Zt,i=-1,u=t.length,a=n;for(n===t&&(t=Io(t)),e&&(a=Lt(n,Jt(e)));++i<u;)for(var c=0,l=t[i],s=e?e(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,t){for(var e=n?t.length:0,r=e-1;e--;){var o=t[e];if(e==r||o!==i){var i=o;bi(o)?Kn.call(n,o,1):ho(n,o)}}return n}function Gr(n,t){return n+yt(Ee()*(t-n+1))}function qr(n,t){var e="";if(!n||t<1||t>d)return e;do{t%2&&(e+=n),(t=yt(t/2))&&(n+=n)}while(t);return e}function Kr(n,t){return Ai(Mi(n,t,oc),n+"")}function Qr(n){return Qe(Ha(n))}function Jr(n,t){var e=Ha(n);return Ti(e,cr(t,0,e.length))}function no(n,t,r,o){if(!ta(n))return n;for(var i=-1,u=(t=_o(t,n)).length,a=u-1,c=n;null!=c&&++i<u;){var l=Di(t[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):e)===e&&(s=ta(f)?f:bi(t[i+1])?[]:{})}er(c,l,s),c=c[l]}return n}var to=Ie?function(n,t){return Ie.set(n,t),n}:oc,eo=ot?function(n,t){return ot(n,"toString",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:oc;function ro(n){return Ti(Ha(n))}function oo(n,t,e){var r=-1,o=n.length;t<0&&(t=-t>o?0:o+t),(e=e>o?o:e)<0&&(e+=o),o=t>e?0:e-t>>>0,t>>>=0;for(var i=an(o);++r<o;)i[r]=n[r+t];return i}function io(n,t){var e;return hr(n,(function(n,r,o){return!(e=t(n,r,o))})),!!e}function uo(n,t,e){var r=0,o=null==n?r:n.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=n[i];null!==u&&!la(u)&&(e?u<=t:u<t)?r=i+1:o=i}return o}return ao(n,t,oc,e)}function ao(n,t,r,o){var i=0,u=null==n?0:n.length;if(0===u)return 0;for(var a=(t=r(t))!=t,c=null===t,l=la(t),s=t===e;i<u;){var f=yt((i+u)/2),d=r(n[f]),h=d!==e,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<=t:d<t);y?i=f+1:u=f}return be(u,4294967294)}function co(n,t){for(var e=-1,r=n.length,o=0,i=[];++e<r;){var u=n[e],a=t?t(u):u;if(!e||!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(Uu(n))return Lt(n,so)+"";if(la(n))return Ve?Ve.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function fo(n,t,e){var r=-1,o=At,i=n.length,u=!0,a=[],c=a;if(e)u=!1,o=zt;else if(i>=200){var l=t?null:Ko(n);if(l)return fe(l);u=!1,o=te,c=new Ge}else c=t?[]:a;n:for(;++r<i;){var s=n[r],f=t?t(s):s;if(s=e||0!==s?s:0,u&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue n;t&&c.push(f),a.push(s)}else o(c,f,e)||(c!==a&&c.push(f),a.push(s))}return a}function ho(n,t){return null==(n=Oi(n,t=_o(t,n)))||delete n[Di(Ki(t))]}function vo(n,t,e,r){return no(n,t,e(Sr(n,t)),r)}function po(n,t,e,r){for(var o=n.length,i=r?o:-1;(r?i--:++i<o)&&t(n[i],i,n););return e?oo(n,r?0:i,r?i+1:o):oo(n,r?i+1:0,r?o:i)}function go(n,t){var e=n;return e instanceof Ue&&(e=e.value()),Bt(t,(function(n,t){return t.func.apply(t.thisArg,Tt([n],t.args))}),e)}function yo(n,t,e){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],t,e));return fo(mr(i,1),t,e)}function mo(n,t,r){for(var o=-1,i=n.length,u=t.length,a={};++o<i;){var c=o<u?t[o]:e;r(a,n[o],c)}return a}function wo(n){return $u(n)?n:[]}function bo(n){return"function"==typeof n?n:oc}function _o(n,t){return Uu(n)?n:xi(n,t)?[n]:Bi(wa(n))}var xo=Kr;function Eo(n,t,r){var o=n.length;return r=r===e?o:r,!t&&r>=o?n:oo(n,t,r)}var So=st||function(n){return pt.clearTimeout(n)};function ko(n,t){if(t)return n.slice();var e=n.length,r=Wn?Wn(e):new n.constructor(e);return n.copy(r),r}function Co(n){var t=new n.constructor(n.byteLength);return new Fn(t).set(new Fn(n)),t}function No(n,t){var e=t?Co(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Mo(n,t){if(n!==t){var r=n!==e,o=null===n,i=n==n,u=la(n),a=t!==e,c=null===t,l=t==t,s=la(t);if(!c&&!s&&!u&&n>t||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&n<t||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}function Oo(n,t,e,r){for(var o=-1,i=n.length,u=e.length,a=-1,c=t.length,l=we(i-u,0),s=an(c+l),f=!r;++a<c;)s[a]=t[a];for(;++o<u;)(f||o<i)&&(s[e[o]]=n[o]);for(;l--;)s[a++]=n[o++];return s}function jo(n,t,e,r){for(var o=-1,i=n.length,u=-1,a=e.length,c=-1,l=t.length,s=we(i-a,0),f=an(s+l),d=!r;++o<s;)f[o]=n[o];for(var h=o;++c<l;)f[h+c]=t[c];for(;++u<a;)(d||o<i)&&(f[h+e[u]]=n[o++]);return f}function Io(n,t){var e=-1,r=n.length;for(t||(t=an(r));++e<r;)t[e]=n[e];return t}function Po(n,t,r,o){var i=!r;r||(r={});for(var u=-1,a=t.length;++u<a;){var c=t[u],l=o?o(r[c],n[c],c,r,n):e;l===e&&(l=n[c]),i?ur(r,c,l):er(r,c,l)}return r}function Ao(n,t){return function(e,r){var o=Uu(e)?Mt:or,i=t?t():{};return o(e,n,si(r,2),i)}}function zo(n){return Kr((function(t,r){var o=-1,i=r.length,u=i>1?r[i-1]:e,a=i>2?r[2]:e;for(u=n.length>3&&"function"==typeof u?(i--,u):e,a&&_i(r[0],r[1],a)&&(u=i<3?e:u,i=1),t=Mn(t);++o<i;){var c=r[o];c&&n(t,c,o,u)}return t}))}function Lo(n,t){return function(e,r){if(null==e)return e;if(!Wu(e))return n(e,r);for(var o=e.length,i=t?o:-1,u=Mn(e);(t?i--:++i<o)&&!1!==r(u[i],i,u););return e}}function To(n){return function(t,e,r){for(var o=-1,i=Mn(t),u=r(t),a=u.length;a--;){var c=u[n?a:++o];if(!1===e(i[c],c,i))break}return t}}function Bo(n){return function(t){var r=ae(t=wa(t))?ve(t):e,o=r?r[0]:t.charAt(0),i=r?Eo(r,1).join(""):t.slice(1);return o[n]()+i}}function Do(n){return function(t){return Bt(Qa(Xa(t).replace(nt,"")),n,"")}}function Ro(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var e=Ye(n.prototype),r=n.apply(e,t);return ta(r)?r:e}}function Vo(n){return function(t,r,o){var i=Mn(t);if(!Wu(t)){var u=si(r,3);t=Pa(t),r=function(n){return u(i[n],n,i)}}var a=n(t,r,o);return a>-1?i[u?t[a]:a]:e}}function Ho(n){return oi((function(t){var o=t.length,i=o,u=Xe.prototype.thru;for(n&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new In(r);if(u&&!c&&"wrapper"==ci(a))var c=new Xe([],!0)}for(i=c?i:o;++i<o;){var l=ci(a=t[i]),s="wrapper"==l?ai(a):e;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,e=n[0];if(c&&1==n.length&&Uu(e))return c.plant(e).value();for(var r=0,i=o?t[r].apply(this,n):e;++r<o;)i=t[r].call(this,i);return i}}))}function Yo(n,t,r,o,i,u,a,c,s,f){var d=t&l,h=1&t,v=2&t,p=24&t,g=512&t,y=v?e:Ro(n);return function l(){for(var m=arguments.length,w=an(m),b=m;b--;)w[b]=arguments[b];if(p)var _=li(l),x=function(n,t){for(var e=n.length,r=0;e--;)n[e]===t&&++r;return r}(w,_);if(o&&(w=Oo(w,o,i,p)),u&&(w=jo(w,u,a,p)),m-=x,p&&m<f){var E=se(w,_);return Go(n,t,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,t){var r=n.length,o=be(t.length,r),i=Io(n);for(;o--;){var u=t[o];n[o]=bi(u,r)?i[u]:e}return n}(w,c):g&&m>1&&w.reverse(),d&&s<m&&(w.length=s),this&&this!==pt&&this instanceof l&&(k=y||Ro(k)),k.apply(S,w)}}function Zo(n,t){return function(e,r){return function(n,t,e,r){return _r(n,(function(n,o,i){t(r,e(n),o,i)})),r}(e,n,t(r),{})}}function Xo(n,t){return function(r,o){var i;if(r===e&&o===e)return t;if(r!==e&&(i=r),o!==e){if(i===e)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=lo(r),o=lo(o)),i=n(r,o)}return i}}function Uo(n){return oi((function(t){return t=Lt(t,Jt(si())),Kr((function(e){var r=this;return n(t,(function(n){return Nt(n,r,e)}))}))}))}function Fo(n,t){var r=(t=t===e?" ":so(t)).length;if(r<2)return r?qr(t,n):t;var o=qr(t,gt(n/he(t)));return ae(t)?Eo(ve(o),0,n).join(""):o.slice(0,n)}function Wo(n){return function(t,r,o){return o&&"number"!=typeof o&&_i(t,r,o)&&(r=o=e),t=va(t),r===e?(r=t,t=0):r=va(r),function(n,t,e,r){for(var o=-1,i=we(gt((t-n)/(e||1)),0),u=an(i);i--;)u[r?i:++o]=n,n+=e;return u}(t,r,o=o===e?t<r?1:-1:va(o),n)}}function $o(n){return function(t,e){return"string"==typeof t&&"string"==typeof e||(t=ya(t),e=ya(e)),n(t,e)}}function Go(n,t,r,o,i,u,l,s,f,d){var h=8&t;t|=h?a:c,4&(t&=~(h?c:a))||(t&=-4);var v=[n,t,i,h?u:e,h?l:e,h?e:u,h?e:l,s,f,d],p=r.apply(e,v);return Ei(n)&&Ii(p,v),p.placeholder=o,zi(p,n,t)}function qo(n){var t=Nn[n];return function(n,e){if(n=ya(n),(e=null==e?0:be(pa(e),292))&&Vt(n)){var r=(wa(n)+"e").split("e");return+((r=(wa(t(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return t(n)}}var Ko=Me&&1/fe(new Me([,-0]))[1]==f?function(n){return new Me(n)}:lc;function Qo(n){return function(t){var e=gi(t);return e==S?ce(t):e==O?de(t):function(n,t){return Lt(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function Jo(n,t,o,f,d,h,v,p){var g=2&t;if(!g&&"function"!=typeof n)throw new In(r);var y=f?f.length:0;if(y||(t&=-97,f=d=e),v=v===e?v:we(pa(v),0),p=p===e?p:pa(p),y-=d?d.length:0,t&c){var m=f,w=d;f=d=e}var b=g?e:ai(n),_=[n,t,o,f,d,m,w,h,v,p];if(b&&function(n,t){var e=n[1],r=t[1],o=e|r,u=o<131,a=r==l&&8==e||r==l&&e==s&&n[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==e;if(!u&&!a)return n;1&r&&(n[2]=t[2],o|=1&e?0:4);var c=t[3];if(c){var f=n[3];n[3]=f?Oo(f,c,t[4]):c,n[4]=f?se(n[3],i):t[4]}(c=t[5])&&(f=n[5],n[5]=f?jo(f,c,t[6]):c,n[6]=f?se(n[5],i):t[6]);(c=t[7])&&(n[7]=c);r&l&&(n[8]=null==n[8]?t[8]:be(n[8],t[8]));null==n[9]&&(n[9]=t[9]);n[0]=t[0],n[1]=o}(_,b),n=_[0],t=_[1],o=_[2],f=_[3],d=_[4],!(p=_[9]=_[9]===e?g?0:n.length:we(_[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||t==u?function(n,t,r){var o=Ro(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?[]:se(a,l);return(u-=s.length)<r?Go(n,t,Yo,i.placeholder,e,a,s,e,e,r-u):Nt(this&&this!==pt&&this instanceof i?o:n,this,a)}}(n,t,p):t!=a&&33!=t||d.length?Yo.apply(e,_):function(n,t,e,r){var o=1&t,i=Ro(n);return function t(){for(var u=-1,a=arguments.length,c=-1,l=r.length,s=an(l+a),f=this&&this!==pt&&this instanceof t?i:n;++c<l;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Nt(f,o?e:this,s)}}(n,t,o,f);else var x=function(n,t,e){var r=1&t,o=Ro(n);return function t(){return(this&&this!==pt&&this instanceof t?o:n).apply(r?e:this,arguments)}}(n,t,o);return zi((b?to:Ii)(x,_),n,t)}function ni(n,t,r,o){return n===e||Hu(n,zn[r])&&!Bn.call(o,r)?t:n}function ti(n,t,r,o,i,u){return ta(n)&&ta(t)&&(u.set(t,n),Zr(n,t,e,ti,u),u.delete(t)),n}function ei(n){return ia(n)?e:n}function ri(n,t,r,o,i,u){var a=1&r,c=n.length,l=t.length;if(c!=l&&!(a&&l>c))return!1;var s=u.get(n),f=u.get(t);if(s&&f)return s==t&&f==n;var d=-1,h=!0,v=2&r?new Ge:e;for(u.set(n,t),u.set(t,n);++d<c;){var p=n[d],g=t[d];if(o)var y=a?o(g,p,d,t,n,u):o(p,g,d,n,t,u);if(y!==e){if(y)continue;h=!1;break}if(v){if(!Rt(t,(function(n,t){if(!te(v,t)&&(p===n||i(p,n,r,o,u)))return v.push(t)}))){h=!1;break}}else if(p!==g&&!i(p,g,r,o,u)){h=!1;break}}return u.delete(n),u.delete(t),h}function oi(n){return Ai(Mi(n,e,Fi),n+"")}function ii(n){return kr(n,Pa,vi)}function ui(n){return kr(n,Aa,pi)}var ai=Ie?function(n){return Ie.get(n)}:lc;function ci(n){for(var t=n.name+"",e=Pe[t],r=Bn.call(Pe,t)?e.length:0;r--;){var o=e[r],i=o.func;if(null==i||i==n)return o.name}return t}function li(n){return(Bn.call(He,"placeholder")?He:n).placeholder}function si(){var n=He.iteratee||ic;return n=n===ic?Tr:n,arguments.length?n(arguments[0],arguments[1]):n}function fi(n,t){var e,r,o=n.__data__;return("string"==(r=typeof(e=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?o["string"==typeof t?"string":"hash"]:o.map}function di(n){for(var t=Pa(n),e=t.length;e--;){var r=t[e],o=n[r];t[e]=[r,o,Ci(o)]}return t}function hi(n,t){var r=function(n,t){return null==n?e:n[t]}(n,t);return Lr(r)?r:e}var vi=wt?function(n){return null==n?[]:(n=Mn(n),Pt(wt(n),(function(t){return qn.call(n,t)})))}:gc,pi=wt?function(n){for(var t=[];n;)Tt(t,vi(n)),n=$n(n);return t}:gc,gi=Cr;function yi(n,t,e){for(var r=-1,o=(t=_o(t,n)).length,i=!1;++r<o;){var u=Di(t[r]);if(!(i=null!=n&&e(n,u)))break;n=n[u]}return i||++r!=o?i:!!(o=null==n?0:n.length)&&na(o)&&bi(u,o)&&(Uu(n)||Xu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Ye($n(n))}function wi(n){return Uu(n)||Xu(n)||!!(Qn&&n&&n[Qn])}function bi(n,t){var e=typeof n;return!!(t=null==t?d:t)&&("number"==e||"symbol"!=e&&bn.test(n))&&n>-1&&n%1==0&&n<t}function _i(n,t,e){if(!ta(e))return!1;var r=typeof t;return!!("number"==r?Wu(e)&&bi(t,e.length):"string"==r&&t in e)&&Hu(e[t],n)}function xi(n,t){if(Uu(n))return!1;var e=typeof n;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=n&&!la(n))||(tn.test(n)||!nn.test(n)||null!=t&&n in Mn(t))}function Ei(n){var t=ci(n),e=He[t];if("function"!=typeof e||!(t in Ue.prototype))return!1;if(n===e)return!0;var r=ai(e);return!!r&&n===r[0]}(ke&&gi(new ke(new ArrayBuffer(1)))!=z||Ce&&gi(new Ce)!=S||Ne&&gi(Ne.resolve())!=N||Me&&gi(new Me)!=O||Oe&&gi(new Oe)!=P)&&(gi=function(n){var t=Cr(n),r=t==C?n.constructor:e,o=r?Ri(r):"";if(o)switch(o){case Ae:return z;case ze:return S;case Le:return N;case Te:return O;case Be:return P}return t});var Si=Ln?Qu:yc;function ki(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||zn)}function Ci(n){return n==n&&!ta(n)}function Ni(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==e||n in Mn(r)))}}function Mi(n,t,r){return t=we(t===e?n.length-1:t,0),function(){for(var e=arguments,o=-1,i=we(e.length-t,0),u=an(i);++o<i;)u[o]=e[t+o];o=-1;for(var a=an(t+1);++o<t;)a[o]=e[o];return a[t]=r(u),Nt(n,this,a)}}function Oi(n,t){return t.length<2?n:Sr(n,oo(t,0,-1))}function ji(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Ii=Li(to),Pi=vt||function(n,t){return pt.setTimeout(n,t)},Ai=Li(eo);function zi(n,t,e){var r=t+"";return Ai(n,function(n,t){var e=t.length;if(!e)return n;var r=e-1;return t[r]=(e>1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+t+"] */\n")}(r,function(n,t){return Ot(p,(function(e){var r="_."+e[0];t&e[1]&&!At(n,r)&&n.push(r)})),n.sort()}(function(n){var t=n.match(ln);return t?t[1].split(sn):[]}(r),e)))}function Li(n){var t=0,r=0;return function(){var o=_e(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(e,arguments)}}function Ti(n,t){var r=-1,o=n.length,i=o-1;for(t=t===e?o:t;++r<t;){var u=Gr(r,i),a=n[u];n[u]=n[r],n[r]=a}return n.length=t,n}var Bi=function(n){var t=Lu(n,(function(n){return 500===e.size&&e.clear(),n})),e=t.cache;return t}((function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(en,(function(n,e,r,o){t.push(r?o.replace(hn,"$1"):e||n)})),t}));function Di(n){if("string"==typeof n||la(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ri(n){if(null!=n){try{return Tn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Ue)return n.clone();var t=new Xe(n.__wrapped__,n.__chain__);return t.__actions__=Io(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var Hi=Kr((function(n,t){return $u(n)?dr(n,mr(t,1,$u,!0)):[]})),Yi=Kr((function(n,t){var r=Ki(t);return $u(r)&&(r=e),$u(n)?dr(n,mr(t,1,$u,!0),si(r,2)):[]})),Zi=Kr((function(n,t){var r=Ki(t);return $u(r)&&(r=e),$u(n)?dr(n,mr(t,1,$u,!0),e,r):[]}));function Xi(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var o=null==e?0:pa(e);return o<0&&(o=we(r+o,0)),Yt(n,si(t,3),o)}function Ui(n,t,r){var o=null==n?0:n.length;if(!o)return-1;var i=o-1;return r!==e&&(i=pa(r),i=r<0?we(o+i,0):be(i,o-1)),Yt(n,si(t,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Wi(n){return n&&n.length?n[0]:e}var $i=Kr((function(n){var t=Lt(n,wo);return t.length&&t[0]===n[0]?jr(t):[]})),Gi=Kr((function(n){var t=Ki(n),r=Lt(n,wo);return t===Ki(r)?t=e:r.pop(),r.length&&r[0]===n[0]?jr(r,si(t,2)):[]})),qi=Kr((function(n){var t=Ki(n),r=Lt(n,wo);return(t="function"==typeof t?t:e)&&r.pop(),r.length&&r[0]===n[0]?jr(r,e,t):[]}));function Ki(n){var t=null==n?0:n.length;return t?n[t-1]:e}var Qi=Kr(Ji);function Ji(n,t){return n&&n.length&&t&&t.length?Wr(n,t):n}var nu=oi((function(n,t){var e=null==n?0:n.length,r=ar(n,t);return $r(n,Lt(t,(function(n){return bi(n,e)?+n:n})).sort(Mo)),r}));function tu(n){return null==n?n:Se.call(n)}var eu=Kr((function(n){return fo(mr(n,1,$u,!0))})),ru=Kr((function(n){var t=Ki(n);return $u(t)&&(t=e),fo(mr(n,1,$u,!0),si(t,2))})),ou=Kr((function(n){var t=Ki(n);return t="function"==typeof t?t:e,fo(mr(n,1,$u,!0),e,t)}));function iu(n){if(!n||!n.length)return[];var t=0;return n=Pt(n,(function(n){if($u(n))return t=we(n.length,t),!0})),Kt(t,(function(t){return Lt(n,Wt(t))}))}function uu(n,t){if(!n||!n.length)return[];var r=iu(n);return null==t?r:Lt(r,(function(n){return Nt(t,e,n)}))}var au=Kr((function(n,t){return $u(n)?dr(n,t):[]})),cu=Kr((function(n){return yo(Pt(n,$u))})),lu=Kr((function(n){var t=Ki(n);return $u(t)&&(t=e),yo(Pt(n,$u),si(t,2))})),su=Kr((function(n){var t=Ki(n);return t="function"==typeof t?t:e,yo(Pt(n,$u),e,t)})),fu=Kr(iu);var du=Kr((function(n){var t=n.length,r=t>1?n[t-1]:e;return r="function"==typeof r?(n.pop(),r):e,uu(n,r)}));function hu(n){var t=He(n);return t.__chain__=!0,t}function vu(n,t){return t(n)}var pu=oi((function(n){var t=n.length,r=t?n[0]:0,o=this.__wrapped__,i=function(t){return ar(t,n)};return!(t>1||this.__actions__.length)&&o instanceof Ue&&bi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:vu,args:[i],thisArg:e}),new Xe(o,this.__chain__).thru((function(n){return t&&!n.length&&n.push(e),n}))):this.thru(i)}));var gu=Ao((function(n,t,e){Bn.call(n,e)?++n[e]:ur(n,e,1)}));var yu=Vo(Xi),mu=Vo(Ui);function wu(n,t){return(Uu(n)?Ot:hr)(n,si(t,3))}function bu(n,t){return(Uu(n)?jt:vr)(n,si(t,3))}var _u=Ao((function(n,t,e){Bn.call(n,e)?n[e].push(t):ur(n,e,[t])}));var xu=Kr((function(n,t,e){var r=-1,o="function"==typeof t,i=Wu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Nt(t,n,e):Ir(n,t,e)})),i})),Eu=Ao((function(n,t,e){ur(n,e,t)}));function Su(n,t){return(Uu(n)?Lt:Vr)(n,si(t,3))}var ku=Ao((function(n,t,e){n[e?0:1].push(t)}),(function(){return[[],[]]}));var Cu=Kr((function(n,t){if(null==n)return[];var e=t.length;return e>1&&_i(n,t[0],t[1])?t=[]:e>2&&_i(t[0],t[1],t[2])&&(t=[t[0]]),Ur(n,mr(t,1),[])})),Nu=ht||function(){return pt.Date.now()};function Mu(n,t,r){return t=r?e:t,t=n&&null==t?n.length:t,Jo(n,l,e,e,e,e,t)}function Ou(n,t){var o;if("function"!=typeof t)throw new In(r);return n=pa(n),function(){return--n>0&&(o=t.apply(this,arguments)),n<=1&&(t=e),o}}var ju=Kr((function(n,t,e){var r=1;if(e.length){var o=se(e,li(ju));r|=a}return Jo(n,r,t,e,o)})),Iu=Kr((function(n,t,e){var r=3;if(e.length){var o=se(e,li(Iu));r|=a}return Jo(t,r,n,e,o)}));function Pu(n,t,o){var i,u,a,c,l,s,f=0,d=!1,h=!1,v=!0;if("function"!=typeof n)throw new In(r);function p(t){var r=i,o=u;return i=u=e,f=t,c=n.apply(o,r)}function g(n){var r=n-s;return s===e||r>=t||r<0||h&&n-f>=a}function y(){var n=Nu();if(g(n))return m(n);l=Pi(y,function(n){var e=t-(n-s);return h?be(e,a-(n-f)):e}(n))}function m(n){return l=e,v&&i?p(n):(i=u=e,c)}function w(){var n=Nu(),r=g(n);if(i=arguments,u=this,s=n,r){if(l===e)return function(n){return f=n,l=Pi(y,t),d?p(n):c}(s);if(h)return So(l),l=Pi(y,t),p(s)}return l===e&&(l=Pi(y,t)),c}return t=ya(t)||0,ta(o)&&(d=!!o.leading,a=(h="maxWait"in o)?we(ya(o.maxWait)||0,t):a,v="trailing"in o?!!o.trailing:v),w.cancel=function(){l!==e&&So(l),f=0,i=s=u=l=e},w.flush=function(){return l===e?c:m(Nu())},w}var Au=Kr((function(n,t){return fr(n,1,t)})),zu=Kr((function(n,t,e){return fr(n,ya(t)||0,e)}));function Lu(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new In(r);var e=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=e.cache;if(i.has(o))return i.get(o);var u=n.apply(this,r);return e.cache=i.set(o,u)||i,u};return e.cache=new(Lu.Cache||$e),e}function Tu(n){if("function"!=typeof n)throw new In(r);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Lu.Cache=$e;var Bu=xo((function(n,t){var e=(t=1==t.length&&Uu(t[0])?Lt(t[0],Jt(si())):Lt(mr(t,1),Jt(si()))).length;return Kr((function(r){for(var o=-1,i=be(r.length,e);++o<i;)r[o]=t[o].call(this,r[o]);return Nt(n,this,r)}))})),Du=Kr((function(n,t){var r=se(t,li(Du));return Jo(n,a,e,t,r)})),Ru=Kr((function(n,t){var r=se(t,li(Ru));return Jo(n,c,e,t,r)})),Vu=oi((function(n,t){return Jo(n,s,e,e,e,t)}));function Hu(n,t){return n===t||n!=n&&t!=t}var Yu=$o(Nr),Zu=$o((function(n,t){return n>=t})),Xu=Pr(function(){return arguments}())?Pr:function(n){return ea(n)&&Bn.call(n,"callee")&&!qn.call(n,"callee")},Uu=an.isArray,Fu=_t?Jt(_t):function(n){return ea(n)&&Cr(n)==A};function Wu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ea(n)&&Wu(n)}var Gu=bt||yc,qu=xt?Jt(xt):function(n){return ea(n)&&Cr(n)==b};function Ku(n){if(!ea(n))return!1;var t=Cr(n);return t==_||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qu(n){if(!ta(n))return!1;var t=Cr(n);return t==x||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}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 ta(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function ea(n){return null!=n&&"object"==typeof n}var ra=Et?Jt(Et):function(n){return ea(n)&&gi(n)==S};function oa(n){return"number"==typeof n||ea(n)&&Cr(n)==k}function ia(n){if(!ea(n)||Cr(n)!=C)return!1;var t=$n(n);if(null===t)return!0;var e=Bn.call(t,"constructor")&&t.constructor;return"function"==typeof e&&e instanceof e&&Tn.call(e)==Hn}var ua=St?Jt(St):function(n){return ea(n)&&Cr(n)==M};var aa=kt?Jt(kt):function(n){return ea(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Uu(n)&&ea(n)&&Cr(n)==j}function la(n){return"symbol"==typeof n||ea(n)&&Cr(n)==I}var sa=Ct?Jt(Ct):function(n){return ea(n)&&na(n.length)&&!!ct[Cr(n)]};var fa=$o(Rr),da=$o((function(n,t){return n<=t}));function ha(n){if(!n)return[];if(Wu(n))return ca(n)?ve(n):Io(n);if(Jn&&n[Jn])return function(n){for(var t,e=[];!(t=n.next()).done;)e.push(t.value);return e}(n[Jn]());var t=gi(n);return(t==S?ce:t==O?fe: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 t=va(n),e=t%1;return t==t?e?t-e:t: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(ta(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ta(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Qt(n);var e=yn.test(n);return e||wn.test(n)?dt(n.slice(2),e?2:8):gn.test(n)?h:+n}function ma(n){return Po(n,Aa(n))}function wa(n){return null==n?"":so(n)}var ba=zo((function(n,t){if(ki(t)||Wu(t))Po(t,Pa(t),n);else for(var e in t)Bn.call(t,e)&&er(n,e,t[e])})),_a=zo((function(n,t){Po(t,Aa(t),n)})),xa=zo((function(n,t,e,r){Po(t,Aa(t),n,r)})),Ea=zo((function(n,t,e,r){Po(t,Pa(t),n,r)})),Sa=oi(ar);var ka=Kr((function(n,t){n=Mn(n);var r=-1,o=t.length,i=o>2?t[2]:e;for(i&&_i(t[0],t[1],i)&&(o=1);++r<o;)for(var u=t[r],a=Aa(u),c=-1,l=a.length;++c<l;){var s=a[c],f=n[s];(f===e||Hu(f,zn[s])&&!Bn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(e,ti),Nt(La,e,n)}));function Na(n,t,r){var o=null==n?e:Sr(n,t);return o===e?r:o}function Ma(n,t){return null!=n&&yi(n,t,Or)}var Oa=Zo((function(n,t,e){null!=t&&"function"!=typeof t.toString&&(t=Vn.call(t)),n[t]=e}),tc(oc)),ja=Zo((function(n,t,e){null!=t&&"function"!=typeof t.toString&&(t=Vn.call(t)),Bn.call(n,t)?n[t].push(e):n[t]=[e]}),si),Ia=Kr(Ir);function Pa(n){return Wu(n)?Ke(n):Br(n)}function Aa(n){return Wu(n)?Ke(n,!0):Dr(n)}var za=zo((function(n,t,e){Zr(n,t,e)})),La=zo((function(n,t,e,r){Zr(n,t,e,r)})),Ta=oi((function(n,t){var e={};if(null==n)return e;var r=!1;t=Lt(t,(function(t){return t=_o(t,n),r||(r=t.length>1),t})),Po(n,ui(n),e),r&&(e=lr(e,7,ei));for(var o=t.length;o--;)ho(e,t[o]);return e}));var Ba=oi((function(n,t){return null==n?{}:function(n,t){return Fr(n,t,(function(t,e){return Ma(n,e)}))}(n,t)}));function Da(n,t){if(null==n)return{};var e=Lt(ui(n),(function(n){return[n]}));return t=si(t),Fr(n,e,(function(n,e){return t(n,e[0])}))}var Ra=Qo(Pa),Va=Qo(Aa);function Ha(n){return null==n?[]:ne(n,Pa(n))}var Ya=Do((function(n,t,e){return t=t.toLowerCase(),n+(e?Za(t):t)}));function Za(n){return Ka(wa(n).toLowerCase())}function Xa(n){return(n=wa(n))&&n.replace(_n,oe).replace(tt,"")}var Ua=Do((function(n,t,e){return n+(e?"-":"")+t.toLowerCase()})),Fa=Do((function(n,t,e){return n+(e?" ":"")+t.toLowerCase()})),Wa=Bo("toLowerCase");var $a=Do((function(n,t,e){return n+(e?"_":"")+t.toLowerCase()}));var Ga=Do((function(n,t,e){return n+(e?" ":"")+Ka(t)}));var qa=Do((function(n,t,e){return n+(e?" ":"")+t.toUpperCase()})),Ka=Bo("toUpperCase");function Qa(n,t,r){return n=wa(n),(t=r?e:t)===e?function(n){return it.test(n)}(n)?function(n){return n.match(rt)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(t)||[]}var Ja=Kr((function(n,t){try{return Nt(n,e,t)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,t){return Ot(t,(function(t){t=Di(t),ur(n,t,ju(n[t],n))})),n}));function tc(n){return function(){return n}}var ec=Ho(),rc=Ho(!0);function oc(n){return n}function ic(n){return Tr("function"==typeof n?n:lr(n,1))}var uc=Kr((function(n,t){return function(e){return Ir(e,n,t)}})),ac=Kr((function(n,t){return function(e){return Ir(n,e,t)}}));function cc(n,t,e){var r=Pa(t),o=Er(t,r);null!=e||ta(t)&&(o.length||!r.length)||(e=t,t=n,n=this,o=Er(t,Pa(t)));var i=!(ta(e)&&"chain"in e&&!e.chain),u=Qu(n);return Ot(o,(function(e){var r=t[e];n[e]=r,u&&(n.prototype[e]=function(){var t=this.__chain__;if(i||t){var e=n(this.__wrapped__);return(e.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:n}),e.__chain__=t,e}return r.apply(n,Tt([this.value()],arguments))})})),n}function lc(){}var sc=Uo(Lt),fc=Uo(It),dc=Uo(Rt);function hc(n){return xi(n)?Wt(Di(n)):function(n){return function(t){return Sr(t,n)}}(n)}var vc=Wo(),pc=Wo(!0);function gc(){return[]}function yc(){return!1}var mc=Xo((function(n,t){return n+t}),0),wc=qo("ceil"),bc=Xo((function(n,t){return n/t}),1),_c=qo("floor");var xc,Ec=Xo((function(n,t){return n*t}),1),Sc=qo("round"),kc=Xo((function(n,t){return n-t}),0);return He.after=function(n,t){if("function"!=typeof t)throw new In(r);return n=pa(n),function(){if(--n<1)return t.apply(this,arguments)}},He.ary=Mu,He.assign=ba,He.assignIn=_a,He.assignInWith=xa,He.assignWith=Ea,He.at=Sa,He.before=Ou,He.bind=ju,He.bindAll=nc,He.bindKey=Iu,He.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Uu(n)?n:[n]},He.chain=hu,He.chunk=function(n,t,r){t=(r?_i(n,t,r):t===e)?1:we(pa(t),0);var o=null==n?0:n.length;if(!o||t<1)return[];for(var i=0,u=0,a=an(gt(o/t));i<o;)a[u++]=oo(n,i,i+=t);return a},He.compact=function(n){for(var t=-1,e=null==n?0:n.length,r=0,o=[];++t<e;){var i=n[t];i&&(o[r++]=i)}return o},He.concat=function(){var n=arguments.length;if(!n)return[];for(var t=an(n-1),e=arguments[0],r=n;r--;)t[r-1]=arguments[r];return Tt(Uu(e)?Io(e):[e],mr(t,1))},He.cond=function(n){var t=null==n?0:n.length,e=si();return n=t?Lt(n,(function(n){if("function"!=typeof n[1])throw new In(r);return[e(n[0]),n[1]]})):[],Kr((function(e){for(var r=-1;++r<t;){var o=n[r];if(Nt(o[0],this,e))return Nt(o[1],this,e)}}))},He.conforms=function(n){return function(n){var t=Pa(n);return function(e){return sr(e,n,t)}}(lr(n,1))},He.constant=tc,He.countBy=gu,He.create=function(n,t){var e=Ye(n);return null==t?e:ir(e,t)},He.curry=function n(t,r,o){var i=Jo(t,8,e,e,e,e,e,r=o?e:r);return i.placeholder=n.placeholder,i},He.curryRight=function n(t,r,o){var i=Jo(t,u,e,e,e,e,e,r=o?e:r);return i.placeholder=n.placeholder,i},He.debounce=Pu,He.defaults=ka,He.defaultsDeep=Ca,He.defer=Au,He.delay=zu,He.difference=Hi,He.differenceBy=Yi,He.differenceWith=Zi,He.drop=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,(t=r||t===e?1:pa(t))<0?0:t,o):[]},He.dropRight=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,0,(t=o-(t=r||t===e?1:pa(t)))<0?0:t):[]},He.dropRightWhile=function(n,t){return n&&n.length?po(n,si(t,3),!0,!0):[]},He.dropWhile=function(n,t){return n&&n.length?po(n,si(t,3),!0):[]},He.fill=function(n,t,r,o){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&_i(n,t,r)&&(r=0,o=i),function(n,t,r,o){var i=n.length;for((r=pa(r))<0&&(r=-r>i?0:i+r),(o=o===e||o>i?i:pa(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)n[r++]=t;return n}(n,t,r,o)):[]},He.filter=function(n,t){return(Uu(n)?Pt:yr)(n,si(t,3))},He.flatMap=function(n,t){return mr(Su(n,t),1)},He.flatMapDeep=function(n,t){return mr(Su(n,t),f)},He.flatMapDepth=function(n,t,r){return r=r===e?1:pa(r),mr(Su(n,t),r)},He.flatten=Fi,He.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,f):[]},He.flattenDepth=function(n,t){return(null==n?0:n.length)?mr(n,t=t===e?1:pa(t)):[]},He.flip=function(n){return Jo(n,512)},He.flow=ec,He.flowRight=rc,He.fromPairs=function(n){for(var t=-1,e=null==n?0:n.length,r={};++t<e;){var o=n[t];r[o[0]]=o[1]}return r},He.functions=function(n){return null==n?[]:Er(n,Pa(n))},He.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},He.groupBy=_u,He.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},He.intersection=$i,He.intersectionBy=Gi,He.intersectionWith=qi,He.invert=Oa,He.invertBy=ja,He.invokeMap=xu,He.iteratee=ic,He.keyBy=Eu,He.keys=Pa,He.keysIn=Aa,He.map=Su,He.mapKeys=function(n,t){var e={};return t=si(t,3),_r(n,(function(n,r,o){ur(e,t(n,r,o),n)})),e},He.mapValues=function(n,t){var e={};return t=si(t,3),_r(n,(function(n,r,o){ur(e,r,t(n,r,o))})),e},He.matches=function(n){return Hr(lr(n,1))},He.matchesProperty=function(n,t){return Yr(n,lr(t,1))},He.memoize=Lu,He.merge=za,He.mergeWith=La,He.method=uc,He.methodOf=ac,He.mixin=cc,He.negate=Tu,He.nthArg=function(n){return n=pa(n),Kr((function(t){return Xr(t,n)}))},He.omit=Ta,He.omitBy=function(n,t){return Da(n,Tu(si(t)))},He.once=function(n){return Ou(2,n)},He.orderBy=function(n,t,r,o){return null==n?[]:(Uu(t)||(t=null==t?[]:[t]),Uu(r=o?e:r)||(r=null==r?[]:[r]),Ur(n,t,r))},He.over=sc,He.overArgs=Bu,He.overEvery=fc,He.overSome=dc,He.partial=Du,He.partialRight=Ru,He.partition=ku,He.pick=Ba,He.pickBy=Da,He.property=hc,He.propertyOf=function(n){return function(t){return null==n?e:Sr(n,t)}},He.pull=Qi,He.pullAll=Ji,He.pullAllBy=function(n,t,e){return n&&n.length&&t&&t.length?Wr(n,t,si(e,2)):n},He.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Wr(n,t,e,r):n},He.pullAt=nu,He.range=vc,He.rangeRight=pc,He.rearg=Vu,He.reject=function(n,t){return(Uu(n)?Pt:yr)(n,Tu(si(t,3)))},He.remove=function(n,t){var e=[];if(!n||!n.length)return e;var r=-1,o=[],i=n.length;for(t=si(t,3);++r<i;){var u=n[r];t(u,r,n)&&(e.push(u),o.push(r))}return $r(n,o),e},He.rest=function(n,t){if("function"!=typeof n)throw new In(r);return Kr(n,t=t===e?t:pa(t))},He.reverse=tu,He.sampleSize=function(n,t,r){return t=(r?_i(n,t,r):t===e)?1:pa(t),(Uu(n)?Je:Jr)(n,t)},He.set=function(n,t,e){return null==n?n:no(n,t,e)},He.setWith=function(n,t,r,o){return o="function"==typeof o?o:e,null==n?n:no(n,t,r,o)},He.shuffle=function(n){return(Uu(n)?nr:ro)(n)},He.slice=function(n,t,r){var o=null==n?0:n.length;return o?(r&&"number"!=typeof r&&_i(n,t,r)?(t=0,r=o):(t=null==t?0:pa(t),r=r===e?o:pa(r)),oo(n,t,r)):[]},He.sortBy=Cu,He.sortedUniq=function(n){return n&&n.length?co(n):[]},He.sortedUniqBy=function(n,t){return n&&n.length?co(n,si(t,2)):[]},He.split=function(n,t,r){return r&&"number"!=typeof r&&_i(n,t,r)&&(t=r=e),(r=r===e?v:r>>>0)?(n=wa(n))&&("string"==typeof t||null!=t&&!ua(t))&&!(t=so(t))&&ae(n)?Eo(ve(n),0,r):n.split(t,r):[]},He.spread=function(n,t){if("function"!=typeof n)throw new In(r);return t=null==t?0:we(pa(t),0),Kr((function(e){var r=e[t],o=Eo(e,0,t);return r&&Tt(o,r),Nt(n,this,o)}))},He.tail=function(n){var t=null==n?0:n.length;return t?oo(n,1,t):[]},He.take=function(n,t,r){return n&&n.length?oo(n,0,(t=r||t===e?1:pa(t))<0?0:t):[]},He.takeRight=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,(t=o-(t=r||t===e?1:pa(t)))<0?0:t,o):[]},He.takeRightWhile=function(n,t){return n&&n.length?po(n,si(t,3),!1,!0):[]},He.takeWhile=function(n,t){return n&&n.length?po(n,si(t,3)):[]},He.tap=function(n,t){return t(n),n},He.throttle=function(n,t,e){var o=!0,i=!0;if("function"!=typeof n)throw new In(r);return ta(e)&&(o="leading"in e?!!e.leading:o,i="trailing"in e?!!e.trailing:i),Pu(n,t,{leading:o,maxWait:t,trailing:i})},He.thru=vu,He.toArray=ha,He.toPairs=Ra,He.toPairsIn=Va,He.toPath=function(n){return Uu(n)?Lt(n,Di):la(n)?[n]:Io(Bi(wa(n)))},He.toPlainObject=ma,He.transform=function(n,t,e){var r=Uu(n),o=r||Gu(n)||sa(n);if(t=si(t,4),null==e){var i=n&&n.constructor;e=o?r?new i:[]:ta(n)&&Qu(i)?Ye($n(n)):{}}return(o?Ot:_r)(n,(function(n,r,o){return t(e,n,r,o)})),e},He.unary=function(n){return Mu(n,1)},He.union=eu,He.unionBy=ru,He.unionWith=ou,He.uniq=function(n){return n&&n.length?fo(n):[]},He.uniqBy=function(n,t){return n&&n.length?fo(n,si(t,2)):[]},He.uniqWith=function(n,t){return t="function"==typeof t?t:e,n&&n.length?fo(n,e,t):[]},He.unset=function(n,t){return null==n||ho(n,t)},He.unzip=iu,He.unzipWith=uu,He.update=function(n,t,e){return null==n?n:vo(n,t,bo(e))},He.updateWith=function(n,t,r,o){return o="function"==typeof o?o:e,null==n?n:vo(n,t,bo(r),o)},He.values=Ha,He.valuesIn=function(n){return null==n?[]:ne(n,Aa(n))},He.without=au,He.words=Qa,He.wrap=function(n,t){return Du(bo(t),n)},He.xor=cu,He.xorBy=lu,He.xorWith=su,He.zip=fu,He.zipObject=function(n,t){return mo(n||[],t||[],er)},He.zipObjectDeep=function(n,t){return mo(n||[],t||[],no)},He.zipWith=du,He.entries=Ra,He.entriesIn=Va,He.extend=_a,He.extendWith=xa,cc(He,He),He.add=mc,He.attempt=Ja,He.camelCase=Ya,He.capitalize=Za,He.ceil=wc,He.clamp=function(n,t,r){return r===e&&(r=t,t=e),r!==e&&(r=(r=ya(r))==r?r:0),t!==e&&(t=(t=ya(t))==t?t:0),cr(ya(n),t,r)},He.clone=function(n){return lr(n,4)},He.cloneDeep=function(n){return lr(n,5)},He.cloneDeepWith=function(n,t){return lr(n,5,t="function"==typeof t?t:e)},He.cloneWith=function(n,t){return lr(n,4,t="function"==typeof t?t:e)},He.conformsTo=function(n,t){return null==t||sr(n,t,Pa(t))},He.deburr=Xa,He.defaultTo=function(n,t){return null==n||n!=n?t:n},He.divide=bc,He.endsWith=function(n,t,r){n=wa(n),t=so(t);var o=n.length,i=r=r===e?o:cr(pa(r),0,o);return(r-=t.length)>=0&&n.slice(r,i)==t},He.eq=Hu,He.escape=function(n){return(n=wa(n))&&q.test(n)?n.replace($,ie):n},He.escapeRegExp=function(n){return(n=wa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},He.every=function(n,t,r){var o=Uu(n)?It:pr;return r&&_i(n,t,r)&&(t=e),o(n,si(t,3))},He.find=yu,He.findIndex=Xi,He.findKey=function(n,t){return Ht(n,si(t,3),_r)},He.findLast=mu,He.findLastIndex=Ui,He.findLastKey=function(n,t){return Ht(n,si(t,3),xr)},He.floor=_c,He.forEach=wu,He.forEachRight=bu,He.forIn=function(n,t){return null==n?n:wr(n,si(t,3),Aa)},He.forInRight=function(n,t){return null==n?n:br(n,si(t,3),Aa)},He.forOwn=function(n,t){return n&&_r(n,si(t,3))},He.forOwnRight=function(n,t){return n&&xr(n,si(t,3))},He.get=Na,He.gt=Yu,He.gte=Zu,He.has=function(n,t){return null!=n&&yi(n,t,Mr)},He.hasIn=Ma,He.head=Wi,He.identity=oc,He.includes=function(n,t,e,r){n=Wu(n)?n:Ha(n),e=e&&!r?pa(e):0;var o=n.length;return e<0&&(e=we(o+e,0)),ca(n)?e<=o&&n.indexOf(t,e)>-1:!!o&&Zt(n,t,e)>-1},He.indexOf=function(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var o=null==e?0:pa(e);return o<0&&(o=we(r+o,0)),Zt(n,t,o)},He.inRange=function(n,t,r){return t=va(t),r===e?(r=t,t=0):r=va(r),function(n,t,e){return n>=be(t,e)&&n<we(t,e)}(n=ya(n),t,r)},He.invoke=Ia,He.isArguments=Xu,He.isArray=Uu,He.isArrayBuffer=Fu,He.isArrayLike=Wu,He.isArrayLikeObject=$u,He.isBoolean=function(n){return!0===n||!1===n||ea(n)&&Cr(n)==m},He.isBuffer=Gu,He.isDate=qu,He.isElement=function(n){return ea(n)&&1===n.nodeType&&!ia(n)},He.isEmpty=function(n){if(null==n)return!0;if(Wu(n)&&(Uu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Xu(n)))return!n.length;var t=gi(n);if(t==S||t==O)return!n.size;if(ki(n))return!Br(n).length;for(var e in n)if(Bn.call(n,e))return!1;return!0},He.isEqual=function(n,t){return Ar(n,t)},He.isEqualWith=function(n,t,r){var o=(r="function"==typeof r?r:e)?r(n,t):e;return o===e?Ar(n,t,e,r):!!o},He.isError=Ku,He.isFinite=function(n){return"number"==typeof n&&Vt(n)},He.isFunction=Qu,He.isInteger=Ju,He.isLength=na,He.isMap=ra,He.isMatch=function(n,t){return n===t||zr(n,t,di(t))},He.isMatchWith=function(n,t,r){return r="function"==typeof r?r:e,zr(n,t,di(t),r)},He.isNaN=function(n){return oa(n)&&n!=+n},He.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},He.isNil=function(n){return null==n},He.isNull=function(n){return null===n},He.isNumber=oa,He.isObject=ta,He.isObjectLike=ea,He.isPlainObject=ia,He.isRegExp=ua,He.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=d},He.isSet=aa,He.isString=ca,He.isSymbol=la,He.isTypedArray=sa,He.isUndefined=function(n){return n===e},He.isWeakMap=function(n){return ea(n)&&gi(n)==P},He.isWeakSet=function(n){return ea(n)&&"[object WeakSet]"==Cr(n)},He.join=function(n,t){return null==n?"":$t.call(n,t)},He.kebabCase=Ua,He.last=Ki,He.lastIndexOf=function(n,t,r){var o=null==n?0:n.length;if(!o)return-1;var i=o;return r!==e&&(i=(i=pa(r))<0?we(o+i,0):be(i,o-1)),t==t?function(n,t,e){for(var r=e+1;r--;)if(n[r]===t)return r;return r}(n,t,i):Yt(n,Ut,i,!0)},He.lowerCase=Fa,He.lowerFirst=Wa,He.lt=fa,He.lte=da,He.max=function(n){return n&&n.length?gr(n,oc,Nr):e},He.maxBy=function(n,t){return n&&n.length?gr(n,si(t,2),Nr):e},He.mean=function(n){return Ft(n,oc)},He.meanBy=function(n,t){return Ft(n,si(t,2))},He.min=function(n){return n&&n.length?gr(n,oc,Rr):e},He.minBy=function(n,t){return n&&n.length?gr(n,si(t,2),Rr):e},He.stubArray=gc,He.stubFalse=yc,He.stubObject=function(){return{}},He.stubString=function(){return""},He.stubTrue=function(){return!0},He.multiply=Ec,He.nth=function(n,t){return n&&n.length?Xr(n,pa(t)):e},He.noConflict=function(){return pt._===this&&(pt._=Yn),this},He.noop=lc,He.now=Nu,He.pad=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;if(!t||r>=t)return n;var o=(t-r)/2;return Fo(yt(o),e)+n+Fo(gt(o),e)},He.padEnd=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;return t&&r<t?n+Fo(t-r,e):n},He.padStart=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;return t&&r<t?Fo(t-r,e)+n:n},He.parseInt=function(n,t,e){return e||null==t?t=0:t&&(t=+t),xe(wa(n).replace(un,""),t||0)},He.random=function(n,t,r){if(r&&"boolean"!=typeof r&&_i(n,t,r)&&(t=r=e),r===e&&("boolean"==typeof t?(r=t,t=e):"boolean"==typeof n&&(r=n,n=e)),n===e&&t===e?(n=0,t=1):(n=va(n),t===e?(t=n,n=0):t=va(t)),n>t){var o=n;n=t,t=o}if(r||n%1||t%1){var i=Ee();return be(n+i*(t-n+ft("1e-"+((i+"").length-1))),t)}return Gr(n,t)},He.reduce=function(n,t,e){var r=Uu(n)?Bt:Gt,o=arguments.length<3;return r(n,si(t,4),e,o,hr)},He.reduceRight=function(n,t,e){var r=Uu(n)?Dt:Gt,o=arguments.length<3;return r(n,si(t,4),e,o,vr)},He.repeat=function(n,t,r){return t=(r?_i(n,t,r):t===e)?1:pa(t),qr(wa(n),t)},He.replace=function(){var n=arguments,t=wa(n[0]);return n.length<3?t:t.replace(n[1],n[2])},He.result=function(n,t,r){var o=-1,i=(t=_o(t,n)).length;for(i||(i=1,n=e);++o<i;){var u=null==n?e:n[Di(t[o])];u===e&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},He.round=Sc,He.runInContext=n,He.sample=function(n){return(Uu(n)?Qe:Qr)(n)},He.size=function(n){if(null==n)return 0;if(Wu(n))return ca(n)?he(n):n.length;var t=gi(n);return t==S||t==O?n.size:Br(n).length},He.snakeCase=$a,He.some=function(n,t,r){var o=Uu(n)?Rt:io;return r&&_i(n,t,r)&&(t=e),o(n,si(t,3))},He.sortedIndex=function(n,t){return uo(n,t)},He.sortedIndexBy=function(n,t,e){return ao(n,t,si(e,2))},He.sortedIndexOf=function(n,t){var e=null==n?0:n.length;if(e){var r=uo(n,t);if(r<e&&Hu(n[r],t))return r}return-1},He.sortedLastIndex=function(n,t){return uo(n,t,!0)},He.sortedLastIndexBy=function(n,t,e){return ao(n,t,si(e,2),!0)},He.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var e=uo(n,t,!0)-1;if(Hu(n[e],t))return e}return-1},He.startCase=Ga,He.startsWith=function(n,t,e){return n=wa(n),e=null==e?0:cr(pa(e),0,n.length),t=so(t),n.slice(e,e+t.length)==t},He.subtract=kc,He.sum=function(n){return n&&n.length?qt(n,oc):0},He.sumBy=function(n,t){return n&&n.length?qt(n,si(t,2)):0},He.template=function(n,t,r){var o=He.templateSettings;r&&_i(n,t,r)&&(t=e),n=wa(n),t=xa({},t,o,ni);var i,u,a=xa({},t.imports,o.imports,ni),c=Pa(a),l=ne(a,c),s=0,f=t.interpolate||xn,d="__p += '",h=On((t.escape||xn).source+"|"+f.source+"|"+(f===J?vn:xn).source+"|"+(t.evaluate||xn).source+"|$","g"),v="//# sourceURL="+(Bn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";n.replace(h,(function(t,e,r,o,a,c){return r||(r=o),d+=n.slice(s,c).replace(En,ue),e&&(i=!0,d+="' +\n__e("+e+") +\n'"),a&&(u=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t})),d+="';\n";var p=Bn.call(t,"variable")&&t.variable;if(p){if(dn.test(p))throw new kn("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(u?d.replace(X,""):d).replace(U,"$1").replace(F,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Cn(c,v+"return "+d).apply(e,l)}));if(g.source=d,Ku(g))throw g;return g},He.times=function(n,t){if((n=pa(n))<1||n>d)return[];var e=v,r=be(n,v);t=si(t),n-=v;for(var o=Kt(r,t);++e<n;)t(e);return o},He.toFinite=va,He.toInteger=pa,He.toLength=ga,He.toLower=function(n){return wa(n).toLowerCase()},He.toNumber=ya,He.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,d):0===n?n:0},He.toString=wa,He.toUpper=function(n){return wa(n).toUpperCase()},He.trim=function(n,t,r){if((n=wa(n))&&(r||t===e))return Qt(n);if(!n||!(t=so(t)))return n;var o=ve(n),i=ve(t);return Eo(o,ee(o,i),re(o,i)+1).join("")},He.trimEnd=function(n,t,r){if((n=wa(n))&&(r||t===e))return n.slice(0,pe(n)+1);if(!n||!(t=so(t)))return n;var o=ve(n);return Eo(o,0,re(o,ve(t))+1).join("")},He.trimStart=function(n,t,r){if((n=wa(n))&&(r||t===e))return n.replace(un,"");if(!n||!(t=so(t)))return n;var o=ve(n);return Eo(o,ee(o,ve(t))).join("")},He.truncate=function(n,t){var r=30,o="...";if(ta(t)){var i="separator"in t?t.separator:i;r="length"in t?pa(t.length):r,o="omission"in t?so(t.omission):o}var u=(n=wa(n)).length;if(ae(n)){var a=ve(n);u=a.length}if(r>=u)return n;var c=r-he(o);if(c<1)return o;var l=a?Eo(a,0,c).join(""):n.slice(0,c);if(i===e)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===e?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},He.unescape=function(n){return(n=wa(n))&&G.test(n)?n.replace(W,ge):n},He.uniqueId=function(n){var t=++Dn;return wa(n)+t},He.upperCase=qa,He.upperFirst=Ka,He.each=wu,He.eachRight=bu,He.first=Wi,cc(He,(xc={},_r(He,(function(n,t){Bn.call(He.prototype,t)||(xc[t]=n)})),xc),{chain:!1}),He.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){He[n].placeholder=He})),Ot(["drop","take"],(function(n,t){Ue.prototype[n]=function(r){r=r===e?1:we(pa(r),0);var o=this.__filtered__&&!t?new Ue(this):this.clone();return o.__filtered__?o.__takeCount__=be(r,o.__takeCount__):o.__views__.push({size:be(r,v),type:n+(o.__dir__<0?"Right":"")}),o},Ue.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(n,t){var e=t+1,r=1==e||3==e;Ue.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:si(n,3),type:e}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(n,t){var e="take"+(t?"Right":"");Ue.prototype[n]=function(){return this[e](1).value()[0]}})),Ot(["initial","tail"],(function(n,t){var e="drop"+(t?"":"Right");Ue.prototype[n]=function(){return this.__filtered__?new Ue(this):this[e](1)}})),Ue.prototype.compact=function(){return this.filter(oc)},Ue.prototype.find=function(n){return this.filter(n).head()},Ue.prototype.findLast=function(n){return this.reverse().find(n)},Ue.prototype.invokeMap=Kr((function(n,t){return"function"==typeof n?new Ue(this):this.map((function(e){return Ir(e,n,t)}))})),Ue.prototype.reject=function(n){return this.filter(Tu(si(n)))},Ue.prototype.slice=function(n,t){n=pa(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ue(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==e&&(r=(t=pa(t))<0?r.dropRight(-t):r.take(t-n)),r)},Ue.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ue.prototype.toArray=function(){return this.take(v)},_r(Ue.prototype,(function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=He[o?"take"+("last"==t?"Right":""):t],u=o||/^find/.test(t);i&&(He.prototype[t]=function(){var t=this.__wrapped__,a=o?[1]:arguments,c=t instanceof Ue,l=a[0],s=c||Uu(t),f=function(n){var t=i.apply(He,Tt([n],a));return o&&d?t[0]:t};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){t=p?t:new Ue(this);var g=n.apply(t,a);return g.__actions__.push({func:vu,args:[f],thisArg:e}),new Xe(g,d)}return v&&p?n.apply(this,a):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(n){var t=Pn[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);He.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Uu(o)?o:[],n)}return this[e]((function(e){return t.apply(Uu(e)?e:[],n)}))}})),_r(Ue.prototype,(function(n,t){var e=He[t];if(e){var r=e.name+"";Bn.call(Pe,r)||(Pe[r]=[]),Pe[r].push({name:t,func:e})}})),Pe[Yo(e,2).name]=[{name:"wrapper",func:e}],Ue.prototype.clone=function(){var n=new Ue(this.__wrapped__);return n.__actions__=Io(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Io(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Io(this.__views__),n},Ue.prototype.reverse=function(){if(this.__filtered__){var n=new Ue(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ue.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,e=Uu(n),r=t<0,o=e?n.length:0,i=function(n,t,e){var r=-1,o=e.length;for(;++r<o;){var i=e[r],u=i.size;switch(i.type){case"drop":n+=u;break;case"dropRight":t-=u;break;case"take":t=be(t,n+u);break;case"takeRight":n=we(n,t-u)}}return{start:n,end:t}}(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=be(c,this.__takeCount__);if(!e||!r&&o==c&&h==c)return go(n,this.__actions__);var v=[];n:for(;c--&&d<h;){for(var p=-1,g=n[l+=t];++p<f;){var y=s[p],m=y.iteratee,w=y.type,b=m(g);if(2==w)g=b;else if(!b){if(1==w)continue n;break n}}v[d++]=g}return v},He.prototype.at=pu,He.prototype.chain=function(){return hu(this)},He.prototype.commit=function(){return new Xe(this.value(),this.__chain__)},He.prototype.next=function(){this.__values__===e&&(this.__values__=ha(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?e:this.__values__[this.__index__++]}},He.prototype.plant=function(n){for(var t,r=this;r instanceof Ze;){var o=Vi(r);o.__index__=0,o.__values__=e,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,t},He.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ue){var t=n;return this.__actions__.length&&(t=new Ue(this)),(t=t.reverse()).__actions__.push({func:vu,args:[tu],thisArg:e}),new Xe(t,this.__chain__)}return this.thru(tu)},He.prototype.toJSON=He.prototype.valueOf=He.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},He.prototype.first=He.prototype.head,Jn&&(He.prototype[Jn]=function(){return this}),He}();yt?((yt.exports=ye)._=ye,gt._=ye):pt._=ye}).call(w)}(lE,lE.exports);var sE=b(lE.exports);function fE(n){var t=n.layoutTypes,e=n.layoutConfig,r=void 0===e?uE:e,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=t[null==r?void 0:r.type]||cE[null==r?void 0:r.type];return function(n){return n.every((function(n){var t,e;return(null===(t=n.measured)||void 0===t?void 0:t.width)&&(null===(e=n.measured)||void 0===e?void 0:e.height)}))}(u)&&c?function(n){var t=n.layoutConfig,e=void 0===t?uE:t,r=n.edges,o=n.nodeOrigin,i=n.nodes,u=n.container,a=n.layoutFn,c=sE.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==e?void 0:e.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 dE(n){var t=n.centerConfig,e=n.width,r=n.height,o=n.transform,i=n.panZoom,u=n.nodeOrigin,a=n.nodes;if(t&&i){var c=a.find((function(n){return n.id===t.centerNodeId}));return c?(function(n){var t=n.node,e=n.height,r=n.width,o=n.zoom,i=void 0===o?1:o,u=n.panZoom,a=n.nodeOrigin,c=zb(t),l=Mb(t,a).positionAbsolute,s={x:r/2-(l.x+c.width/2)*i,y:e/2-(l.y+c.height/2)*i};u.setViewport({x:s.x,y:s.y,zoom:i})}({node:c,width:e,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0):(t.centerByBBox&&function(n){var t=n.nodes,e=n.nodeOrigin,r=n.height,o=n.width,i=n.zoom,u=void 0===i?1:i,a=n.panZoom,c=m_(t,{nodeOrigin:e}),l={x:o/2-(c.x+c.width/2)*u,y:r/2-(c.y+c.height/2)*u};a.setViewport({x:l.x,y:l.y,zoom:u})}({nodes:a,width:e,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var hE=function(n){var t,e,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return t=function(n,t){return d(d({},aE({nodes:r,edges:o,width:a,height:c,fitView:l,defaultNodes:i,defaultEdges:u})),{setNodes:function(t){n({nodes:t})},setEdges:function(t){n({edges:t})},setDefaultNodesAndEdges:function(e,r){e&&((0,t().onNodesChange)({changes:[],userNodes:e}),n({hasDefaultNodes:!0})),r&&((0,t().onEdgesChange)({userEdges:r}),n({hasDefaultEdges:!0}))},updateNodeInternals:function(e){var r=t(),o=r.triggerNodeChanges,i=r.nodeLookup,u=r.parentLookup,a=r.domNode,c=r.nodeOrigin,l=r.debug,s=function(n,t,e,r,o){var i=null==r?void 0:r.querySelector(".xyflow__viewport"),u=!1;if(!i)return{changes:[],updatedInternals:u};var a=[],c=window.getComputedStyle(i),l=new window.DOMMatrixReadOnly(c.transform).m22,s=[];if(n.forEach((function(n){var e=t.get(n.id);if(null==e?void 0:e.hidden)t.set(e.id,d(d({},e),{internals:d(d({},e.internals),{handleBounds:void 0})})),u=!0;else if(e){var r=qb(n.nodeElement),i=e.measured.width!==r.width||e.measured.height!==r.height;if(r.width&&r.height&&(i||!e.internals.handleBounds||n.force)){var c=d(d({},e),{measured:r,internals:d(d({},e.internals),{handleBounds:{source:t_(".source",n.nodeElement,l,e.origin||o),target:t_(".target",n.nodeElement,l,e.origin||o)}})});t.set(e.id,c),u=!0,i&&(a.push({id:c.id,type:"dimensions",dimensions:r}),c.expandParent&&c.parentId&&s.push({id:c.id,parentId:c.parentId,rect:Db(c,c.origin||o)}))}}})),s.length>0){var f=Ib(s,t,e,o);a.push.apply(a,m([],y(f),!1))}return{changes:a,updatedInternals:u}}(e,i,u,a,c),f=s.changes;if(s.updatedInternals){var h=sE.cloneDeep(i);n({nodeLookup:h}),Cb(i,{nodeOrigin:c}),(null==f?void 0:f.length)>0&&(l&&console.log("Ink Flow: trigger node changes",f),null==o||o(f))}},updateNodePositions:function(n,e){var r,o;void 0===e&&(e=!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:e};(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=t(),p=Ib(i,v.nodeLookup,v.parentLookup);u.push.apply(u,m([],y(p),!1))}t().triggerNodeChanges(u)},triggerNodeChanges:function(n){var e=t(),r=e.onNodesChange,o=e.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger node changes",n),r({changes:n}))},triggerEdgeChanges:function(n){var e=t(),r=e.onEdgesChange,o=e.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 e=t(),r=e.multiSelectionActive,o=e.edgeLookup,i=e.nodeLookup,u=e.triggerNodeChanges,a=e.triggerEdgeChanges;r?u(n.map((function(n){return h_(n,!0)}))):(u(v_(i,new Set(m([],y(n),!1)),!0)),a(v_(o)))},addSelectedEdges:function(n){var e=t(),r=e.multiSelectionActive,o=e.edgeLookup,i=e.nodeLookup,u=e.triggerNodeChanges,a=e.triggerEdgeChanges;r?a(n.map((function(n){return h_(n,!0)}))):(a(v_(o,new Set(m([],y(n),!1)))),u(v_(i,new Set,!0)))},unselectNodesAndEdges:function(n){var e=void 0===n?{}:n,r=e.nodes,o=e.edges,i=t(),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,h_(n.id,!1)})),d=s.map((function(n){return h_(n.id,!1)}));c(f),l(d)},setMinZoom:function(e){var r=t(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([e,i]),n({minZoom:e})},setMaxZoom:function(e){var r=t(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,e]),n({maxZoom:e})},setTranslateExtent:function(e){var r;null===(r=t().panZoom)||void 0===r||r.setTranslateExtent(e),n({translateExtent:e})},resetSelectedElements:function(){var n=t(),e=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,u=r.reduce((function(n,t){return t.selected?m(m([],y(n),!1),[h_(t.id,!1)],!1):n}),[]),a=e.reduce((function(n,t){return t.selected?m(m([],y(n),!1),[h_(t.id,!1)],!1):n}),[]);o(u),i(a)},setNodeExtent:function(e){var r,o,i=t().nodeLookup;try{for(var u=g(i),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=Ab(c.position,e);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:e})},panBy:function(n){var e=t(),r=e.transform,o=e.width,i=e.height;return function(n){var t=n.delta,e=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,u=n.height;if(!e||!t.x&&!t.y)return!1;var a=e.setViewportConstrained({x:r[0]+t.x,y:r[1]+t.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:e.panZoom,transform:r,translateExtent:e.translateExtent,width:o,height:i})},cancelConnection:function(){return n({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(e){var r,o=t().connectionPosition,i=d(d({},e),{connectionPosition:null!==(r=e.connectionPosition)&&void 0!==r?r:o});n(i)},reset:function(){return n(d({},aE()))},updateLayout:function(e){var r,o=e.config,i=e.nodes,u=e.force,a=t(),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,b=a.minZoom,_=a.maxZoom,x=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,N=a.centered,M=fE({container:{width:c,height:l},edges:s,nodes:i||Array.from(p.values()),nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||uE});if(M.layoutComplete&&(jb(M.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:M.layoutComplete}),h&&M.layoutComplete&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values()))&&(u||!(k||N||C))))if(d.offsetConfig){var O=function(n){var t=n.offsetConfig,e=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==t?void 0:t.nodeId)}));if(!a||!c)return!1;var l=y_(c,i).positionAbsolute,s=zb(c),f=e/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-t.offset-s.height};break;case"LR":h={x:t.offset-l.x,y:d-l.y-s.height/2};break;case"RL":h={x:e-l.x-t.offset-s.width,y:d-l.y-s.height/2};break;default:h={x:f-l.x-s.width/2,y:t.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:O})}else{if(w)return b_({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:w,minZoom:b,maxZoom:_,fitViewOnInitOptions:x,nodeLookup:p}),void n({fitViewDone:!0});S&&(dE({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}},onNodesChange:function(n){var e=n.changes,r=n.userNodes;if(e||r){var o=t(),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==e?void 0:e.length),p=[];if(p=v?(r||[]).map((function(n){var t=u.get(n.id),e=d(d({},t||{}),n);return(null==t?void 0:t.position)&&(e.position=t.position),e})):function(n,t){return d_(n,t)}(e,Array.from(u.values())),v||!function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(e)||!f)return jb(p,u,a,{nodeOrigin:l,elevateNodesOnSelect:c,checkEquality:!0}),void i(v?r||[]:null!=r?r:s);h({nodes:p})}},onEdgesChange:function(n){var e=n.changes,r=void 0===e?[]:e,o=n.userEdges,i=t(),u=i.connectionLookup,a=i.edgeLookup,c=i.setEdges,l=i.edges,s=!(null==r?void 0:r.length),f=[];f=s?o.map((function(n){var t=a.get(n.id)||{};return d(d({},t),n)})):function(n,t){return d_(n,t)}(r,Array.from(a.values())),Ob(u,a,f),o&&c(s?o||[]:l)},updateLayoutConfig:function(e){var r=t(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;sE.isEqual(e,u)||(n({layoutConfig:e}),o&&i({config:e,force:!0}))}})},e=Object.is,t?Y(t,e):Y};function vE(n){var t=n.initialNodes,e=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 hE({nodes:t,edges:e,defaultNodes:r,defaultEdges:o,width:u,height:a,fitView:c})})),1)[0];return k.jsx(X,{value:s,children:k.jsx(T_,{children:l})})}function pE(n){var t=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return e(Z)?k.jsx(k.Fragment,{children:t}):k.jsx(vE,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:t})}var gE=m(m([],y(["layoutConfig","nodes","edges","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions","nodeOrigin","autoLayout","centerConfig","layoutTypes"]),!1),["rfId"],!1),yE=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}},mE={translateExtent:Nv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wE(n){var t=Sb(yE,u_),e=t.setMinZoom,r=t.setMaxZoom,o=t.setTranslateExtent,i=t.setNodeExtent,c=t.reset,l=t.setDefaultNodesAndEdges,s=t.onNodesChange,f=t.onEdgesChange,h=t.updateLayoutConfig,v=kb();a((function(){return l(n.defaultNodes,n.defaultEdges),function(){p.current=mE,c()}}),[]);var p=u(mE);return a((function(){var t,u,a,c;try{for(var l=g(gE),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)e(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 b=w||{},_=d(d({},b),{options:d(d({},b.options||{}),{rankdir:(null===(c=b.options)||void 0===c?void 0:c.rankdir)||"TB"})});h(_)}else v.setState(((a={})[m]=w,a))}}catch(n){t={error:n}}finally{try{y&&!y.done&&(u=l.return)&&u.call(l)}finally{if(t)throw t.error}}p.current=n}),gE.map((function(t){return n[t]}))),null}var bE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var _E=Zb((function(n,t){var e=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?Nv:o,u=n.defaultViewport,a=void 0===u?iE: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=n.noPanClassName,w=n.disableKeyboardA11y,b=n.nodeTypes,_=n.edgeTypes;n.connectionMode;var x=n.connectionLineType,E=void 0===x?rp.Bezier:x,S=n.connectionLineStyle,C=n.connectionLineComponent,N=n.connectionLineContainerStyle,M=n.onNodeClick,O=n.onNodeDoubleClick,I=n.onNodeMouseEnter,P=n.onNodeMouseMove,A=n.onNodeMouseLeave,z=n.onNodeContextMenu,L=n.onEdgeClick,T=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,D=n.onEdgeMouseLeave,R=n.onEdgeContextMenu,V=n.onEdgeDoubleClick,H=n.fitView,Y=n.fitViewOptions,Z=n.nodeExtent,X=n.nodesDraggable,U=n.children,F=n.id,W=n.width,$=n.height,G=n.onPaneClick,q=n.onPaneContextMenu,K=n.onPaneMouseEnter,Q=n.onPaneMouseMove,J=n.onPaneMouseLeave,nn=n.onPaneScroll,tn=n.elementsSelectable,en=void 0===tn||tn,rn=n.autoLayout,on=void 0===rn||rn,un=n.layoutConfig,an=void 0===un?uE:un,cn=n.centerConfig,ln=void 0===cn?{}:cn,sn=n.layoutTypes,fn=void 0===sn?{}:sn,dn=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","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoLayout","layoutConfig","centerConfig","layoutTypes"]),hn=F||"1";return k.jsx("div",d({},dn,{ref:t,style:d({},bE),className:j(["ink-flow"]),"data-testid":"rf__wrapper",id:F,children:k.jsxs(pE,{nodes:e,edges:r,width:W,height:$,fitView:H,children:[k.jsx(oE,{onNodeClick:M,onNodeMouseEnter:I,onNodeMouseMove:P,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:O,onEdgeClick:L,onEdgeMouseEnter:T,onEdgeMouseMove:B,onEdgeMouseLeave:D,onEdgeContextMenu:R,onEdgeDoubleClick:V,rfId:hn,nodeTypes:b,edgeTypes:_,minZoom:l,maxZoom:f,nodeOrigin:g,noDragClassName:y,noPanClassName:m,disableKeyboardA11y:w,translateExtent:i,defaultMarkerColor:p,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:C,connectionLineContainerStyle:N,defaultViewport:a,onPaneClick:G,onPaneContextMenu:q,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:J,onPaneScroll:nn}),k.jsx(wE,{nodes:e,edges:r,rfId:hn,fitView:H,fitViewOptions:Y,nodeExtent:Z,nodesDraggable:X,elementsSelectable:en,minZoom:l,maxZoom:f,nodeOrigin:g,autoLayout:on,layoutConfig:an,layoutTypes:fn,centerConfig:ln}),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 EE(){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 SE(){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 kE(){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 CE(){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 NE(n){var t=n.children,e=n.className,r=h(n,["children","className"]);return k.jsx("button",d({type:"button",className:j(["ink-flow__controls-button",e])},r,{children:t}))}var ME=function(n){return n.userSelectionActive?"none":"all"};function OE(n){var t=n.position,e=void 0===t?"top-left":t,r=n.children,o=n.className,i=n.style,u=h(n,["position","children","className","style"]),a=Sb(ME),c="".concat(e).split("-");return k.jsx("div",d({className:j(m(["ink-flow__panel",o],y(c),!1)),style:d(d({},i),{pointerEvents:a})},u,{children:r}))}var jE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function IE(n){var t=n.style,e=n.showZoom,r=void 0===e||e,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"],b=void 0===w?"Ink Flow controls":w,_=kb(),x=Sb(jE,u_),E=x.isInteractive,S=x.minZoomReached,C=x.maxZoomReached,N=R_(),M=N.zoomIn,O=N.zoomOut,I=N.fitView,P="horizontal"===m?"horizontal":"vertical";return k.jsxs(OE,{className:j(["ink-flow__controls",P,h]),position:g,style:t,"data-testid":"rf__controls","aria-label":b,children:[i&&k.jsx(NE,{className:"ink-flow__controls-fitview",onClick:function(){I(c),null==f||f()},"aria-label":"fit view",children:k.jsx(SE,{})}),r&&k.jsxs("div",{className:"ink-flow__controls-zoom",children:[k.jsx(NE,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:C,children:k.jsx(xE,{})}),k.jsx(NE,{onClick:function(){O(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:S,children:k.jsx(EE,{})})]}),a&&k.jsx(NE,{className:"ink-flow__controls-interactive",onClick:function(){_.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==d||d(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?k.jsx(CE,{}):k.jsx(kE,{})}),v]})}IE.displayName="Controls";var PE,AE,zE=c(IE);function LE(n){var t=n.dimensions,e=n.lineWidth,r=n.variant,o=n.className;return k.jsx("path",{strokeWidth:e,d:"M".concat(t[0]/2," 0 V").concat(t[1]," M0 ").concat(t[1]/2," H").concat(t[0]),className:j(["react-flow__background-pattern",r,o])})}function TE(n){var t=n.radius,e=n.className;return k.jsx("circle",{cx:t,cy:t,r:t,className:j(["react-flow__background-pattern","dots",e])})}!function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"}(PE||(PE={}));var BE=((AE={})[PE.Dots]=1,AE[PE.Lines]=1,AE[PE.Cross]=6,AE),DE=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function RE(n){var t=n.id,e=n.variant,r=void 0===e?PE.Dots:e,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=Sb(DE,u_),b=w.transform,_=w.patternId,x=a||BE[r],E=r===PE.Dots,S=r===PE.Cross,C=Array.isArray(i)?i:[i,i],N=[C[0]*b[2]||1,C[1]*b[2]||1],M=x*b[2],O=S?[M,M]:N,I=E?[M/f,M/f]:[O[0]/f,O[1]/f],P="".concat(_).concat(t||"");return k.jsxs("svg",{className:j(["ink-flow__background",g]),style:d(d(d({},p),a_),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[k.jsx("pattern",{id:P,x:b[0]%N[0],y:b[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(I[0],",-").concat(I[1],")"),children:E?k.jsx(TE,{radius:M/f,className:y}):k.jsx(LE,{dimensions:O,lineWidth:l,variant:r,className:y})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(P,")")})]})}RE.displayName="Background";var VE=c(RE),HE=function(n){var t;return null===(t=n.domNode)||void 0===t?void 0:t.querySelector(".ink-flow__edgelabel-renderer")};function YE(n){var t=n.children,e=Sb(HE);return e?f(t,e):null}export{VE as Background,PE as BackgroundVariant,yx as BaseEdge,rp as ConnectionLineType,np as ConnectionMode,NE as ControlButton,zE as Controls,YE as EdgeLabelRenderer,tx as Handle,vE as InkFlowProvider,op as MarkerType,tp as PanOnScrollMode,ip as Position,ep as SelectionMode,Sx as SmoothStepEdge,Nx as StepEdge,vp as addEdge,_p as dagreLayout,_E as default,ap as getBezierEdgeCenter,sp as getBezierPath,Tv as getConnectedEdges,fp as getEdgeCenter,Av as getIncomers,Lv as getNodesBounds,Pv as getOutgoers,bp as getSmoothStepPath,gp as getStraightPath,$v as getViewportForBounds,pp as updateEdge,I_ as useEdgesState,R_ as useInkFlow,P_ as useNodesState,Sb as useStore,kb as useStoreApi};
17
25
  //# sourceMappingURL=index.esm.js.map