@aloudata/ink-flow 1.0.7 → 1.0.8

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 (191) hide show
  1. package/dist/components/A11yDescriptions/index.d.ts +8 -0
  2. package/dist/components/A11yDescriptions/index.d.ts.map +1 -0
  3. package/dist/components/BatchProvider/index.d.ts +17 -0
  4. package/dist/components/BatchProvider/index.d.ts.map +1 -0
  5. package/dist/components/BatchProvider/types.d.ts +7 -0
  6. package/dist/components/BatchProvider/types.d.ts.map +1 -0
  7. package/dist/components/BatchProvider/useQueue.d.ts +11 -0
  8. package/dist/components/BatchProvider/useQueue.d.ts.map +1 -0
  9. package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +17 -0
  10. package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -0
  11. package/dist/components/EdgeWrapper/index.d.ts +3 -0
  12. package/dist/components/EdgeWrapper/index.d.ts.map +1 -0
  13. package/dist/components/EdgeWrapper/utils.d.ts +11 -0
  14. package/dist/components/EdgeWrapper/utils.d.ts.map +1 -0
  15. package/dist/components/Edges/BaseEdge.d.ts +3 -0
  16. package/dist/components/Edges/BaseEdge.d.ts.map +1 -0
  17. package/dist/components/Edges/BezierEdge.d.ts +5 -0
  18. package/dist/components/Edges/BezierEdge.d.ts.map +1 -0
  19. package/dist/components/Edges/EdgeAnchor.d.ts +14 -0
  20. package/dist/components/Edges/EdgeAnchor.d.ts.map +1 -0
  21. package/dist/components/Edges/EdgeText.d.ts +8 -0
  22. package/dist/components/Edges/EdgeText.d.ts.map +1 -0
  23. package/dist/components/Edges/SimpleBezierEdge.d.ts +21 -0
  24. package/dist/components/Edges/SimpleBezierEdge.d.ts.map +1 -0
  25. package/dist/components/Edges/SmoothStepEdge.d.ts +5 -0
  26. package/dist/components/Edges/SmoothStepEdge.d.ts.map +1 -0
  27. package/dist/components/Edges/StepEdge.d.ts +5 -0
  28. package/dist/components/Edges/StepEdge.d.ts.map +1 -0
  29. package/dist/components/Edges/StraightEdge.d.ts +5 -0
  30. package/dist/components/Edges/StraightEdge.d.ts.map +1 -0
  31. package/dist/components/Edges/index.d.ts +6 -0
  32. package/dist/components/Edges/index.d.ts.map +1 -0
  33. package/dist/components/Handle/index.d.ts +11 -0
  34. package/dist/components/Handle/index.d.ts.map +1 -0
  35. package/dist/components/InkFlowProvider/index.d.ts +14 -0
  36. package/dist/components/InkFlowProvider/index.d.ts.map +1 -0
  37. package/dist/components/NodeWrapper/index.d.ts +3 -0
  38. package/dist/components/NodeWrapper/index.d.ts.map +1 -0
  39. package/dist/components/NodeWrapper/useNodeObserver.d.ts +14 -0
  40. package/dist/components/NodeWrapper/useNodeObserver.d.ts.map +1 -0
  41. package/dist/components/NodeWrapper/utils.d.ts +9 -0
  42. package/dist/components/NodeWrapper/utils.d.ts.map +1 -0
  43. package/dist/components/Nodes/DefaultNode.d.ts +3 -0
  44. package/dist/components/Nodes/DefaultNode.d.ts.map +1 -0
  45. package/dist/components/Nodes/GroupNode.d.ts +2 -0
  46. package/dist/components/Nodes/GroupNode.d.ts.map +1 -0
  47. package/dist/components/Nodes/InputNode.d.ts +3 -0
  48. package/dist/components/Nodes/InputNode.d.ts.map +1 -0
  49. package/dist/components/Nodes/OutputNode.d.ts +3 -0
  50. package/dist/components/Nodes/OutputNode.d.ts.map +1 -0
  51. package/dist/components/Nodes/utils.d.ts +13 -0
  52. package/dist/components/Nodes/utils.d.ts.map +1 -0
  53. package/dist/components/Panel/index.d.ts +11 -0
  54. package/dist/components/Panel/index.d.ts.map +1 -0
  55. package/dist/components/StoreUpdater/index.d.ts +9 -0
  56. package/dist/components/StoreUpdater/index.d.ts.map +1 -0
  57. package/dist/components/UserSelection/index.d.ts +2 -0
  58. package/dist/components/UserSelection/index.d.ts.map +1 -0
  59. package/dist/container/EdgeRenderer/MarkerDefinitions.d.ts +10 -0
  60. package/dist/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -0
  61. package/dist/container/EdgeRenderer/MarkerSymbols.d.ts +9 -0
  62. package/dist/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -0
  63. package/dist/container/EdgeRenderer/index.d.ts +13 -0
  64. package/dist/container/EdgeRenderer/index.d.ts.map +1 -0
  65. package/dist/container/FlowRenderer/index.d.ts +14 -0
  66. package/dist/container/FlowRenderer/index.d.ts.map +1 -0
  67. package/dist/container/GraphView/index.d.ts +11 -0
  68. package/dist/container/GraphView/index.d.ts.map +1 -0
  69. package/dist/container/InkFlow/Wrapper.d.ts +13 -0
  70. package/dist/container/InkFlow/Wrapper.d.ts.map +1 -0
  71. package/dist/container/InkFlow/index.d.ts +4 -0
  72. package/dist/container/InkFlow/index.d.ts.map +1 -0
  73. package/dist/container/InkFlow/init-values.d.ts +4 -0
  74. package/dist/container/InkFlow/init-values.d.ts.map +1 -0
  75. package/dist/container/NodeRenderer/index.d.ts +10 -0
  76. package/dist/container/NodeRenderer/index.d.ts.map +1 -0
  77. package/dist/container/NodeRenderer/useResizeObserver.d.ts +2 -0
  78. package/dist/container/NodeRenderer/useResizeObserver.d.ts.map +1 -0
  79. package/dist/container/Pane/index.d.ts +12 -0
  80. package/dist/container/Pane/index.d.ts.map +1 -0
  81. package/dist/container/Viewport/index.d.ts +7 -0
  82. package/dist/container/Viewport/index.d.ts.map +1 -0
  83. package/dist/container/ZoomPane/index.d.ts +7 -0
  84. package/dist/container/ZoomPane/index.d.ts.map +1 -0
  85. package/dist/contexts/NodeIdContext.d.ts +6 -0
  86. package/dist/contexts/NodeIdContext.d.ts.map +1 -0
  87. package/dist/contexts/StoreContext.d.ts +4 -0
  88. package/dist/contexts/StoreContext.d.ts.map +1 -0
  89. package/dist/hooks/index.d.ts +5 -0
  90. package/dist/hooks/index.d.ts.map +1 -0
  91. package/dist/hooks/useDrag.d.ts +12 -0
  92. package/dist/hooks/useDrag.d.ts.map +1 -0
  93. package/dist/hooks/useEdgesState.d.ts +4 -0
  94. package/dist/hooks/useEdgesState.d.ts.map +1 -0
  95. package/dist/hooks/useGlobalKeyHandler.d.ts +11 -0
  96. package/dist/hooks/useGlobalKeyHandler.d.ts.map +1 -0
  97. package/dist/hooks/useInkFlow.d.ts +10 -0
  98. package/dist/hooks/useInkFlow.d.ts.map +1 -0
  99. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  100. package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  101. package/dist/hooks/useKeyPress.d.ts +15 -0
  102. package/dist/hooks/useKeyPress.d.ts.map +1 -0
  103. package/dist/hooks/useMoveSelectedNodes.d.ts +12 -0
  104. package/dist/hooks/useMoveSelectedNodes.d.ts.map +1 -0
  105. package/dist/hooks/useNodesState.d.ts +4 -0
  106. package/dist/hooks/useNodesState.d.ts.map +1 -0
  107. package/dist/hooks/useResizeHandler.d.ts +8 -0
  108. package/dist/hooks/useResizeHandler.d.ts.map +1 -0
  109. package/dist/hooks/useStore.d.ts +21 -0
  110. package/dist/hooks/useStore.d.ts.map +1 -0
  111. package/dist/hooks/useViewportHelper.d.ts +10 -0
  112. package/dist/hooks/useViewportHelper.d.ts.map +1 -0
  113. package/dist/hooks/useVisibleEdgeIds.d.ts +9 -0
  114. package/dist/hooks/useVisibleEdgeIds.d.ts.map +1 -0
  115. package/dist/hooks/useVisibleNodeIds.d.ts +9 -0
  116. package/dist/hooks/useVisibleNodeIds.d.ts.map +1 -0
  117. package/dist/index.cjs.js +17 -0
  118. package/dist/index.cjs.js.map +1 -0
  119. package/dist/index.d.ts +11 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.esm.js +17 -0
  122. package/dist/index.esm.js.map +1 -0
  123. package/dist/plugins/Controls/ControlButton.d.ts +3 -0
  124. package/dist/plugins/Controls/ControlButton.d.ts.map +1 -0
  125. package/dist/plugins/Controls/Controls.d.ts +8 -0
  126. package/dist/plugins/Controls/Controls.d.ts.map +1 -0
  127. package/dist/plugins/Controls/Icons/FitView.d.ts +2 -0
  128. package/dist/plugins/Controls/Icons/FitView.d.ts.map +1 -0
  129. package/dist/plugins/Controls/Icons/Lock.d.ts +2 -0
  130. package/dist/plugins/Controls/Icons/Lock.d.ts.map +1 -0
  131. package/dist/plugins/Controls/Icons/Minus.d.ts +2 -0
  132. package/dist/plugins/Controls/Icons/Minus.d.ts.map +1 -0
  133. package/dist/plugins/Controls/Icons/Plus.d.ts +2 -0
  134. package/dist/plugins/Controls/Icons/Plus.d.ts.map +1 -0
  135. package/dist/plugins/Controls/Icons/Unlock.d.ts +2 -0
  136. package/dist/plugins/Controls/Icons/Unlock.d.ts.map +1 -0
  137. package/dist/plugins/Controls/index.d.ts +4 -0
  138. package/dist/plugins/Controls/index.d.ts.map +1 -0
  139. package/dist/plugins/Controls/types.d.ts +35 -0
  140. package/dist/plugins/Controls/types.d.ts.map +1 -0
  141. package/dist/plugins/index.d.ts +2 -0
  142. package/dist/plugins/index.d.ts.map +1 -0
  143. package/dist/store/index.d.ts +12 -0
  144. package/dist/store/index.d.ts.map +1 -0
  145. package/dist/store/initialState.d.ts +12 -0
  146. package/dist/store/initialState.d.ts.map +1 -0
  147. package/dist/styles/utils.d.ts +3 -0
  148. package/dist/styles/utils.d.ts.map +1 -0
  149. package/dist/types/edges.d.ts +114 -0
  150. package/dist/types/edges.d.ts.map +1 -0
  151. package/dist/types/general.d.ts +123 -0
  152. package/dist/types/general.d.ts.map +1 -0
  153. package/dist/types/index.d.ts +7 -0
  154. package/dist/types/index.d.ts.map +1 -0
  155. package/dist/types/instance.d.ts +149 -0
  156. package/dist/types/instance.d.ts.map +1 -0
  157. package/dist/types/nodes.d.ts +40 -0
  158. package/dist/types/nodes.d.ts.map +1 -0
  159. package/dist/types/props.d.ts +151 -0
  160. package/dist/types/props.d.ts.map +1 -0
  161. package/dist/types/store.d.ts +105 -0
  162. package/dist/types/store.d.ts.map +1 -0
  163. package/dist/types/utils/types.d.ts +8 -0
  164. package/dist/types/utils/types.d.ts.map +1 -0
  165. package/dist/utils/changes.d.ts +16 -0
  166. package/dist/utils/changes.d.ts.map +1 -0
  167. package/dist/utils/dom.d.ts +20 -0
  168. package/dist/utils/dom.d.ts.map +1 -0
  169. package/dist/utils/edges/bezier-edge.d.ts +59 -0
  170. package/dist/utils/edges/bezier-edge.d.ts.map +1 -0
  171. package/dist/utils/edges/general.d.ts +46 -0
  172. package/dist/utils/edges/general.d.ts.map +1 -0
  173. package/dist/utils/edges/index.d.ts +6 -0
  174. package/dist/utils/edges/index.d.ts.map +1 -0
  175. package/dist/utils/edges/positions.d.ts +12 -0
  176. package/dist/utils/edges/positions.d.ts.map +1 -0
  177. package/dist/utils/edges/smoothstep-edge.d.ts +43 -0
  178. package/dist/utils/edges/smoothstep-edge.d.ts.map +1 -0
  179. package/dist/utils/edges/straight-edge.d.ts +28 -0
  180. package/dist/utils/edges/straight-edge.d.ts.map +1 -0
  181. package/dist/utils/general.d.ts +61 -0
  182. package/dist/utils/general.d.ts.map +1 -0
  183. package/dist/utils/graph.d.ts +113 -0
  184. package/dist/utils/graph.d.ts.map +1 -0
  185. package/dist/utils/marker.d.ts +9 -0
  186. package/dist/utils/marker.d.ts.map +1 -0
  187. package/dist/utils/positions.d.ts +12 -0
  188. package/dist/utils/positions.d.ts.map +1 -0
  189. package/dist/utils/store.d.ts +30 -0
  190. package/dist/utils/store.d.ts.map +1 -0
  191. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import n,{createContext as e,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";var d=function(){return d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},d.apply(this,arguments)};function f(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function h(n,e,t,r){return new(t||(t=Promise))((function(o,i){function a(n){try{c(r.next(n))}catch(n){i(n)}}function u(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var e;n.done?o(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,u)}c((r=r.apply(n,e||[])).next())}))}function v(n,e){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=e.call(n,a)}catch(n){u=[6,n],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 p(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function y(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}function m(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}"function"==typeof SuppressedError&&SuppressedError;var w,b={exports:{}},x={};b.exports=function(){if(w)return x;w=1;var e=n,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(n,e,r){var u,c={},l=null,s=null;for(u in void 0!==r&&(l=""+r),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(s=e.ref),e)o.call(e,u)&&!a.hasOwnProperty(u)&&(c[u]=e[u]);if(n&&n.defaultProps)for(u in e=n.defaultProps)void 0===c[u]&&(c[u]=e[u]);return{$$typeof:t,type:n,key:l,ref:s,props:c,_owner:i.current}}return x.Fragment=r,x.jsx=u,x.jsxs=u,x}();var _,E=b.exports,S={exports:{}};
2
+ /*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */
7
+ _=S,function(){var n={}.hasOwnProperty;function e(){for(var t=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)t.push(o);else if(Array.isArray(o)){if(o.length){var a=e.apply(null,o);a&&t.push(a)}}else if("object"===i)if(o.toString===Object.prototype.toString)for(var u in o)n.call(o,u)&&o[u]&&t.push(u);else t.push(o.toString())}}return t.join(" ")}_.exports?(e.default=e,_.exports=e):window.classNames=e}();var k,N,C,O=m(S.exports),M={exports:{}},j={},P={exports:{}},I={};function A(){return N||(N=1,P.exports=function(){if(k)return I;k=1;var e=n,t="function"==typeof Object.is?Object.is:function(n,e){return n===e&&(0!==n||1/n==1/e)||n!=n&&e!=e},r=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function u(n){var e=n.getSnapshot;n=n.value;try{var r=e();return!t(n,r)}catch(n){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(n,e){return e()}:function(n,e){var t=e(),c=r({inst:{value:t,getSnapshot:e}}),l=c[0].inst,s=c[1];return i((function(){l.value=t,l.getSnapshot=e,u(l)&&s({inst:l})}),[n,t,e]),o((function(){return u(l)&&s({inst:l}),n((function(){u(l)&&s({inst:l})}))}),[n]),a(t),t};return I.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,I}()),P.exports}
8
+ /**
9
+ * @license React
10
+ * use-sync-external-store-shim/with-selector.production.min.js
11
+ *
12
+ * Copyright (c) Facebook, Inc. and its affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */M.exports=function(){if(C)return j;C=1;var e=n,t=A(),r="function"==typeof Object.is?Object.is:function(n,e){return n===e&&(0!==n||1/n==1/e)||n!=n&&e!=e},o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,u=e.useMemo,c=e.useDebugValue;return j.useSyncExternalStoreWithSelector=function(n,e,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 n(n){if(!a){if(a=!0,o=n,n=l(n),void 0!==s&&f.hasValue){var e=f.value;if(s(e,n))return i=e}return i=n}if(e=i,r(o,n))return e;var t=l(n);return void 0!==s&&s(e,t)?e:(o=n,i=t)}var o,i,a=!1,u=void 0===t?null:t;return[function(){return n(e())},null===u?void 0:function(){return n(u())}]}),[e,t,l,s]);var h=o(n,d[0],d[1]);return a((function(){f.hasValue=!0,f.value=h}),[h]),c(h),h},j}();var z=m(M.exports);const T=n=>{let e;const t=new Set,r=(n,r)=>{const o="function"==typeof n?n(e):n;if(!Object.is(o,e)){const n=e;e=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},e,o),t.forEach((t=>t(e,n)))}},o=()=>e,i={setState:r,getState:o,getInitialState:()=>a,subscribe:n=>(t.add(n),()=>t.delete(n)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},a=e=n(r,o,i);return i},{useDebugValue:B}=n,{useSyncExternalStoreWithSelector:L}=z,D=n=>n;function R(n,e=D,t){const r=L(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return B(r),r}const V=(n,e)=>{const t=(n=>n?T(n):T)(n),r=(n,r=e)=>R(t,n,r);return Object.assign(r,t),r};var H,Y,X,F,Z,U,G,W,q,$,K,Q,J,nn,en,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,On,Mn,jn,Pn,In,An,zn,Tn,Bn,Ln,Dn,Rn,Vn,Hn,Yn,Xn,Fn,Zn,Un,Gn,Wn,qn,$n,Kn,Qn,Jn,ne,ee,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,Oe,Me,je,Pe,Ie,Ae,ze,Te,Be,Le,De,Re,Ve,He,Ye=e(null),Xe=Ye.Provider,Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ze(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ue(){return F?X:(F=1,X=function(n,e){return n===e||n!=n&&e!=e})}function Ge(){if(U)return Z;U=1;var n=Ue();return Z=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1},Z}function We(){if(tn)return en;tn=1;var n=Y?H:(Y=1,H=function(){this.__data__=[],this.size=0}),e=function(){if(W)return G;W=1;var n=Ge(),e=Array.prototype.splice;return G=function(t){var r=this.__data__,o=n(r,t);return!(o<0||(o==r.length-1?r.pop():e.call(r,o,1),--this.size,0))}}(),t=function(){if($)return q;$=1;var n=Ge();return q=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}}(),r=function(){if(Q)return K;Q=1;var n=Ge();return K=function(e){return n(this.__data__,e)>-1}}(),o=function(){if(nn)return J;nn=1;var n=Ge();return J=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,en=i}function qe(){if(hn)return fn;hn=1;var n="object"==typeof Fe&&Fe&&Fe.Object===Object&&Fe;return fn=n}function $e(){if(pn)return vn;pn=1;var n=qe(),e="object"==typeof self&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return vn=t}function Ke(){if(yn)return gn;yn=1;var n=$e().Symbol;return gn=n}function Qe(){if(En)return _n;En=1;var n=Ke(),e=function(){if(wn)return mn;wn=1;var n=Ke(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;return mn=function(n){var e=t.call(n,o),i=n[o];try{n[o]=void 0;var a=!0}catch(n){}var u=r.call(n);return a&&(e?n[o]=i:delete n[o]),u}}(),t=function(){if(xn)return bn;xn=1;var n=Object.prototype.toString;return bn=function(e){return n.call(e)}}(),r=n?n.toStringTag:void 0;return _n=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?e(n):t(n)}}function Je(){return kn?Sn:(kn=1,Sn=function(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)})}function nt(){if(Cn)return Nn;Cn=1;var n=Qe(),e=Je();return Nn=function(t){if(!e(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function et(){if(An)return In;An=1;var n=Function.prototype.toString;return In=function(e){if(null!=e){try{return n.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function tt(){if(Rn)return Dn;Rn=1;var n=function(){if(Tn)return zn;Tn=1;var n=nt(),e=function(){if(Pn)return jn;Pn=1;var n,e=function(){if(Mn)return On;Mn=1;var n=$e()["__core-js_shared__"];return On=n}(),t=(n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return jn=function(n){return!!t&&t in n}}(),t=Je(),r=et(),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 zn=function(i){return!(!t(i)||e(i))&&(n(i)?l:o).test(r(i))}}(),e=Ln?Bn:(Ln=1,Bn=function(n,e){return null==n?void 0:n[e]});return Dn=function(t,r){var o=e(t,r);return n(o)?o:void 0}}function rt(){if(Hn)return Vn;Hn=1;var n=tt()($e(),"Map");return Vn=n}function ot(){if(Xn)return Yn;Xn=1;var n=tt()(Object,"create");return Yn=n}function it(){if(ue)return ae;ue=1;var n=ie?oe:(ie=1,oe=function(n){var e=typeof n;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n});return ae=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map},ae}function at(){if(ye)return ge;ye=1;var n=function(){if(re)return te;re=1;var n=function(){if(ee)return ne;ee=1;var n=function(){if(Zn)return Fn;Zn=1;var n=ot();return Fn=function(){this.__data__=n?n(null):{},this.size=0}}(),e=Gn?Un:(Gn=1,Un=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}),t=function(){if(qn)return Wn;qn=1;var n=ot(),e=Object.prototype.hasOwnProperty;return Wn=function(t){var r=this.__data__;if(n){var o=r[t];return"__lodash_hash_undefined__"===o?void 0:o}return e.call(r,t)?r[t]:void 0}}(),r=function(){if(Kn)return $n;Kn=1;var n=ot(),e=Object.prototype.hasOwnProperty;return $n=function(t){var r=this.__data__;return n?void 0!==r[t]:e.call(r,t)}}(),o=function(){if(Jn)return Qn;Jn=1;var n=ot();return Qn=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,ne=i}(),e=We(),t=rt();return te=function(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}}(),e=function(){if(le)return ce;le=1;var n=it();return ce=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}}(),t=function(){if(de)return se;de=1;var n=it();return se=function(e){return n(this,e).get(e)}}(),r=function(){if(he)return fe;he=1;var n=it();return fe=function(e){return n(this,e).has(e)}}(),o=function(){if(pe)return ve;pe=1;var n=it();return ve=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this},ve}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,ge=i}function ut(){if(xe)return be;xe=1;var n=We(),e=function(){if(on)return rn;on=1;var n=We();return rn=function(){this.__data__=new n,this.size=0}}(),t=un?an:(un=1,an=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}),r=ln?cn:(ln=1,cn=function(n){return this.__data__.get(n)}),o=dn?sn:(dn=1,sn=function(n){return this.__data__.has(n)}),i=function(){if(we)return me;we=1;var n=We(),e=rt(),t=at();return me=function(r,o){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!e||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(e){var t=this.__data__=new n(e);this.size=t.size}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=o,a.prototype.set=i,be=a}function ct(){return Ee||(Ee=1,_e=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}),_e}function lt(){if(ke)return Se;ke=1;var n=tt(),e=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Se=e}function st(){if(Ce)return Ne;Ce=1;var n=lt();return Ne=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}}function dt(){if(Me)return Oe;Me=1;var n=st(),e=Ue(),t=Object.prototype.hasOwnProperty;return Oe=function(r,o,i){var a=r[o];t.call(r,o)&&e(a,i)&&(void 0!==i||o in r)||n(r,o,i)}}function ft(){if(Pe)return je;Pe=1;var n=dt(),e=st();return je=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?e(o,l,s):n(o,l,s)}return o}}function ht(){return Te?ze:(Te=1,ze=function(n){return null!=n&&"object"==typeof n})}function vt(){if(Re)return De;Re=1;var n=function(){if(Le)return Be;Le=1;var n=Qe(),e=ht();return Be=function(t){return e(t)&&"[object Arguments]"==n(t)}}(),e=ht(),t=Object.prototype,r=t.hasOwnProperty,o=t.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return e(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return De=i}function pt(){if(He)return Ve;He=1;var n=Array.isArray;return Ve=n}var gt,yt,mt,wt,bt,xt,_t,Et,St,kt,Nt,Ct={exports:{}};function Ot(){return mt||(mt=1,function(n,e){var t=$e(),r=yt?gt:(yt=1,gt=function(){return!1}),o=e&&!e.nodeType&&e,i=o&&n&&!n.nodeType&&n,a=i&&i.exports===o?t.Buffer:void 0,u=(a?a.isBuffer:void 0)||r;n.exports=u}(Ct,Ct.exports)),Ct.exports}function Mt(){if(bt)return wt;bt=1;var n=/^(?:0|[1-9]\d*)$/;return wt=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}}function jt(){return _t?xt:(_t=1,xt=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Pt(){return Nt?kt:(Nt=1,kt=function(n){return function(e){return n(e)}})}Ct.exports;var It,At,zt,Tt,Bt,Lt,Dt,Rt,Vt,Ht,Yt,Xt,Ft,Zt,Ut,Gt,Wt,qt,$t,Kt,Qt,Jt,nr,er,tr,rr,or,ir={exports:{}};function ar(){return It||(It=1,n=ir,e=ir.exports,t=qe(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,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(n){}}(),n.exports=a),ir.exports;var n,e,t,r,o,i,a}function ur(){if(zt)return At;zt=1;var n=function(){if(St)return Et;St=1;var n=Qe(),e=jt(),t=ht(),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,Et=function(o){return t(o)&&e(o.length)&&!!r[n(o)]}}(),e=Pt(),t=ar(),r=t&&t.isTypedArray,o=r?e(r):n;return At=o}function cr(){if(Bt)return Tt;Bt=1;var n=Ae?Ie:(Ae=1,Ie=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}),e=vt(),t=pt(),r=Ot(),o=Mt(),i=ur(),a=Object.prototype.hasOwnProperty;return Tt=function(u,c){var l=t(u),s=!l&&e(u),d=!l&&!s&&r(u),f=!l&&!s&&!d&&i(u),h=l||s||d||f,v=h?n(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},Tt}function lr(){if(Dt)return Lt;Dt=1;var n=Object.prototype;return Lt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}}function sr(){return Vt||(Vt=1,Rt=function(n,e){return function(t){return n(e(t))}}),Rt}function dr(){if(Ft)return Xt;Ft=1;var n=lr(),e=function(){if(Yt)return Ht;Yt=1;var n=sr()(Object.keys,Object);return Ht=n}(),t=Object.prototype.hasOwnProperty;return Xt=function(r){if(!n(r))return e(r);var o=[];for(var i in Object(r))t.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function fr(){if(Ut)return Zt;Ut=1;var n=nt(),e=jt();return Zt=function(t){return null!=t&&e(t.length)&&!n(t)}}function hr(){if(Wt)return Gt;Wt=1;var n=cr(),e=dr(),t=fr();return Gt=function(r){return t(r)?n(r):e(r)}}function vr(){if(tr)return er;tr=1;var n=cr(),e=function(){if(nr)return Jt;nr=1;var n=Je(),e=lr(),t=Qt?Kt:(Qt=1,Kt=function(n){var e=[];if(null!=n)for(var t in Object(n))e.push(t);return e}),r=Object.prototype.hasOwnProperty;return Jt=function(o){if(!n(o))return t(o);var i=e(o),a=[];for(var u in o)("constructor"!=u||!i&&r.call(o,u))&&a.push(u);return a}}(),t=fr();return er=function(r){return t(r)?n(r,!0):e(r)}}ir.exports;var pr,gr,yr,mr,wr,br,xr,_r,Er,Sr,kr,Nr,Cr,Or,Mr,jr,Pr,Ir,Ar,zr,Tr,Br,Lr,Dr,Rr,Vr,Hr,Yr,Xr,Fr,Zr,Ur,Gr,Wr,qr,$r,Kr,Qr,Jr,no,eo,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,Oo,Mo,jo,Po,Io,Ao,zo,To,Bo,Lo,Do,Ro,Vo,Ho,Yo,Xo,Fo,Zo,Uo,Go,Wo,qo,$o,Ko,Qo,Jo,ni,ei,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,Oi,Mi,ji,Pi,Ii,Ai,zi,Ti,Bi,Li,Di,Ri,Vi,Hi,Yi,Xi,Fi,Zi,Ui,Gi,Wi,qi,$i,Ki,Qi,Ji,na,ea,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,Oa,Ma,ja,Pa,Ia,Aa,za,Ta,Ba,La,Da,Ra,Va,Ha,Ya,Xa,Fa,Za,Ua,Ga,Wa,qa,$a,Ka,Qa,Ja,nu,eu,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,Ou,Mu,ju,Pu,Iu,Au,zu,Tu,Bu,Lu,Du,Ru,Vu,Hu,Yu,Xu,Fu,Zu,Uu,Gu,Wu,qu,$u,Ku,Qu,Ju,nc,ec,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={exports:{}};function Cc(){return pr||(pr=1,function(n,e){var t=$e(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?t.Buffer:void 0,a=i?i.allocUnsafe:void 0;n.exports=function(n,e){if(e)return n.slice();var t=n.length,r=a?a(t):new n.constructor(t);return n.copy(r),r}}(Nc,Nc.exports)),Nc.exports}function Oc(){return yr||(yr=1,gr=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}),gr}function Mc(){return wr||(wr=1,mr=function(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[o++]=a)}return i}),mr}function jc(){return xr?br:(xr=1,br=function(){return[]})}function Pc(){if(Er)return _r;Er=1;var n=Mc(),e=jc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return _r=r?function(e){return null==e?[]:(e=Object(e),n(r(e),(function(n){return t.call(e,n)})))}:e}function Ic(){return Cr||(Cr=1,Nr=function(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}),Nr}function Ac(){if(Mr)return Or;Mr=1;var n=sr()(Object.getPrototypeOf,Object);return Or=n}function zc(){if(Pr)return jr;Pr=1;var n=Ic(),e=Ac(),t=Pc(),r=jc(),o=Object.getOwnPropertySymbols;return jr=o?function(r){for(var o=[];r;)n(o,t(r)),r=e(r);return o}:r}function Tc(){if(Tr)return zr;Tr=1;var n=Ic(),e=pt();return zr=function(t,r,o){var i=r(t);return e(t)?i:n(i,o(t))}}function Bc(){if(Lr)return Br;Lr=1;var n=Tc(),e=Pc(),t=hr();return Br=function(r){return n(r,t,e)}}function Lc(){if(Zr)return Fr;Zr=1;var n=tt()($e(),"Set");return Fr=n}function Dc(){if(qr)return Wr;qr=1;var n=function(){if(Hr)return Vr;Hr=1;var n=tt()($e(),"DataView");return Vr=n}(),e=rt(),t=function(){if(Xr)return Yr;Xr=1;var n=tt()($e(),"Promise");return Yr=n}(),r=Lc(),o=function(){if(Gr)return Ur;Gr=1;var n=tt()($e(),"WeakMap");return Ur=n}(),i=Qe(),a=et(),u="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",d="[object DataView]",f=a(n),h=a(e),v=a(t),p=a(r),g=a(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=d||e&&y(new e)!=u||t&&y(t.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var e=i(n),t="[object Object]"==e?n.constructor:void 0,r=t?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 e}),Wr=y}function Rc(){if(Jr)return Qr;Jr=1;var n=$e().Uint8Array;return Qr=n}function Vc(){if(eo)return no;eo=1;var n=Rc();return no=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}}function Hc(){if(lo)return co;lo=1;var n=Vc();return co=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}}function Yc(){if(vo)return ho;vo=1;var n=Je(),e=Object.create,t=function(){function t(){}return function(r){if(!n(r))return{};if(e)return e(r);t.prototype=r;var o=new t;return t.prototype=void 0,o}}();return ho=t}function Xc(){if(go)return po;go=1;var n=Yc(),e=Ac(),t=lr();return po=function(r){return"function"!=typeof r.constructor||t(r)?{}:n(e(r))}}function Fc(){if(No)return ko;No=1;var n=ut(),e=ct(),t=dt(),r=function(){if($t)return qt;$t=1;var n=ft(),e=hr();return qt=function(t,r){return t&&n(r,e(r),t)}}(),o=function(){if(or)return rr;or=1;var n=ft(),e=vr();return rr=function(t,r){return t&&n(r,e(r),t)}}(),i=Cc(),a=Oc(),u=function(){if(kr)return Sr;kr=1;var n=ft(),e=Pc();return Sr=function(t,r){return n(t,e(t),r)}}(),c=function(){if(Ar)return Ir;Ar=1;var n=ft(),e=zc();return Ir=function(t,r){return n(t,e(t),r)}}(),l=Bc(),s=function(){if(Rr)return Dr;Rr=1;var n=Tc(),e=zc(),t=vr();return Dr=function(r){return n(r,t,e)}}(),d=Dc(),f=function(){if(Kr)return $r;Kr=1;var n=Object.prototype.hasOwnProperty;return $r=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r},$r}(),h=function(){if(fo)return so;fo=1;var n=Vc(),e=function(){if(ro)return to;ro=1;var n=Vc();return to=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}}(),t=function(){if(io)return oo;io=1;var n=/\w*$/;return oo=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}(),r=function(){if(uo)return ao;uo=1;var n=Ke(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;return ao=function(n){return t?Object(t.call(n)):{}}}(),o=Hc();return so=function(i,a,u){var c=i.constructor;switch(a){case"[object ArrayBuffer]":return n(i);case"[object Boolean]":case"[object Date]":return new c(+i);case"[object DataView]":return e(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=Xc(),p=pt(),g=Ot(),y=function(){if(bo)return wo;bo=1;var n=function(){if(mo)return yo;mo=1;var n=Dc(),e=ht();return yo=function(t){return e(t)&&"[object Map]"==n(t)}}(),e=Pt(),t=ar(),r=t&&t.isMap,o=r?e(r):n;return wo=o}(),m=Je(),w=function(){if(So)return Eo;So=1;var n=function(){if(_o)return xo;_o=1;var n=Dc(),e=ht();return xo=function(t){return e(t)&&"[object Set]"==n(t)}}(),e=Pt(),t=ar(),r=t&&t.isSet,o=r?e(r):n;return Eo=o}(),b=hr(),x=vr(),_="[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,ko=function N(C,O,M,j,P,I){var A,z=1&O,T=2&O,B=4&O;if(M&&(A=P?M(C,j,P,I):M(C)),void 0!==A)return A;if(!m(C))return C;var L=p(C);if(L){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 n);var V=I.get(C);if(V)return V;I.set(C,A),w(C)?C.forEach((function(n){A.add(N(n,O,M,n,C,I))})):y(C)&&C.forEach((function(n,e){A.set(e,N(n,O,M,e,C,I))}));var H=L?void 0:(B?T?s:l:T?x:b)(C);return e(H||C,(function(n,e){H&&(n=C[e=n]),t(A,e,N(n,O,M,e,C,I))})),A},ko}function Zc(){if(Oo)return Co;Oo=1;var n=Fc();return Co=function(e){return n(e,4)}}function Uc(){return jo?Mo:(jo=1,Mo=function(n){return function(){return n}})}function Gc(){if(zo)return Ao;zo=1;var n=(Io?Po:(Io=1,Po=function(n){return function(e,t,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[n?u:++o];if(!1===t(i[c],c,i))break}return e}}))();return Ao=n}function Wc(){if(Bo)return To;Bo=1;var n=Gc(),e=hr();return To=function(t,r){return t&&n(t,r,e)}}function qc(){if(Vo)return Ro;Vo=1;var n=Wc(),e=function(){if(Do)return Lo;Do=1;var n=fr();return Lo=function(e,t){return function(r,o){if(null==r)return r;if(!n(r))return e(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=e(n);return Ro=t}function $c(){return Yo?Ho:(Yo=1,Ho=function(n){return n})}function Kc(){if(Fo)return Xo;Fo=1;var n=$c();return Xo=function(e){return"function"==typeof e?e:n}}function Qc(){if(Uo)return Zo;Uo=1;var n=ct(),e=qc(),t=Kc(),r=pt();return Zo=function(o,i){return(r(o)?n:e)(o,t(i))}}function Jc(){return Wo?Go:(Wo=1,Go=Qc())}function nl(){if(ti)return ei;ti=1;var n=at(),e=Qo?Ko:(Qo=1,Ko=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=ni?Jo:(ni=1,Jo=function(n){return this.__data__.has(n)});function r(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,ei=r}function el(){return ai?ii:(ai=1,ii=function(n,e){return n.has(e)})}function tl(){if(ci)return ui;ci=1;var n=nl(),e=(oi||(oi=1,ri=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}),ri),t=el();return ui=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 n: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(!e(o,(function(n,e){if(!t(g,e)&&(y===n||u(y,n,i,a,c)))return g.push(e)}))){p=!1;break}}else if(y!==m&&!u(y,m,i,a,c)){p=!1;break}}return c.delete(r),c.delete(o),p},ui}function rl(){return fi||(fi=1,di=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}),di}function ol(){if(mi)return yi;mi=1;var n=ut(),e=tl(),t=function(){if(vi)return hi;vi=1;var n=Ke(),e=Rc(),t=Ue(),r=tl(),o=(si||(si=1,li=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}),li),i=rl(),a=n?n.prototype:void 0,u=a?a.valueOf:void 0;return hi=function(n,a,c,l,s,d,f){switch(c){case"[object DataView]":if(n.byteLength!=a.byteLength||n.byteOffset!=a.byteOffset)return!1;n=n.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=a.byteLength||!d(new e(n),new e(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+n,+a);case"[object Error]":return n.name==a.name&&n.message==a.message;case"[object RegExp]":case"[object String]":return n==a+"";case"[object Map]":var h=o;case"[object Set]":var v=1&l;if(h||(h=i),n.size!=a.size&&!v)return!1;var p=f.get(n);if(p)return p==a;l|=2,f.set(n,a);var g=r(h(n),h(a),l,s,d,f);return f.delete(n),g;case"[object Symbol]":if(u)return u.call(n)==u.call(a)}return!1}}(),r=function(){if(gi)return pi;gi=1;var n=Bc(),e=Object.prototype.hasOwnProperty;return pi=function(t,r,o,i,a,u){var c=1&o,l=n(t),s=l.length;if(s!=n(r).length&&!c)return!1;for(var d=s;d--;){var f=l[d];if(!(c?f in r:e.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=Dc(),i=pt(),a=Ot(),u=ur(),c="[object Arguments]",l="[object Array]",s="[object Object]",d=Object.prototype.hasOwnProperty;return yi=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 n),m||u(f)?e(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,O=N?h.value():h;return y||(y=new n),g(C,O,v,p,y)}}return!!S&&(y||(y=new n),r(f,h,v,p,g,y))}}function il(){if(bi)return wi;bi=1;var n=ol(),e=ht();return wi=function t(r,o,i,a,u){return r===o||(null==r||null==o||!e(r)&&!e(o)?r!=r&&o!=o:n(r,o,i,a,t,u))},wi}function al(){if(Si)return Ei;Si=1;var n=Je();return Ei=function(e){return e==e&&!n(e)}}function ul(){return Oi?Ci:(Oi=1,Ci=function(n,e){return function(t){return null!=t&&t[n]===e&&(void 0!==e||n in Object(t))}})}function cl(){if(Ii)return Pi;Ii=1;var n=Qe(),e=ht();return Pi=function(t){return"symbol"==typeof t||e(t)&&"[object Symbol]"==n(t)}}function ll(){if(zi)return Ai;zi=1;var n=pt(),e=cl(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Ai=function(o,i){if(n(o))return!1;var a=typeof o;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=o&&!e(o))||r.test(o)||!t.test(o)||null!=i&&o in Object(i)}}function sl(){return Yi||(Yi=1,Hi=function(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}),Hi}function dl(){if(Ui)return Zi;Ui=1;var n=function(){if(Fi)return Xi;Fi=1;var n=Ke(),e=sl(),t=pt(),r=cl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return Xi=function n(o){if("string"==typeof o)return o;if(t(o))return e(o,n)+"";if(r(o))return i?i.call(o):"";var a=o+"";return"0"==a&&1/o==-1/0?"-0":a},Xi}();return Zi=function(e){return null==e?"":n(e)}}function fl(){if(Wi)return Gi;Wi=1;var n=pt(),e=ll(),t=function(){if(Vi)return Ri;Vi=1;var n=function(){if(Di)return Li;Di=1;var n=function(){if(Bi)return Ti;Bi=1;var n=at();function e(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,e=r?r.apply(this,n):n[0],i=o.cache;if(i.has(e))return i.get(e);var a=t.apply(this,n);return o.cache=i.set(e,a)||i,a};return o.cache=new(e.Cache||n),o}return e.Cache=n,Ti=e}();return Li=function(e){var t=n(e,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}}(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(e,(function(n,e,o,i){r.push(o?i.replace(t,"$1"):e||n)})),r}));return Ri=r}(),r=dl();return Gi=function(o,i){return n(o)?o:e(o,i)?[o]:t(r(o))}}function hl(){if($i)return qi;$i=1;var n=cl();return qi=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}}function vl(){if(Qi)return Ki;Qi=1;var n=fl(),e=hl();return Ki=function(t,r){for(var o=0,i=(r=n(r,t)).length;null!=t&&o<i;)t=t[e(r[o++])];return o&&o==i?t:void 0}}function pl(){if(oa)return ra;oa=1;var n=fl(),e=vt(),t=pt(),r=Mt(),o=jt(),i=hl();return ra=function(a,u,c){for(var l=-1,s=(u=n(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)||e(a))}}function gl(){if(aa)return ia;aa=1;var n=ta?ea:(ta=1,ea=function(n,e){return null!=n&&e in Object(n)}),e=pl();return ia=function(t,r){return null!=t&&e(t,r,n)}}function yl(){return sa?la:(sa=1,la=function(n){return function(e){return null==e?void 0:e[n]}})}function ml(){if(ga)return pa;ga=1;var n=function(){if(ji)return Mi;ji=1;var n=function(){if(_i)return xi;_i=1;var n=ut(),e=il();return xi=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 n;if(i)var v=i(d,f,s,t,r,h);if(!(void 0===v?e(f,d,3,i,h):v))return!1}}return!0}}(),e=function(){if(Ni)return ki;Ni=1;var n=al(),e=hr();return ki=function(t){for(var r=e(t),o=r.length;o--;){var i=r[o],a=t[i];r[o]=[i,a,n(a)]}return r}}(),t=ul();return Mi=function(r){var o=e(r);return 1==o.length&&o[0][2]?t(o[0][0],o[0][1]):function(e){return e===r||n(e,r,o)}}}(),e=function(){if(ca)return ua;ca=1;var n=il(),e=function(){if(na)return Ji;na=1;var n=vl();return Ji=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}}(),t=gl(),r=ll(),o=al(),i=ul(),a=hl();return ua=function(u,c){return r(u)&&o(c)?i(a(u),c):function(r){var o=e(r,u);return void 0===o&&o===c?t(r,u):n(c,o,3)}}}(),t=$c(),r=pt(),o=function(){if(va)return ha;va=1;var n=yl(),e=function(){if(fa)return da;fa=1;var n=vl();return da=function(e){return function(t){return n(t,e)}}}(),t=ll(),r=hl();return ha=function(o){return t(o)?n(r(o)):e(o)}}();return pa=function(i){return"function"==typeof i?i:null==i?t:"object"==typeof i?r(i)?e(i[0],i[1]):n(i):o(i)}}function wl(){if(ma)return ya;ma=1;var n=Mc(),e=function(){if($o)return qo;$o=1;var n=qc();return qo=function(e,t){var r=[];return n(e,(function(n,e,o){t(n,e,o)&&r.push(n)})),r}}(),t=ml(),r=pt();return ya=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function bl(){if(_a)return xa;_a=1;var n=function(){if(ba)return wa;ba=1;var n=Object.prototype.hasOwnProperty;return wa=function(e,t){return null!=e&&n.call(e,t)}}(),e=pl();return xa=function(t,r){return null!=t&&e(t,r,n)}}function xl(){if(Sa)return Ea;Sa=1;var n=dr(),e=Dc(),t=vt(),r=pt(),o=fr(),i=Ot(),a=lr(),u=ur(),c=Object.prototype.hasOwnProperty;return Ea=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=e(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(a(l))return!n(l).length;for(var d in l)if(c.call(l,d))return!1;return!0}}function _l(){return Na?ka:(Na=1,ka=function(n){return void 0===n})}function El(){if(Oa)return Ca;Oa=1;var n=qc(),e=fr();return Ca=function(t,r){var o=-1,i=e(t)?Array(t.length):[];return n(t,(function(n,e,t){i[++o]=r(n,e,t)})),i}}function Sl(){if(ja)return Ma;ja=1;var n=sl(),e=ml(),t=El(),r=pt();return Ma=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function kl(){if(Ba)return Ta;Ba=1;var n=(Ia||(Ia=1,Pa=function(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}),Pa),e=qc(),t=ml(),r=za?Aa:(za=1,Aa=function(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}),o=pt();return Ta=function(i,a,u){var c=o(i)?n:r,l=arguments.length<3;return c(i,t(a,4),u,l,e)},Ta}function Nl(){if(Wa)return Ga;Wa=1;var n=dr(),e=Dc(),t=fr(),r=function(){if(Da)return La;Da=1;var n=Qe(),e=pt(),t=ht();return La=function(r){return"string"==typeof r||!e(r)&&t(r)&&"[object String]"==n(r)}}(),o=function(){if(Ua)return Za;Ua=1;var n=function(){if(Va)return Ra;Va=1;var n=yl()("length");return Ra=n}(),e=function(){if(Ya)return Ha;Ya=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Ha=function(e){return n.test(e)}}(),t=function(){if(Fa)return Xa;Fa=1;var n="\\ud800-\\udfff",e="["+n+"]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",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,e].join("|")+")",d=RegExp(r+"(?="+r+")|"+s+l,"g");return Xa=function(n){for(var e=d.lastIndex=0;d.test(n);)++e;return e}}();return Za=function(r){return e(r)?t(r):n(r)}}();return Ga=function(i){if(null==i)return 0;if(t(i))return r(i)?o(i):i.length;var a=e(i);return"[object Map]"==a||"[object Set]"==a?i.size:n(i).length}}function Cl(){if($a)return qa;$a=1;var n=ct(),e=Yc(),t=Wc(),r=ml(),o=Ac(),i=pt(),a=Ot(),u=nt(),c=Je(),l=ur();return qa=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)?e(o(s)):{}}return(v?n:t)(s,(function(n,e,t){return d(f,n,e,t)})),f}}function Ol(){if(nu)return Ja;nu=1;var n=Ic(),e=function(){if(Qa)return Ka;Qa=1;var n=Ke(),e=vt(),t=pt(),r=n?n.isConcatSpreadable:void 0;return Ka=function(n){return t(n)||e(n)||!!(r&&n&&n[r])}}();return Ja=function t(r,o,i,a,u){var c=-1,l=r.length;for(i||(i=e),u||(u=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?t(s,o-1,i,a,u):n(u,s):a||(u[u.length]=s)}return u},Ja}function Ml(){if(ou)return ru;ou=1;var n=tu?eu:(tu=1,eu=function(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}),e=Math.max;return ru=function(t,r,o){return r=e(void 0===r?t.length-1:r,0),function(){for(var i=arguments,a=-1,u=e(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),n(t,this,l)}},ru}function jl(){if(su)return lu;su=1;var n=function(){if(au)return iu;au=1;var n=Uc(),e=lt(),t=$c();return iu=e?function(t,r){return e(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:t}(),e=function(){if(cu)return uu;cu=1;var n=Date.now;return uu=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},uu}(),t=e(n);return lu=t}function Pl(){if(fu)return du;fu=1;var n=$c(),e=Ml(),t=jl();return du=function(r,o){return t(e(r,o,n),r+"")},du}function Il(){return vu||(vu=1,hu=function(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}),hu}function Al(){if(ju)return Mu;ju=1;var n=nl(),e=function(){if(_u)return xu;_u=1;var n=function(){if(bu)return wu;bu=1;var n=Il(),e=gu?pu:(gu=1,pu=function(n){return n!=n}),t=(mu||(mu=1,yu=function(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}),yu);return wu=function(r,o,i){return o==o?t(r,o,i):n(r,e,i)},wu}();return xu=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1},xu}(),t=(Su||(Su=1,Eu=function(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}),Eu),r=el(),o=function(){if(Ou)return Cu;Ou=1;var n=Lc(),e=Nu?ku:(Nu=1,ku=function(){}),t=rl(),r=n&&1/t(new n([,-0]))[1]==1/0?function(e){return new n(e)}:e;return Cu=r}(),i=rl();return Mu=function(a,u,c){var l=-1,s=e,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 n}else v=u?[]:h;n: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 n;u&&v.push(y),h.push(g)}else s(v,y,c)||(v!==h&&v.push(y),h.push(g))}return h},Mu}function zl(){if(Iu)return Pu;Iu=1;var n=fr(),e=ht();return Pu=function(t){return e(t)&&n(t)}}function Tl(){if(zu)return Au;zu=1;var n=Ol(),e=Pl(),t=Al(),r=zl(),o=e((function(e){return t(n(e,1,r,!0))}));return Au=o}function Bl(){if(Du)return Lu;Du=1;var n=function(){if(Bu)return Tu;Bu=1;var n=sl();return Tu=function(e,t){return n(t,(function(n){return e[n]}))}}(),e=hr();return Lu=function(t){return null==t?[]:n(t,e(t))}}function Ll(){if(Vu)return Ru;var n;Vu=1;try{n={clone:Zc(),constant:Uc(),each:Jc(),filter:wl(),has:bl(),isArray:pt(),isEmpty:xl(),isFunction:nt(),isUndefined:_l(),keys:hr(),map:Sl(),reduce:kl(),size:Nl(),transform:Cl(),union:Tl(),values:Bl()}}catch(n){}return n||(n=window._),Ru=n}function Dl(){if(Yu)return Hu;Yu=1;var n=Ll();Hu=o;var e="\0",t="\0",r="";function o(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 i(n,e){n[e]?n[e]++:n[e]=1}function a(n,e){--n[e]||delete n[e]}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+(n.isUndefined(a)?e:a)}function c(n,e){return u(n,e.v,e.w,e.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(n){return this._label=n,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return n.keys(this._nodes)},o.prototype.sources=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._in[t])}))},o.prototype.sinks=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._out[t])}))},o.prototype.setNodes=function(e,t){var r=arguments,o=this;return n.each(e,(function(n){r.length>1?o.setNode(n,t):o.setNode(n)})),this},o.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)},o.prototype.node=function(n){return this._nodes[n]},o.prototype.hasNode=function(e){return n.has(this._nodes,e)},o.prototype.removeNode=function(e){var t=this;if(n.has(this._nodes,e)){var r=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],n.each(this.children(e),(function(n){t.setParent(n)})),delete this._children[e]),n.each(n.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],n.each(n.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},o.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},o.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},o.prototype.parent=function(n){if(this._isCompound){var e=this._parent[n];if(e!==t)return e}},o.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[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return n.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return n.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return n.union(t,this.successors(e))},o.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},o.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),n.each(this._edgeObjs,(function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,r.edge(n))}));var o={};function i(n){var e=r.parent(n);return void 0===e||t.hasNode(e)?(o[n]=e,e):e in o?o[e]:i(e)}return this._isCompound&&n.each(t.nodes(),(function(n){t.setParent(n,i(n))})),t},o.prototype.setDefaultEdgeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return n.values(this._edgeObjs)},o.prototype.setPath=function(e,t){var r=this,o=arguments;return n.reduce(e,(function(n,e){return o.length>1?r.setEdge(n,e,t):r.setEdge(n,e),e})),this},o.prototype.setEdge=function(){var e,t,r,o,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(e=c.v,t=c.w,r=c.name,2===arguments.length&&(o=arguments[1],a=!0)):(e=c,t=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,n.isUndefined(r)||(r=""+r);var l=u(this._isDirected,e,t,r);if(n.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=o),this;if(!n.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?o:this._defaultEdgeLabelFn(e,t,r);var s=function(n,e,t,r){var o=""+e,i=""+t;if(!n&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};return r&&(u.name=r),u}(this._isDirected,e,t,r);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[l]=s,i(this._preds[t],e),i(this._sucs[e],t),this._in[t][l]=s,this._out[e][l]=s,this._edgeCount++,this},o.prototype.edge=function(n,e,t){var r=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,n,e,t);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,r){var o=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,e,t,r);return n.has(this._edgeLabels,o)},o.prototype.removeEdge=function(n,e,t){var r=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,n,e,t),o=this._edgeObjs[r];return o&&(n=o.v,e=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],a(this._preds[e],n),a(this._sucs[n],e),delete this._in[e][r],delete this._out[n][r],this._edgeCount--),this},o.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.v===t})):o}},o.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.w===t})):o}},o.prototype.nodeEdges=function(n,e){var t=this.inEdges(n,e);if(t)return t.concat(this.outEdges(n,e))},Hu}function Rl(){if(Wu)return Gu;Wu=1;var n=Ll(),e=Dl();function t(e){return n.map(e.nodes(),(function(t){var r=e.node(t),o=e.parent(t),i={v:t};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(e){return n.map(e.edges(),(function(t){var r=e.edge(t),o={v:t.v,w:t.w};return n.isUndefined(t.name)||(o.name=t.name),n.isUndefined(r)||(o.value=r),o}))}return Gu={write:function(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t(e),edges:r(e)};return n.isUndefined(e.graph())||(o.value=n.clone(e.graph())),o},read:function(t){var r=new e(t.options).setGraph(t.value);return n.each(t.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(t.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Vl(){if($u)return qu;$u=1;var n=Ll();return qu=function(e){var t,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,t.push(o),n.each(e.successors(o),i),n.each(e.predecessors(o),i))}return n.each(e.nodes(),(function(n){t=[],i(n),t.length&&o.push(t)})),o},qu}function Hl(){if(Qu)return Ku;Qu=1;var n=Ll();function e(){this._arr=[],this._keyIndices={}}return Ku=e,e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},e.prototype.has=function(e){return n.has(this._keyIndices,e)},e.prototype.priority=function(n){var e=this._keyIndices[n];if(void 0!==e)return this._arr[e].priority},e.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!n.has(r,e)){var o=this._arr,i=o.length;return r[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,e){var t=this._keyIndices[n];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)},e.prototype._heapify=function(n){var e=this._arr,t=2*n,r=t+1,o=n;t<e.length&&(o=e[t].priority<e[o].priority?t:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},e.prototype._decrease=function(n){for(var e,t=this._arr,r=t[n].priority;0!==n&&!(t[e=n>>1].priority<r);)this._swap(n,e),n=e},e.prototype._swap=function(n,e){var t=this._arr,r=this._keyIndices,o=t[n],i=t[e];t[n]=i,t[e]=o,r[i.key]=n,r[o.key]=e},Ku}function Yl(){if(nc)return Ju;nc=1;var n=Ll(),e=Hl();Ju=function(n,r,o,i){return function(n,t,r,o){var i,a,u={},c=new e,l=function(n){var e=n.v!==i?n.v:n.w,t=u[e],o=r(n),l=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+n+" Weight: "+o);l<t.distance&&(t.distance=l,t.predecessor=i,c.decrease(e,l))};for(n.nodes().forEach((function(n){var e=n===t?0:Number.POSITIVE_INFINITY;u[n]={distance:e},c.add(n,e)}));c.size()>0&&(i=c.removeMin(),(a=u[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return u}(n,String(r),o||t,i||function(e){return n.outEdges(e)})};var t=n.constant(1);return Ju}function Xl(){if(tc)return ec;tc=1;var n=Yl(),e=Ll();return ec=function(t,r,o){return e.transform(t.nodes(),(function(e,i){e[i]=n(t,i,r,o)}),{})}}function Fl(){if(oc)return rc;oc=1;var n=Ll();return rc=function(e){var t=0,r=[],o={},i=[];function a(u){var c=o[u]={onStack:!0,lowlink:t,index:t++};if(r.push(u),e.successors(u).forEach((function(e){n.has(o,e)?o[e].onStack&&(c.lowlink=Math.min(c.lowlink,o[e].index)):(a(e),c.lowlink=Math.min(c.lowlink,o[e].lowlink))})),c.lowlink===c.index){var l,s=[];do{l=r.pop(),o[l].onStack=!1,s.push(l)}while(u!==l);i.push(s)}}return e.nodes().forEach((function(e){n.has(o,e)||a(e)})),i},rc}function Zl(){if(ac)return ic;ac=1;var n=Ll(),e=Fl();return ic=function(t){return n.filter(e(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function Ul(){if(cc)return uc;cc=1;var n=Ll();uc=function(n,t,r){return function(n,e,t){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(e){n!==e&&(r[n][e]={distance:Number.POSITIVE_INFINITY})})),t(n).forEach((function(t){var o=t.v===n?t.w:t.v,i=e(t);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var e=r[n];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[n],o=e[t],a=i[t],u=r.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)}))}))})),r}(n,t||e,r||function(e){return n.outEdges(e)})};var e=n.constant(1);return uc}function Gl(){if(sc)return lc;sc=1;var n=Ll();function e(e){var r={},o={},i=[];if(n.each(e.sinks(),(function a(u){if(n.has(o,u))throw new t;n.has(r,u)||(o[u]=!0,r[u]=!0,n.each(e.predecessors(u),a),delete o[u],i.push(u))})),n.size(r)!==e.nodeCount())throw new t;return i}function t(){}return lc=e,e.CycleException=t,t.prototype=new Error,lc}function Wl(){if(fc)return dc;fc=1;var n=Gl();return dc=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}function ql(){if(vc)return hc;vc=1;var n=Ll();function e(t,r,o,i,a,u){n.has(i,r)||(i[r]=!0,o||u.push(r),n.each(a(r),(function(n){e(t,n,o,i,a,u)})),o&&u.push(r))}return hc=function(t,r,o){n.isArray(r)||(r=[r]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],u={};return n.each(r,(function(n){if(!t.hasNode(n))throw new Error("Graph does not have node: "+n);e(t,n,"post"===o,u,i,a)})),a},hc}function $l(){if(gc)return pc;gc=1;var n=ql();return pc=function(e,t){return n(e,t,"post")}}function Kl(){if(mc)return yc;mc=1;var n=ql();return yc=function(e,t){return n(e,t,"pre")}}function Ql(){if(bc)return wc;bc=1;var n=Ll(),e=Dl(),t=Hl();return wc=function(r,o){var i,a=new e,u={},c=new t;function l(n){var e=n.v===i?n.w:n.v,t=c.priority(e);if(void 0!==t){var r=o(n);r<t&&(u[e]=i,c.decrease(e,r))}}if(0===r.nodeCount())return a;n.each(r.nodes(),(function(n){c.add(n,Number.POSITIVE_INFINITY),a.setNode(n)})),c.decrease(r.nodes()[0],0);for(var s=!1;c.size()>0;){if(i=c.removeMin(),n.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},wc}Nc.exports;try{kc=function(){if(Sc)return Ec;Sc=1;var n=Uu?Zu:(Uu=1,Zu={Graph:Dl(),version:Fu?Xu:(Fu=1,Xu="2.1.8")});return Ec={Graph:n.Graph,json:Rl(),alg:_c?xc:(_c=1,xc={components:Vl(),dijkstra:Yl(),dijkstraAll:Xl(),findCycles:Zl(),floydWarshall:Ul(),isAcyclic:Wl(),postorder:$l(),preorder:Kl(),prim:Ql(),tarjan:Fl(),topsort:Gl()}),version:n.version}}()}catch(H){}kc||(kc=window.graphlib);var Jl,ns,es,ts,rs,os,is,as,us,cs,ls,ss,ds,fs,hs,vs,ps,gs,ys,ms,ws,bs,xs,_s,Es,Ss,ks,Ns,Cs,Os,Ms,js,Ps,Is,As,zs,Ts,Bs,Ls,Ds,Rs,Vs,Hs,Ys,Xs,Fs,Zs,Us,Gs,Ws,qs,$s,Ks,Qs,Js,nd,ed,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,Od,Md,jd,Pd,Id,Ad,zd,Td,Bd,Ld,Dd=kc;function Rd(){if(ts)return es;ts=1;var n=Ue(),e=fr(),t=Mt(),r=Je();return es=function(o,i,a){if(!r(a))return!1;var u=typeof i;return!!("number"==u?e(a)&&t(i,a.length):"string"==u&&i in a)&&n(a[i],o)}}function Vd(){if(vs)return hs;vs=1;var n=function(){if(fs)return ds;fs=1;var n=function(){if(ss)return ls;ss=1;var n=function(){if(cs)return us;cs=1;var n=/\s/;return us=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}}(),e=/^\s+/;return ls=function(t){return t?t.slice(0,n(t)+1).replace(e,""):t}}(),e=Je(),t=cl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;return ds=function(u){if("number"==typeof u)return u;if(t(u))return NaN;if(e(u)){var c="function"==typeof u.valueOf?u.valueOf():u;u=e(c)?c+"":c}if("string"!=typeof u)return 0===u?u:+u;u=n(u);var l=o.test(u);return l||i.test(u)?a(u.slice(2),l?2:8):r.test(u)?NaN:+u}}(),e=1/0;return hs=function(t){return t?(t=n(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}}function Hd(){if(_s)return xs;_s=1;var n=Ol();return xs=function(e){return null!=e&&e.length?n(e,1):[]},xs}function Yd(){if(js)return Ms;js=1;var n=cl();return Ms=function(e,t,r){for(var o=-1,i=e.length;++o<i;){var a=e[o],u=t(a);if(null!=u&&(void 0===c?u==u&&!n(u):r(u,c)))var c=u,l=a}return l},Ms}function Xd(){if(Bs)return Ts;Bs=1;var n=st(),e=Ue();return Ts=function(t,r,o){(void 0!==o&&!e(t[r],o)||void 0===o&&!(r in t))&&n(t,r,o)}}function Fd(){return Vs?Rs:(Vs=1,Rs=function(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]})}function Zd(){return Qs?Ks:(Qs=1,Ks=function(n,e){return n<e})}function Ud(){if(Od)return Cd;Od=1;var n=sl(),e=vl(),t=ml(),r=El(),o=(_d||(_d=1,xd=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}),xd),i=Pt(),a=function(){if(Nd)return kd;Nd=1;var n=function(){if(Sd)return Ed;Sd=1;var n=cl();return Ed=function(e,t){if(e!==t){var r=void 0!==e,o=null===e,i=e==e,a=n(e),u=void 0!==t,c=null===t,l=t==t,s=n(t);if(!c&&!s&&!a&&e>t||a&&u&&l&&!c&&!s||o&&u&&l||!r&&l||!i)return 1;if(!o&&!a&&!s&&e<t||s&&r&&i&&!o&&!a||c&&r&&i||!u&&i||!l)return-1}return 0}}();return kd=function(e,t,r){for(var o=-1,i=e.criteria,a=t.criteria,u=i.length,c=r.length;++o<u;){var l=n(i[o],a[o]);if(l)return o>=c?l:l*("desc"==r[o]?-1:1)}return e.index-t.index}}(),u=$c(),c=pt();return Cd=function(l,s,d){s=s.length?n(s,(function(n){return c(n)?function(t){return e(t,1===n.length?n[0]:n)}:n})):[u];var f=-1;s=n(s,i(t));var h=r(l,(function(e,t,r){return{criteria:n(s,(function(n){return n(e)})),index:++f,value:e}}));return o(h,(function(n,e){return a(n,e,d)}))}}try{Ld={cloneDeep:function(){if(ns)return Jl;ns=1;var n=Fc();return Jl=function(e){return n(e,5)}}(),constant:Uc(),defaults:function(){if(os)return rs;os=1;var n=Pl(),e=Ue(),t=Rd(),r=vr(),o=Object.prototype,i=o.hasOwnProperty,a=n((function(n,a){n=Object(n);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=n[v];(void 0===p||e(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return rs=a}(),each:Jc(),filter:wl(),find:function(){if(bs)return ws;bs=1;var n=function(){if(as)return is;as=1;var n=ml(),e=fr(),t=hr();return is=function(r){return function(o,i,a){var u=Object(o);if(!e(o)){var c=n(i,3);o=t(o),i=function(n){return c(u[n],n,u)}}var l=r(o,i,a);return l>-1?u[c?o[l]:l]:void 0}}}(),e=n(function(){if(ms)return ys;ms=1;var n=Il(),e=ml(),t=function(){if(gs)return ps;gs=1;var n=Vd();return ps=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return ys=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)),n(o,e(i,3),c)},ys}());return ws=e}(),flatten:Hd(),forEach:Qc(),forIn:function(){if(Ss)return Es;Ss=1;var n=Gc(),e=Kc(),t=vr();return Es=function(r,o){return null==r?r:n(r,e(o),t)}}(),has:bl(),isUndefined:_l(),last:(Ns||(Ns=1,ks=function(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}),ks),map:Sl(),mapValues:function(){if(Os)return Cs;Os=1;var n=st(),e=Wc(),t=ml();return Cs=function(r,o){var i={};return o=t(o,3),e(r,(function(e,t,r){n(i,t,o(e,t,r))})),i}}(),max:function(){if(zs)return As;zs=1;var n=Yd(),e=Is?Ps:(Is=1,Ps=function(n,e){return n>e}),t=$c();return As=function(r){return r&&r.length?n(r,t,e):void 0},As}(),merge:function(){if($s)return qs;$s=1;var n=function(){if(Us)return Zs;Us=1;var n=ut(),e=Xd(),t=Gc(),r=function(){if(Fs)return Xs;Fs=1;var n=Xd(),e=Cc(),t=Hc(),r=Oc(),o=Xc(),i=vt(),a=pt(),u=zl(),c=Ot(),l=nt(),s=Je(),d=function(){if(Ds)return Ls;Ds=1;var n=Qe(),e=Ac(),t=ht(),r=Function.prototype,o=Object.prototype,i=r.toString,a=o.hasOwnProperty,u=i.call(Object);return Ls=function(r){if(!t(r)||"[object Object]"!=n(r))return!1;var o=e(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=ur(),h=Fd(),v=function(){if(Ys)return Hs;Ys=1;var n=ft(),e=vr();return Hs=function(t){return n(t,e(t))}}();return Xs=function(p,g,y,m,w,b,x){var _=h(p,y),E=h(g,y),S=x.get(E);if(S)n(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),O=!C&&c(E),M=!C&&!O&&f(E);k=E,C||O||M?a(_)?k=_:u(_)?k=r(_):O?(N=!1,k=e(E,!0)):M?(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)),n(p,y,k)}}}(),o=Je(),i=vr(),a=Fd();return Zs=function u(c,l,s,d,f){c!==l&&t(l,(function(t,i){if(f||(f=new n),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),e(c,i,h)}}),i)},Zs}(),e=function(){if(Ws)return Gs;Ws=1;var n=Pl(),e=Rd();return Gs=function(t){return n((function(n,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&&e(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),n=Object(n);++o<i;){var c=r[o];c&&t(n,c,o,a)}return n}))}}()((function(e,t,r){n(e,t,r)}));return qs=e}(),min:function(){if(nd)return Js;nd=1;var n=Yd(),e=Zd(),t=$c();return Js=function(r){return r&&r.length?n(r,t,e):void 0},Js}(),minBy:function(){if(td)return ed;td=1;var n=Yd(),e=ml(),t=Zd();return ed=function(r,o){return r&&r.length?n(r,e(o,2),t):void 0},ed}(),now:function(){if(od)return rd;od=1;var n=$e();return rd=function(){return n.Date.now()}}(),pick:function(){if(vd)return hd;vd=1;var n=function(){if(sd)return ld;sd=1;var n=function(){if(cd)return ud;cd=1;var n=vl(),e=function(){if(ad)return id;ad=1;var n=dt(),e=fl(),t=Mt(),r=Je(),o=hl();return id=function(i,a,u,c){if(!r(i))return i;for(var l=-1,s=(a=e(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])?[]:{})}n(f,h,v),f=f[h]}return i}}(),t=fl();return ud=function(r,o,i){for(var a=-1,u=o.length,c={};++a<u;){var l=o[a],s=n(r,l);i(s,l)&&e(c,t(l,r),s)}return c}}(),e=gl();return ld=function(t,r){return n(t,r,(function(n,r){return e(t,r)}))}}(),e=function(){if(fd)return dd;fd=1;var n=Hd(),e=Ml(),t=jl();return dd=function(r){return t(e(r,void 0,n),r+"")}}(),t=e((function(e,t){return null==e?{}:n(e,t)}));return hd=t}(),range:function(){if(bd)return wd;bd=1;var n=function(){if(md)return yd;md=1;var n=function(){if(gd)return pd;gd=1;var n=Math.ceil,e=Math.max;return pd=function(t,r,o,i){for(var a=-1,u=e(n((r-t)/(o||1)),0),c=Array(u);u--;)c[i?u:++a]=t,t+=o;return c},pd}(),e=Rd(),t=Vd();return yd=function(r){return function(o,i,a){return a&&"number"!=typeof a&&e(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),n(o,i,a,r)}},yd}()();return wd=n}(),reduce:kl(),sortBy:function(){if(jd)return Md;jd=1;var n=Ol(),e=Ud(),t=Pl(),r=Rd(),o=t((function(t,o){if(null==t)return[];var i=o.length;return i>1&&r(t,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(t,n(o,1),[])}));return Md=o}(),uniqueId:function(){if(Id)return Pd;Id=1;var n=dl(),e=0;return Pd=function(t){var r=++e;return n(t)+r},Pd}(),values:Bl(),zipObject:function(){if(Bd)return Td;Bd=1;var n=dt(),e=(zd||(zd=1,Ad=function(n,e,t){for(var r=-1,o=n.length,i=e.length,a={};++r<o;){var u=r<i?e[r]:void 0;t(a,n[r],u)}return a}),Ad);return Td=function(t,r){return e(t||[],r||[],n)},Td}()}}catch(H){}Ld||(Ld=window._);var Gd=Ld,Wd=qd;function qd(){var n={};n._next=n._prev=n,this._sentinel=n}function $d(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Kd(n,e){if("_next"!==n&&"_prev"!==n)return e}qd.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return $d(e),e},qd.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&$d(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},qd.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,Kd)),t=t._prev;return"["+n.join(", ")+"]"};var Qd=Gd,Jd=Dd.Graph,nf=Wd,ef=Qd.constant(1);function tf(n,e,t,r,o){var i=o?[]:void 0;return Qd.forEach(n.inEdges(r.v),(function(r){var a=n.edge(r),u=n.node(r.v);o&&i.push({v:r.v,w:r.w}),u.out-=a,rf(e,t,u)})),Qd.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,a=n.node(i);a.in-=o,rf(e,t,a)})),n.removeNode(r.v),i}function rf(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var of=Gd,af=function(n,e){if(n.nodeCount()<=1)return[];var t=function(n,e){var t=new Jd,r=0,o=0;Qd.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),Qd.forEach(n.edges(),(function(n){var i=t.edge(n.v,n.w)||0,a=e(n),u=i+a;t.setEdge(n.v,n.w,u),o=Math.max(o,t.node(n.v).out+=a),r=Math.max(r,t.node(n.w).in+=a)}));var i=Qd.range(o+r+3).map((function(){return new nf})),a=r+1;return Qd.forEach(t.nodes(),(function(n){rf(i,a,t.node(n))})),{graph:t,buckets:i,zeroIdx:a}}(n,e||ef),r=function(n,e,t){for(var r,o=[],i=e[e.length-1],a=e[0];n.nodeCount();){for(;r=a.dequeue();)tf(n,e,t,r);for(;r=i.dequeue();)tf(n,e,t,r);if(n.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(tf(n,e,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return Qd.flatten(Qd.map(r,(function(e){return n.outEdges(e.v,e.w)})),!0)},uf={run:function(n){var e="greedy"===n.graph().acyclicer?af(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],t={},r={};return of.forEach(n.nodes(),(function o(i){of.has(r,i)||(r[i]=!0,t[i]=!0,of.forEach(n.outEdges(i),(function(n){of.has(t,n.w)?e.push(n):o(n.w)})),delete t[i])})),e}(n);of.forEach(e,(function(e){var t=n.edge(e);n.removeEdge(e),t.forwardName=e.name,t.reversed=!0,n.setEdge(e.w,e.v,t,of.uniqueId("rev"))}))},undo:function(n){of.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}}))}},cf=Gd,lf=Dd.Graph,sf={addDummyNode:df,simplify:function(n){var e=(new lf).setGraph(n.graph());return cf.forEach(n.nodes(),(function(t){e.setNode(t,n.node(t))})),cf.forEach(n.edges(),(function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},o=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(n){var e=new lf({multigraph:n.isMultigraph()}).setGraph(n.graph());return cf.forEach(n.nodes(),(function(t){n.children(t).length||e.setNode(t,n.node(t))})),cf.forEach(n.edges(),(function(t){e.setEdge(t,n.edge(t))})),e},successorWeights:function(n){var e=cf.map(n.nodes(),(function(e){var t={};return cf.forEach(n.outEdges(e),(function(e){t[e.w]=(t[e.w]||0)+n.edge(e).weight})),t}));return cf.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=cf.map(n.nodes(),(function(e){var t={};return cf.forEach(n.inEdges(e),(function(e){t[e.v]=(t[e.v]||0)+n.edge(e).weight})),t}));return cf.zipObject(n.nodes(),e)},intersectRect:function(n,e){var t,r,o=n.x,i=n.y,a=e.x-o,u=e.y-i,c=n.width/2,l=n.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(n){var e=cf.map(cf.range(ff(n)+1),(function(){return[]}));return cf.forEach(n.nodes(),(function(t){var r=n.node(t),o=r.rank;cf.isUndefined(o)||(e[o][r.order]=t)})),e},normalizeRanks:function(n){var e=cf.min(cf.map(n.nodes(),(function(e){return n.node(e).rank})));cf.forEach(n.nodes(),(function(t){var r=n.node(t);cf.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(n){var e=cf.min(cf.map(n.nodes(),(function(e){return n.node(e).rank}))),t=[];cf.forEach(n.nodes(),(function(r){var o=n.node(r).rank-e;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;cf.forEach(t,(function(e,t){cf.isUndefined(e)&&t%o!=0?--r:r&&cf.forEach(e,(function(e){n.node(e).rank+=r}))}))},addBorderNode:function(n,e,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),df(n,"border",o,e)},maxRank:ff,partition:function(n,e){var t={lhs:[],rhs:[]};return cf.forEach(n,(function(n){e(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,e){var t=cf.now();try{return e()}finally{console.log(n+" time: "+(cf.now()-t)+"ms")}},notime:function(n,e){return e()}};function df(n,e,t,r){var o;do{o=cf.uniqueId(r)}while(n.hasNode(o));return t.dummy=e,n.setNode(o,t),o}function ff(n){return cf.max(cf.map(n.nodes(),(function(e){var t=n.node(e).rank;if(!cf.isUndefined(t))return t})))}var hf=Gd,vf=sf,pf={run:function(n){n.graph().dummyChains=[],hf.forEach(n.edges(),(function(e){!function(n,e){var t,r,o,i=e.v,a=n.node(i).rank,u=e.w,c=n.node(u).rank,l=e.name,s=n.edge(e),d=s.labelRank;if(c!==a+1){for(n.removeEdge(e),o=0,++a;a<c;++o,++a)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:e,rank:a},t=vf.addDummyNode(n,"edge",r,"_d"),a===d&&(r.width=s.width,r.height=s.height,r.dummy="edge-label",r.labelpos=s.labelpos),n.setEdge(i,t,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(t),i=t;n.setEdge(i,u,{weight:s.weight},l)}}(n,e)}))},undo:function(n){hf.forEach(n.graph().dummyChains,(function(e){var t,r=n.node(e),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)t=n.successors(e)[0],n.removeNode(e),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),e=t,r=n.node(e)}))}},gf=Gd,yf=function(n){var e={};gf.forEach(n.sources(),(function t(r){var o=n.node(r);if(gf.has(e,r))return o.rank;e[r]=!0;var i=gf.min(gf.map(n.outEdges(r),(function(e){return t(e.w)-n.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},mf=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},wf=Gd,bf=Dd.Graph,xf=mf,_f=function(n){var e,t,r=new bf({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Ef(r,n)<i;)e=Sf(r,n),t=r.hasNode(e.v)?xf(n,e):-xf(n,e),kf(r,n,t);return r};function Ef(n,e){return wf.forEach(n.nodes(),(function t(r){wf.forEach(e.nodeEdges(r),(function(o){var i=o.v,a=r===i?o.w:i;n.hasNode(a)||xf(e,o)||(n.setNode(a,{}),n.setEdge(r,a,{}),t(a))}))})),n.nodeCount()}function Sf(n,e){return wf.minBy(e.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return xf(e,t)}))}function kf(n,e,t){wf.forEach(n.nodes(),(function(n){e.node(n).rank+=t}))}var Nf=Gd,Cf=_f,Of=mf,Mf=yf,jf=Dd.alg.preorder,Pf=Dd.alg.postorder,If=sf.simplify,Af=zf;function zf(n){n=If(n),Mf(n);var e,t=Cf(n);for(Lf(t),Tf(t,n);e=Rf(t);)Hf(t,n,e,Vf(t,n,e))}function Tf(n,e){var t=Pf(n,n.nodes());t=t.slice(0,t.length-1),Nf.forEach(t,(function(t){!function(n,e,t){var r=n.node(t).parent;n.edge(t,r).cutvalue=Bf(n,e,t)}(n,e,t)}))}function Bf(n,e,t){var r=n.node(t).parent,o=!0,i=e.edge(t,r),a=0;return i||(o=!1,i=e.edge(r,t)),a=i.weight,Nf.forEach(e.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=e.edge(i).weight;if(a+=d?f:-f,u=t,c=s,n.hasEdge(u,c)){var h=n.edge(t,s).cutvalue;a+=d?-h:h}}})),a}function Lf(n,e){arguments.length<2&&(e=n.nodes()[0]),Df(n,{},1,e)}function Df(n,e,t,r,o){var i=t,a=n.node(r);return e[r]=!0,Nf.forEach(n.neighbors(r),(function(o){Nf.has(e,o)||(t=Df(n,e,t,o,r))})),a.low=i,a.lim=t++,o?a.parent=o:delete a.parent,t}function Rf(n){return Nf.find(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function Vf(n,e,t){var r=t.v,o=t.w;e.hasEdge(r,o)||(r=t.w,o=t.v);var i=n.node(r),a=n.node(o),u=i,c=!1;i.lim>a.lim&&(u=a,c=!0);var l=Nf.filter(e.edges(),(function(e){return c===Yf(n,n.node(e.v),u)&&c!==Yf(n,n.node(e.w),u)}));return Nf.minBy(l,(function(n){return Of(e,n)}))}function Hf(n,e,t,r){var o=t.v,i=t.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Lf(n),Tf(n,e),function(n,e){var t=Nf.find(n.nodes(),(function(n){return!e.node(n).parent})),r=jf(n,t);r=r.slice(1),Nf.forEach(r,(function(t){var r=n.node(t).parent,o=e.edge(t,r),i=!1;o||(o=e.edge(r,t),i=!0),e.node(t).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,e)}function Yf(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}zf.initLowLimValues=Lf,zf.initCutValues=Tf,zf.calcCutValue=Bf,zf.leaveEdge=Rf,zf.enterEdge=Vf,zf.exchangeEdges=Hf;var Xf=yf,Ff=_f,Zf=Af,Uf=Xf;var Gf=Gd,Wf=Gd,qf=sf,$f={run:function(n){var e=qf.addDummyNode(n,"root",{},"_root"),t=function(n){var e={};function t(r,o){var i=n.children(r);i&&i.length&&Wf.forEach(i,(function(n){t(n,o+1)})),e[r]=o}return Wf.forEach(n.children(),(function(n){t(n,1)})),e}(n),r=Wf.max(Wf.values(t))-1,o=2*r+1;n.graph().nestingRoot=e,Wf.forEach(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return Wf.reduce(n.edges(),(function(e,t){return e+n.edge(t).weight}),0)}(n)+1;Wf.forEach(n.children(),(function(a){Kf(n,e,o,i,r,t,a)})),n.graph().nodeRankFactor=o},cleanup:function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,Wf.forEach(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}};function Kf(n,e,t,r,o,i,a){var u=n.children(a);if(u.length){var c=qf.addBorderNode(n,"_bt"),l=qf.addBorderNode(n,"_bb"),s=n.node(a);n.setParent(c,a),s.borderTop=c,n.setParent(l,a),s.borderBottom=l,Wf.forEach(u,(function(u){Kf(n,e,t,r,o,i,u);var s=n.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;n.setEdge(c,d,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(f,l,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(a)||n.setEdge(e,c,{weight:0,minlen:o+i[a]})}else a!==e&&n.setEdge(e,a,{weight:0,minlen:t})}var Qf=Gd,Jf=sf;function nh(n,e,t,r,o,i){var a={width:0,height:0,rank:i,borderType:e},u=o[e][i-1],c=Jf.addDummyNode(n,"border",a,t);o[e][i]=c,n.setParent(c,r),u&&n.setEdge(u,c,{weight:1})}var eh=Gd,th={adjust:function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||rh(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){eh.forEach(n.nodes(),(function(e){ih(n.node(e))})),eh.forEach(n.edges(),(function(e){var t=n.edge(e);eh.forEach(t.points,ih),eh.has(t,"y")&&ih(t)}))}(n),"lr"!==e&&"rl"!==e||(function(n){eh.forEach(n.nodes(),(function(e){ah(n.node(e))})),eh.forEach(n.edges(),(function(e){var t=n.edge(e);eh.forEach(t.points,ah),eh.has(t,"x")&&ah(t)}))}(n),rh(n))}};function rh(n){eh.forEach(n.nodes(),(function(e){oh(n.node(e))})),eh.forEach(n.edges(),(function(e){oh(n.edge(e))}))}function oh(n){var e=n.width;n.width=n.height,n.height=e}function ih(n){n.y=-n.y}function ah(n){var e=n.x;n.x=n.y,n.y=e}var uh=Gd,ch=Gd;function lh(n,e,t){for(var r=ch.zipObject(t,ch.map(t,(function(n,e){return e}))),o=ch.flatten(ch.map(e,(function(e){return ch.sortBy(ch.map(n.outEdges(e),(function(e){return{pos:r[e.w],weight:n.edge(e).weight}})),"pos")})),!0),i=1;i<t.length;)i<<=1;var a=2*i-1;i-=1;var u=ch.map(new Array(a),(function(){return 0})),c=0;return ch.forEach(o.forEach((function(n){var e=n.pos+i;u[e]+=n.weight;for(var t=0;e>0;)e%2&&(t+=u[e+1]),u[e=e-1>>1]+=n.weight;c+=n.weight*t}))),c}var sh=Gd,dh=Gd,fh=Gd,hh=sf;function vh(n,e,t){for(var r;e.length&&(r=fh.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var ph=Gd,gh=Gd,yh=Dd.Graph,mh=Gd,wh=Gd,bh=function(n){var e={},t=uh.filter(n.nodes(),(function(e){return!n.children(e).length})),r=uh.max(uh.map(t,(function(e){return n.node(e).rank}))),o=uh.map(uh.range(r+1),(function(){return[]}));var i=uh.sortBy(t,(function(e){return n.node(e).rank}));return uh.forEach(i,(function t(r){if(!uh.has(e,r)){e[r]=!0;var i=n.node(r);o[i.rank].push(r),uh.forEach(n.successors(r),t)}})),o},xh=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=lh(n,e[r-1],e[r]);return t},_h=function n(e,t,r,o){var i=e.children(t),a=e.node(t),u=a?a.borderLeft:void 0,c=a?a.borderRight:void 0,l={};u&&(i=ph.filter(i,(function(n){return n!==u&&n!==c})));var s=function(n,e){return sh.map(e,(function(e){var t=n.inEdges(e);if(t.length){var r=sh.reduce(t,(function(e,t){var r=n.edge(t),o=n.node(t.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);ph.forEach(s,(function(t){if(e.children(t.v).length){var i=n(e,t.v,r,o);l[t.v]=i,ph.has(i,"barycenter")&&(a=t,u=i,ph.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(n,e){var t={};return dh.forEach(n,(function(n,e){var r=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};dh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),dh.forEach(e.edges(),(function(n){var e=t[n.v],r=t[n.w];dh.isUndefined(e)||dh.isUndefined(r)||(r.indegree++,e.out.push(t[n.w]))})),function(n){var e=[];function t(n){return function(e){e.merged||(dh.isUndefined(e.barycenter)||dh.isUndefined(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function r(e){return function(t){t.in.push(e),0==--t.indegree&&n.push(t)}}for(;n.length;){var o=n.pop();e.push(o),dh.forEach(o.in.reverse(),t(o)),dh.forEach(o.out,r(o))}return dh.map(dh.filter(e,(function(n){return!n.merged})),(function(n){return dh.pick(n,["vs","i","barycenter","weight"])}))}(dh.filter(t,(function(n){return!n.indegree})))}(s,r);!function(n,e){ph.forEach(n,(function(n){n.vs=ph.flatten(n.vs.map((function(n){return e[n]?e[n].vs:n})),!0)}))}(d,l);var f=function(n,e){var t,r=hh.partition(n,(function(n){return fh.has(n,"barycenter")})),o=r.lhs,i=fh.sortBy(r.rhs,(function(n){return-n.i})),a=[],u=0,c=0,l=0;o.sort((t=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:t?e.i-n.i:n.i-e.i})),l=vh(a,i,l),fh.forEach(o,(function(n){l+=n.vs.length,a.push(n.vs),u+=n.barycenter*n.weight,c+=n.weight,l=vh(a,i,l)}));var s={vs:fh.flatten(a,!0)};return c&&(s.barycenter=u/c,s.weight=c),s}(d,o);if(u&&(f.vs=ph.flatten([u,f.vs,c],!0),e.predecessors(u).length)){var h=e.node(e.predecessors(u)[0]),v=e.node(e.predecessors(c)[0]);ph.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},Eh=function(n,e,t){var r=function(n){for(var e;n.hasNode(e=gh.uniqueId("_root")););return e}(n),o=new yh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return n.node(e)}));return gh.forEach(n.nodes(),(function(i){var a=n.node(i),u=n.parent(i);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||r),gh.forEach(n[t](i),(function(e){var t=e.v===i?e.w:e.v,r=o.edge(t,i),a=gh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:n.edge(e).weight+a})})),gh.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),o},Sh=Dd.Graph,kh=sf;function Nh(n,e,t){return wh.map(e,(function(e){return Eh(n,e,t)}))}function Ch(n,e){var t=new Sh;wh.forEach(n,(function(n){var r=n.graph().root,o=_h(n,r,t,e);wh.forEach(o.vs,(function(e,t){n.node(e).order=t})),function(n,e,t){var r,o={};mh.forEach(t,(function(t){for(var i,a,u=n.parent(t);u;){if((i=n.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=i}}))}(n,t,o.vs)}))}function Oh(n,e){wh.forEach(e,(function(e){wh.forEach(e,(function(e,t){n.node(e).order=t}))}))}var Mh=Gd,jh=Dd.Graph,Ph=sf;function Ih(n,e,t){if(e>t){var r=e;e=t,t=r}var o=n[e];o||(n[e]=o={}),o[t]=!0}function Ah(n,e,t){if(e>t){var r=e;e=t,t=r}return Mh.has(n[e],t)}var zh=Gd,Th=sf,Bh=function(n){var e,t=Ph.buildLayerMatrix(n),r=Mh.merge(function(n,e){var t={};return Mh.reduce(e,(function(e,r){var o=0,i=0,a=e.length,u=Mh.last(r);return Mh.forEach(r,(function(e,c){var l=function(n,e){if(n.node(e).dummy)return Mh.find(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),s=l?n.node(l).order:a;(l||e===u)&&(Mh.forEach(r.slice(i,c+1),(function(e){Mh.forEach(n.predecessors(e),(function(r){var i=n.node(r),a=i.order;!(a<o||s<a)||i.dummy&&n.node(e).dummy||Ih(t,r,e)}))})),i=c+1,o=s)})),r})),t}(n,t),function(n,e){var t={};function r(e,r,o,i,a){var u;Mh.forEach(Mh.range(r,o),(function(r){u=e[r],n.node(u).dummy&&Mh.forEach(n.predecessors(u),(function(e){var r=n.node(e);r.dummy&&(r.order<i||r.order>a)&&Ih(t,e,u)}))}))}return Mh.reduce(e,(function(e,t){var o,i=-1,a=0;return Mh.forEach(t,(function(u,c){if("border"===n.node(u).dummy){var l=n.predecessors(u);l.length&&(o=n.node(l[0]).order,r(t,a,c,i,o),a=c,i=o)}r(t,a,t.length,o,e.length)})),t})),t}(n,t)),o={};Mh.forEach(["u","d"],(function(i){e="u"===i?t:Mh.values(t).reverse(),Mh.forEach(["l","r"],(function(t){"r"===t&&(e=Mh.map(e,(function(n){return Mh.values(n).reverse()})));var a=("u"===i?n.predecessors:n.successors).bind(n),u=function(n,e,t,r){var o={},i={},a={};return Mh.forEach(e,(function(n){Mh.forEach(n,(function(n,e){o[n]=n,i[n]=n,a[n]=e}))})),Mh.forEach(e,(function(n){var e=-1;Mh.forEach(n,(function(n){var u=r(n);if(u.length){u=Mh.sortBy(u,(function(n){return a[n]}));for(var c=(u.length-1)/2,l=Math.floor(c),s=Math.ceil(c);l<=s;++l){var d=u[l];i[n]===n&&e<a[d]&&!Ah(t,n,d)&&(i[d]=n,i[n]=o[n]=o[d],e=a[d])}}}))})),{root:o,align:i}}(0,e,r,a),c=function(n,e,t,r,o){var i={},a=function(n,e,t,r){var o=new jh,i=n.graph(),a=function(n,e,t){return function(r,o,i){var a,u=r.node(o),c=r.node(i),l=0;if(l+=u.width/2,Mh.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?e:n)/2,l+=(c.dummy?e:n)/2,l+=c.width/2,Mh.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 Mh.forEach(e,(function(e){var r;Mh.forEach(e,(function(e){var i=t[e];if(o.setNode(i),r){var u=t[r],c=o.edge(u,i);o.setEdge(u,i,Math.max(a(n,e,r),c||0))}r=e}))})),o}(n,e,t,o),u=o?"borderLeft":"borderRight";function c(n,e){for(var t=a.nodes(),r=t.pop(),o={};r;)o[r]?n(r):(o[r]=!0,t.push(r),t=t.concat(e(r))),r=t.pop()}return c((function(n){i[n]=a.inEdges(n).reduce((function(n,e){return Math.max(n,i[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),c((function(e){var t=a.outEdges(e).reduce((function(n,e){return Math.min(n,i[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),r=n.node(e);t!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(i[e]=Math.max(i[e],t))}),a.successors.bind(a)),Mh.forEach(r,(function(n){i[n]=i[t[n]]})),i}(n,e,u.root,u.align,"r"===t);"r"===t&&(c=Mh.mapValues(c,(function(n){return-n}))),o[i+t]=c}))}));var i=function(n,e){return Mh.minBy(Mh.values(e),(function(e){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Mh.forIn(e,(function(e,o){var i=function(n,e){return n.node(e).width}(n,o)/2;t=Math.max(e+i,t),r=Math.min(e-i,r)})),t-r}))}(n,o);return function(n,e){var t=Mh.values(e),r=Mh.min(t),o=Mh.max(t);Mh.forEach(["u","d"],(function(t){Mh.forEach(["l","r"],(function(i){var a,u=t+i,c=n[u];if(c!==e){var l=Mh.values(c);(a="l"===i?r-Mh.min(l):o-Mh.max(l))&&(n[u]=Mh.mapValues(c,(function(n){return n+a})))}}))}))}(o,i),function(n,e){return Mh.mapValues(n.ul,(function(t,r){if(e)return n[e.toLowerCase()][r];var o=Mh.sortBy(Mh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Lh=Gd,Dh=uf,Rh=pf,Vh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Zf(n)}(n);break;case"tight-tree":!function(n){Xf(n),Ff(n)}(n);break;case"longest-path":Uf(n)}},Hh=sf.normalizeRanks,Yh=function(n){var e=function(n){var e={},t=0;return Gf.forEach(n.children(),(function r(o){var i=t;Gf.forEach(n.children(o),r),e[o]={low:i,lim:t++}})),e}(n);Gf.forEach(n.graph().dummyChains,(function(t){for(var r=n.node(t),o=r.edgeObj,i=function(n,e,t,r){var o,i,a=[],u=[],c=Math.min(e[t].low,e[r].low),l=Math.max(e[t].lim,e[r].lim);o=t;do{o=n.parent(o),a.push(o)}while(o&&(e[o].low>c||l>e[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(n,e,o.v,o.w),a=i.path,u=i.lca,c=0,l=a[c],s=!0;t!==o.w;){if(r=n.node(t),s){for(;(l=a[c])!==u&&n.node(l).maxRank<r.rank;)c++;l===u&&(s=!1)}if(!s){for(;c<a.length-1&&n.node(l=a[c+1]).minRank<=r.rank;)c++;l=a[c]}n.setParent(t,l),t=n.successors(t)[0]}}))},Xh=sf.removeEmptyRanks,Fh=$f,Zh=function(n){Qf.forEach(n.children(),(function e(t){var r=n.children(t),o=n.node(t);if(r.length&&Qf.forEach(r,e),Qf.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)nh(n,"borderLeft","_bl",t,o,i),nh(n,"borderRight","_br",t,o,i)}}))},Uh=th,Gh=function(n){var e=kh.maxRank(n),t=Nh(n,wh.range(1,e+1),"inEdges"),r=Nh(n,wh.range(e-1,-1,-1),"outEdges"),o=bh(n);Oh(n,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ch(u%2?t:r,u%4>=2),o=kh.buildLayerMatrix(n);var l=xh(n,o);l<a&&(c=0,i=wh.cloneDeep(o),a=l)}Oh(n,i)},Wh=function(n){(function(n){var e=Th.buildLayerMatrix(n),t=n.graph().ranksep,r=0;zh.forEach(e,(function(e){var o=zh.max(zh.map(e,(function(e){return n.node(e).height})));zh.forEach(e,(function(e){n.node(e).y=r+o/2})),r+=o+t}))})(n=Th.asNonCompoundGraph(n)),zh.forEach(Bh(n),(function(e,t){n.node(t).x=e}))},qh=sf,$h=Dd.Graph,Kh=["nodesep","edgesep","ranksep","marginx","marginy"],Qh={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Jh=["acyclicer","ranker","rankdir","align"],nv=["width","height"],ev={width:0,height:0},tv=["minlen","weight","width","height","labeloffset"],rv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ov=["labelpos"];function iv(n,e){return Lh.mapValues(Lh.pick(n,e),Number)}function av(n){var e={};return Lh.forEach(n,(function(n,t){e[t.toLowerCase()]=n})),e}var uv=Gd,cv=sf,lv=Dd.Graph,sv={debugOrdering:function(n){var e=cv.buildLayerMatrix(n),t=new lv({compound:!0,multigraph:!0}).setGraph({});return uv.forEach(n.nodes(),(function(e){t.setNode(e,{label:e}),t.setParent(e,"layer"+n.node(e).rank)})),uv.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),uv.forEach(e,(function(n,e){var r="layer"+e;t.setNode(r,{rank:"same"}),uv.reduce(n,(function(n,e){return t.setEdge(n,e,{style:"invis"}),e}))})),t}},dv=Ze({graphlib:Dd,layout:function(n,e){var t=e&&e.debugTiming?qh.time:qh.notime;t("layout",(function(){var e=t(" buildLayoutGraph",(function(){return function(n){var e=new $h({multigraph:!0,compound:!0}),t=av(n.graph());return e.setGraph(Lh.merge({},Qh,iv(t,Kh),Lh.pick(t,Jh))),Lh.forEach(n.nodes(),(function(t){var r=av(n.node(t));e.setNode(t,Lh.defaults(iv(r,nv),ev)),e.setParent(t,n.parent(t))})),Lh.forEach(n.edges(),(function(t){var r=av(n.edge(t));e.setEdge(t,Lh.merge({},rv,iv(r,tv),Lh.pick(r,ov)))})),e}(n)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,Lh.forEach(n.edges(),(function(t){var r=n.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),e(" removeSelfEdges",(function(){!function(n){Lh.forEach(n.edges(),(function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}}))}(n)})),e(" acyclic",(function(){Dh.run(n)})),e(" nestingGraph.run",(function(){Fh.run(n)})),e(" rank",(function(){Vh(qh.asNonCompoundGraph(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){Lh.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),o={rank:(n.node(e.w).rank-r.rank)/2+r.rank,e:e};qh.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){Xh(n)})),e(" nestingGraph.cleanup",(function(){Fh.cleanup(n)})),e(" normalizeRanks",(function(){Hh(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;Lh.forEach(n.nodes(),(function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=Lh.max(e,r.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){Lh.forEach(n.nodes(),(function(e){var t=n.node(e);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))}))}(n)})),e(" normalize.run",(function(){Rh.run(n)})),e(" parentDummyChains",(function(){Yh(n)})),e(" addBorderSegments",(function(){Zh(n)})),e(" order",(function(){Gh(n)})),e(" insertSelfEdges",(function(){!function(n){var e=qh.buildLayerMatrix(n);Lh.forEach(e,(function(e){var t=0;Lh.forEach(e,(function(e,r){var o=n.node(e);o.order=r+t,Lh.forEach(o.selfEdges,(function(e){qh.addDummyNode(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++t,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(n)})),e(" adjustCoordinateSystem",(function(){Uh.adjust(n)})),e(" position",(function(){Wh(n)})),e(" positionSelfEdges",(function(){!function(n){Lh.forEach(n.nodes(),(function(e){var t=n.node(e);if("selfedge"===t.dummy){var r=n.node(t.e.v),o=r.x+r.width/2,i=r.y,a=t.x-o,u=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),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}}))}(n)})),e(" removeBorderNodes",(function(){!function(n){Lh.forEach(n.nodes(),(function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),o=n.node(t.borderBottom),i=n.node(Lh.last(t.borderLeft)),a=n.node(Lh.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}})),Lh.forEach(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){Rh.undo(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){Lh.forEach(n.edges(),(function(e){var t=n.edge(e);if(Lh.has(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}}))}(n)})),e(" undoCoordinateSystem",(function(){Uh.undo(n)})),e(" translateGraph",(function(){!function(n){var e=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,o=0,i=n.graph(),a=i.marginx||0,u=i.marginy||0;function c(n){var i=n.x,a=n.y,u=n.width,c=n.height;e=Math.min(e,i-u/2),t=Math.max(t,i+u/2),r=Math.min(r,a-c/2),o=Math.max(o,a+c/2)}Lh.forEach(n.nodes(),(function(e){c(n.node(e))})),Lh.forEach(n.edges(),(function(e){var t=n.edge(e);Lh.has(t,"x")&&c(t)})),e-=a,r-=u,Lh.forEach(n.nodes(),(function(t){var o=n.node(t);o.x-=e,o.y-=r})),Lh.forEach(n.edges(),(function(t){var o=n.edge(t);Lh.forEach(o.points,(function(n){n.x-=e,n.y-=r})),Lh.has(o,"x")&&(o.x-=e),Lh.has(o,"y")&&(o.y-=r)})),i.width=t-e+a,i.height=o-r+u}(n)})),e(" assignNodeIntersects",(function(){!function(n){Lh.forEach(n.edges(),(function(e){var t,r,o=n.edge(e),i=n.node(e.v),a=n.node(e.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=a,r=i),o.points.unshift(qh.intersectRect(i,t)),o.points.push(qh.intersectRect(a,r))}))}(n)})),e(" reversePoints",(function(){!function(n){Lh.forEach(n.edges(),(function(e){var t=n.edge(e);t.reversed&&t.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){Dh.undo(n)}))}(e,t)})),t(" updateInputGraph",(function(){!function(n,e){Lh.forEach(n.nodes(),(function(t){var r=n.node(t),o=e.node(t);r&&(r.x=o.x,r.y=o.y,e.children(t).length&&(r.width=o.width,r.height=o.height))})),Lh.forEach(n.edges(),(function(t){var r=n.edge(t),o=e.edge(t);r.points=o.points,Lh.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(n,e)}))}))},debug:sv,util:{time:sf.time,notime:sf.notime},version:"0.8.5"});function fv(n,e,t){void 0===t&&(t={rankdir:"TB"});var r=t.rankdir,o=new dv.graphlib.Graph;return o.setDefaultEdgeLabel((function(){return{}})),o.setGraph({rankdir:r}),n.forEach((function(n){var e,t;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(e=n.data)||void 0===e?void 0:e.width)||200,i=(null===(t=n.data)||void 0===t?void 0:t.height)||56;o.setNode(n.id,{width:r,height:i})})),e.forEach((function(n){o.setEdge(n.source,n.target)})),dv.layout(o),n.forEach((function(n){var e=o.node(n.id),t="bottom",i="top";switch(r){case"TB":t="bottom",i="top";break;case"BT":t="top",i="bottom";break;case"LR":case"RL":t="right",i="left"}n.targetPosition=i,n.sourcePosition=t,n.position={x:e.x-e.width/2,y:e.y-e.height/2}})),{nodes:n,edges:e}}var hv=function(n){return null!==n&&"function"!=typeof n&&isFinite(n.length)},vv=function(n,e){return!!hv(n)&&n.indexOf(e)>-1},pv=function(n,e){if(!hv(n))return n;for(var t=[],r=0;r<n.length;r++){var o=n[r];e(o,r)&&t.push(o)}return t},gv={}.toString,yv=function(n,e){return gv.call(n)==="[object "+e+"]"},mv=function(n){return yv(n,"Function")},wv=function(n){return null==n},bv=function(n){return Array.isArray?Array.isArray(n):yv(n,"Array")},xv=function(n){var e=typeof n;return null!==n&&"object"===e||"function"===e};function _v(n,e){if(n)if(bv(n))for(var t=0,r=n.length;t<r&&!1!==e(n[t],t);t++);else if(xv(n))for(var o in n)if(n.hasOwnProperty(o)&&!1===e(n[o],o))break}var Ev=Object.keys?function(n){return Object.keys(n)}:function(n){var e=[];return _v(n,(function(t,r){mv(n)&&"prototype"===r||e.push(r)})),e};function Sv(n,e){var t=Ev(e),r=t.length;if(wv(n))return!r;for(var o=0;o<r;o+=1){var i=t[o];if(e[i]!==n[i]||!(i in n))return!1}return!0}var kv=function(n){return"object"==typeof n&&null!==n},Nv=function(n){if(!kv(n)||!yv(n,"Object"))return!1;if(null===Object.getPrototypeOf(n))return!0;for(var e=n;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e},Cv=function(n,e){if(void 0===e&&(e=[]),bv(n))for(var t=0;t<n.length;t+=1)Cv(n[t],e);else e.push(n);return e},Ov=function(n){if(bv(n))return n.reduce((function(n,e){return Math.max(n,e)}),n[0])},Mv=function(n){if(bv(n))return n.reduce((function(n,e){return Math.min(n,e)}),n[0])},jv=Array.prototype,Pv=jv.splice,Iv=jv.indexOf,Av=Array.prototype.splice,zv=function(n,e){if(!hv(n))return[];for(var t=n?e.length:0,r=t-1;t--;){var o=void 0,i=e[t];t!==r&&i===o||(o=i,Av.call(n,i,1))}return n},Tv=function(n,e,t){if(!bv(n)&&!Nv(n))return n;var r=t;return _v(n,(function(n,t){r=e(r,n,t)})),r},Bv=function(n){return yv(n,"String")};function Lv(n,e){void 0===e&&(e=new Map);var t=[];if(Array.isArray(n))for(var r=0,o=n.length;r<o;r++){var i=n[r];e.has(i)||(t.push(i),e.set(i,!0))}return t}var Dv=Object.prototype.hasOwnProperty;function Rv(n,e){if(!e||!bv(n))return{};for(var t,r={},o=mv(e)?e:function(n){return n[e]},i=0;i<n.length;i++){var a=n[i];t=o(a),Dv.call(r,t)?r[t].push(a):r[t]=[a]}return r}function Vv(n,e){if(!e)return{0:n};if(!mv(e)){var t=bv(e)?e:e.replace(/\s+/g,"").split("*");e=function(n){for(var e="_",r=0,o=t.length;r<o;r++)e+=n[t[r]]&&n[t[r]].toString();return e}}return Rv(n,e)}var Hv={},Yv=function(n){return yv(n,"Number")},Xv=Number.isInteger?Number.isInteger:function(n){return Yv(n)&&n%1==0},Fv=180/Math.PI,Zv=parseInt,Uv=Math.PI/180,Gv=function(n,e){return n.hasOwnProperty(e)},Wv=Object.values?function(n){return Object.values(n)}:function(n){var e=[];return _v(n,(function(t,r){mv(n)&&"prototype"===r||e.push(t)})),e},qv=function(n){return wv(n)?"":n.toString()},$v={}.toString,Kv=function(n){return $v.call(n).replace(/^\[object /,"").replace(/]$/,"")},Qv=Object.prototype,Jv=function(n){var e=n&&n.constructor;return n===("function"==typeof e&&e.prototype||Qv)};function np(n,e){for(var t in e)e.hasOwnProperty(t)&&"constructor"!==t&&void 0!==e[t]&&(n[t]=e[t])}function ep(n,e,t,r){return e&&np(n,e),t&&np(n,t),r&&np(n,r),n}var tp=function(n){if("object"!=typeof n||null===n)return n;var e;if(bv(n)){e=[];for(var t=0,r=n.length;t<r;t++)"object"==typeof n[t]&&null!=n[t]?e[t]=tp(n[t]):e[t]=n[t]}else for(var o in e={},n)"object"==typeof n[o]&&null!=n[o]?e[o]=tp(n[o]):e[o]=n[o];return e},rp=function(n,e){if(!mv(n))throw new TypeError("Expected a function");var t=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=e?e.apply(this,r):r[0],a=t.cache;if(a.has(i))return a.get(i);var u=n.apply(this,r);return a.set(i,u),u};return t.cache=new Map,t};function op(n,e,t,r){for(var o in t=t||0,r=r||5,e)if(e.hasOwnProperty(o)){var i=e[o];null!==i&&Nv(i)?(Nv(n[o])||(n[o]={}),t<r?op(n[o],i,t+1,r):n[o]=e[o]):bv(i)?(n[o]=[],n[o]=n[o].concat(i)):void 0!==i&&(n[o]=i)}}var ip,ap=Object.prototype.hasOwnProperty,up=function(n,e){if(n===e)return!0;if(!n||!e)return!1;if(Bv(n)||Bv(e))return!1;if(hv(n)||hv(e)){if(n.length!==e.length)return!1;for(var t=!0,r=0;r<n.length&&(t=up(n[r],e[r]));r++);return t}if(kv(n)||kv(e)){var o=Object.keys(n),i=Object.keys(e);if(o.length!==i.length)return!1;for(t=!0,r=0;r<o.length&&(t=up(n[o[r]],e[o[r]]));r++);return t}return!1},cp=function(n){return n},lp=Object.prototype.hasOwnProperty,sp={},dp=function(){return dp=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},dp.apply(this,arguments)};function fp(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function hp(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function vp(n,e,t){if(2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var pp=rp((function(n,e){void 0===e&&(e={});var t=e.fontSize,r=e.fontFamily,o=e.fontWeight,i=e.fontStyle,a=e.fontVariant;return ip||(ip=document.createElement("canvas").getContext("2d")),ip.font=[i,a,o,t+"px",r].join(" "),ip.measureText(Bv(n)?n:"").width}),(function(n,e){return void 0===e&&(e={}),function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;var r=Array(n),o=0;for(e=0;e<t;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}([n],Wv(e)).join("")})),gp=function(){function n(){this.map={}}return n.prototype.has=function(n){return void 0!==this.map[n]},n.prototype.get=function(n,e){var t=this.map[n];return void 0===t?e:t},n.prototype.set=function(n,e){this.map[n]=e},n.prototype.clear=function(){this.map={}},n.prototype.delete=function(n){delete this.map[n]},n.prototype.size=function(){return Object.keys(this.map).length},n}(),yp=Object.freeze({__proto__:null,Cache:gp,assign:ep,augment:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=n[0],r=1;r<n.length;r++){var o=n[r];mv(o)&&(o=o.prototype),ep(t.prototype,o)}},clamp:function(n,e,t){return n<e?e:n>t?t:n},clearAnimationFrame:function(n){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(n)},clone:tp,contains:vv,debounce:function(n,e,t){var r;return function(){var o=this,i=arguments,a=t&&!r;clearTimeout(r),r=setTimeout((function(){r=null,t||n.apply(o,i)}),e),a&&n.apply(o,i)}},deepMix:function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r+=1)op(n,e[r]);return n},difference:function(n,e){return void 0===e&&(e=[]),pv(n,(function(n){return!vv(e,n)}))},each:_v,endsWith:function(n,e){return!(!bv(n)&&!Bv(n))&&n[n.length-1]===e},every:function(n,e){for(var t=0;t<n.length;t++)if(!e(n[t],t))return!1;return!0},extend:function(n,e,t,r){mv(e)||(t=e,e=n,n=function(){});var o=Object.create?function(n,e){return Object.create(n,{constructor:{value:e}})}:function(n,e){function t(){}t.prototype=n;var r=new t;return r.constructor=e,r},i=o(e.prototype,n);return n.prototype=ep(i,n.prototype),n.superclass=o(e.prototype,e),ep(i,t),ep(n,r),n},filter:pv,find:function(n,e){if(!bv(n))return null;var t;if(mv(e)&&(t=e),Nv(e)&&(t=function(n){return Sv(n,e)}),t)for(var r=0;r<n.length;r+=1)if(t(n[r]))return n[r];return null},findIndex:function(n,e,t){void 0===t&&(t=0);for(var r=t;r<n.length;r++)if(e(n[r],r))return r;return-1},firstValue:function(n,e){for(var t=null,r=0;r<n.length;r++){var o=n[r][e];if(!wv(o)){t=bv(o)?o[0]:o;break}}return t},fixedBase:function(n,e){var t=e.toString(),r=t.indexOf(".");if(-1===r)return Math.round(n);var o=t.substr(r+1).length;return o>20&&(o=20),parseFloat(n.toFixed(o))},flatten:function(n){if(!bv(n))return[];for(var e=[],t=0;t<n.length;t++)e=e.concat(n[t]);return e},flattenDeep:Cv,forIn:_v,get:function(n,e,t){for(var r=0,o=Bv(e)?e.split("."):e;n&&r<o.length;)n=n[o[r++]];return void 0===n||r<o.length?t:n},getEllipsisText:function(n,e,t,r){void 0===r&&(r="...");var o,i,a=pp(r,t),u=Bv(n)?n:qv(n),c=e,l=[];if(pp(n,t)<=e)return n;for(;o=u.substr(0,16),!((i=pp(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=pp(o,t))+a>c);)if(l.push(o),c-=i,!(u=u.substr(1)))return l.join("");return""+l.join("")+r},getRange:function(n){var e=n.filter((function(n){return!isNaN(n)}));if(!e.length)return{min:0,max:0};if(bv(n[0])){for(var t=[],r=0;r<n.length;r++)t=t.concat(n[r]);e=t}var o=Ov(e);return{min:Mv(e),max:o}},getType:Kv,getWrapBehavior:function(n,e){return n["_wrap_"+e]},group:function(n,e){if(!e)return[n];var t=Vv(n,e),r=[];for(var o in t)r.push(t[o]);return r},groupBy:Rv,groupToMap:Vv,has:Gv,hasKey:Gv,hasValue:function(n,e){return vv(Wv(n),e)},head:function(n){if(hv(n))return n[0]},identity:function(n){return n},includes:vv,indexOf:function(n,e){if(!hv(n))return-1;var t=Array.prototype.indexOf;if(t)return t.call(n,e);for(var r=-1,o=0;o<n.length;o++)if(n[o]===e){r=o;break}return r},isArguments:function(n){return yv(n,"Arguments")},isArray:bv,isArrayLike:hv,isBoolean:function(n){return yv(n,"Boolean")},isDate:function(n){return yv(n,"Date")},isDecimal:function(n){return Yv(n)&&n%1!=0},isElement:function(n){return n instanceof Element||n instanceof HTMLDocument},isEmpty:function(n){if(wv(n))return!0;if(hv(n))return!n.length;var e=Kv(n);if("Map"===e||"Set"===e)return!n.size;if(Jv(n))return!Object.keys(n).length;for(var t in n)if(ap.call(n,t))return!1;return!0},isEqual:up,isEqualWith:function(n,e,t){return mv(t)?!!t(n,e):up(n,e)},isError:function(n){return yv(n,"Error")},isEven:function(n){return Yv(n)&&n%2==0},isFinite:function(n){return Yv(n)&&isFinite(n)},isFunction:mv,isInteger:Xv,isMatch:Sv,isNegative:function(n){return Yv(n)&&n<0},isNil:wv,isNull:function(n){return null===n},isNumber:Yv,isNumberEqual:function(n,e,t){return void 0===t&&(t=1e-5),Math.abs(n-e)<t},isObject:xv,isObjectLike:kv,isOdd:function(n){return Yv(n)&&n%2!=0},isPlainObject:Nv,isPositive:function(n){return Yv(n)&&n>0},isPrototype:Jv,isRegExp:function(n){return yv(n,"RegExp")},isString:Bv,isType:yv,isUndefined:function(n){return void 0===n},keys:Ev,last:function(n){if(hv(n))return n[n.length-1]},lowerCase:function(n){return qv(n).toLowerCase()},lowerFirst:function(n){var e=qv(n);return e.charAt(0).toLowerCase()+e.substring(1)},map:function(n,e){if(!hv(n))return n;for(var t=[],r=0;r<n.length;r++){var o=n[r];t.push(e(o,r))}return t},mapValues:function(n,e){void 0===e&&(e=cp);var t={};return xv(n)&&!wv(n)&&Object.keys(n).forEach((function(r){t[r]=e(n[r],r)})),t},max:Ov,maxBy:function(n,e){if(bv(n)){for(var t,r=-1/0,o=0;o<n.length;o++){var i=n[o],a=mv(e)?e(i):i[e];a>r&&(t=i,r=a)}return t}},measureTextWidth:pp,memoize:rp,min:Mv,minBy:function(n,e){if(bv(n)){for(var t,r=1/0,o=0;o<n.length;o++){var i=n[o],a=mv(e)?e(i):i[e];a<r&&(t=i,r=a)}return t}},mix:ep,mod:function(n,e){return(n%e+e)%e},noop:function(){},number2color:function(n){var e=Hv[n];if(!e){for(var t=n.toString(16),r=t.length;r<6;r++)t="0"+t;e="#"+t,Hv[n]=e}return e},omit:function(n,e){return Tv(n,(function(n,t,r){return e.includes(r)||(n[r]=t),n}),{})},parseRadius:function(n){var e=0,t=0,r=0,o=0;return bv(n)?1===n.length?e=t=r=o=n[0]:2===n.length?(e=r=n[0],t=o=n[1]):3===n.length?(e=n[0],t=o=n[1],r=n[2]):(e=n[0],t=n[1],r=n[2],o=n[3]):e=t=r=o=n,{r1:e,r2:t,r3:r,r4:o}},pick:function(n,e){if(null===n||!Nv(n))return{};var t={};return _v(e,(function(e){lp.call(n,e)&&(t[e]=n[e])})),t},pull:function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r++)for(var o=e[r],i=-1;(i=Iv.call(n,o))>-1;)Pv.call(n,i,1);return n},pullAt:zv,reduce:Tv,remove:function(n,e){var t=[];if(!hv(n))return t;for(var r=-1,o=[],i=n.length;++r<i;){var a=n[r];e(a,r,n)&&(t.push(a),o.push(r))}return zv(n,o),t},requestAnimationFrame:function(n){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(n){return setTimeout(n,16)})(n)},set:function(n,e,t){var r=n,o=Bv(e)?e.split("."):e;return o.forEach((function(n,e){e<o.length-1?(xv(r[n])||(r[n]=Yv(o[e+1])?[]:{}),r=r[n]):r[n]=t})),n},size:function(n){return wv(n)?0:hv(n)?n.length:Object.keys(n).length},some:function(n,e){for(var t=0;t<n.length;t++)if(e(n[t],t))return!0;return!1},sortBy:function(n,e){var t;if(mv(e))t=function(n,t){return e(n)-e(t)};else{var r=[];Bv(e)?r.push(e):bv(e)&&(r=e),t=function(n,e){for(var t=0;t<r.length;t+=1){var o=r[t];if(n[o]>e[o])return 1;if(n[o]<e[o])return-1}return 0}}return n.sort(t),n},startsWith:function(n,e){return!(!bv(n)&&!Bv(n))&&n[0]===e},substitute:function(n,e){return n&&e?n.replace(/\\?\{([^{}]+)\}/g,(function(n,t){return"\\"===n.charAt(0)?n.slice(1):void 0===e[t]?"":e[t]})):n},throttle:function(n,e,t){var r,o,i,a,u=0;t||(t={});var c=function(){u=!1===t.leading?0:Date.now(),r=null,a=n.apply(o,i),r||(o=i=null)},l=function(){var l=Date.now();u||!1!==t.leading||(u=l);var s=e-(l-u);return o=this,i=arguments,s<=0||s>e?(r&&(clearTimeout(r),r=null),u=l,a=n.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(n){return hv(n)?Array.prototype.slice.call(n):[]},toDegree:function(n){return Fv*n},toInteger:Zv,toRadian:function(n){return Uv*n},toString:qv,union:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return Lv([].concat.apply([],n))},uniq:Lv,uniqueId:function(n){return sp[n=n||"g"]?sp[n]+=1:sp[n]=1,n+sp[n]},upperCase:function(n){return qv(n).toUpperCase()},upperFirst:function(n){var e=qv(n);return e.charAt(0).toUpperCase()+e.substring(1)},values:Wv,valuesOfKey:function(n,e){for(var t=[],r={},o=0;o<n.length;o++){var i=n[o][e];if(!wv(i)){bv(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(n,e){if(n["_wrap_"+e])return n["_wrap_"+e];var t=function(t){n[e](t)};return n["_wrap_"+e]=t,t}}),mp={assign:function(n){if(n.__esModule)return n;var e=n.default;if("function"==typeof e){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach((function(e){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})})),t}(yp).mix,getHeight:function(n,e,t,r){return void 0===r&&(r="height"),"center"===t?(n[r]+e[r])/2:n.height}},wp=mp,bp={getId:function(n){return n.id||n.name},getPreH:function(n){return n.preH||0},getPreV:function(n){return n.preV||0},getHGap:function(n){return n.hgap||18},getVGap:function(n){return n.vgap||18},getChildren:function(n){return n.children},getHeight:function(n){return n.height||36},getWidth:function(n){var e=n.label||" ";return n.width||18*e.split("").length}};function xp(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof xp)return n;t.data=n;var r=e.getHGap(n),o=e.getVGap(n);return t.preH=e.getPreH(n),t.preV=e.getPreV(n),t.width=e.getWidth(n),t.height=e.getHeight(n),t.width+=t.preH,t.height+=t.preV,t.id=e.getId(n),t.x=t.y=0,t.depth=0,t.children||(t.children=[]),t.addGap(r,o),t}wp.assign(xp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,e){var t=this;t.hgap+=n,t.vgap+=e,t.width+=2*n,t.height+=2*e},eachNode:function(n){for(var e,t=[this];e=t.shift();)n(e),t=e.children.concat(t)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var e,t=[this];e=t.shift();)n(e),t=t.concat(e.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){n.left=Math.min(n.left,e.x),n.top=Math.min(n.top,e.y),n.width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height)})),n},translate:function(n,e){void 0===n&&(n=0),void 0===e&&(e=0),this.eachNode((function(t){t.x+=n,t.y+=e,t.x+=t.preH,t.y+=t.preV}))},right2left:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-e.left)-n.width})),n.translate(e.width,0)},bottom2top:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-e.top)-n.height})),n.translate(0,e.height)}});var _p=function(n,e,t){void 0===e&&(e={});var r,o=new xp(n,e=wp.assign({},bp,e)),i=[o];if(!t&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var a=e.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 xp(a[c],e);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Ep=_p,Sp=function(){function n(n,e){void 0===e&&(e={}),this.options=e,this.rootNode=Ep(n,e)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),kp=Sp;function Np(n,e,t,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=e||0,o.y=t||0,o.x=0,o.c=r||[],o.cs=r.length,o.prelim=0,o.mod=0,o.shift=0,o.change=0,o.tl=null,o.tr=null,o.el=null,o.er=null,o.msel=0,o.mser=0}function Cp(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach((function(n){Cp(n,e,t)}))}function Op(n,e){var t=e?n.y:n.x;return n.children.forEach((function(n){t=Math.min(Op(n,e),t)})),t}function Mp(n,e){Cp(n,-Op(n,e),e)}function jp(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach((function(n,r){jp(n,e.children[r],t)}))}function Pp(n,e,t){void 0===t&&(t=0),e?(n.x=t,t+=n.width):(n.y=t,t+=n.height),n.children.forEach((function(n){Pp(n,e,t)}))}Np.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach((function(n){t.push(Np.fromNode(n,e))})),e?new Np(n.height,n.width,n.x,t):new Np(n.width,n.height,n.y,t)};var Ip=_p,Ap=function(n,e){for(var t=Ip(n.data,e,!0),r=Ip(n.data,e,!0),o=n.children.length,i=Math.round(o/2),a=e.getSide||function(n,e){return e<i?"right":"left"},u=0;u<o;u++){var c=n.children[u];"right"===a(c,u)?r.children.push(c):t.children.push(c)}return t.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:t,right:r}},zp=Ap,Tp=["LR","RL","TB","BT","H","V"],Bp=["LR","RL","H"],Lp=Tp[0],Dp=function(n,e,t){var r=e.direction||Lp;if(e.isHorizontal=function(n){return Bp.indexOf(n)>-1}(r),r&&-1===Tp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Tp[0])t(n,e);else if(r===Tp[1])t(n,e),n.right2left();else if(r===Tp[2])t(n,e);else if(r===Tp[3])t(n,e),n.bottom2top();else if(r===Tp[4]||r===Tp[5]){var o=zp(n,e),i=o.left,a=o.right;t(i,e),t(a,e),e.isHorizontal?i.right2left():i.bottom2top(),a.translate(i.x-a.x,i.y-a.y),n.x=i.x,n.y=a.y;var u=n.getBoundingBox();e.isHorizontal?u.top<0&&n.translate(0,-u.top):u.left<0&&n.translate(-u.left,0)}var c=e.fixedRoot;return void 0===c&&(c=!0),c&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),n};function Rp(n,e){return Rp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Rp(n,e)}var Vp=function(n,e){void 0===e&&(e={});var t=e.isHorizontal;function r(n){0===n.cs?(n.el=n,n.er=n,n.msel=n.mser=0):(n.el=n.c[0].el,n.msel=n.c[0].msel,n.er=n.c[n.cs-1].er,n.mser=n.c[n.cs-1].mser)}function o(n,e,t){for(var r=n.c[e-1],o=r.mod,l=n.c[e],s=l.mod;null!==r&&null!==l;){c(r)>t.low&&(t=t.nxt);var d=o+r.prelim+r.w-(s+l.prelim);d>0&&(s+=d,i(n,e,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(n,e,t,r){var o=n.c[0].el;o.tl=t;var i=r-t.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[e].el,n.c[0].msel=n.c[e].msel}(n,e,l,s):r&&!l&&function(n,e,t,r){var o=n.c[e].er;o.tr=t;var i=r-t.mod-n.c[e].mser;o.mod+=i,o.prelim-=i,n.c[e].er=n.c[e-1].er,n.c[e].mser=n.c[e-1].mser}(n,e,r,o)}function i(n,e,t,r){n.c[e].mod+=r,n.c[e].msel+=r,n.c[e].mser+=r,function(n,e,t,r){if(t!==e-1){var o=e-t;n.c[t+1].shift+=r/o,n.c[e].shift-=r/o,n.c[e].change-=r-r/o}}(n,e,t,r)}function a(n){return 0===n.cs?n.tl:n.c[0]}function u(n){return 0===n.cs?n.tr:n.c[n.cs-1]}function c(n){return n.y+n.h}function l(n,e,t){for(;null!==t&&n>=t.low;)t=t.nxt;return{low:n,index:e,nxt:t}}Pp(n,t);var s=Np.fromNode(n,t);return function n(e){if(0!==e.cs){n(e.c[0]);for(var t=l(c(e.c[0].el),0,null),i=1;i<e.cs;++i){n(e.c[i]);var a=c(e.c[i].er);o(e,i,t),t=l(a,i,t)}!function(n){n.prelim=(n.c[0].prelim+n.c[0].mod+n.c[n.cs-1].mod+n.c[n.cs-1].prelim+n.c[n.cs-1].w)/2-n.w/2}(e),r(e)}else r(e)}(s),function n(e,t){t+=e.mod,e.x=e.prelim+t,function(n){for(var e=0,t=0,r=0;r<n.cs;r++)t+=(e+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=t}(e);for(var r=0;r<e.cs;r++)n(e.c[r],t)}(s,0),jp(s,n,t),Mp(n,t),n},Hp=Dp,Yp=mp,Xp=function(n){var e,t;function r(){return n.apply(this,arguments)||this}return t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,Rp(e,t),r.prototype.execute=function(){return Hp(this.rootNode,this.options,Vp)},r}(kp),Fp={},Zp=mp;function Up(n,e){void 0===e&&(e=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=e}var Gp={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Wp(n,e,t){t?(e.x=n.x,e.y=n.y):(e.x=n.y,e.y=n.x),n.children.forEach((function(n,r){Wp(n,e.children[r],t)}))}function qp(n,e){return qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},qp(n,e)}var $p=function(n,e){void 0===e&&(e={}),e=Zp.assign({},Gp,e);var t,r=0,o=function n(e){if(!e)return null;e.width=0,e.depth&&e.depth>r&&(r=e.depth);var t=e.children,o=t.length,i=new Up(e.height,[]);return t.forEach((function(e,t){var r=n(e);i.children.push(r),0===t&&(i.leftChild=r),t===o-1&&(i.rightChild=r)})),i.originNode=e,i.isLeaf=e.isLeaf(),i}(n);return function n(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=r;else{var t=e.children.map((function(e){return n(e)})),o=Math.min.apply(null,t);e.drawingDepth=o-1}return e.drawingDepth}(o),function n(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,t&&(r.y=t.y+t.height+e.nodeSep,r.originNode.parent!==t.originNode.parent&&(r.y+=e.subTreeSep)),t=r):(r.children.forEach((function(e){n(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Wp(o,n,e.isHorizontal),n},Kp=Dp,Qp=mp,Jp=function(n){var e,t;function r(){return n.apply(this,arguments)||this}return t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,qp(e,t),r.prototype.execute=function(){var n=this;return n.rootNode.width=0,Kp(n.rootNode,n.options,$p)},r}(kp),ng={},eg=mp;function tg(n,e){return tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},tg(n,e)}var rg=kp,og=function(n,e,t,r){var o=null;n.eachNode((function(n){!function(n,e,t,r,o){var i="function"==typeof t?t(n):t*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=e?e.y:0)}catch(n){}if(n.x+=i,e){if(n.y=e.y+eg.getHeight(e,n,o),e.parent&&n.parent.id!==e.parent.id){var a=e.parent,u=a.y+eg.getHeight(a,n,o);n.y=u>n.y?u:n.y}}else n.y=0}(n,o,e,t,r),o=n}))},ig=Ap,ag=mp,ug=["LR","RL","H"],cg=ug[0],lg=function(n){var e,t;function r(){return n.apply(this,arguments)||this}return t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,tg(e,t),r.prototype.execute=function(){var n=this.options,e=this.rootNode;n.isHorizontal=!0;var t=n.indent,r=void 0===t?20:t,o=n.dropCap,i=void 0===o||o,a=n.direction,u=void 0===a?cg:a,c=n.align;if(u&&-1===ug.indexOf(u))throw new TypeError("Invalid direction: "+u);if(u===ug[0])og(e,r,i,c);else if(u===ug[1])og(e,r,i,c),e.right2left();else if(u===ug[2]){var l=ig(e,n),s=l.left,d=l.right;og(s,r,i,c),s.right2left(),og(d,r,i,c);var f=s.getBoundingBox();d.translate(f.width,0),e.x=d.x-e.width/2}return e},r}(rg),sg={},dg=mp;function fg(n,e){var t=0;return n.children.length?n.children.forEach((function(n){t+=fg(n,e)})):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function hg(n){var e=n.children,t=e.length;if(t){e.forEach((function(n){hg(n)}));var r=e[0],o=e[t-1],i=o.y-r.y+o.height,a=0;if(e.forEach((function(n){a+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==e.length||n.height>a){var u=n.y+(n.height-i)/2-r.y;e.forEach((function(n){n.translate(0,u)}))}else n.y=(r.y+r.height/2+o.y+o.height/2)/2-n.height/2}}var vg={getSubTreeSep:function(){return 0}};function pg(n,e){return pg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},pg(n,e)}var gg=function(n,e){void 0===e&&(e={}),e=dg.assign({},vg,e),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse((function(n){n.x=n.parent.x+n.parent.width})),n.parent=null,fg(n,e),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var e=n.children,t=e.length;if(t){var r=e[0];if(r.startY=n.startY+n._subTreeSep,1===t)r.y=n.y+n.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var o=1;o<t;o++){var i=e[o];i.startY=e[o-1].startY+e[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),hg(n)},yg=Dp,mg=mp,wg=function(n){var e,t;function r(){return n.apply(this,arguments)||this}return t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,pg(e,t),r.prototype.execute=function(){return yg(this.rootNode,this.options,gg)},r}(kp),bg={};Ze({compactBox:function(n,e){return e=Yp.assign({},Fp,e),new Xp(n,e).execute()},dendrogram:function(n,e){return e=Qp.assign({},ng,e),new Jp(n,e).execute()},indented:function(n,e){return e=ag.assign({},sg,e),new lg(n,e).execute()},mindmap:function(n,e){return e=mg.assign({},bg,e),new wg(n,e).execute()}});var xg={value:()=>{}};function _g(){for(var n,e=0,t=arguments.length,r={};e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Eg(r)}function Eg(n){this._=n}function Sg(n,e){for(var t,r=0,o=n.length;r<o;++r)if((t=n[r]).name===e)return t.value}function kg(n,e,t){for(var r=0,o=n.length;r<o;++r)if(n[r].name===e){n[r]=xg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}Eg.prototype=_g.prototype={constructor:Eg,on:function(n,e){var t,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");if(t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(t=(n=i[a]).type)o[t]=kg(o[t],n.name,e);else if(null==e)for(t in o)o[t]=kg(o[t],n.name,null);return this}for(;++a<u;)if((t=(n=i[a]).type)&&(t=Sg(o[t],n.name)))return t},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new Eg(n)},call:function(n,e){if((t=arguments.length-2)>0)for(var t,r,o=new Array(t),i=0;i<t;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,t=(r=this._[n]).length;i<t;++i)r[i].value.apply(e,o)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],o=0,i=r.length;o<i;++o)r[o].value.apply(e,t)}};var Ng="http://www.w3.org/1999/xhtml",Cg={svg:"http://www.w3.org/2000/svg",xhtml:Ng,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Og(n){var e=n+="",t=e.indexOf(":");return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Cg.hasOwnProperty(e)?{space:Cg[e],local:n}:n}function Mg(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Ng&&e.documentElement.namespaceURI===Ng?e.createElement(n):e.createElementNS(t,n)}}function jg(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Pg(n){var e=Og(n);return(e.local?jg:Mg)(e)}function Ig(){}function Ag(n){return null==n?Ig:function(){return this.querySelector(n)}}function zg(){return[]}function Tg(n){return null==n?zg:function(){return this.querySelectorAll(n)}}function Bg(n){return function(){return this.matches(n)}}function Lg(n){return function(e){return e.matches(n)}}var Dg=Array.prototype.find;function Rg(){return this.firstElementChild}var Vg=Array.prototype.filter;function Hg(){return Array.from(this.children)}function Yg(n){return new Array(n.length)}function Xg(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}function Fg(n,e,t,r,o,i){for(var a,u=0,c=e.length,l=i.length;u<l;++u)(a=e[u])?(a.__data__=i[u],r[u]=a):t[u]=new Xg(n,i[u]);for(;u<c;++u)(a=e[u])&&(o[u]=a)}function Zg(n,e,t,r,o,i,a){var u,c,l,s=new Map,d=e.length,f=i.length,h=new Array(d);for(u=0;u<d;++u)(c=e[u])&&(h[u]=l=a.call(c,c.__data__,u,e)+"",s.has(l)?o[u]=c:s.set(l,c));for(u=0;u<f;++u)l=a.call(n,i[u],u,i)+"",(c=s.get(l))?(r[u]=c,c.__data__=i[u],s.delete(l)):t[u]=new Xg(n,i[u]);for(u=0;u<d;++u)(c=e[u])&&s.get(h[u])===c&&(o[u]=c)}function Ug(n){return n.__data__}function Gg(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function Wg(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function qg(n){return function(){this.removeAttribute(n)}}function $g(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Kg(n,e){return function(){this.setAttribute(n,e)}}function Qg(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function Jg(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function ny(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function ey(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function ty(n){return function(){this.style.removeProperty(n)}}function ry(n,e,t){return function(){this.style.setProperty(n,e,t)}}function oy(n,e,t){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function iy(n,e){return n.style.getPropertyValue(e)||ey(n).getComputedStyle(n,null).getPropertyValue(e)}function ay(n){return function(){delete this[n]}}function uy(n,e){return function(){this[n]=e}}function cy(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function ly(n){return n.trim().split(/^|\s+/)}function sy(n){return n.classList||new dy(n)}function dy(n){this._node=n,this._names=ly(n.getAttribute("class")||"")}function fy(n,e){for(var t=sy(n),r=-1,o=e.length;++r<o;)t.add(e[r])}function hy(n,e){for(var t=sy(n),r=-1,o=e.length;++r<o;)t.remove(e[r])}function vy(n){return function(){fy(this,n)}}function py(n){return function(){hy(this,n)}}function gy(n,e){return function(){(e.apply(this,arguments)?fy:hy)(this,n)}}function yy(){this.textContent=""}function my(n){return function(){this.textContent=n}}function wy(n){return function(){var e=n.apply(this,arguments);this.textContent=null==e?"":e}}function by(){this.innerHTML=""}function xy(n){return function(){this.innerHTML=n}}function _y(n){return function(){var e=n.apply(this,arguments);this.innerHTML=null==e?"":e}}function Ey(){this.nextSibling&&this.parentNode.appendChild(this)}function Sy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ky(){return null}function Ny(){var n=this.parentNode;n&&n.removeChild(this)}function Cy(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Oy(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function My(n){return function(){var e=this.__on;if(e){for(var t,r=0,o=-1,i=e.length;r<i;++r)t=e[r],n.type&&t.type!==n.type||t.name!==n.name?e[++o]=t:this.removeEventListener(t.type,t.listener,t.options);++o?e.length=o:delete this.__on}}}function jy(n,e,t){return function(){var r,o=this.__on,i=function(n){return function(e){n.call(this,e,this.__data__)}}(e);if(o)for(var a=0,u=o.length;a<u;++a)if((r=o[a]).type===n.type&&r.name===n.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=t),void(r.value=e);this.addEventListener(n.type,i,t),r={type:n.type,name:n.name,value:e,listener:i,options:t},o?o.push(r):this.__on=[r]}}function Py(n,e,t){var r=ey(n),o=r.CustomEvent;"function"==typeof o?o=new o(e,t):(o=r.document.createEvent("Event"),t?(o.initEvent(e,t.bubbles,t.cancelable),o.detail=t.detail):o.initEvent(e,!1,!1)),n.dispatchEvent(o)}function Iy(n,e){return function(){return Py(this,n,e)}}function Ay(n,e){return function(){return Py(this,n,e.apply(this,arguments))}}Xg.prototype={constructor:Xg,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},dy.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var zy=[null];function Ty(n,e){this._groups=n,this._parents=e}function By(){return new Ty([[document.documentElement]],zy)}function Ly(n){return"string"==typeof n?new Ty([[document.querySelector(n)]],[document.documentElement]):new Ty([[n]],zy)}function Dy(n,e){if(n=function(n){let e;for(;e=n.sourceEvent;)n=e;return n}(n),void 0===e&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[n.clientX-o.left-e.clientLeft,n.clientY-o.top-e.clientTop]}}return[n.pageX,n.pageY]}Ty.prototype=By.prototype={constructor:Ty,select:function(n){"function"!=typeof n&&(n=Ag(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,a,u=e[o],c=u.length,l=r[o]=new Array(c),s=0;s<c;++s)(i=u[s])&&(a=n.call(i,i.__data__,s,u))&&("__data__"in i&&(a.__data__=i.__data__),l[s]=a);return new Ty(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(e=n.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(n):Tg(n);for(var e=this._groups,t=e.length,r=[],o=[],i=0;i<t;++i)for(var a,u=e[i],c=u.length,l=0;l<c;++l)(a=u[l])&&(r.push(n.call(a,a.__data__,l,u)),o.push(a));return new Ty(r,o)},selectChild:function(n){return this.select(null==n?Rg:function(n){return function(){return Dg.call(this.children,n)}}("function"==typeof n?n:Lg(n)))},selectChildren:function(n){return this.selectAll(null==n?Hg:function(n){return function(){return Vg.call(this.children,n)}}("function"==typeof n?n:Lg(n)))},filter:function(n){"function"!=typeof n&&(n=Bg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,a=e[o],u=a.length,c=r[o]=[],l=0;l<u;++l)(i=a[l])&&n.call(i,i.__data__,l,a)&&c.push(i);return new Ty(r,this._parents)},data:function(n,e){if(!arguments.length)return Array.from(this,Ug);var t,r=e?Zg:Fg,o=this._parents,i=this._groups;"function"!=typeof n&&(t=n,n=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=Gg(n.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,e);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 Ty(u,o))._enter=c,u._exit=l,u},enter:function(){return new Ty(this._enter||this._groups.map(Yg),this._parents)},exit:function(){return new Ty(this._exit||this._groups.map(Yg),this._parents)},join:function(n,e,t){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=e&&(o=e(o))&&(o=o.selection()),null==t?i.remove():t(i),r&&o?r.merge(o).order():o},merge:function(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,o=t.length,i=r.length,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 Ty(u,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r,o=n[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(n){function e(e,t){return e&&t?n(e.__data__,t.__data__):!e-!t}n||(n=Wg);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(e)}return new Ty(o,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r=n[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let n=0;for(const e of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o,i=e[t],a=0,u=i.length;a<u;++a)(o=i[a])&&n.call(o,o.__data__,a,i);return this},attr:function(n,e){var t=Og(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((null==e?t.local?$g:qg:"function"==typeof e?t.local?ny:Jg:t.local?Qg:Kg)(t,e))},style:function(n,e,t){return arguments.length>1?this.each((null==e?ty:"function"==typeof e?oy:ry)(n,e,null==t?"":t)):iy(this.node(),n)},property:function(n,e){return arguments.length>1?this.each((null==e?ay:"function"==typeof e?cy:uy)(n,e)):this.node()[n]},classed:function(n,e){var t=ly(n+"");if(arguments.length<2){for(var r=sy(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof e?gy:e?vy:py)(t,e))},text:function(n){return arguments.length?this.each(null==n?yy:("function"==typeof n?wy:my)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?by:("function"==typeof n?_y:xy)(n)):this.node().innerHTML},raise:function(){return this.each(Ey)},lower:function(){return this.each(Sy)},append:function(n){var e="function"==typeof n?n:Pg(n);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(n,e){var t="function"==typeof n?n:Pg(n),r=null==e?ky:"function"==typeof e?e:Ag(e);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Ny)},clone:function(n){return this.select(n?Oy:Cy)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,e,t){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");return t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),{type:n,name:e}}))}(n+""),a=i.length;if(!(arguments.length<2)){for(u=e?jy:My,r=0;r<a;++r)this.each(u(i[r],e,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(n,e){return this.each(("function"==typeof e?Ay:Iy)(n,e))},[Symbol.iterator]:function*(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r,o=n[e],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const Ry={passive:!1},Vy={capture:!0,passive:!1};function Hy(n){n.stopImmediatePropagation()}function Yy(n){n.preventDefault(),n.stopImmediatePropagation()}function Xy(n){var e=n.document.documentElement,t=Ly(n).on("dragstart.drag",Yy,Vy);"onselectstart"in e?t.on("selectstart.drag",Yy,Vy):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Fy(n,e){var t=n.document.documentElement,r=Ly(n).on("dragstart.drag",null);e&&(r.on("click.drag",Yy,Vy),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 Zy=n=>()=>n;function Uy(n,{sourceEvent:e,subject:t,target:r,identifier:o,active:i,x:a,y:u,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value: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 Gy(n){return!n.ctrlKey&&!n.button}function Wy(){return this.parentNode}function qy(n,e){return null==e?{x:n.x,y:n.y}:e}function $y(){return navigator.maxTouchPoints||"ontouchstart"in this}Uy.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var Ky={error001:function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001"},error002:function(){return"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them."},error003:function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},error004:function(){return"The Ink Flow parent container needs a width and a height to render the graph."},error005:function(){return"Only child nodes can use a parent extent."},error006:function(){return"Can't create edge. An edge needs a source and a target."},error007:function(n){return"The old edge with id=".concat(n," does not exist.")},error009:function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},error008:function(n,e){var t=e.id,r=e.sourceHandle,o=e.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(t,".")},error010:function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},error011:function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},error012:function(n){return'Node with id "'.concat(n,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},error013:function(n){return void 0===n&&(n="react"),"It seems that you haven't loaded the styles. Please import '@xyflow/".concat(n,"/dist/style.css' or base.css to make sure everything is working properly.")}},Qy=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Jy=["Enter"," ","Escape"],nm=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.source===n.id&&r.add(e.target)})),e.filter((function(n){return r.has(n.id)}))},em=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.target===n.id&&r.add(e.source)})),e.filter((function(n){return r.has(n.id)}))},tm=function(n,e){void 0===e&&(e=[0,0]);var t=function(n){var e,t,r,o,i,a,u,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(u=null!==(a=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:n.height)&&void 0!==u?u:n.initialHeight)&&void 0!==c?c:0}}(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,a=n.origin||e,u=r*a[0],c=o*a[1];return{position:{x:n.position.x-u,y:n.position.y-c},positionAbsolute:{x:i.x-u,y:i.y-c}}},rm=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=vm(t,e.nodeOrigin);return dm(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return hm(t)},om=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==e.filter||e.filter(n)){var r=vm(n,e.nodeOrigin);t=dm(t,r)}})),hm(t)},im=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))};function am(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,a=n.nodeExtent,u=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?tm(l,l.origin||i).positionAbsolute:{x:0,y:0},d=s.x,f=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||a);if("parent"!==c.extent||c.expandParent)l&&bm(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",Ky.error005());var x=bm(h)?cm(t,h):t;return{position:{x:x.x-d,y:x.y-f},positionAbsolute:x}}var um=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},cm=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:um(n.x,e[0][0],e[1][0]),y:um(n.y,e[0][1],e[1][1])}},lm=function(n,e,t){return n<e?um(Math.abs(n-e),1,50)/50:n>t?-um(Math.abs(n-t),1,50)/50:0},sm=function(n,e){return[20*lm(n.x,35,e.width-35),20*lm(n.y,35,e.height-35)]},dm=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},fm=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},hm=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},vm=function(n,e){var t,r,o,i,a,u;void 0===e&&(e=[0,0]);var c=tm(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(u=null!==(a=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:n.height)&&void 0!==u?u:0)}},pm=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},gm=function(n,e,t,r){var o=n.x,i=n.y,a=hp(e,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?pm(s,r):s},ym=function(n,e){var t=n.x,r=n.y,o=hp(e,3),i=o[0],a=o[1],u=o[2];return{x:t*u+i,y:r*u+a}},mm=function(n,e,t,r,o,i){var a=e/(n.width*(1+i)),u=t/(n.height*(1+i)),c=Math.min(a,u),l=um(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}},wm=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 bm(n){return void 0!==n&&"parent"!==n}function xm(n,e){var t=e.snapGrid,r=void 0===t?[0,0]:t,o=e.snapToGrid,i=void 0!==o&&o,a=e.transform,u=Om(n),c=u.x,l=u.y,s=gm({x:c,y:l},a),d=i?pm(s,r):s,f=d.x,h=d.y;return dp({xSnapped:f,ySnapped:h},s)}var _m,Em,Sm,km,Nm,Cm,Om=function(n,e){var t,r,o,i,a=function(n){return"clientX"in n}(n),u=a?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=a?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:u-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}};function Mm(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,a=n.sourceControlY,u=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*a+.375*n.targetControlY+.125*o;return[u,c,Math.abs(u-e),Math.abs(c-t)]}function jm(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function Pm(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,a=n.c;switch(e){case Cm.Left:return[t-jm(t-o,a),r];case Cm.Right:return[t+jm(o-t,a),r];case Cm.Top:return[t,r-jm(r-i,a)];case Cm.Bottom:return[t,r+jm(i-r,a)]}}function Im(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?Cm.Bottom:r,i=n.targetX,a=n.targetY,u=n.targetPosition,c=void 0===u?Cm.Top:u,l=n.curvature,s=void 0===l?.25:l,d=hp(Pm({pos:o,x1:e,y1:t,x2:i,y2:a,c:s}),2),f=d[0],h=d[1],v=hp(Pm({pos:c,x1:i,y1:a,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],y=hp(Mm({sourceX:e,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(e,",").concat(t," C").concat(f,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(a),m,w,b,x]}function Am(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,a=r<e?r+i:r-i,u=Math.abs(o-t)/2;return[a,o<t?o+u:o-u,i,u]}!function(n){n.Strict="strict",n.Loose="loose"}(_m||(_m={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(Em||(Em={})),function(n){n.Partial="partial",n.Full="full"}(Sm||(Sm={})),function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(km||(km={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(Nm||(Nm={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(Cm||(Cm={}));var zm,Tm=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")},Bm=function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(t=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?dp({},n):dp(dp({},n),{id:Tm(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):e;var t},Lm=function(n,e,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}(n,["id"]);if(!e.source||!e.target)return t;if(!t.find((function(e){return e.id===n.id})))return t;var a=dp(dp({},i),{id:r.shouldReplaceId?Tm(e):o,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle});return t.filter((function(n){return n.id!==o})).concat(a)};function Dm(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=hp(Am({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),a=i[0],u=i[1],c=i[2],l=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),a,u,c,l]}var Rm=((zm={})[Cm.Left]={x:-1,y:0},zm[Cm.Right]={x:1,y:0},zm[Cm.Top]={x:0,y:-1},zm[Cm.Bottom]={x:0,y:1},zm),Vm=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Hm(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?Cm.Bottom:r,i=n.targetX,a=n.targetY,u=n.targetPosition,c=void 0===u?Cm.Top:u,l=n.borderRadius,s=void 0===l?5:l,d=n.centerX,f=n.centerY,h=n.offset,v=hp(function(n){var e,t,r,o,i=n.source,a=n.sourcePosition,u=void 0===a?Cm.Bottom:a,c=n.target,l=n.targetPosition,s=void 0===l?Cm.Top:l,d=n.center,f=n.offset,h=Rm[u],v=Rm[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(n){var e=n.source,t=n.sourcePosition,r=void 0===t?Cm.Bottom:t,o=n.target;return r===Cm.Left||r===Cm.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:u,target:g}),m=0!==y.x?"x":"y",w=y[m],b=[],x={x:0,y:0},_={x:0,y:0},E=hp(Am({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!==(e=d.x)&&void 0!==e?e:S,o=null!==(t=d.y)&&void 0!==t?t:k;var O=[{x:r,y:p.y},{x:r,y:g.y}],M=[{x:p.x,y:o},{x:g.x,y:o}];b=h[m]===w?"x"===m?O:M:"x"===m?M:O}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],B=p[z]>g[z],L=p[z]<g[z];(1===h[m]&&(!T&&B||T&&L)||1!==h[m]&&(!T&&L||T&&B))&&(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[vp(vp([i,{x:p.x+x.x,y:p.y+x.y}],hp(b),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,N,C]}({source:{x:e,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(n,e,t){var r;return r=t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(Vm(n,e)/2,Vm(e,t)/2,r),i=e.x,a=e.y;if(n.x===i&&i===t.x||n.y===a&&a===t.y)return"L".concat(i," ").concat(a);if(n.y===a){var u=n.x<t.x?-1:1,c=n.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=n.x<t.x?1:-1,s=n.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],e,p[t+1],s):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y),n+r}),"");return[b,g,y,m,w]}function Ym(n,e){if(!n.parentId)return!1;var t=e.get(n.parentId);return!!t&&(!!t.selected||Ym(t,e))}function Xm(n,e,t){var r=n;do{if(null==r?void 0:r.matches(e))return!0;if(r===t)return!1;r=r.parentElement}while(r);return!1}function Fm(n){var e,t,r,o,i=n.nodeId,a=n.dragItems,u=n.nodeLookup,c=[];try{for(var l=fp(a),s=l.next();!s.done;s=l.next()){var d=hp(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(dp(dp({},v),{position:h.position}))}}catch(n){e={error:n}}finally{try{s&&!s.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}if(!i)return[c[0],c];var p=u.get(i).internals.userNode;return[dp(dp({},p),{position:(null===(o=a.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function Zm(n){var e=n.onNodeMouseDown,t=n.getStoreItems,r=n.onDragStart,o=n.onDrag,i=n.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(n){var v=n.noDragClassName,p=n.handleSelector,g=n.domNode,y=n.isSelectable,m=n.nodeId;function w(n,e){var r,i,u=n.x,l=n.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=om(c,{nodeOrigin:p});_=fm(E)}try{for(var S=fp(c),k=S.next();!k.done;k=S.next()){var N=hp(k.value,2),C=N[0],O=N[1],M={x:u-O.distance.x,y:l-O.distance.y};v&&(M=pm(M,h));var j=[[f[0][0],f[0][1]],[f[1][0],f[1][1]]];if(c.size>1&&f&&!O.extent){var P=O.internals.positionAbsolute,I=P.x-_.x+f[0][0],A=P.x+O.measured.width-_.x2+f[1][0];j=[[I,P.y-_.y+f[0][1]],[A,P.y+O.measured.height-_.y2+f[1][1]]]}var z=am({nodeId:C,nextPosition:M,nodeLookup:d,nodeExtent:j,nodeOrigin:p,onError:w}),T=z.position,B=z.positionAbsolute;x=x||O.position.x!==T.x||O.position.y!==T.y,O.position=T,O.internals.positionAbsolute=B}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(x&&(b(c,!0),e&&(o||g||!m&&y))){var L=hp(Fm({nodeId:m,dragItems:c,nodeLookup:d}),2),D=L[0],R=L[1];null==o||o(e,c,D,R),null==g||g(e,D,R),m||null==y||y(e,R)}}function b(){var n,e;if(d){var r=hp(sm(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!==(n=a.x)&&void 0!==n?n:0)-o/l[2],a.y=(null!==(e=a.y)&&void 0!==e?e:0)-i/l[2],f({x:o,y:i})&&w(a,null)}u=requestAnimationFrame(b)}}function x(n){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==e||e(m));var x=xm(n.sourceEvent,{transform:d,snapGrid:h,snapToGrid:v});if(a=x,c=function(n,e,t,r){var o,i,a,u,c=new Map;try{for(var l=fp(n),s=l.next();!s.done;s=l.next()){var d=hp(s.value,2),f=d[0],h=d[1];if((h.selected||h.id===r)&&(!h.parentId||!Ym(h,n))&&(h.draggable||e&&void 0===h.draggable)){var v=n.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(n){o={error:n}}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 _=hp(Fm({nodeId:m,dragItems:c,nodeLookup:u}),2),E=_[0],S=_[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==w||w(n.sourceEvent,S)}}h=Ly(g);var _=function(){var n,e,t,r,o=Gy,i=Wy,a=qy,u=$y,c={},l=_g("start","drag","end"),s=0,d=0;function f(n){n.on("mousedown.drag",h).filter(u).on("touchstart.drag",g).on("touchmove.drag",y,Ry).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&&(Ly(a.view).on("mousemove.drag",v,Vy).on("mouseup.drag",p,Vy),Xy(a.view),Hy(a),t=!1,n=a.clientX,e=a.clientY,c("start",a))}}function v(r){if(Yy(r),!t){var o=r.clientX-n,i=r.clientY-e;t=o*o+i*i>d}c.mouse("drag",r)}function p(n){Ly(n.view).on("mousemove.drag mouseup.drag",null),Fy(n.view,t),Yy(n),c.mouse("end",n)}function g(n,e){if(o.call(this,n,e)){var t,r,a=n.changedTouches,u=i.call(this,n,e),c=a.length;for(t=0;t<c;++t)(r=w(this,u,n,e,a[t].identifier,a[t]))&&(Hy(n),r("start",n,a[t]))}}function y(n){var e,t,r=n.changedTouches,o=r.length;for(e=0;e<o;++e)(t=c[r[e].identifier])&&(Yy(n),t("drag",n,r[e]))}function m(n){var e,t,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<i;++e)(t=c[o[e].identifier])&&(Hy(n),t("end",n,o[e]))}function w(n,e,t,r,o,i){var u,d,h,v=l.copy(),p=Dy(i||t,e);if(null!=(h=a.call(n,new Uy("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=Dy(l||a,e),g=s}v.call(i,n,new Uy(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(n){return arguments.length?(o="function"==typeof n?n:Zy(!!n),f):o},f.container=function(n){return arguments.length?(i="function"==typeof n?n:Zy(n),f):i},f.subject=function(n){return arguments.length?(a="function"==typeof n?n:Zy(n),f):a},f.touchable=function(n){return arguments.length?(u="function"==typeof n?n:Zy(!!n),f):u},f.on=function(){var n=l.on.apply(l,arguments);return n===l?f:n},f.clickDistance=function(n){return arguments.length?(d=(n=+n)*n,f):Math.sqrt(d)},f}().on("start",(function(n){var e=t(),r=e.domNode,o=e.nodeDragThreshold,i=e.transform,u=e.snapGrid,c=e.snapToGrid;0===o&&x(n);var l=xm(n.sourceEvent,{transform:i,snapGrid:u,snapToGrid:c});a=l,d=(null==r?void 0:r.getBoundingClientRect())||null,s=Om(n.sourceEvent,d)})).on("drag",(function(n){var e,r,o=t(),i=o.autoPanOnNodeDrag,u=o.transform,h=o.snapGrid,v=o.snapToGrid,p=o.nodeDragThreshold,g=xm(n.sourceEvent,{transform:u,snapGrid:h,snapToGrid:v});if(!l&&i&&f&&(l=!0,b()),!f){var y=g.xSnapped-(null!==(e=a.x)&&void 0!==e?e:0),m=g.ySnapped-(null!==(r=a.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&x(n)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&c&&f&&(s=Om(n.sourceEvent,d),w(g,n.sourceEvent))})).on("end",(function(n){if(f&&(l=!1,f=!1,cancelAnimationFrame(u),c.size>0)){var e=t(),r=e.nodeLookup,o=e.updateNodePositions,a=e.onNodeDragStop,s=e.onSelectionDragStop;if(o(c,!1),i||a||!m&&s){var d=hp(Fm({nodeId:m,dragItems:c,nodeLookup:r}),2),h=d[0],v=d[1];null==i||i(n.sourceEvent,c,h,v),null==a||a(n.sourceEvent,h,v),m||null==s||s(n.sourceEvent,v)}}})).filter((function(n){var e=n.target;return!n.button&&(!v||!Xm(e,".".concat(v),g))&&(!p||Xm(e,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function Um(n,e,t,r){return(e[t]||[]).reduce((function(e,o){return"".concat(n.id,"-").concat(o.id,"-").concat(t)!==r&&e.push({id:o.id||null,type:t,nodeId:n.id,x:n.internals.positionAbsolute.x+o.x+o.width/2,y:n.internals.positionAbsolute.y+o.y+o.height/2}),e}),[])}function Gm(n,e){return n||((null==e?void 0:e.classList.contains("target"))?"target":(null==e?void 0:e.classList.contains("source"))?"source":null)}var Wm=function(){return!0},qm=null;function $m(n,e){var t=e.handle,r=e.connectionMode,o=e.fromNodeId,i=e.fromHandleId,a=e.fromType,u=e.doc,c=e.lib,l=e.flowId,s=e.isValidConnection,d=void 0===s?Wm: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=Om(n),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=Gm(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===_m.Strict?f&&"source"===b||!f&&"target"===b:x!==o||_!==i)&&(w.endHandle={nodeId:x,handleId:_,type:b},w.isValid=d(k))}return w}var Km={onPointerDown:function(n,e){var t,r=e.connectionMode,o=e.connectionRadius,i=e.handleId,a=e.nodeId,u=e.edgeUpdaterType,c=e.isTarget,l=e.domNode,s=e.nodeLookup,d=e.lib,f=e.autoPanOnConnect,h=e.flowId,v=e.panBy,p=e.cancelConnection,g=e.onConnectStart,y=e.onConnect,m=e.onConnectEnd,w=e.isValidConnection,b=void 0===w?Wm:w,x=e.onEdgeUpdateEnd,_=e.updateConnection,E=e.getTransform,S=e.getConnectionStartHandle,k=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),N=0,C=Om(n),O=C.x,M=C.y,j=null==k?void 0:k.elementFromPoint(O,M),P=Gm(u,j),I=null==l?void 0:l.getBoundingClientRect();if(I&&P){var A=Om(n,I),z=!1,T=null,B=!1,L=null,D=function(n){var e,t,r=n.nodeLookup,o=n.nodeId,i=n.handleId,a=n.handleType,u=[];try{for(var c=fp(r),l=c.next();!l.done;l=c.next()){var s=hp(l.value,2)[1];if(s.internals.handleBounds){var d="".concat(o,"-").concat(i,"-").concat(a),f=Um(s,s.internals.handleBounds,"source",d),h=Um(s,s.internals.handleBounds,"target",d);u.push.apply(u,vp(vp([],hp(f),!1),hp(h),!1))}}}catch(n){e={error:n}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}return u}({nodeLookup:s,nodeId:a,handleId:i,handleType:P});_({connectionPosition:A,connectionStatus:null,connectionStartHandle:qm={nodeId:a,handleId:i,type:P},connectionEndHandle:null}),null==g||g(n,{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 n=hp(sm(A,I),2),e=n[0],t=n[1];v({x:e,y:t}),N=requestAnimationFrame(R)}}function V(n){S()||H(n);var e=E();A=Om(n,I),t=function(n,e,t){var r,o,i=[],a=1/0;try{for(var u=fp(t),c=u.next();!c.done;c=u.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));s<=e&&(s<a?i=[l]:s===a&&i.push(l),a=s)}}catch(n){r={error:n}}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(n){return"target"===n.type}))||i[0]:null}(gm(A,e,!1,[1,1]),o,D),z||(R(),z=!0);var u,l,s,f=$m(n,{handle:t,connectionMode:r,fromNodeId:a,fromHandleId:i,fromType:c?"target":"source",isValidConnection:b,doc:k,lib:d,flowId:h});L=f.handleDomNode,T=f.connection,B=f.isValid,_({connectionStartHandle:qm,connectionPosition:t&&B?ym({x:t.x,y:t.y},e):A,connectionStatus:(u=!!t,l=B,s=null,l?s="valid":u&&!l&&(s="invalid"),s),connectionEndHandle:f.endHandle})}function H(n){(t||L)&&T&&B&&(null==y||y(T)),null==m||m(n),u&&(null==x||x(n)),p(),cancelAnimationFrame(N),z=!1,B=!1,T=null,L=null,qm=null,k.removeEventListener("mousemove",V),k.removeEventListener("mouseup",H),k.removeEventListener("touchmove",V),k.removeEventListener("touchend",H)}},isValid:$m};function Qm(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Jm(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function nw(){}var ew=.7,tw=1/ew,rw="\\s*([+-]?\\d+)\\s*",ow="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",iw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aw=/^#([0-9a-f]{3,8})$/,uw=new RegExp(`^rgb\\(${rw},${rw},${rw}\\)$`),cw=new RegExp(`^rgb\\(${iw},${iw},${iw}\\)$`),lw=new RegExp(`^rgba\\(${rw},${rw},${rw},${ow}\\)$`),sw=new RegExp(`^rgba\\(${iw},${iw},${iw},${ow}\\)$`),dw=new RegExp(`^hsl\\(${ow},${iw},${iw}\\)$`),fw=new RegExp(`^hsla\\(${ow},${iw},${iw},${ow}\\)$`),hw={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 vw(){return this.rgb().formatHex()}function pw(){return this.rgb().formatRgb()}function gw(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=aw.exec(n))?(t=e[1].length,e=parseInt(e[1],16),6===t?yw(e):3===t?new bw(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===t?mw(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===t?mw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=uw.exec(n))?new bw(e[1],e[2],e[3],1):(e=cw.exec(n))?new bw(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=lw.exec(n))?mw(e[1],e[2],e[3],e[4]):(e=sw.exec(n))?mw(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dw.exec(n))?Nw(e[1],e[2]/100,e[3]/100,1):(e=fw.exec(n))?Nw(e[1],e[2]/100,e[3]/100,e[4]):hw.hasOwnProperty(n)?yw(hw[n]):"transparent"===n?new bw(NaN,NaN,NaN,0):null}function yw(n){return new bw(n>>16&255,n>>8&255,255&n,1)}function mw(n,e,t,r){return r<=0&&(n=e=t=NaN),new bw(n,e,t,r)}function ww(n,e,t,r){return 1===arguments.length?((o=n)instanceof nw||(o=gw(o)),o?new bw((o=o.rgb()).r,o.g,o.b,o.opacity):new bw):new bw(n,e,t,null==r?1:r);var o}function bw(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}function xw(){return`#${kw(this.r)}${kw(this.g)}${kw(this.b)}`}function _w(){const n=Ew(this.opacity);return`${1===n?"rgb(":"rgba("}${Sw(this.r)}, ${Sw(this.g)}, ${Sw(this.b)}${1===n?")":`, ${n})`}`}function Ew(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Sw(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function kw(n){return((n=Sw(n))<16?"0":"")+n.toString(16)}function Nw(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Ow(n,e,t,r)}function Cw(n){if(n instanceof Ow)return new Ow(n.h,n.s,n.l,n.opacity);if(n instanceof nw||(n=gw(n)),!n)return new Ow;if(n instanceof Ow)return n;var e=(n=n.rgb()).r/255,t=n.g/255,r=n.b/255,o=Math.min(e,t,r),i=Math.max(e,t,r),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(t-r)/u+6*(t<r):t===i?(r-e)/u+2:(e-t)/u+4,u/=c<.5?i+o:2-i-o,a*=60):u=c>0&&c<1?0:a,new Ow(a,u,c,n.opacity)}function Ow(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}function Mw(n){return(n=(n||0)%360)<0?n+360:n}function jw(n){return Math.max(0,Math.min(1,n||0))}function Pw(n,e,t){return 255*(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)}Qm(nw,gw,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:vw,formatHex:vw,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Cw(this).formatHsl()},formatRgb:pw,toString:pw}),Qm(bw,ww,Jm(nw,{brighter(n){return n=null==n?tw:Math.pow(tw,n),new bw(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?ew:Math.pow(ew,n),new bw(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new bw(Sw(this.r),Sw(this.g),Sw(this.b),Ew(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:xw,formatHex:xw,formatHex8:function(){return`#${kw(this.r)}${kw(this.g)}${kw(this.b)}${kw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:_w,toString:_w})),Qm(Ow,(function(n,e,t,r){return 1===arguments.length?Cw(n):new Ow(n,e,t,null==r?1:r)}),Jm(nw,{brighter(n){return n=null==n?tw:Math.pow(tw,n),new Ow(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?ew:Math.pow(ew,n),new Ow(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,o=2*t-r;return new bw(Pw(n>=240?n-240:n+120,o,r),Pw(n,o,r),Pw(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new Ow(Mw(this.h),jw(this.s),jw(this.l),Ew(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=Ew(this.opacity);return`${1===n?"hsl(":"hsla("}${Mw(this.h)}, ${100*jw(this.s)}%, ${100*jw(this.l)}%${1===n?")":`, ${n})`}`}}));var Iw=n=>()=>n;function Aw(n,e){var t=e-n;return t?function(n,e){return function(t){return n+t*e}}(n,t):Iw(isNaN(n)?e:n)}var zw=function n(e){var t=function(n){return 1==(n=+n)?Aw:function(e,t){return t-e?function(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}(e,t,n):Iw(isNaN(e)?t:e)}}(e);function r(n,e){var r=t((n=ww(n)).r,(e=ww(e)).r),o=t(n.g,e.g),i=t(n.b,e.b),a=Aw(n.opacity,e.opacity);return function(e){return n.r=r(e),n.g=o(e),n.b=i(e),n.opacity=a(e),n+""}}return r.gamma=n,r}(1);function Tw(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var Bw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lw=new RegExp(Bw.source,"g");function Dw(n,e){var t,r,o,i=Bw.lastIndex=Lw.lastIndex=0,a=-1,u=[],c=[];for(n+="",e+="";(t=Bw.exec(n))&&(r=Lw.exec(e));)(o=r.index)>i&&(o=e.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:Tw(t,r)})),i=Lw.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?function(n){return function(e){return n(e)+""}}(c[0].x):function(n){return function(){return n}}(e):(e=c.length,function(n){for(var t,r=0;r<e;++r)u[(t=c[r]).i]=t.x(n);return u.join("")})}var Rw,Vw=180/Math.PI,Hw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yw(n,e,t,r,o,i){var a,u,c;return(a=Math.sqrt(n*n+e*e))&&(n/=a,e/=a),(c=n*t+e*r)&&(t-=n*c,r-=e*c),(u=Math.sqrt(t*t+r*r))&&(t/=u,r/=u,c/=u),n*r<e*t&&(n=-n,e=-e,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,n)*Vw,skewX:Math.atan(c)*Vw,scaleX:a,scaleY:u}}function Xw(n,e,t,r){function o(n){return n.length?n.pop()+" ":""}return function(i,a){var u=[],c=[];return i=n(i),a=n(a),function(n,r,o,i,a,u){if(n!==o||r!==i){var c=a.push("translate(",null,e,null,t);u.push({i:c-4,x:Tw(n,o)},{i:c-2,x:Tw(r,i)})}else(o||i)&&a.push("translate("+o+e+i+t)}(i.translateX,i.translateY,a.translateX,a.translateY,u,c),function(n,e,t,i){n!==e?(n-e>180?e+=360:e-n>180&&(n+=360),i.push({i:t.push(o(t)+"rotate(",null,r)-2,x:Tw(n,e)})):e&&t.push(o(t)+"rotate("+e+r)}(i.rotate,a.rotate,u,c),function(n,e,t,i){n!==e?i.push({i:t.push(o(t)+"skewX(",null,r)-2,x:Tw(n,e)}):e&&t.push(o(t)+"skewX("+e+r)}(i.skewX,a.skewX,u,c),function(n,e,t,r,i,a){if(n!==t||e!==r){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:Tw(n,t)},{i:u-2,x:Tw(e,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(n){for(var e,t=-1,r=c.length;++t<r;)u[(e=c[t]).i]=e.x(n);return u.join("")}}}var Fw=Xw((function(n){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?Hw:Yw(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Zw=Xw((function(n){return null==n?Hw:(Rw||(Rw=document.createElementNS("http://www.w3.org/2000/svg","g")),Rw.setAttribute("transform",n),(n=Rw.transform.baseVal.consolidate())?Yw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):Hw)}),", ",")",")");function Uw(n){return((n=Math.exp(n))+1/n)/2}var Gw,Ww,qw=function n(e,t,r){function o(n,o){var i,a,u=n[0],c=n[1],l=n[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)/e,i=function(n){return[u+n*h,c+n*v,l*Math.exp(e*n*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)/e,i=function(n){var r,o=n*a,i=Uw(w),s=l/(t*g)*(i*(r=e*o+w,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(w));return[u+s*h,c+s*v,l*i/Uw(e*o+w)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var t=Math.max(.001,+e),r=t*t;return n(t,r,r*r)},o}(Math.SQRT2,2,4),$w=0,Kw=0,Qw=0,Jw=1e3,nb=0,eb=0,tb=0,rb="object"==typeof performance&&performance.now?performance:Date,ob="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function ib(){return eb||(ob(ab),eb=rb.now()+tb)}function ab(){eb=0}function ub(){this._call=this._time=this._next=null}function cb(n,e,t){var r=new ub;return r.restart(n,e,t),r}function lb(){eb=(nb=rb.now())+tb,$w=Kw=0;try{!function(){ib(),++$w;for(var n,e=Gw;e;)(n=eb-e._time)>=0&&e._call.call(void 0,n),e=e._next;--$w}()}finally{$w=0,function(){for(var n,e,t=Gw,r=1/0;t;)t._call?(r>t._time&&(r=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:Gw=e);Ww=n,db(r)}(),eb=0}}function sb(){var n=rb.now(),e=n-nb;e>Jw&&(tb-=e,nb=n)}function db(n){$w||(Kw&&(Kw=clearTimeout(Kw)),n-eb>24?(n<1/0&&(Kw=setTimeout(lb,n-rb.now()-tb)),Qw&&(Qw=clearInterval(Qw))):(Qw||(nb=rb.now(),Qw=setInterval(sb,Jw)),$w=1,ob(lb)))}function fb(n,e,t){var r=new ub;return e=null==e?0:+e,r.restart((t=>{r.stop(),n(t+e)}),e,t),r}ub.prototype=cb.prototype={constructor:ub,restart:function(n,e,t){if("function"!=typeof n)throw new TypeError("callback is not a function");t=(null==t?ib():+t)+(null==e?0:+e),this._next||Ww===this||(Ww?Ww._next=this:Gw=this,Ww=this),this._call=n,this._time=t,db()},stop:function(){this._call&&(this._call=null,this._time=1/0,db())}};var hb=_g("start","end","cancel","interrupt"),vb=[],pb=0,gb=2,yb=3,mb=5,wb=6;function bb(n,e,t,r,o,i){var a=n.__transition;if(a){if(t in a)return}else n.__transition={};!function(n,e,t){var r,o=n.__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===yb)return fb(i);4===f.state?(f.state=wb,f.timer.stop(),f.on.call("interrupt",n,n.__data__,f.index,f.group),delete o[l]):+l<e&&(f.state=wb,f.timer.stop(),f.on.call("cancel",n,n.__data__,f.index,f.group),delete o[l])}if(fb((function(){t.state===yb&&(t.state=4,t.timer.restart(a,t.delay,t.time),a(c))})),t.state=gb,t.on.call("start",n,n.__data__,t.index,t.group),t.state===gb){for(t.state=yb,r=new Array(d=t.tween.length),l=0,s=-1;l<d;++l)(f=t.tween[l].value.call(n,n.__data__,t.index,t.group))&&(r[++s]=f);r.length=s+1}}function a(e){for(var o=e<t.duration?t.ease.call(null,e/t.duration):(t.timer.restart(u),t.state=mb,1),i=-1,a=r.length;++i<a;)r[i].call(n,o);t.state===mb&&(t.on.call("end",n,n.__data__,t.index,t.group),u())}function u(){for(var r in t.state=wb,t.timer.stop(),delete o[e],o)return;delete n.__transition}o[e]=t,t.timer=cb((function(n){t.state=1,t.timer.restart(i,t.delay,t.time),t.delay<=n&&i(n-t.delay)}),0,t.time)}(n,t,{name:e,index:r,group:o,on:hb,tween:vb,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:pb})}function xb(n,e){var t=Eb(n,e);if(t.state>pb)throw new Error("too late; already scheduled");return t}function _b(n,e){var t=Eb(n,e);if(t.state>yb)throw new Error("too late; already running");return t}function Eb(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Sb(n,e){var t,r,o,i=n.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(t=i[o]).name===e?(r=t.state>gb&&t.state<mb,t.state=wb,t.timer.stop(),t.on.call(r?"interrupt":"cancel",n,n.__data__,t.index,t.group),delete i[o]):a=!1;a&&delete n.__transition}}function kb(n,e){var t,r;return function(){var o=_b(this,n),i=o.tween;if(i!==t)for(var a=0,u=(r=t=i).length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function Nb(n,e,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=_b(this,n),a=i.tween;if(a!==r){o=(r=a).slice();for(var u={name:e,value:t},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=u;break}c===l&&o.push(u)}i.tween=o}}function Cb(n,e,t){var r=n._id;return n.each((function(){var n=_b(this,r);(n.value||(n.value={}))[e]=t.apply(this,arguments)})),function(n){return Eb(n,r).value[e]}}function Ob(n,e){var t;return("number"==typeof e?Tw:e instanceof gw?zw:(t=gw(e))?(e=t,zw):Dw)(n,e)}function Mb(n){return function(){this.removeAttribute(n)}}function jb(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Pb(n,e,t){var r,o,i=t+"";return function(){var a=this.getAttribute(n);return a===i?null:a===r?o:o=e(r=a,t)}}function Ib(n,e,t){var r,o,i=t+"";return function(){var a=this.getAttributeNS(n.space,n.local);return a===i?null:a===r?o:o=e(r=a,t)}}function Ab(n,e,t){var r,o,i;return function(){var a,u,c=t(this);if(null!=c)return(a=this.getAttribute(n))===(u=c+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,c));this.removeAttribute(n)}}function zb(n,e,t){var r,o,i;return function(){var a,u,c=t(this);if(null!=c)return(a=this.getAttributeNS(n.space,n.local))===(u=c+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,c));this.removeAttributeNS(n.space,n.local)}}function Tb(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}(n,o)),t}return o._value=e,o}function Bb(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}(n,o)),t}return o._value=e,o}function Lb(n,e){return function(){xb(this,n).delay=+e.apply(this,arguments)}}function Db(n,e){return e=+e,function(){xb(this,n).delay=e}}function Rb(n,e){return function(){_b(this,n).duration=+e.apply(this,arguments)}}function Vb(n,e){return e=+e,function(){_b(this,n).duration=e}}var Hb=By.prototype.constructor;function Yb(n){return function(){this.style.removeProperty(n)}}var Xb=0;function Fb(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function Zb(){return++Xb}var Ub=By.prototype;Fb.prototype={constructor:Fb,select:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=Ag(n));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=n.call(u,u.__data__,f,l))&&("__data__"in u&&(c.__data__=u.__data__),d[f]=c,bb(d[f],e,t,f,d,Eb(u,t)));return new Fb(i,this._parents,e,t)},selectAll:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=Tg(n));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=n.call(c,c.__data__,d,l),v=Eb(c,t),p=0,g=h.length;p<g;++p)(f=h[p])&&bb(f,e,t,p,h,v);i.push(h),a.push(c)}return new Fb(i,a,e,t)},selectChild:Ub.selectChild,selectChildren:Ub.selectChildren,filter:function(n){"function"!=typeof n&&(n=Bg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,a=e[o],u=a.length,c=r[o]=[],l=0;l<u;++l)(i=a[l])&&n.call(i,i.__data__,l,a)&&c.push(i);return new Fb(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,o=t.length,i=Math.min(r,o),a=new Array(r),u=0;u<i;++u)for(var c,l=e[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]=e[u];return new Fb(a,this._parents,this._name,this._id)},selection:function(){return new Hb(this._groups,this._parents)},transition:function(){for(var n=this._name,e=this._id,t=Zb(),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=Eb(a,e);bb(a,n,t,l,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Fb(r,this._parents,n,t)},call:Ub.call,nodes:Ub.nodes,node:Ub.node,size:Ub.size,empty:Ub.empty,each:Ub.each,on:function(n,e){var t=this._id;return arguments.length<2?Eb(this.node(),t).on.on(n):this.each(function(n,e,t){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||"start"===n}))}(e)?xb:_b;return function(){var a=i(this,n),u=a.on;u!==r&&(o=(r=u).copy()).on(e,t),a.on=o}}(t,n,e))},attr:function(n,e){var t=Og(n),r="transform"===t?Zw:Ob;return this.attrTween(n,"function"==typeof e?(t.local?zb:Ab)(t,r,Cb(this,"attr."+n,e)):null==e?(t.local?jb:Mb)(t):(t.local?Ib:Pb)(t,r,e))},attrTween:function(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;var r=Og(n);return this.tween(t,(r.local?Tb:Bb)(r,e))},style:function(n,e,t){var r="transform"==(n+="")?Fw:Ob;return null==e?this.styleTween(n,function(n,e){var t,r,o;return function(){var i=iy(this,n),a=(this.style.removeProperty(n),iy(this,n));return i===a?null:i===t&&a===r?o:o=e(t=i,r=a)}}(n,r)).on("end.style."+n,Yb(n)):"function"==typeof e?this.styleTween(n,function(n,e,t){var r,o,i;return function(){var a=iy(this,n),u=t(this),c=u+"";return null==u&&(this.style.removeProperty(n),c=u=iy(this,n)),a===c?null:a===r&&c===o?i:(o=c,i=e(r=a,u))}}(n,r,Cb(this,"style."+n,e))).each(function(n,e){var t,r,o,i,a="style."+e,u="end."+a;return function(){var c=_b(this,n),l=c.on,s=null==c.value[a]?i||(i=Yb(e)):void 0;l===t&&o===s||(r=(t=l).copy()).on(u,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,e,t){var r,o,i=t+"";return function(){var a=iy(this,n);return a===i?null:a===r?o:o=e(r=a,t)}}(n,r,e),t).on("end.style."+n,null)},styleTween:function(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(n,e,t){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}(n,i,t)),r}return i._value=e,i}(n,e,null==t?"":t))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var e=n(this);this.textContent=null==e?"":e}}(Cb(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;return this.tween(e,function(n){var e,t;function r(){var r=n.apply(this,arguments);return r!==t&&(e=(t=r)&&function(n){return function(e){this.textContent=n.call(this,e)}}(r)),e}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}(this._id))},tween:function(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r,o=Eb(this.node(),t).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==e?kb:Nb)(t,n,e))},delay:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?Lb:Db)(e,n)):Eb(this.node(),e).delay},duration:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?Rb:Vb)(e,n)):Eb(this.node(),e).duration},ease:function(n){var e=this._id;return arguments.length?this.each(function(n,e){if("function"!=typeof e)throw new Error;return function(){_b(this,n).ease=e}}(e,n)):Eb(this.node(),e).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,e){return function(){var t=e.apply(this,arguments);if("function"!=typeof t)throw new Error;_b(this,n).ease=t}}(this._id,n))},end:function(){var n,e,t=this,r=t._id,o=t.size();return new Promise((function(i,a){var u={value:a},c={value:function(){0==--o&&i()}};t.each((function(){var t=_b(this,r),o=t.on;o!==n&&((e=(n=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(c)),t.on=e})),0===o&&i()}))},[Symbol.iterator]:Ub[Symbol.iterator]};var Gb={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function Wb(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}By.prototype.interrupt=function(n){return this.each((function(){Sb(this,n)}))},By.prototype.transition=function(n){var e,t;n instanceof Fb?(e=n._id,n=n._name):(e=Zb(),(t=Gb).time=ib(),n=null==n?null:n+"");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])&&bb(a,n,e,l,u,t||Wb(a,e));return new Fb(r,this._parents,n,e)};var qb=n=>()=>n;function $b(n,{sourceEvent:e,target:t,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Kb(n,e,t){this.k=n,this.x=e,this.y=t}Kb.prototype={constructor:Kb,scale:function(n){return 1===n?this:new Kb(this.k*n,this.x,this.y)},translate:function(n,e){return 0===n&0===e?this:new Kb(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qb=new Kb(1,0,0);function Jb(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Qb;return n.__zoom}function nx(n){n.stopImmediatePropagation()}function ex(n){n.preventDefault(),n.stopImmediatePropagation()}function tx(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function rx(){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 ox(){return this.__zoom||Qb}function ix(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function ax(){return navigator.maxTouchPoints||"ontouchstart"in this}function ux(n,e,t){var r=n.invertX(e[0][0])-t[0][0],o=n.invertX(e[1][0])-t[1][0],i=n.invertY(e[0][1])-t[0][1],a=n.invertY(e[1][1])-t[1][1];return n.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))}Jb.prototype=Kb.prototype;var cx,lx=function(n,e){return n.x!==e.x||n.y!==e.y||n.zoom!==e.k},sx=function(n){return{x:n.x,y:n.y,zoom:n.k}},dx=function(n){var e=n.x,t=n.y,r=n.zoom;return Qb.translate(e,t).scale(r)},fx=function(n,e){return n.target.closest(".".concat(e))},hx=function(n,e){return 2===e&&Array.isArray(n)&&n.includes(2)},vx=function(n,e){return void 0===e&&(e=0),"number"==typeof e&&e>0?n.transition().duration(e):n},px=function(n){var e=n.ctrlKey&&wm()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*e};function gx(n){var e=n.domNode,t=n.minZoom,r=n.maxZoom,o=n.translateExtent,i=n.viewport,a=n.onPanZoom,u=n.onPanZoomStart,c=n.onPanZoomEnd,l=n.onTransformChange,s=n.onDraggingChange,d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),h=function(){var n,e,t,r=tx,o=rx,i=ux,a=ix,u=ax,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,d=qw,f=_g("start","zoom","end"),h=500,v=150,p=0,g=10;function y(n){n.property("__zoom",ox).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",N).filter(u).on("touchstart.zoom",C).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(n,e){return(e=Math.max(c[0],Math.min(c[1],e)))===n.k?n:new Kb(e,n.x,n.y)}function w(n,e,t){var r=e[0]-t[0]*n.k,o=e[1]-t[1]*n.k;return r===n.x&&o===n.y?n:new Kb(n.k,r,o)}function b(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function x(n,e,t,r){n.on("start.zoom",(function(){_(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,a=_(n,i).event(r),u=o.apply(n,i),c=null==t?b(u):"function"==typeof t?t.apply(n,i):t,l=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=n.__zoom,f="function"==typeof e?e.apply(n,i):e,h=d(s.invert(c).concat(l/s.k),f.invert(c).concat(l/f.k));return function(n){if(1===n)n=f;else{var e=h(n),t=l/e[2];n=new Kb(t,c[0]-e[0]*t,c[1]-e[1]*t)}a.zoom(null,n)}}))}function _(n,e,t){return!t&&n.__zooming||new E(n,e)}function E(n,e){this.that=n,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,e),this.taps=0}function S(n,...e){if(r.apply(this,arguments)){var t=_(this,e).event(n),o=this.__zoom,u=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=Dy(n);if(t.wheel)t.mouse[0][0]===s[0]&&t.mouse[0][1]===s[1]||(t.mouse[1]=o.invert(t.mouse[0]=s)),clearTimeout(t.wheel);else{if(o.k===u)return;t.mouse=[s,o.invert(s)],Sb(this),t.start()}ex(n),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(n,...e){if(!t&&r.apply(this,arguments)){var o=n.currentTarget,a=_(this,e,!0).event(n),u=Ly(n.view).on("mousemove.zoom",(function(n){if(ex(n),!a.moved){var e=n.clientX-s,t=n.clientY-d;a.moved=e*e+t*t>p}a.event(n).zoom("mouse",i(w(a.that.__zoom,a.mouse[0]=Dy(n,o),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(n){u.on("mousemove.zoom mouseup.zoom",null),Fy(n.view,a.moved),ex(n),a.event(n).end()}),!0),c=Dy(n,o),s=n.clientX,d=n.clientY;Xy(n.view),nx(n),a.mouse=[c,this.__zoom.invert(c)],Sb(this),a.start()}}function N(n,...e){if(r.apply(this,arguments)){var t=this.__zoom,a=Dy(n.changedTouches?n.changedTouches[0]:n,this),u=t.invert(a),c=t.k*(n.shiftKey?.5:2),d=i(w(m(t,c),a,u),o.apply(this,e),l);ex(n),s>0?Ly(this).transition().duration(s).call(x,d,a,n):Ly(this).call(y.transform,d,a,n)}}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(nx(t),a=0;a<s;++a)c=[c=Dy(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+!!n);n&&(n=clearTimeout(n)),i&&(d.taps<2&&(e=c[0],n=setTimeout((function(){n=null}),h)),Sb(this),d.start())}}function O(n,...e){if(this.__zooming){var t,r,o,a,u=_(this,e).event(n),c=n.changedTouches,s=c.length;for(ex(n),t=0;t<s;++t)o=Dy(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 M(n,...r){if(this.__zooming){var o,i,a=_(this,r).event(n),u=n.changedTouches,c=u.length;for(nx(n),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=Dy(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<g)){var l=Ly(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return y.transform=function(n,e,t,r){var o=n.selection?n.selection():n;o.property("__zoom",ox),n!==o?x(n,e,t,r):o.interrupt().each((function(){_(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},y.scaleBy=function(n,e,t,r){y.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),t,r)},y.scaleTo=function(n,e,t,r){y.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,a=null==t?b(n):"function"==typeof t?t.apply(this,arguments):t,u=r.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return i(w(m(r,c),a,u),n,l)}),t,r)},y.translateBy=function(n,e,t,r){y.transform(n,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof t?t.apply(this,arguments):t),o.apply(this,arguments),l)}),null,r)},y.translateTo=function(n,e,t,r,a){y.transform(n,(function(){var n=o.apply(this,arguments),a=this.__zoom,u=null==r?b(n):"function"==typeof r?r.apply(this,arguments):r;return i(Qb.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof t?-t.apply(this,arguments):-t),n,l)}),r,a)},E.prototype={event:function(n){return n&&(this.sourceEvent=n),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(n,e){return this.mouse&&"mouse"!==n&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var e=Ly(this.that).datum();f.call(n,this.that,new $b(n,{sourceEvent:this.sourceEvent,target:y,type:n,transform:this.that.__zoom,dispatch:f}),e)}},y.wheelDelta=function(n){return arguments.length?(a="function"==typeof n?n:qb(+n),y):a},y.filter=function(n){return arguments.length?(r="function"==typeof n?n:qb(!!n),y):r},y.touchable=function(n){return arguments.length?(u="function"==typeof n?n:qb(!!n),y):u},y.extent=function(n){return arguments.length?(o="function"==typeof n?n:qb([[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]]),y):o},y.scaleExtent=function(n){return arguments.length?(c[0]=+n[0],c[1]=+n[1],y):[c[0],c[1]]},y.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],y):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},y.constrain=function(n){return arguments.length?(i=n,y):i},y.duration=function(n){return arguments.length?(s=+n,y):s},y.interpolate=function(n){return arguments.length?(d=n,y):d},y.on=function(){var n=f.on.apply(f,arguments);return n===f?y:n},y.clickDistance=function(n){return arguments.length?(p=(n=+n)*n,y):Math.sqrt(p)},y.tapDistance=function(n){return arguments.length?(g=+n,y):g},y}().scaleExtent([t,r]).translateExtent(o),v=Ly(e).call(h);w({x:i.x,y:i.y,zoom:um(i.zoom,t,r)},[[0,0],[f.width,f.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,e){v&&(null==h||h.transform(vx(v,null==e?void 0:e.duration),n))}function m(){h.on("zoom",null)}function w(n,e,t){var r=dx(n),o=null==h?void 0:h.constrain()(r,e,t);return o&&y(o),o}return h.wheelDelta(px),{update:function(n){var e=n.noWheelClassName,t=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,f=n.panOnDrag,y=n.panOnScrollMode,w=n.panOnScrollSpeed,b=n.preventScrolling,x=n.zoomOnPinch,_=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!d.isZoomingOrPanning&&m();var N=!i||S||o?function(n){var e=n.noWheelClassName,t=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!t&&"wheel"===n.type&&!n.ctrlKey||fx(n,e))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:e,preventScrolling:b,d3ZoomHandler:p}):function(n){var e=n.zoomPanValues,t=n.noWheelClassName,r=n.d3Selection,o=n.d3Zoom,i=n.panOnScrollMode,a=n.panOnScrollSpeed,u=n.zoomOnPinch,c=n.onPanZoomStart,l=n.onPanZoom,s=n.onPanZoomEnd;return function(n){if(fx(n,t))return!1;n.preventDefault(),n.stopImmediatePropagation();var d=r.property("__zoom").k||1;if(n.ctrlKey&&u){var f=Dy(n),h=px(n),v=d*Math.pow(2,h);o.scaleTo(r,v,f,n)}else{var p=1===n.deltaMode?20:1,g=i===Em.Vertical?0:n.deltaX*p,y=i===Em.Horizontal?0:n.deltaY*p;!wm()&&n.shiftKey&&i!==Em.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/d*a,-y/d*a,{internal:!0});var m=sx(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,null==c||c(n,m)),e.isPanScrolling&&(null==l||l(n,m),e.panScrollTimeout=setTimeout((function(){null==s||s(n,m),e.isPanScrolling=!1}),150))}}}({zoomPanValues:d,noWheelClassName:e,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(n){var e=n.zoomPanValues,t=n.onDraggingChange,r=n.onPanZoomStart;return function(n){var o,i,a;if(!(null===(o=n.sourceEvent)||void 0===o?void 0:o.internal)){var u=sx(n.transform);e.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=u,"mousedown"===(null===(a=n.sourceEvent)||void 0===a?void 0:a.type)&&t(!0),r&&(null==r||r(n.sourceEvent,u))}}}({zoomPanValues:d,onDraggingChange:s,onPanZoomStart:u});h.on("start",C);var O=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var a,u,c;e.usedRightMouseButton=!(!r||!hx(t,null!==(a=e.mouseButton)&&void 0!==a?a:0)),(null===(u=n.sourceEvent)||void 0===u?void 0:u.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,sx(n.transform)))}}({zoomPanValues:d,panOnDrag:f,onPaneContextMenu:!!r,onPanZoom:a,onTransformChange:l});h.on("zoom",O);var M=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.panOnScroll,o=n.onDraggingChange,i=n.onPanZoomEnd,a=n.onPaneContextMenu;return function(n){var u,c;if(!(null===(u=n.sourceEvent)||void 0===u?void 0:u.internal)&&(e.isZoomingOrPanning=!1,a&&hx(t,null!==(c=e.mouseButton)&&void 0!==c?c:0)&&!e.usedRightMouseButton&&n.sourceEvent&&a(n.sourceEvent),e.usedRightMouseButton=!1,o(!1),i&&lx(e.prevViewport,n.transform))){var l=sx(n.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout((function(){null==i||i(n.sourceEvent,l)}),r?150:0)}}}({zoomPanValues:d,panOnDrag:f,panOnScroll:i,onPaneContextMenu:r,onPanZoomEnd:c,onDraggingChange:s});h.on("end",M)}var j=function(n){var e=n.zoomActivationKeyPressed,t=n.zoomOnScroll,r=n.zoomOnPinch,o=n.panOnDrag,i=n.panOnScroll,a=n.zoomOnDoubleClick,u=n.userSelectionActive,c=n.noWheelClassName,l=n.noPanClassName,s=n.lib;return function(n){var d=e||t,f=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(fx(n,"".concat(s,"-flow__node"))||fx(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||d||i||a||r))return!1;if(u)return!1;if(fx(n,c)&&"wheel"===n.type)return!1;if(fx(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!e))return!1;if(!r&&n.ctrlKey&&"wheel"===n.type)return!1;if(!d&&!i&&!f&&"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:f,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:x,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:k});h.filter(j),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,e){var t=dx(n);return y(t,e),t},setViewportConstrained:w,getViewport:function(){var n=v?Jb(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,e){v&&(null==h||h.scaleTo(vx(v,null==e?void 0:e.duration),n))},scaleBy:function(n,e){v&&(null==h||h.scaleBy(vx(v,null==e?void 0:e.duration),n))},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var e=dx(n),t=v.property("__zoom");t.k===n.zoom&&t.x===n.x&&t.y===n.y||null==h||h.transform(v,e,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(cx||(cx={}));dp(dp({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var yx=Ky.error001();function mx(n,e){var r=t(Ye);if(null===r)throw new Error(yx);return R(r,n,e)}function wx(){var n=t(Ye);if(null===n)throw new Error(yx);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}function bx(n,e){var t,r,o;void 0===e&&(e={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var i=(null==e?void 0:e.elevateNodesOnSelect)?1e3:0;try{for(var a=p(n),u=a.next();!u.done;u=a.next()){var c=g(u.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=xx(c,n,d(d({},c.position),{z:(Mx(c.zIndex)?c.zIndex:0)+(c.selected?i:0)}),null!==(o=null==s?void 0:s.origin)&&void 0!==o?o:e.nodeOrigin),h=f.x,v=f.y,y=f.z,m=c.internals.positionAbsolute,w=h!==m.x||v!==m.y;(w||y!==c.internals.z)&&(c.internals=d(d({},c.internals),{positionAbsolute:w?{x:h,y:v}:m,z:y}))}}}catch(n){t={error:n}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}function xx(n,e,t,r){var o,i,a,u,c,l;if(void 0===r&&(r=[0,0]),!n.parentId)return t;var s=e.get(n.parentId),d=_x(s,r).position;return xx(s,e,{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 _x=function(n,e){void 0===e&&(e=[0,0]);var t=Ox(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,a=n.origin||e,u=r*a[0],c=o*a[1];return{position:{x:n.position.x-u,y:n.position.y-c},positionAbsolute:{x:i.x-u,y:i.y-c}}};function Ex(n,e,t){var r,o;n.clear(),e.clear();try{for(var i=p(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),g="".concat(l,"-target-").concat(h),y=n.get(v)||new Map,m=n.get(g)||new Map,w={edgeId:u.id,source:c,target:l,sourceHandle:d,targetHandle:h};e.set(u.id,u),n.set(v,y.set("".concat(l,"-").concat(h),w)),n.set(g,m.set("".concat(c,"-").concat(d),w))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}function Sx(n,e,t,r){void 0===r&&(r={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var o=new Map(e);e.clear(),t.clear();var i=(null==r?void 0:r.elevateNodesOnSelect)?1e3:0;n.forEach((function(n){var a,u,c=o.get(n.id);if(r.checkEquality&&n===(null==c?void 0:c.internals.userNode)||(c=d(d(d({},r.defaults),n),{measured:{width:null===(a=n.measured)||void 0===a?void 0:a.width,height:null===(u=n.measured)||void 0===u?void 0:u.height},internals:{positionAbsolute:n.position,handleBounds:null==c?void 0:c.internals.handleBounds,z:(Mx(n.zIndex)?n.zIndex:0)+(n.selected?i:0),userNode:n}})),e.set(n.id,c),n.parentId){var l=t.get(n.parentId);l?l.push(c):t.set(n.parentId,[c])}})),t.size>0&&bx(e,r)}function kx(n,e,t,r){var o,i,a,u,c,l=[],s=new Map;try{for(var d=p(n),f=d.next();!f.done;f=d.next()){var h=f.value,v=e.get(h.parentId);if(v){var g=null!==(u=null===(a=s.get(h.parentId))||void 0===a?void 0:a.expandedRect)&&void 0!==u?u:Ix(v,null!==(c=v.origin)&&void 0!==c?c:r),y=Bx(g,h.rect);s.set(h.parentId,{expandedRect:y,parent:v})}}}catch(n){o={error:n}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}return s.size>0&&s.forEach((function(e,r){var o=e.expandedRect,i=e.parent,a=_x(i,i.origin).position,u=Ox(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(e){n.some((function(n){return n.id===e.id}))||l.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+s}})}))}(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 Nx=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Cx=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:Nx(n.x,e[0][0],e[1][0]),y:Nx(n.y,e[0][1],e[1][1])}};function Ox(n){var e,t,r,o,i,a,u,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(u=null!==(a=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:n.height)&&void 0!==u?u:n.initialHeight)&&void 0!==c?c:0}}var Mx=function(n){return!isNaN(n)&&isFinite(n)},jx=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},Px=function(n,e,t,r){var o=n.x,i=n.y,a=g(e,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?jx(s,r):s},Ix=function(n,e){var t,r,o,i,a,u;void 0===e&&(e=[0,0]);var c=_x(n,e).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0,height:null!==(u=null!==(a=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:n.height)&&void 0!==u?u:0}},Ax=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},zx=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},Tx=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},Bx=function(n,e){return Tx(Ax(zx(n),zx(e)))};function Lx(n){return o(n)}var Dx=function(n,e){var t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),r=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*r)},Rx=function(n,e,t,r,o,i){var a=e/(n.width*(1+i)),u=t/(n.height*(1+i)),c=Math.min(a,u),l=Nx(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}};function Vx(n){return void 0!==n&&"parent"!==n}var Hx=function(n){var e=n.x,t=n.y,r=n.width,o=n.height,i=n.origin,a=void 0===i?[0,0]:i;return!r||!o||a[0]<0||a[1]<0||a[0]>1||a[1]>1?{x:e,y:t}:{x:e-r*a[0],y:t-o*a[1]}},Yx=function(n){return Xx(n)},Xx=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};var Fx=function(n){return Mx(n.width)&&Mx(n.height)&&Mx(n.x)&&Mx(n.y)},Zx=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},Ux=["INPUT","SELECT","TEXTAREA"];function Gx(n){var e,t,r=(null===(t=null===(e=n.composedPath)||void 0===e?void 0:e.call(n))||void 0===t?void 0:t[0])||n.target;return Ux.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var Wx=function(n){return"clientX"in n},qx=function(n,e){var t,r,o,i,a=Wx(n),u=a?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=a?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:u-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}},$x=function(n,e,t,r){void 0===r&&(r=[0,0]);var o=e.querySelectorAll(n);if(!o||!o.length)return null;var i=Array.from(o),a=e.getBoundingClientRect(),u=a.width*r[0],c=a.height*r[1];return i.map((function(n){var e=n.getBoundingClientRect();return d({id:n.getAttribute("data-handleid"),position:n.getAttribute("data-handlepos"),x:(e.left-a.left-u)/t,y:(e.top-a.top-c)/t},Zx(n))}))},Kx="undefined"!=typeof document?document:null;function Qx(n,e){void 0===n&&(n=null),void 0===e&&(e={target:Kx,actInsideInputWithModifier:!0});var t=g(i(!1),2),o=t[0],c=t[1],l=a(!1),s=a(new Set([])),d=g(r((function(){if(null!==n){var e=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),t=e.reduce((function(n,e){return n.concat.apply(n,y([],g(e),!1))}),[]);return[e,t]}return[[],[]]}),[n]),2),f=d[0],h=d[1];return u((function(){var t=(null==e?void 0:e.target)||Kx;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!e.actInsideInputWithModifier)&&Gx(n))return!1;var t=n_(n.code,h);s.current.add(n[t]),Jx(f,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!e.actInsideInputWithModifier)&&Gx(n))return!1;var t=n_(n.code,h);Jx(f,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[t]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==t||t.addEventListener("keydown",r),null==t||t.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==t||t.removeEventListener("keydown",r),null==t||t.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function Jx(n,e,t){return n.filter((function(n){return t||n.length===e.size})).some((function(n){return n.every((function(n){return e.has(n)}))}))}function n_(n,e){return e.includes(n)?"code":"key"}function e_(n,e){if(Object.is(n,e))return!0;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[t,r]of n)if(!Object.is(r,e.get(t)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}var t_={position:"absolute",width:"100%",height:"100%",top:0,left:0};var r_=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function o_(n){var e=n.onPaneContextMenu,t=n.zoomOnScroll,r=void 0===t||t,o=n.zoomOnPinch,i=void 0===o||o,c=n.panOnScroll,l=void 0!==c&&c,s=n.panOnScrollSpeed,d=void 0===s?.5:s,f=n.panOnScrollMode,h=void 0===f?Em.Free:f,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,b=n.minZoom,x=n.maxZoom,_=n.zoomActivationKeyCode,S=n.preventScrolling,k=void 0===S||S,N=n.children,C=n.noWheelClassName,O=n.noPanClassName,M=n.onViewportChange,j=n.isControlledViewport,P=wx(),I=a(null),A=mx(r_,e_),z=A.userSelectionActive,T=A.lib,B=Qx(_),L=a();return function(n){var e=wx();u((function(){var t=function(){var t,r;if(!n.current)return!1;var o=Zx(n.current);0!==o.height&&0!==o.width||null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"004",Ky.error004()),e.setState({width:o.width||500,height:o.height||500})};if(n.current){t(),window.addEventListener("resize",t);var r=new ResizeObserver((function(){return t()}));return r.observe(n.current),function(){window.removeEventListener("resize",t),r&&n.current&&r.unobserve(n.current)}}}),[])}(I),u((function(){if(I.current){L.current=gx({domNode:I.current,minZoom:b,maxZoom:x,translateExtent:w,viewport:m,onTransformChange:function(n){null==M||M({x:n[0],y:n[1],zoom:n[2]}),j||P.setState({transform:n})},onDraggingChange:function(n){return P.setState({paneDragging:n})},onPanZoomStart:function(n,e){var t=P.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(n,e),null==r||r(e)},onPanZoom:function(n,e){var t=P.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(n,e),null==r||r(e)},onPanZoomEnd:function(n,e){var t=P.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(n,e),null==r||r(e)}});var n=L.current.getViewport(),e=n.x,t=n.y,r=n.zoom;return P.setState({panZoom:L.current,transform:[e,t,r],domNode:I.current.closest(".ink-flow")}),function(){var n;null===(n=L.current)||void 0===n||n.destroy()}}}),[]),u((function(){var n;null===(n=L.current)||void 0===n||n.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:d,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:B,preventScrolling:k,noPanClassName:O,userSelectionActive:z,noWheelClassName:C,lib:T})}),[e,r,i,l,d,h,p,y,B,k,O,z,C,T]),E.jsx("div",{className:"ink-flow__renderer",ref:I,style:t_,children:N})}var i_={actInsideInputWithModifier:!1};function a_(n,e){var t;switch(n.type){case"select":e.selected=n.selected;break;case"position":void 0!==n.position&&(e.position=n.position),void 0!==n.dragging&&(e.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(null!==(t=e.measured)&&void 0!==t||(e.measured={}),e.measured.width=n.dimensions.width,e.measured.height=n.dimensions.height,n.setAttributes&&(e.width=n.dimensions.width,e.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(e.resizing=n.resizing)}}function u_(n,e){var t,r,o,i,a,u,c=[],l=new Map;try{for(var s=p(n),f=s.next();!f.done;f=s.next()){if("add"!==(_=f.value).type)if("remove"===_.type||"replace"===_.type)l.set(_.id,[_]);else{var h=l.get(_.id);h?h.push(_):l.set(_.id,[_])}else c.push(_.item)}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}try{for(var v=p(e),g=v.next();!g.done;g=v.next()){var y=g.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=(a=void 0,p(m)),x=b.next();!x.done;x=b.next()){var _;a_(_=x.value,w)}}catch(n){a={error:n}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(a)throw a.error}}c.push(w)}else c.push(d({},m[0].item))}else c.push(y)}}catch(n){o={error:n}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return c}function c_(n,e){return u_(n,e)}function l_(n,e){return u_(n,e)}function s_(n,e){return{id:n,type:"select",selected:e}}function d_(n,e,t){var r,o;void 0===e&&(e=new Set),void 0===t&&(t=!1);var i=[];try{for(var a=p(n),u=a.next();!u.done;u=a.next()){var c=g(u.value,2),l=c[0],s=c[1],d=e.has(l);void 0===s.selected&&!d||s.selected===d||(t&&(s.selected=d),i.push(s_(s.id,d)))}}catch(n){r={error:n}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}function f_(n){var e,t,r,o,i,a,u=n.items,c=void 0===u?[]:u,l=n.lookup,s=[],d=new Map(c.map((function(n){return[n.id,n]})));try{for(var f=p(c),h=f.next();!h.done;h=f.next()){var v=h.value,y=l.get(v.id),m=null!==(a=null===(i=null==y?void 0:y.internals)||void 0===i?void 0:i.userNode)&&void 0!==a?a:y;void 0!==m&&m!==v&&s.push({id:v.id,item:v,type:"replace"}),void 0===m&&s.push({item:v,type:"add"})}}catch(n){e={error:n}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var w=p(l),b=w.next();!b.done;b=w.next()){var x=g(b.value,1)[0];void 0===d.get(x)&&s.push({id:x,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 h_(n){return{id:n.id,type:"remove"}}var v_=function(n,e){void 0===e&&(e=[0,0]);var t=Ox(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,a=n.origin||e,u=r*a[0],c=o*a[1];return{position:{x:n.position.x-u,y:n.position.y-c},positionAbsolute:{x:i.x-u,y:i.y-c}}},p_=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=function(n,e){var t,r,o,i,a,u;void 0===e&&(e=[0,0]);var c=_x(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(u=null!==(a=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==a?a:n.height)&&void 0!==u?u:0)}}(t,e.nodeOrigin);return Ax(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Tx(t)},g_=function(n,e,t,r,o,i){var a,u,c,l,s,f,h,v,y=g(void 0===t?[0,0,1]:t,3),m=y[0],w=y[1],b=y[2];void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=[0,0]);var x=d(d({},Px(e,[m,w,b])),{width:e.width/b,height:e.height/b}),_=[];try{for(var E=p(n),S=E.next();!S.done;S=E.next()){var k=g(S.value,2)[1],N=k.measured,C=k.selectable,O=void 0===C||C,M=k.hidden,j=void 0!==M&&M,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!==(f=N.height)&&void 0!==f?f:k.height)&&void 0!==h?h:k.initialHeight)&&void 0!==v?v:null;if(!(o&&!O||j)){var A=Dx(x,Ix(k,i));(null===P||null===I||r&&A>0||A>=(null!=P?P:0)*(null!=I?I:0)||k.dragging)&&_.push(k)}}}catch(n){a={error:n}}finally{try{S&&!S.done&&(u=E.return)&&u.call(E)}finally{if(a)throw a.error}}return _},y_=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))};function m_(n,e){var t,r,o,i=n.nodeLookup,a=n.width,u=n.height,c=n.panZoom,l=n.minZoom,s=n.maxZoom,d=n.nodeOrigin,f=void 0===d?[0,0]:d,h=[],v=(null==e?void 0:e.nodes)?new Set(e.nodes.map((function(n){return n.id}))):null;if(i.forEach((function(n){!(n.measured.width&&n.measured.height&&((null==e?void 0:e.includeHiddenNodes)||!n.hidden))||v&&!v.has(n.id)||h.push(n)})),h.length>0){var p=p_(h,{nodeOrigin:f}),g=Rx(p,a,u,null!==(t=null==e?void 0:e.minZoom)&&void 0!==t?t:l,null!==(r=null==e?void 0:e.maxZoom)&&void 0!==r?r:s,null!==(o=null==e?void 0:e.padding)&&void 0!==o?o:.1);return c.setViewport(g,{duration:null==e?void 0:e.duration}),!0}return!1}function w_(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,a=n.nodeExtent,u=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?v_(l,l.origin||i).positionAbsolute:{x:0,y:0},d=s.x,f=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||a);if("parent"!==c.extent||c.expandParent)l&&Vx(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",Ky.error005());var x=Vx(h)?Cx(t,h):t;return{position:{x:x.x-d,y:x.y-f},positionAbsolute:x}}function b_(n){return h(this,arguments,void 0,(function(n){var e,t,r,o,i,a,u,c,l,s,d,f,h,g,y,m,w,b,x,_=n.nodesToRemove,E=void 0===_?[]:_,S=n.edgesToRemove,k=void 0===S?[]:S,N=n.nodes,C=n.edges,O=n.onBeforeDelete;return v(this,(function(n){switch(n.label){case 0:e=new Set(E.map((function(n){return n.id}))),t=[],r=function(n){if(!1===n.deletable)return"continue";var r=e.has(n.id),o=!r&&n.parentId&&t.find((function(e){return e.id===n.parentId}));(r||o)&&t.push(n)};try{for(o=p(N),i=o.next();!i.done;i=o.next())a=i.value,r(a)}catch(n){m={error:n}}finally{try{i&&!i.done&&(w=o.return)&&w.call(o)}finally{if(m)throw m.error}}u=new Set(k.map((function(n){return n.id}))),c=C.filter((function(n){return!1!==n.deletable})),l=y_(t,c),s=l,d=function(n){u.has(n.id)&&!s.find((function(e){return e.id===n.id}))&&s.push(n)};try{for(f=p(c),h=f.next();!h.done;h=f.next())g=h.value,d(g)}catch(n){b={error:n}}finally{try{h&&!h.done&&(x=f.return)&&x.call(f)}finally{if(b)throw b.error}}return O?[4,O({nodes:t,edges:s})]:[2,{edges:s,nodes:t}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var x_=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function __(){var n=mx(x_,e_),e=n.userSelectionActive,t=n.userSelectionRect;return e&&t?E.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 E_=function(n,e){return function(t){t.target===e.current&&(null==n||n(t))}},S_=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function k_(n){var e=n.isSelecting;n.selectionMode;var t=n.panOnDrag,r=n.onSelectionStart,o=n.onSelectionEnd,i=n.onPaneClick,u=n.onPaneContextMenu,c=n.onPaneScroll,l=n.onPaneMouseEnter,s=n.onPaneMouseMove,d=n.onPaneMouseLeave,f=n.children,h=a(null),v=wx(),y=a(0),m=a(0),w=a(),b=a(new Map),x=mx(S_,e_),_=x.userSelectionActive,S=x.elementsSelectable,k=x.dragging,N=function(){v.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,m.current=0},C=function(n){null==i||i(n),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},M=c?function(n){return c(n)}:void 0,j=S&&(e||_);return E.jsxs("div",{className:O(["ink-flow__pane",{draggable:t,dragging:k,selection:e}]),onClick:j?void 0:E_(C,h),onContextMenu:E_((function(n){Array.isArray(t)&&(null==t?void 0:t.includes(2))?n.preventDefault():null==u||u(n)}),h),onWheel:E_(M,h),onMouseEnter:j?void 0:l,onMouseDown:j?function(n){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(),S&&e&&0===n.button&&n.target===h.current&&w.current){b.current=new Map;try{for(var d=p(s),f=d.next();!f.done;f=d.next()){var y=g(f.value,2),m=y[0],x=y[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(n){t={error:n}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(t)throw t.error}}var _=qx(n.nativeEvent,w.current),E=_.x,k=_.y;c(),v.setState({userSelectionRect:{width:0,height:0,startX:E,startY:k,x:E,y:k}}),null==r||r(n)}}:void 0,onMouseMove:j?function(n){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(e&&w.current&&u){var g=qx(n.nativeEvent,w.current),x=g.x,_=g.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=g_(d,k,l,!1,!0,s),C=new Set,O=new Set;try{for(var M=p(N),j=M.next();!j.done;j=M.next()){var P=j.value;O.add(P.id);var I=b.current.get(P.id);if(I)try{for(var A=(o=void 0,p(I)),z=A.next();!z.done;z=A.next()){var T=z.value;C.add(T)}}catch(n){o={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(n){t={error:n}}finally{try{j&&!j.done&&(r=M.return)&&r.call(M)}finally{if(t)throw t.error}}if(y.current!==O.size)y.current=O.size,f(d_(d,O,!0));if(m.current!==C.size)m.current=C.size,h(d_(c,C));v.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:s,onMouseUp:j?function(n){if(0===n.button){var e=v.getState().userSelectionRect;!_&&e&&n.target===h.current&&(null==C||C(n)),v.setState({nodesSelectionActive:y.current>0}),N(),null==o||o(n)}}:void 0,onMouseLeave:j?function(n){_&&(v.setState({nodesSelectionActive:y.current>0}),null==o||o(n)),N()}:d,ref:h,style:t_,children:[f,E.jsx(__,{})]})}var N_=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function C_(n){var e=n.children,t=n.onPaneClick,r=n.onPaneMouseEnter,o=n.onPaneMouseMove,i=n.onPaneMouseLeave,a=n.onPaneContextMenu,c=n.onPaneScroll,l=n.deleteKeyCode,s=n.selectionKeyCode,d=n.selectionOnDrag,f=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,x=n.panOnScroll,_=n.panOnScrollSpeed,S=n.panOnScrollMode,k=n.zoomOnDoubleClick,N=n.panOnDrag,C=n.defaultViewport,O=n.translateExtent,M=n.minZoom,j=n.maxZoom,P=n.preventScrolling;n.onSelectionContextMenu;var I=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,T=n.isControlledViewport,B=mx(N_);B.nodesSelectionActive;var L=B.userSelectionActive,D=Qx(s),R=Qx(g),V=R||N,H=R||x,Y=D||L||d&&!0!==V;return function(n){var e=n.deleteKeyCode,t=n.multiSelectionKeyCode,r=wx(),o=Qx(e,i_),i=Qx(t);u((function(){if(o){var n=r.getState();n.edges,n.nodes,r.setState({nodesSelectionActive:!1})}}),[o]),u((function(){r.setState({multiSelectionActive:i})}),[i])}({deleteKeyCode:l,multiSelectionKeyCode:p}),E.jsx(o_,{onPaneContextMenu:a,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:_,panOnScrollMode:S,zoomOnDoubleClick:k,panOnDrag:!D&&V,defaultViewport:C,translateExtent:O,minZoom:M,maxZoom:j,zoomActivationKeyCode:y,preventScrolling:P,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:T,children:E.jsx(k_,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:f,children:e})})}C_.displayName="FlowRenderer";var O_=c(C_);function M_(n){var e=g(i(n),2),t=e[0],r=e[1],o=l((function(n){return r((function(e){return c_(n,e)}))}),[]);return[t,r,o]}function j_(n){var e=g(i(n),2),t=e[0],r=e[1],o=l((function(n){return r((function(e){return l_(n,e)}))}),[]);return[t,r,o]}var P_="undefined"!=typeof window?s:u;function I_(n){var e=g(i(!1),2),t=e[0],r=e[1],o=g(i((function(){return function(n){var e=[];return{get:function(){return e},reset:function(){e=[]},push:function(t){e.push(t),n()}}}((function(){return r(!0)}))})),1),a=o[0];return P_((function(){if(t){var e=a.get();e.length&&(n(e),a.reset()),r(!1)}else a.reset()}),[t]),a}var A_=e(null);function z_(n){var e=n.children,t=wx(),o=l((function(n){var e,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=p(n),h=f.next();!h.done;h=f.next()){var v=h.value;d="function"==typeof v?v(d):v}}catch(n){e={error:n}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(e)throw e.error}}c?u(d):l&&l(f_({items:d,lookup:s}))}),[]),i=I_(o),a=l((function(n){var e,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=p(n),h=f.next();!h.done;h=f.next()){var v=h.value;d="function"==typeof v?v(d):v}}catch(n){e={error:n}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(e)throw e.error}}c?u(d):l&&l(f_({items:d,lookup:s}))}),[]),u=I_(a),c=r((function(){return{nodeQueue:i,edgeQueue:u}}),[]);return E.jsx(A_.Provider,{value:c,children:e})}var T_=function(){var n=wx();return r((function(){return{zoomIn:function(e){var t;return null===(t=n.getState().panZoom)||void 0===t?void 0:t.scaleBy(1.2,{duration:null==e?void 0:e.duration})},zoomOut:function(e){var t;return null===(t=n.getState().panZoom)||void 0===t?void 0:t.scaleBy(1/1.2,{duration:null==e?void 0:e.duration})},zoomTo:function(e,t){var r;return null===(r=n.getState().panZoom)||void 0===r?void 0:r.scaleTo(e,{duration:null==t?void 0:t.duration})},getZoom:function(){return n.getState().transform[2]},setViewport:function(e,t){var r,o,i,a=n.getState(),u=g(a.transform,3),c=u[0],l=u[1],s=u[2],d=a.panZoom;null==d||d.setViewport({x:null!==(r=e.x)&&void 0!==r?r:c,y:null!==(o=e.y)&&void 0!==o?o:l,zoom:null!==(i=e.zoom)&&void 0!==i?i:s},{duration:null==t?void 0:t.duration})},getViewport:function(){var e=g(n.getState().transform,3);return{x:e[0],y:e[1],zoom:e[2]}},fitView:function(e){var t=n.getState(),r=t.nodeLookup,o=t.width,i=t.height,a=t.nodeOrigin,u=t.minZoom,c=t.maxZoom,l=t.panZoom;return!!l&&m_({nodeLookup:r,width:o,height:i,nodeOrigin:a,minZoom:u,maxZoom:c,panZoom:l},e)},setCenter:function(e,t,r){var o=n.getState(),i=o.width,a=o.height,u=o.maxZoom,c=o.panZoom,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:u,s=i/2-e*l,d=a/2-t*l;null==c||c.setViewport({x:s,y:d,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(e,t){var r,o=n.getState(),i=o.width,a=o.height,u=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Rx(e,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(e,t){void 0===t&&(t={snapToGrid:!0});var r=n.getState(),o=r.transform,i=r.snapGrid,a=r.domNode;if(!a)return e;var u=a.getBoundingClientRect(),c=u.x,l=u.y,s={x:e.x-c,y:e.y-l};return Px(s,o,t.snapToGrid,i)},flowToScreenPosition:function(e){var t=n.getState(),r=t.transform,o=t.domNode;if(!o)return e;var i=o.getBoundingClientRect(),a=i.x,u=i.y,c=function(n,e){var t=n.x,r=n.y,o=g(e,3),i=o[0],a=o[1],u=o[2];return{x:t*u+i,y:r*u+a}}(e,r);return{x:c.x+a,y:c.y+u}}}}),[])},B_=function(n){return!!n.panZoom};function L_(){var n=this,e=T_(),o=wx(),i=function(){var n=t(A_);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),a=mx(B_),u=r((function(){var e=function(n){return o.getState().nodeLookup.get(n)},t=function(n){i.nodeQueue.push(n)},r=function(n){var e,t,r,i,a=o.getState(),u=a.nodeLookup,c=a.nodeOrigin,l=Yx(n)?n:u.get(n.id),s=l.parentId?function(n,e,t,r){var o,i;void 0===r&&(r=[0,0]);for(var a=e,u=d({},n);a;){var c=t.get(e);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],f=(null!==(i=c.measured.height)&&void 0!==i?i:0)*l[1];u.x+=c.position.x-s,u.y+=c.position.y-f}}return u}(l.position,l.parentId,u,c):l.position,f={id:l.id,position:s,width:null!==(t=null===(e=l.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:l.width,height:null!==(i=null===(r=l.measured)||void 0===r?void 0:r.height)&&void 0!==i?i:l.height,data:l.data};return Ix(f)},a=function(n,e,r){void 0===r&&(r={replace:!1}),t((function(t){return t.map((function(t){if(t.id===n){var o="function"==typeof e?e(t):e;return r.replace&&Yx(o)?o:d(d({},t),o)}return t}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var t;return null===(t=e(n))||void 0===t?void 0:t.internals.userNode},getInternalNode:e,getEdges:function(){var n=o.getState().edges;return(void 0===n?[]:n).map((function(n){return d({},n)}))},getEdge:function(n){return o.getState().edgeLookup.get(n)},setNodes:t,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var e=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return y(y([],g(n),!1),g(e),!1)}))},addEdges:function(n){var e=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return y(y([],g(n),!1),g(e),!1)}))},toObject:function(){var n=o.getState(),e=n.nodes,t=void 0===e?[]:e,r=n.edges,i=void 0===r?[]:r,a=g(n.transform,3),u=a[0],c=a[1],l=a[2];return{nodes:t.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:u,y:c,zoom:l}}},deleteElements:function(e){return h(n,[e],void 0,(function(n){var e,t,r,i,a,u,c,l,s,d,f,h,p,g,y,m,w=n.nodes,b=void 0===w?[]:w,x=n.edges,_=void 0===x?[]:x;return v(this,(function(n){switch(n.label){case 0:return e=o.getState(),t=e.nodes,r=e.edges,i=e.onNodesDelete,a=e.onEdgesDelete,u=e.triggerNodeChanges,c=e.triggerEdgeChanges,l=e.onDelete,s=e.onBeforeDelete,[4,b_({nodesToRemove:b,edgesToRemove:_,nodes:t,edges:r,onBeforeDelete:s})];case 1:return d=n.sent(),f=d.nodes,h=d.edges,p=h.length>0,g=f.length>0,p&&(y=h.map(h_),null==a||a(h),c(y)),g&&(m=f.map(h_),null==i||i(f),u(m)),(g||p)&&(null==l||l({nodes:f,edges:h})),[2,{deletedNodes:f,deletedEdges:h}]}}))}))},getIntersectingNodes:function(n,e,t){void 0===e&&(e=!0);var i=Fx(n),a=i?n:r(n),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===n.id||!r.internals.positionAbsolute))return!1;var c=Ix(u?t:r),l=Dx(c,a);return e&&l>0||l>=a.width*a.height})):[]},isNodeIntersecting:function(n,e,t){void 0===t&&(t=!0);var o=Fx(n)?n:r(n);if(!o)return!1;var i=Dx(o,e);return t&&i>0||i>=o.width*o.height},updateNode:a,updateNodeData:function(n,e,t){void 0===t&&(t={replace:!1}),a(n,(function(n){var r="function"==typeof e?e(n):e;return t.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),t)}}}),[]);return r((function(){return d(d(d({},u),e),{viewportInitialized:a})}),[a])}var D_=function(n){return n.updateNodeInternals};var R_=function(n){return function(e){return n?g_(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map((function(n){return n.id})):Array.from(e.nodeLookup.keys())}};var V_=e(null),H_=V_.Provider;V_.Consumer;var Y_="ink-flow__node-desc",X_="ink-flow__edge-desc";function F_(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,a=n.sourceControlY,u=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*a+.375*n.targetControlY+.125*o;return[u,c,Math.abs(u-e),Math.abs(c-t)]}function Z_(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function U_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,a=n.c;switch(e){case Cm.Left:return[t-Z_(t-o,a),r];case Cm.Right:return[t+Z_(o-t,a),r];case Cm.Top:return[t,r-Z_(r-i,a)];case Cm.Bottom:return[t,r+Z_(i-r,a)]}}function G_(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,a=r<e?r+i:r-i,u=Math.abs(o-t)/2;return[a,o<t?o+u:o-u,i,u]}var W_,q_=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")};var $_=((W_={})[Cm.Left]={x:-1,y:0},W_[Cm.Right]={x:1,y:0},W_[Cm.Top]={x:0,y:-1},W_[Cm.Bottom]={x:0,y:1},W_),K_=function(n){var e=n.source,t=n.sourcePosition,r=void 0===t?Cm.Bottom:t,o=n.target;return r===Cm.Left||r===Cm.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}},Q_=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function J_(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?Cm.Bottom:r,i=n.targetX,a=n.targetY,u=n.targetPosition,c=void 0===u?Cm.Top:u,l=n.borderRadius,s=void 0===l?5:l,d=n.centerX,f=n.centerY,h=n.offset,v=g(function(n){var e,t,r,o,i=n.source,a=n.sourcePosition,u=void 0===a?Cm.Bottom:a,c=n.target,l=n.targetPosition,s=void 0===l?Cm.Top:l,d=n.center,f=n.offset,h=$_[u],v=$_[s],p={x:i.x+h.x*f,y:i.y+h.y*f},m={x:c.x+v.x*f,y:c.y+v.y*f},w=K_({source:p,sourcePosition:u,target:m}),b=0!==w.x?"x":"y",x=w[b],_=[],E={x:0,y:0},S={x:0,y:0},k=g(G_({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),N=k[0],C=k[1],O=k[2],M=k[3];if(h[b]*v[b]==-1){r=null!==(e=d.x)&&void 0!==e?e:N,o=null!==(t=d.y)&&void 0!==t?t:C;var j=[{x:r,y:p.y},{x:r,y:m.y}],P=[{x:p.x,y:o},{x:m.x,y:o}];_=h[b]===x?"x"===b?j:P:"x"===b?P:j}else{var I=[{x:p.x,y:m.y}],A=[{x:m.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]=(m[b]>c[b]?-1:1)*T}}if(u!==s){var B="x"===b?"y":"x",L=h[b]===v[B],D=p[B]>m[B],R=p[B]<m[B];(1===h[b]&&(!L&&D||L&&R)||1!==h[b]&&(!L&&R||L&&D))&&(_="x"===b?I:A)}var V={x:p.x+E.x,y:p.y+E.y},H={x:m.x+S.x,y:m.y+S.y};Math.max(Math.abs(V.x-_[0].x),Math.abs(H.x-_[0].x))>=Math.max(Math.abs(V.y-_[0].y),Math.abs(H.y-_[0].y))?(r=(V.x+H.x)/2,o=_[0].y):(r=_[0].x,o=(V.y+H.y)/2)}return[y(y([i,{x:p.x+E.x,y:p.y+E.y}],g(_),!1),[{x:m.x+S.x,y:m.y+S.y},c],!1),r,o,O,M]}({source:{x:e,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],m=v[1],w=v[2],b=v[3],x=v[4],_=p.reduce((function(n,e,t){var r="";return r=t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(Q_(n,e)/2,Q_(e,t)/2,r),i=e.x,a=e.y;if(n.x===i&&i===t.x||n.y===a&&a===t.y)return"L".concat(i," ").concat(a);if(n.y===a){var u=n.x<t.x?-1:1,c=n.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=n.x<t.x?1:-1,s=n.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],e,p[t+1],s):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y),n+=r}),"");return[_,m,w,b,x]}var nE=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var eE=c(Lx((function(n,e){var r,o,i=n.type,a=void 0===i?"source":i,u=n.position,c=void 0===u?Cm.Top:u,l=n.isValidConnection,s=n.isConnectable,h=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,x=n.className,_=n.onMouseDown,S=n.onTouchStart,k=f(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),N=m||null,C="target"===a,M=wx(),j=t(V_),P=mx(nE,e_),I=P.connectOnClick,A=P.noPanClassName,z=P.rfId,T=mx(function(n,e,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)===n&&(null==i?void 0:i.handleId)===e&&(null==i?void 0:i.type)===t;return{connectingFrom:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.handleId)===e&&(null==o?void 0:o.type)===t,connectingTo:l,clickConnecting:(null==a?void 0:a.nodeId)===n&&(null==a?void 0:a.handleId)===e&&(null==a?void 0:a.type)===t,isPossibleEndHandle:u===_m.Strict?(null==o?void 0:o.type)!==t:n!==(null==o?void 0:o.nodeId)||e!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(j,N,a),e_),B=T.connectingFrom,L=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",Ky.error010());var Y=function(n){var e=M.getState(),t=e.defaultEdgeOptions,r=e.onConnect,o=e.hasDefaultEdges,i=d(d({},t),n);if(o){var a=M.getState(),u=a.edges;(0,a.setEdges)(function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(t="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:q_(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):e;var t,r}(i,u))}null==r||r(i),null==w||w(i)},X=function(n){if(j){var e=Wx(n.nativeEvent);if(p&&(e&&0===n.button||!e)){var t=M.getState();Km.onPointerDown(n.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}})}e?null==_||_(n):null==S||S(n)}};return E.jsx("div",d({"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:h,connectablestart:p,connectableend:y,clickconnecting:D,connectingfrom:B,connectingto:L,valid:H,connectionindicator:h&&(!V||R)&&(V?y:p)}]),onMouseDown:X,onTouchStart:X,onClick:I?function(n){var e=M.getState(),t=e.onClickConnectStart,r=e.onClickConnectEnd,o=e.connectionClickStartHandle,i=e.connectionMode,u=e.isValidConnection,c=e.lib,s=e.rfId;if(j&&(o||p)){if(!o)return null==t||t(n.nativeEvent,{nodeId:j,handleId:N,handleType:a}),void M.setState({connectionClickStartHandle:{nodeId:j,type:a,handleId:N}});var d=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),f=l||u,h=Km.isValid(n.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(n),M.setState({connectionClickStartHandle:null})}}:void 0,ref:e},k,{children:b}))})));var tE={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rE={input:function(n){var e=n.data,t=n.isConnectable,r=n.sourcePosition,o=void 0===r?Cm.Bottom:r;return E.jsxs(E.Fragment,{children:[null==e?void 0:e.label,E.jsx(eE,{type:"source",position:o,isConnectable:t})]})},default:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?Cm.Top:r,i=n.sourcePosition,a=void 0===i?Cm.Bottom:i;return E.jsxs(E.Fragment,{children:[E.jsx(eE,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label,E.jsx(eE,{type:"source",position:a,isConnectable:t})]})},output:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?Cm.Top:r;return E.jsxs(E.Fragment,{children:[E.jsx(eE,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};function oE(n){var e=n.id,t=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,a=t.getState(),u=a.addSelectedNodes,c=a.unselectNodesAndEdges,l=a.multiSelectionActive,s=a.nodeLookup,d=a.onError,f=s.get(e);f?(t.setState({nodesSelectionActive:!1}),f.selected?(o||f.selected&&l)&&(c({nodes:[f],edges:[]}),requestAnimationFrame((function(){var n;return null===(n=null==i?void 0:i.current)||void 0===n?void 0:n.blur()}))):u([e])):null==d||d("012",Ky.error012(e))}var iE=function(n){return function(e){return e.selected&&(e.draggable||n&&void 0===e.draggable)}};function aE(n){var e,t=n.id,r=n.onClick,o=n.onMouseEnter,c=n.onMouseMove,s=n.onMouseLeave,f=n.onContextMenu,h=n.onDoubleClick,v=n.nodesDraggable,y=n.elementsSelectable,m=n.nodesConnectable,w=n.nodesFocusable,b=n.resizeObserver,x=n.noDragClassName,_=n.noPanClassName,S=n.disableKeyboardA11y,k=n.rfId,N=n.nodeTypes,C=n.nodeExtent,M=n.nodeOrigin,j=n.onError,P=mx((function(n){var e=n.nodeLookup.get(t),r=n.parentLookup.has(t);return{node:e,internals:e.internals,isParent:r}}),e_),I=P.node,A=P.internals,z=P.isParent,T=I.type||"default",B=(null==N?void 0:N[T])||rE[T];void 0===B&&(null==j||j("003",Ky.error003(T)),T="default",B=rE.default);var L=!!(I.draggable||v&&void 0===I.draggable),D=!!(I.selectable||y&&void 0===I.selectable),R=!!(I.connectable||m&&void 0===I.connectable),V=!!(I.focusable||w&&void 0===I.focusable),H=wx(),Y=function(n){var e,t,r,o,i,a;return void 0!==(null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==(null!==(a=null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:n.height)&&void 0!==a?a:n.initialHeight)}(I),X=function(n){var e=n.node,t=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=wx(),c=a(null),l=a(null),s=a(e.sourcePosition),d=a(e.targetPosition),f=a(t),h=r&&!!e.internals.handleBounds&&!e.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 n=f.current!==t,r=s.current!==e.sourcePosition,o=d.current!==e.targetPosition;(n||r||o)&&(f.current=t,s.current=e.sourcePosition,d.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}}),[e.id,t,e.sourcePosition,e.targetPosition]),c}({node:I,nodeType:T,hasDimensions:Y,resizeObserver:b}),F=function(n){var e=n.nodeRef,t=n.disabled,r=void 0!==t&&t,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,d=wx(),f=g(i(!1),2),h=f[0],v=f[1],p=a();return u((function(){p.current=Zm({getStoreItems:function(){return d.getState()},onNodeMouseDown:function(n){oE({id:n,store:d,nodeRef:e})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),u((function(){var n,t;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(e.current)return null===(t=p.current)||void 0===t||t.update({noDragClassName:o,handleSelector:c,domNode:e.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,e,l]),h}({nodeRef:X,disabled:I.hidden||!L,noDragClassName:x,handleSelector:I.dragHandle,nodeId:t,isSelectable:D}),Z=function(){var n=wx(),e=l((function(e){var t,r,o=n.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=iE(c),y=a?u[0]:5,m=a?u[1]:5,w=e.direction.x*y*e.factor,b=e.direction.y*m*e.factor;try{for(var x=p(d),_=x.next();!_.done;_=x.next()){var E=g(_.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+b};a&&(S=jx(S,u));var k=w_({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(n){t={error:n}}finally{try{_&&!_.done&&(r=x.return)&&r.call(x)}finally{if(t)throw t.error}}s(h)}),[]);return e}();if(I.hidden)return null;var U=Ox(I),G=function(n){var e,t,r,o,i,a,u,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(t=null!==(e=n.width)&&void 0!==e?e:n.initialWidth)&&void 0!==t?t:null===(r=n.style)||void 0===r?void 0:r.width,height:null!==(i=null!==(o=n.height)&&void 0!==o?o:n.initialHeight)&&void 0!==i?i:null===(a=n.style)||void 0===a?void 0:a.height}:{width:null!==(u=n.width)&&void 0!==u?u: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}}(I),W=C?Cx(A.positionAbsolute,C):A.positionAbsolute,q=Hx(d(d(d({},W),U),{origin:I.origin||M})),$=D||L||r||o||c||s,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=s?function(n){return s(n,d({},A.userNode))}:void 0,nn=f?function(n){return f(n,d({},A.userNode))}:void 0,en=h?function(n){return h(n,d({},A.userNode))}:void 0;return E.jsx("div",{className:O(["ink-flow__node","ink-flow__node-".concat(T),(e={},e[_]=L,e),I.className,{selected:I.selected,selectable:D,parent:z,draggable:L,dragging:F}]),ref:X,style:d(d({zIndex:A.z,transform:"translate(".concat(q.x,"px,").concat(q.y,"px)"),pointerEvents:$?"all":"none",visibility:Y?"visible":"hidden"},I.style),G),"data-id":t,"data-testid":"rf__node-".concat(t),onMouseEnter:K,onMouseMove:Q,onMouseLeave:J,onContextMenu:nn,onClick:function(n){var e=H.getState(),o=e.selectNodesOnDrag,i=e.nodeDragThreshold;D&&(!o||!L||i>0)&&oE({id:t,store:H,nodeRef:X}),r&&r(n,d({},A.userNode))},onDoubleClick:en,onKeyDown:V?function(n){if(!Gx(n.nativeEvent)&&!S)if(Jy.includes(n.key)&&D){var e="Escape"===n.key;oE({id:t,store:H,unselect:e,nodeRef:X})}else L&&I.selected&&Object.prototype.hasOwnProperty.call(tE,n.key)&&(H.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~W.x,", y: ").concat(~~W.y)}),Z({direction:tE[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:V?0:void 0,role:V?"button":void 0,"aria-describedby":S?void 0:"".concat(Y_,"-").concat(k),"aria-label":I.ariaLabel,children:E.jsx(H_,{value:t,children:E.jsx(B,d({id:t,data:I.data,type:T,positionAbsoluteX:W.x,positionAbsoluteY:W.y,selected:I.selected,isConnectable:R,sourcePosition:I.sourcePosition,targetPosition:I.targetPosition,dragging:F,dragHandle:I.dragHandle,zIndex:A.z},U))})})}var uE=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function cE(n){var e,t=mx(uE,e_),r=t.nodesDraggable,o=t.nodesConnectable,a=t.nodesFocusable,c=t.elementsSelectable,s=t.onError,d=mx(l(R_(e=!1),[e]),e_),f=function(){var n=mx(D_),e=g(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(e){var t=new Map;e.forEach((function(n){var e=n.target.getAttribute("data-id");t.set(e,{id:e,nodeElement:n.target})})),n(t)}))})),1),t=e[0];return u((function(){return function(){null==t||t.disconnect()}}),[t]),t}();return E.jsx("div",{className:"ink-flow__nodes",style:t_,children:d.map((function(e){return E.jsx(aE,{id:e,nodeTypes:n.nodeTypes,nodeOrigin:n.nodeOrigin,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:f,nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:c,onError:s},e)}))})}cE.displayName="NodeRenderer";var lE,sE=c(cE),dE=((lE={})[Nm.Arrow]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return E.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},lE[Nm.ArrowClosed]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return E.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},lE);function fE(n,e){if(!n)return"";if("string"==typeof n)return n;var t=e?"".concat(e,"__"):"";return"".concat(t).concat(Object.keys(n).sort().map((function(e){return"".concat(e,"=").concat(n[e])})).join("&"))}var hE=function(n){var e=n.id,t=n.type,o=n.color,i=n.width,a=void 0===i?12.5:i,u=n.height,c=void 0===u?12.5:u,l=n.markerUnits,s=void 0===l?"strokeWidth":l,d=n.strokeWidth,f=n.orient,h=void 0===f?"auto-start-reverse":f,v=function(n){var e=wx(),t=r((function(){var t,r;return Object.prototype.hasOwnProperty.call(dE,n)?dE[n]:(null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"009",Ky.error009(n)),null)}),[n]);return t}(t);return v?E.jsx("marker",{className:"ink-flow__arrowhead",id:e,markerWidth:"".concat(a),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:E.jsx(v,{color:o,strokeWidth:d})}):null},vE=function(n){var e=n.defaultColor,t=n.rfId,o=mx((function(n){return n.edges})),i=mx((function(n){return n.defaultEdgeOptions})),a=r((function(){var n=function(n,e){var t=e.id,r=e.defaultColor,o=e.defaultMarkerStart,i=e.defaultMarkerEnd,a=new Set;return n.reduce((function(n,e){return[e.markerStart||o,e.markerEnd||i].forEach((function(e){if(e&&"object"==typeof e){var o=fE(e,t);a.has(o)||(n.push(d({id:o,color:e.color||r},e)),a.add(o))}})),n}),[]).sort((function(n,e){return n.id.localeCompare(e.id)}))}(o,{id:t,defaultColor:e,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,t,e]);return a.length?E.jsx("svg",{className:"ink-flow__marker",children:E.jsx("defs",{children:a.map((function(n){return E.jsx(hE,{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};vE.displayName="MarkerDefinitions";var pE=c(vE);function gE(n){var e=n.x,t=n.y,r=n.label,o=n.labelStyle,a=void 0===o?{}:o,u=n.labelShowBg,c=void 0===u||u,s=n.labelBgStyle,h=void 0===s?{}:s,v=n.labelBgPadding,p=void 0===v?[2,4]:v,y=n.labelBgBorderRadius,m=void 0===y?2:y,w=n.children,b=n.className,x=f(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),_=g(i({x:1,y:0,width:0,height:0}),2),S=_[0],k=_[1],N=O(["ink-flow__edge-textwrapper",b]),C=l((function(n){if(null!==n){var e=n.getBBox();k({x:e.x,y:e.y,width:e.width,height:e.height})}}),[]);return void 0!==r&&r?E.jsxs("g",d({transform:"translate(".concat(e-S.width/2," ").concat(t-S.height/2,")"),className:N,visibility:S.width?"visible":"hidden"},x,{children:[c&&E.jsx("rect",{width:S.width+2*p[0],x:-p[0],y:-p[1],height:S.height+2*p[1],className:"ink-flow__edge-textbg",style:h,rx:m,ry:m}),E.jsx("text",{className:"ink-flow__edge-text",y:S.height/2,dy:"0.3em",ref:C,style:a,children:r}),w]})):null}gE.displayName="EdgeText";var yE=c(gE);function mE(n){var e=n.id,t=n.path,r=n.labelX,o=n.labelY,i=n.label,a=n.labelStyle,u=n.labelShowBg,c=n.labelBgStyle,l=n.labelBgPadding,s=n.labelBgBorderRadius,d=n.style,f=n.markerEnd,h=n.markerStart,v=n.className,p=n.interactionWidth,g=void 0===p?20:p;return E.jsxs(E.Fragment,{children:[E.jsx("path",{id:e,style:d,d:t,fill:"none",className:O(["ink-flow__edge-path",v]),markerEnd:f,markerStart:h}),g&&E.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&Mx(r)&&Mx(o)?E.jsx(yE,{x:r,y:o,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function wE(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2;return e===Cm.Left||e===Cm.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function bE(n){return c((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,a=e.targetY,u=e.sourcePosition,c=void 0===u?Cm.Bottom:u,l=e.targetPosition,s=void 0===l?Cm.Top:l,d=e.label,f=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,y=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,b=e.markerStart,x=e.interactionWidth,_=g(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?Cm.Bottom:r,i=n.targetX,a=n.targetY,u=n.targetPosition,c=void 0===u?Cm.Top:u,l=g(wE({pos:o,x1:e,y1:t,x2:i,y2:a}),2),s=l[0],d=l[1],f=g(wE({pos:c,x1:i,y1:a,x2:e,y2:t}),2),h=f[0],v=f[1],p=g(F_({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:s,sourceControlY:d,targetControlX:h,targetControlY:v}),4),y=p[0],m=p[1],w=p[2],b=p[3];return["M".concat(e,",").concat(t," C").concat(s,",").concat(d," ").concat(h,",").concat(v," ").concat(i,",").concat(a),y,m,w,b]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:a,targetPosition:s}),3),S=_[0],k=_[1],N=_[2],C=n.isInternal?void 0:t;return E.jsx(mE,{id:C,path:S,labelX:k,labelY:N,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:y,style:m,markerEnd:w,markerStart:b,interactionWidth:x})}))}var xE=bE({isInternal:!1}),_E=bE({isInternal:!0});function EE(n){return c((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,a=e.targetY,u=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,d=e.labelBgPadding,f=e.labelBgBorderRadius,h=e.style,v=e.sourcePosition,p=void 0===v?Cm.Bottom:v,y=e.targetPosition,m=void 0===y?Cm.Top:y,w=e.markerEnd,b=e.markerStart,x=e.pathOptions,_=e.interactionWidth,S=g(J_({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=S[0],N=S[1],C=S[2],O=n.isInternal?void 0:t;return E.jsx(mE,{id:O,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:_})}))}xE.displayName="SimpleBezierEdge",_E.displayName="SimpleBezierEdgeInternal";var SE=EE({isInternal:!1}),kE=EE({isInternal:!0});function NE(n){return c((function(e){var t,o=e.id,i=f(e,["id"]),a=n.isInternal?void 0:o;return E.jsx(SE,d({},i,{id:a,pathOptions:r((function(){var n;return{borderRadius:0,offset:null===(n=i.pathOptions)||void 0===n?void 0:n.offset}}),[null===(t=i.pathOptions)||void 0===t?void 0:t.offset])}))}))}SE.displayName="SmoothStepEdge",kE.displayName="SmoothStepEdgeInternal";var CE=NE({isInternal:!1}),OE=NE({isInternal:!0});function ME(n){return c((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,a=e.targetY,u=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,d=e.labelBgPadding,f=e.labelBgBorderRadius,h=e.style,v=e.markerEnd,p=e.markerStart,y=e.interactionWidth,m=g(function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=g(G_({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),a=i[0],u=i[1],c=i[2],l=i[3];return["M ".concat(e,",").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],_=n.isInternal?void 0:t;return E.jsx(mE,{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:y})}))}CE.displayName="StepEdge",OE.displayName="StepEdgeInternal";var jE=ME({isInternal:!1}),PE=ME({isInternal:!0});function IE(n){return c((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,a=e.targetY,u=e.sourcePosition,c=void 0===u?Cm.Bottom:u,l=e.targetPosition,s=void 0===l?Cm.Top:l,d=e.label,f=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,y=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,b=e.markerStart,x=e.pathOptions,_=e.interactionWidth,S=g(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?Cm.Bottom:r,i=n.targetX,a=n.targetY,u=n.targetPosition,c=void 0===u?Cm.Top:u,l=n.curvature,s=void 0===l?.25:l,d=g(U_({pos:o,x1:e,y1:t,x2:i,y2:a,c:s}),2),f=d[0],h=d[1],v=g(U_({pos:c,x1:i,y1:a,x2:e,y2:t,c:s}),2),p=v[0],y=v[1],m=g(F_({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:y}),4),w=m[0],b=m[1],x=m[2],_=m[3];return["M".concat(e,",").concat(t," C").concat(f,",").concat(h," ").concat(p,",").concat(y," ").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=S[0],N=S[1],C=S[2],O=n.isInternal?void 0:t;return E.jsx(mE,{id:O,path:k,labelX:N,labelY:C,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:y,style:m,markerEnd:w,markerStart:b,interactionWidth:_})}))}jE.displayName="StraightEdge",PE.displayName="StraightEdgeInternal";var AE=IE({isInternal:!1}),zE=IE({isInternal:!0});AE.displayName="BezierEdge",zE.displayName="BezierEdgeInternal";var TE={default:zE,straight:PE,step:OE,smoothstep:kE,simplebezier:_E},BE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},LE=function(n,e,t){return t===Cm.Left?n-e:t===Cm.Right?n+e:n},DE=function(n,e,t){return t===Cm.Top?n-e:t===Cm.Bottom?n+e:n},RE="ink-flow__edgeupdater";function VE(n){var e=n.position,t=n.centerX,r=n.centerY,o=n.radius,i=void 0===o?10:o,a=n.onMouseDown,u=n.onMouseEnter,c=n.onMouseOut,l=n.type;return E.jsx("circle",{onMouseDown:a,onMouseEnter:u,onMouseOut:c,className:O([RE,"".concat(RE,"-").concat(l)]),cx:LE(t,i,e),cy:DE(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function HE(n){var e=n.isUpdatable,t=n.edgeUpdaterRadius,r=n.edge,o=n.targetHandleId,i=n.sourceHandleId,a=n.sourceX,u=n.sourceY,c=n.targetX,l=n.targetY,s=n.sourcePosition,d=n.targetPosition,f=n.onEdgeUpdate,h=n.onEdgeUpdateStart,v=n.onEdgeUpdateEnd,p=n.setUpdating,g=n.setUpdateHover,y=wx(),m=function(n,e){if(0===n.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=e?r.target:r.source,k=(e?o:i)||null,N=e?"target":"source",C=e;p(!0),null==h||h(n,r,N);Km.onPointerDown(n.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(n){return null==f?void 0:f(r,n)},onConnectStart:g,onConnectEnd:m,onEdgeUpdateEnd:function(n){p(!1),null==v||v(n,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 E.jsxs(E.Fragment,{children:[("source"===e||!0===e)&&E.jsx(VE,{position:s,centerX:a,centerY:u,radius:t,onMouseDown:function(n){return m(n,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===e||!0===e)&&E.jsx(VE,{position:d,centerX:c,centerY:l,radius:t,onMouseDown:function(n){return m(n,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function YE(n){var e;return n&&!(!n.internals.handleBounds&&!(null===(e=n.handles)||void 0===e?void 0:e.length))&&!!(n.measured.width||n.width||n.initialWidth)}function XE(n){var e,t,r,o;if(!n)return null;var i=[],a=[];try{for(var u=p(n),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(n){e={error:n}}finally{try{c&&!c.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}return{source:i,target:a}}function FE(n,e,t){var r,o;void 0===t&&(t=null);var i=(null!==(r=null==t?void 0:t.x)&&void 0!==r?r:0)+e.internals.positionAbsolute.x,a=(null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0)+e.internals.positionAbsolute.y,u=null!=t?t:Ox(e),c=u.width,l=u.height;switch(n){case Cm.Top:return[i+c/2,a];case Cm.Right:return[i+c,a+l/2];case Cm.Bottom:return[i+c/2,a+l];case Cm.Left:return[i,a+l/2]}}function ZE(n,e){return n&&(e?n.find((function(n){return n.id===e})):n[0])||null}function UE(n){var e=n.id,t=n.edgesFocusable,o=n.edgesUpdatable,u=n.elementsSelectable,c=n.onClick,s=n.onDoubleClick,f=n.onContextMenu,h=n.onMouseEnter,v=n.onMouseMove,p=n.onMouseLeave,y=n.edgeUpdaterRadius,m=n.onEdgeUpdate,w=n.onEdgeUpdateStart,b=n.onEdgeUpdateEnd,x=n.rfId,_=n.edgeTypes,S=n.noPanClassName,k=n.onError,N=n.disableKeyboardA11y,C=mx((function(n){return n.edgeLookup.get(e)})),M=mx((function(n){return n.defaultEdgeOptions})),j=(C=M?d(d({},M),C):C).type||"default",P=(null==_?void 0:_[j])||TE[j];void 0===P&&(null==k||k("011",Ky.error011(j)),j="default",P=TE.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),B=g(i(!1),2),L=B[0],D=B[1],R=g(i(!1),2),V=R[0],H=R[1],Y=wx(),X=mx(l((function(n){var t=n.nodeLookup.get(C.source),r=n.nodeLookup.get(C.target);if(!t||!r)return d({zIndex:C.zIndex},BE);var o=function(n){var e,t,r,o,i,a=n.sourceNode,u=n.targetNode;if(!YE(a)||!YE(u))return null;var c=a.internals.handleBounds||XE(a.handles),l=u.internals.handleBounds||XE(u.handles),s=ZE(null!==(e=null==c?void 0:c.source)&&void 0!==e?e:[],n.sourceHandle),d=ZE(n.connectionMode===_m.Strict?null!==(t=null==l?void 0:l.target)&&void 0!==t?t:[]:(null!==(r=null==l?void 0:l.target)&&void 0!==r?r:[]).concat(null!==(o=null==l?void 0:l.source)&&void 0!==o?o:[]),n.targetHandle),f=(null==s?void 0:s.position)||Cm.Bottom,h=(null==d?void 0:d.position)||Cm.Top;if(!s||!d)return null===(i=n.onError)||void 0===i||i.call(n,"008",Ky.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=g(FE(f,a,s),2),p=v[0],y=v[1],m=g(FE(h,u,d),2);return{sourceX:p,sourceY:y,targetX:m[0],targetY:m[1],sourcePosition:f,targetPosition:h}}({id:e,sourceNode:t,targetNode:r,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:n.connectionMode,onError:k}),i=function(n){var e=n.sourceNode,t=n.targetNode,r=n.selected,o=void 0!==r&&r,i=n.zIndex,a=void 0===i?0:i,u=n.elevateOnSelect;if(void 0===u||!u)return a;var c=o||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return a+(c?l:0)}({selected:C.selected,zIndex:C.zIndex,sourceNode:t,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||BE)}),[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),e_),F=X.zIndex,Z=X.sourceX,U=X.sourceY,G=X.targetX,W=X.targetY,q=X.sourcePosition,$=X.targetPosition,K=r((function(){return C.markerStart?"url('#".concat(fE(C.markerStart,x),"')"):void 0}),[C.markerStart,x]),Q=r((function(){return C.markerEnd?"url('#".concat(fE(C.markerEnd,x),"')"):void 0}),[C.markerEnd,x]);if(C.hidden||null===Z||null===U||null===G||null===W)return null;var J=s?function(n){s(n,d({},C))}:void 0,nn=f?function(n){f(n,d({},C))}:void 0,en=h?function(n){h(n,d({},C))}:void 0,tn=v?function(n){v(n,d({},C))}:void 0,rn=p?function(n){p(n,d({},C))}:void 0;return E.jsx("svg",{style:{zIndex:F},children:E.jsxs("g",{className:O(["ink-flow__edge","ink-flow__edge-".concat(j),C.className,S,{selected:C.selected,animated:C.animated,inactive:!z&&!c,updating:L,selectable:z}]),onClick:function(n){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([e])),c&&c(n,C)},onDoubleClick:J,onContextMenu:nn,onMouseEnter:en,onMouseMove:tn,onMouseLeave:rn,onKeyDown:I?function(n){var t;if(!N&&Jy.includes(n.key)&&z){var r=Y.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(t=T.current)||void 0===t||t.blur(),o({edges:[C]})):i([e])}}:void 0,tabIndex:I?0:void 0,role:I?"button":"img","data-id":e,"data-testid":"rf__edge-".concat(e),"aria-label":null===C.ariaLabel?void 0:C.ariaLabel||"Edge from ".concat(C.source," to ").concat(C.target),"aria-describedby":I?"".concat(X_,"-").concat(x):void 0,ref:T,children:[!V&&E.jsx(P,{id:e,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:Z,sourceY:U,targetX:G,targetY:W,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&&E.jsx(HE,{edge:C,isUpdatable:A,edgeUpdaterRadius:y,onEdgeUpdate:m,onEdgeUpdateStart:w,onEdgeUpdateEnd:b,sourceX:Z,sourceY:U,targetX:G,targetY:W,sourcePosition:q,targetPosition:$,setUpdateHover:D,setUpdating:H,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle})]})})}var GE=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 WE(n){var e=n.rfId,t=n.noPanClassName,r=n.onEdgeUpdate,o=mx(GE,e_),i=o.edgesFocusable,a=o.edgesUpdatable,u=o.elementsSelectable,c=o.onError,s=function(n){var e=mx(l((function(n){return n.edges.map((function(n){return n.id}))}),[n]),e_);return e}(!1);return E.jsxs("div",{className:"ink-flow__edges",children:[E.jsx(pE,{defaultColor:"",rfId:e}),s.map((function(n){return E.jsx(UE,{id:n,edgesFocusable:i,edgesUpdatable:a,elementsSelectable:u,noPanClassName:t,onEdgeUpdate:r,rfId:e,onError:c},n)}))]})}WE.displayName="EdgeRenderer";var qE=c(WE),$E=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function KE(n){var e=n.children,t=mx($E);return E.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:e})}function QE(n){var e=n.rfId,t=n.minZoom,r=n.maxZoom,o=n.noPanClassName,i=n.noDragClassName,a=n.nodeOrigin,u=n.viewport,c=n.disableKeyboardA11y,l=n.translateExtent,s=n.defaultViewport,d=n.nodeTypes,f=n.elementsSelectable,h=n.onPaneClick,v=n.onPaneContextMenu;return E.jsx(O_,{minZoom:t,maxZoom:r,noPanClassName:o,noDragClassName:i,isControlledViewport:!!u,disableKeyboardA11y:c,translateExtent:l,defaultViewport:s,elementsSelectable:f,onPaneClick:h,onPaneContextMenu:v,children:E.jsxs(KE,{children:[E.jsx(qE,{rfId:e,noPanClassName:o}),E.jsx("div",{className:"ink-flow__edgelabel-renderer"}),E.jsx(sE,{rfId:e,nodeTypes:d,nodeOrigin:a,noDragClassName:i,noPanClassName:o,disableKeyboardA11y:!1}),E.jsx("div",{className:"ink-flow__viewport-portal"})]})})}QE.displayName="GraphView";var JE=c(QE),nS=function(n){var e,t,r=void 0===n?{}:n,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!==(e=null!=u?u:i)&&void 0!==e?e:[],h=null!==(t=null!=a?a:o)&&void 0!==t?t:[];Ex(s,d,f),Sx(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:Qy,nodeExtent:Qy,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:_m.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:[],lib:"react",debug:!1}},eS=function(n){var e,t,r=n.nodes,o=n.edges,i=n.defaultNodes,a=n.defaultEdges,u=n.width,c=n.height,l=n.fitView;return e=function(n,e){return d(d({},nS({nodes:r,edges:o,width:u,height:c,fitView:l,defaultNodes:i,defaultEdges:a})),{setNodes:function(t){var r=e();Sx(t,r.nodeLookup,r.parentLookup,{nodeOrigin:r.nodeOrigin,elevateNodesOnSelect:r.elevateNodesOnSelect,checkEquality:!0}),n({nodes:t})},setEdges:function(t){var r=e();Ex(r.connectionLookup,r.edgeLookup,t),n({edges:t})},setDefaultNodesAndEdges:function(t,r){t&&((0,e().setNodes)(t),n({hasDefaultNodes:!0})),r&&((0,e().setEdges)(r),n({hasDefaultEdges:!0}))},updateNodeInternals:function(t){var r=e(),o=r.triggerNodeChanges,i=r.fitView,a=r.nodeLookup,u=r.parentLookup,c=r.fitViewOnInit,l=r.fitViewDone,s=r.fitViewOnInitOptions,f=r.domNode,h=r.nodeOrigin,v=r.debug,p=function(n,e,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(n.forEach((function(n){var t=e.get(n.id);if(null==t?void 0:t.hidden)e.set(t.id,d(d({},t),{internals:d(d({},t.internals),{handleBounds:void 0})})),a=!0;else if(t){var r=Zx(n.nodeElement),i=t.measured.width!==r.width||t.measured.height!==r.height;if(r.width&&r.height&&(i||!t.internals.handleBounds||n.force)){var c=d(d({},t),{measured:r,internals:d(d({},t.internals),{handleBounds:{source:$x(".source",n.nodeElement,l,t.origin||o),target:$x(".target",n.nodeElement,l,t.origin||o)}})});e.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:Ix(c,c.origin||o)}))}}})),s.length>0){var f=kx(s,e,t,o);u.push.apply(u,y([],g(f),!1))}return{changes:u,updatedInternals:a}}(t,a,u,f,h),m=p.changes;if(p.updatedInternals){bx(a,{nodeOrigin:h});var w=l;!l&&c&&(w=i(d(d({},s),{nodes:null==s?void 0:s.nodes}))),n({fitViewDone:w}),(null==m?void 0:m.length)>0&&(v&&console.log("Ink Flow: trigger node changes",m),null==o||o(m))}},updateNodePositions:function(n,t){var r,o;void 0===t&&(t=!1);var i=[],a=[];try{for(var u=p(n),c=u.next();!c.done;c=u.next()){var l=g(c.value,2),s=l[0],f=l[1],h={id:s,type:"position",position:f.position,dragging:t};(null==f?void 0:f.expandParent)&&(null==f?void 0:f.parentId)&&h.position&&(i.push({id:s,parentId:f.parentId,rect:d(d({},f.internals.positionAbsolute),{width:f.measured.width,height:f.measured.height})}),h.position.x=Math.max(0,h.position.x),h.position.y=Math.max(0,h.position.y)),a.push(h)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}if(i.length>0){var v=e(),m=kx(i,v.nodeLookup,v.parentLookup);a.push.apply(a,y([],g(m),!1))}e().triggerNodeChanges(a)},triggerNodeChanges:function(n){var t=e(),r=t.onNodesChange,o=t.setNodes,i=t.nodes,a=t.hasDefaultNodes,u=t.debug;(null==n?void 0:n.length)&&(a&&o(l_(n,i)),u&&console.log("Ink Flow: trigger node changes",n),null==r||r(n))},triggerEdgeChanges:function(n){var t=e(),r=t.onEdgesChange,o=t.setEdges,i=t.edges,a=t.hasDefaultEdges,u=t.debug;(null==n?void 0:n.length)&&(a&&o(c_(n,i)),u&&console.log("Ink Flow: trigger edge changes",n),null==r||r(n))},addSelectedNodes:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,a=t.triggerNodeChanges,u=t.triggerEdgeChanges;r?a(n.map((function(n){return s_(n,!0)}))):(a(d_(i,new Set(y([],g(n),!1)),!0)),u(d_(o)))},addSelectedEdges:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,a=t.triggerNodeChanges,u=t.triggerEdgeChanges;r?u(n.map((function(n){return s_(n,!0)}))):(u(d_(o,new Set(y([],g(n),!1)))),a(d_(i,new Set,!0)))},unselectNodesAndEdges:function(n){var t=void 0===n?{}:n,r=t.nodes,o=t.edges,i=e(),a=i.edges,u=i.nodes,c=i.triggerNodeChanges,l=i.triggerEdgeChanges,s=o||a,d=(r||u).map((function(n){return n.selected=!1,s_(n.id,!1)})),f=s.map((function(n){return s_(n.id,!1)}));c(d),l(f)},setMinZoom:function(t){var r=e(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([t,i]),n({minZoom:t})},setMaxZoom:function(t){var r=e(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,t]),n({maxZoom:t})},setTranslateExtent:function(t){var r;null===(r=e().panZoom)||void 0===r||r.setTranslateExtent(t),n({translateExtent:t})},resetSelectedElements:function(){var n=e(),t=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,a=r.reduce((function(n,e){return e.selected?y(y([],g(n),!1),[s_(e.id,!1)],!1):n}),[]),u=t.reduce((function(n,e){return e.selected?y(y([],g(n),!1),[s_(e.id,!1)],!1):n}),[]);o(a),i(u)},setNodeExtent:function(t){var r,o,i=e().nodeLookup;try{for(var a=p(i),u=a.next();!u.done;u=a.next()){var c=g(u.value,2)[1],l=Cx(c.position,t);i.set(c.id,d(d({},c),{internals:d(d({},c.internals),{positionAbsolute:l})}))}}catch(n){r={error:n}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}n({nodeExtent:t})},panBy:function(n){var t=e(),r=t.transform,o=t.width,i=t.height;return function(n){var e=n.delta,t=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,a=n.height;if(!t||!e.x&&!e.y)return!1;var u=t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[i,a]],o);return!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2])}({delta:n,panZoom:t.panZoom,transform:r,translateExtent:t.translateExtent,width:o,height:i})},fitView:function(n){var t=e(),r=t.panZoom,o=t.width,i=t.height,a=t.minZoom,u=t.maxZoom,c=t.nodeOrigin,l=t.nodeLookup;return!!r&&m_({nodeLookup:l,width:o,height:i,panZoom:r,minZoom:a,maxZoom:u,nodeOrigin:c},n)},cancelConnection:function(){return n({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(t){var r,o=e().connectionPosition,i=d(d({},t),{connectionPosition:null!==(r=t.connectionPosition)&&void 0!==r?r:o});n(i)},reset:function(){return n(d({},nS()))}})},t=Object.is,e?V(e,t):V};function tS(n){var e=n.initialNodes,t=n.initialEdges,r=n.defaultNodes,o=n.defaultEdges,a=n.initialWidth,u=n.initialHeight,c=n.fitView,l=n.children,s=g(i((function(){return eS({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:a,height:u,fitView:c})})),1)[0];return E.jsx(Xe,{value:s,children:E.jsx(z_,{children:l})})}function rS(n){var e=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,a=n.defaultEdges,u=n.width,c=n.height,l=n.fitView;return t(Ye)?E.jsx(E.Fragment,{children:e}):E.jsx(tS,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:a,initialWidth:u,initialHeight:c,fitView:l,children:e})}var oS={x:0,y:0,zoom:1},iS=y(y([],g(["nodes","edges","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions"]),!1),["rfId"],!1),aS=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}},uS={translateExtent:Qy,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function cS(n){var e=mx(aS,e_),t=e.setNodes,r=e.setEdges,o=e.setMinZoom,i=e.setMaxZoom,c=e.setTranslateExtent,l=e.setNodeExtent,s=e.reset,d=e.setDefaultNodesAndEdges,f=wx();u((function(){return d(n.defaultNodes,n.defaultEdges),function(){h.current=uS,s()}}),[]);var h=a(uS);return u((function(){var e,a,u;try{for(var s=p(iS),d=s.next();!d.done;d=s.next()){var v=d.value,g=n[v];g!==h.current[v]&&(void 0!==n[v]&&("nodes"===v?t(g):"edges"===v?r(g):"minZoom"===v?o(g):"maxZoom"===v?i(g):"translateExtent"===v?c(g):"nodeExtent"===v?l(g):"fitView"===v?f.setState({fitViewOnInit:g}):"fitViewOptions"===v?f.setState({fitViewOnInitOptions:g}):f.setState(((u={})[v]=g,u))))}}catch(n){e={error:n}}finally{try{d&&!d.done&&(a=s.return)&&a.call(s)}finally{if(e)throw e.error}}h.current=n}),iS.map((function(e){return n[e]}))),null}var lS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var sS=Lx((function(n,e){var t=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?Qy:o,a=n.defaultViewport,u=void 0===a?oS:a,c=n.minZoom,l=void 0===c?.5:c,s=n.maxZoom,h=void 0===s?2:s,v=n.nodeOrigin,p=n.noDragClassName,g=n.noPanClassName,y=n.disableKeyboardA11y,m=n.nodeTypes,w=n.onNodesChange,b=n.onEdgesChange,x=n.fitView,_=n.fitViewOptions,S=n.nodeExtent,k=n.nodesDraggable,N=n.children,C=n.id,M=n.width,j=n.height,P=n.onPaneClick,I=n.onPaneContextMenu,A=n.elementsSelectable,z=void 0===A||A,T=f(n,["nodes","edges","translateExtent","defaultViewport","minZoom","maxZoom","nodeOrigin","noDragClassName","noPanClassName","disableKeyboardA11y","nodeTypes","onNodesChange","onEdgesChange","fitView","fitViewOptions","nodeExtent","nodesDraggable","children","id","width","height","onPaneClick","onPaneContextMenu","elementsSelectable"]),B=C||"1";return E.jsx("div",d({},T,{ref:e,style:d({},lS),className:O(["ink-flow"]),"data-testid":"rf__wrapper",id:C,children:E.jsxs(rS,{nodes:t,edges:r,width:M,height:j,fitView:x,children:[E.jsx(JE,{rfId:B,nodeTypes:m,minZoom:l,maxZoom:h,nodeOrigin:v,noDragClassName:p,noPanClassName:g,disableKeyboardA11y:y,translateExtent:i,defaultViewport:u,onPaneClick:P,onPaneContextMenu:I}),E.jsx(cS,{nodes:t,edges:r,rfId:B,onNodesChange:w,onEdgesChange:b,fitView:x,fitViewOptions:_,nodeExtent:S,nodesDraggable:k,elementsSelectable:z}),N]})}))}));function dS(){return E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.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 fS(){return E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.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 hS(){return E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.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 vS(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.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 pS(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.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 gS(n){var e=n.children,t=n.className,r=f(n,["children","className"]);return E.jsx("button",d({type:"button",className:O(["ink-flow__controls-button",t])},r,{children:e}))}var yS=function(n){return n.userSelectionActive?"none":"all"};function mS(n){var e=n.position,t=void 0===e?"top-left":e,r=n.children,o=n.className,i=n.style,a=f(n,["position","children","className","style"]),u=mx(yS),c="".concat(t).split("-");return E.jsx("div",d({className:O(y(["ink-flow__panel",o],g(c),!1)),style:d(d({},i),{pointerEvents:u})},a,{children:r}))}var wS=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function bS(n){var e=n.style,t=n.showZoom,r=void 0===t||t,o=n.showFitView,i=void 0===o||o,a=n.showInteractive,u=void 0===a||a,c=n.fitViewOptions,l=n.onZoomIn,s=n.onZoomOut,d=n.onFitView,f=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,x=wx(),_=mx(wS,e_),S=_.isInteractive,k=_.minZoomReached,N=_.maxZoomReached,C=L_(),M=C.zoomIn,j=C.zoomOut,P=C.fitView,I="horizontal"===m?"horizontal":"vertical";return E.jsxs(mS,{className:O(["ink-flow__controls",I,h]),position:g,style:e,"data-testid":"rf__controls","aria-label":b,children:[i&&E.jsx(gS,{className:"ink-flow__controls-fitview",onClick:function(){P(c),null==d||d()},title:"fit view","aria-label":"fit view",children:E.jsx(hS,{})}),r&&E.jsxs("div",{className:"ink-flow__controls-zoom",children:[E.jsx(gS,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:N,children:E.jsx(dS,{})}),E.jsx(gS,{onClick:function(){j(),null==s||s()},className:"ink-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:k,children:E.jsx(fS,{})})]}),u&&E.jsx(gS,{className:"ink-flow__controls-interactive",onClick:function(){x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),null==f||f(!S)},title:"toggle interactivity","aria-label":"toggle interactivity",children:S?E.jsx(pS,{}):E.jsx(vS,{})}),v]})}bS.displayName="Controls";var xS=c(bS);export{km as ConnectionLineType,_m as ConnectionMode,gS as ControlButton,xS as Controls,eE as Handle,tS as InkFlowProvider,Nm as MarkerType,Em as PanOnScrollMode,Cm as Position,Sm as SelectionMode,Bm as addEdge,fv as dagreLayout,sS as default,Mm as getBezierEdgeCenter,Im as getBezierPath,im as getConnectedEdges,Am as getEdgeCenter,em as getIncomers,rm as getNodesBounds,nm as getOutgoers,Hm as getSmoothStepPath,Dm as getStraightPath,mm as getViewportForBounds,Lm as updateEdge,M_ as useEdgesState,L_ as useInkFlow,j_ as useNodesState,mx as useStore,wx as useStoreApi};
17
+ //# sourceMappingURL=index.esm.js.map