@railtownai/railtracks-visualizer 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as e from"react";import t,{createContext as n,memo as o,useMemo as r,forwardRef as a,useEffect as i,useCallback as s,useRef as l,useContext as c,useState as u,createElement as d,useLayoutEffect as f}from"react";import*as p from"react-dom";import h from"react-dom";import{jsx as m,jsxs as g,Fragment as y}from"react/jsx-runtime";function v(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o<e.length;o++)""!==(n=v(e[o]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,x={exports:{}},E={},S={exports:{}},_={};var N,C,k,M={};
1
+ import*as e from"react";import t,{createContext as n,memo as o,useMemo as r,forwardRef as a,useEffect as i,useCallback as s,useRef as l,useContext as c,useState as u,createElement as d,useLayoutEffect as f}from"react";import*as p from"react-dom";import h from"react-dom";import{jsx as m,jsxs as g,Fragment as y}from"react/jsx-runtime";function v(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o<e.length;o++)""!==(n=v(e[o]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,x={exports:{}},E={},S={exports:{}},_={};var k,C,N,M={};
2
2
  /**
3
3
  * @license React
4
4
  * use-sync-external-store-shim.development.js
@@ -7,7 +7,7 @@ import*as e from"react";import t,{createContext as n,memo as o,useMemo as r,forw
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function O(){return C||(C=1,"production"===process.env.NODE_ENV?S.exports=function(){if(w)return _;w=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=e.useState,r=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!n(e,o)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=o({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return a(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),r(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(n),n};return _.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,_}():S.exports=(N||(N=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=t,o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===n.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();o(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=r({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){p.value=d,p.getSnapshot=u,e(p)&&h({inst:p})},[t,d,u]),a(function(){return e(p)&&h({inst:p}),t(function(){e(p)&&h({inst:p})})},[t]),s(d),d};M.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),M)),S.exports}
10
+ */function O(){return C||(C=1,"production"===process.env.NODE_ENV?S.exports=function(){if(w)return _;w=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=e.useState,r=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!n(e,o)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=o({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return a(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),r(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(n),n};return _.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,_}():S.exports=(k||(k=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=t,o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===n.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();o(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=r({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){p.value=d,p.getSnapshot=u,e(p)&&h({inst:p})},[t,d,u]),a(function(){return e(p)&&h({inst:p}),t(function(){e(p)&&h({inst:p})})},[t]),s(d),d};M.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),M)),S.exports}
11
11
  /**
12
12
  * @license React
13
13
  * use-sync-external-store-shim/with-selector.production.js
@@ -16,7 +16,7 @@ import*as e from"react";import t,{createContext as n,memo as o,useMemo as r,forw
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var P,R={};
19
+ */var P,A={};
20
20
  /**
21
21
  * @license React
22
22
  * use-sync-external-store-shim/with-selector.development.js
@@ -25,7 +25,7 @@ import*as e from"react";import t,{createContext as n,memo as o,useMemo as r,forw
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */"production"===process.env.NODE_ENV?x.exports=function(){if(k)return E;k=1;var e=t,n=O(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return E.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},E}():x.exports=(P||(P=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=t,n=O(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;R.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),R);var A=b(x.exports);const D=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(o,r,a);return a},{useDebugValue:T}=t,{useSyncExternalStoreWithSelector:I}=A,z=e=>e;function L(e,t=z,n){const o=I(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return T(o),o}const $=(e,t)=>{const n=(e=>e?D(e):D)(e),o=(e,o=t)=>L(n,e,o);return Object.assign(o,n),o};function B(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var H={value:()=>{}};function F(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new j(o)}function j(e){this._=e}function V(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function W(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=H,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}j.prototype=F.prototype={constructor:j,on:function(e,t){var n,o,r=this._,a=(o=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)r[n]=W(r[n],e.name,t);else if(null==t)for(n in r)r[n]=W(r[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=V(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new j(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(o=this._[e]).length;a<n;++a)o[a].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,a=o.length;r<a;++r)o[r].value.apply(t,n)}};var Y="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function K(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),X.hasOwnProperty(t)?{space:X[t],local:e}:e}function U(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Y&&t.documentElement.namespaceURI===Y?t.createElement(e):t.createElementNS(n,e)}}function q(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Z(e){var t=K(e);return(t.local?q:U)(t)}function G(){}function Q(e){return null==e?G:function(){return this.querySelector(e)}}function J(){return[]}function ee(e){return null==e?J:function(){return this.querySelectorAll(e)}}function te(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ne(e){return function(){return this.matches(e)}}function oe(e){return function(t){return t.matches(e)}}var re=Array.prototype.find;function ae(){return this.firstElementChild}var ie=Array.prototype.filter;function se(){return Array.from(this.children)}function le(e){return new Array(e.length)}function ce(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ue(e,t,n,o,r,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],o[s]=i):n[s]=new ce(e,a[s]);for(;s<l;++s)(i=t[s])&&(r[s]=i)}function de(e,t,n,o,r,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(o[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new ce(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(r[s]=l)}function fe(e){return e.__data__}function pe(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function me(e){return function(){this.removeAttribute(e)}}function ge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ye(e,t){return function(){this.setAttribute(e,t)}}function ve(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function be(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function we(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xe(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ee(e){return function(){this.style.removeProperty(e)}}function Se(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _e(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Ne(e,t){return e.style.getPropertyValue(t)||xe(e).getComputedStyle(e,null).getPropertyValue(t)}function Ce(e){return function(){delete this[e]}}function ke(e,t){return function(){this[e]=t}}function Me(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Oe(e){return e.trim().split(/^|\s+/)}function Pe(e){return e.classList||new Re(e)}function Re(e){this._node=e,this._names=Oe(e.getAttribute("class")||"")}function Ae(e,t){for(var n=Pe(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function De(e,t){for(var n=Pe(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Te(e){return function(){Ae(this,e)}}function Ie(e){return function(){De(this,e)}}function ze(e,t){return function(){(t.apply(this,arguments)?Ae:De)(this,e)}}function Le(){this.textContent=""}function $e(e){return function(){this.textContent=e}}function Be(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function He(){this.innerHTML=""}function Fe(e){return function(){this.innerHTML=e}}function je(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ve(){this.nextSibling&&this.parentNode.appendChild(this)}function We(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ye(){return null}function Xe(){var e=this.parentNode;e&&e.removeChild(this)}function Ke(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ue(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qe(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,a=t.length;o<a;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function Ze(e,t,n){return function(){var o,r=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var i=0,s=r.length;i<s;++i)if((o=r[i]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),void(o.value=t);this.addEventListener(e.type,a,n),o={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(o):this.__on=[o]}}function Ge(e,t,n){var o=xe(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Qe(e,t){return function(){return Ge(this,e,t)}}function Je(e,t){return function(){return Ge(this,e,t.apply(this,arguments))}}ce.prototype={constructor:ce,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},Re.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var et=[null];function tt(e,t){this._groups=e,this._parents=t}function nt(){return new tt([[document.documentElement]],et)}function ot(e){return"string"==typeof e?new tt([[document.querySelector(e)]],[document.documentElement]):new tt([[e]],et)}function rt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}tt.prototype=nt.prototype={constructor:tt,select:function(e){"function"!=typeof e&&(e=Q(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new tt(o,this._parents)},selectAll:function(e){e="function"==typeof e?te(e):ee(e);for(var t=this._groups,n=t.length,o=[],r=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(o.push(e.call(i,i.__data__,c,s)),r.push(i));return new tt(o,r)},selectChild:function(e){return this.select(null==e?ae:function(e){return function(){return re.call(this.children,e)}}("function"==typeof e?e:oe(e)))},selectChildren:function(e){return this.selectAll(null==e?se:function(e){return function(){return ie.call(this.children,e)}}("function"==typeof e?e:oe(e)))},filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new tt(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,fe);var n,o=t?de:ue,r=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=r[u],f=a[u],p=f.length,h=pe(e.call(d,d&&d.__data__,u,r)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);o(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new tt(s,r))._enter=l,s._exit=c,s},enter:function(){return new tt(this._enter||this._groups.map(le),this._parents)},exit:function(){return new tt(this._exit||this._groups.map(le),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,a=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?a.remove():n(a),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,a=o.length,i=Math.min(r,a),s=new Array(r),l=0;l<i;++l)for(var c,u=n[l],d=o[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<r;++l)s[l]=n[l];return new tt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],a=r.length-1,i=r[a];--a>=0;)(o=r[a])&&(i&&4^o.compareDocumentPosition(i)&&i.parentNode.insertBefore(o,i),i=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=he);for(var n=this._groups,o=n.length,r=new Array(o),a=0;a<o;++a){for(var i,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new tt(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,a=o.length;r<a;++r){var i=o[r];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,a=t[n],i=0,s=a.length;i<s;++i)(r=a[i])&&e.call(r,r.__data__,i,a);return this},attr:function(e,t){var n=K(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?ge:me:"function"==typeof t?n.local?we:be:n.local?ve:ye)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Ee:"function"==typeof t?_e:Se)(e,t,null==n?"":n)):Ne(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Ce:"function"==typeof t?Me:ke)(e,t)):this.node()[e]},classed:function(e,t){var n=Oe(e+"");if(arguments.length<2){for(var o=Pe(this.node()),r=-1,a=n.length;++r<a;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?ze:t?Te:Ie)(n,t))},text:function(e){return arguments.length?this.each(null==e?Le:("function"==typeof e?Be:$e)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?He:("function"==typeof e?je:Fe)(e)):this.node().innerHTML},raise:function(){return this.each(Ve)},lower:function(){return this.each(We)},append:function(e){var t="function"==typeof e?e:Z(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Z(e),o=null==t?Ye:"function"==typeof t?t:Q(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Xe)},clone:function(e){return this.select(e?Ue:Ke)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Ze:qe,o=0;o<i;++o)this.each(s(a[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<i;++o)if((r=a[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Je:Qe)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],a=0,i=r.length;a<i;++a)(o=r[a])&&(yield o)}};const at={passive:!1},it={capture:!0,passive:!1};function st(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function ct(e){var t=e.document.documentElement,n=ot(e).on("dragstart.drag",lt,it);"onselectstart"in t?n.on("selectstart.drag",lt,it):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ut(e,t){var n=e.document.documentElement,o=ot(e).on("dragstart.drag",null);t&&(o.on("click.drag",lt,it),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var dt=e=>()=>e;function ft(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function pt(e){return!e.ctrlKey&&!e.button}function ht(){return this.parentNode}function mt(e,t){return null==t?{x:e.x,y:e.y}:t}function gt(){return navigator.maxTouchPoints||"ontouchstart"in this}function yt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vt(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function bt(){}ft.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var wt=.7,xt=1/wt,Et="\\s*([+-]?\\d+)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nt=/^#([0-9a-f]{3,8})$/,Ct=new RegExp(`^rgb\\(${Et},${Et},${Et}\\)$`),kt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),Mt=new RegExp(`^rgba\\(${Et},${Et},${Et},${St}\\)$`),Ot=new RegExp(`^rgba\\(${_t},${_t},${_t},${St}\\)$`),Pt=new RegExp(`^hsl\\(${St},${_t},${_t}\\)$`),Rt=new RegExp(`^hsla\\(${St},${_t},${_t},${St}\\)$`),At={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 Dt(){return this.rgb().formatHex()}function Tt(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Nt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?zt(t):3===n?new Bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Lt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Lt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ct.exec(e))?new Bt(t[1],t[2],t[3],1):(t=kt.exec(e))?new Bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Mt.exec(e))?Lt(t[1],t[2],t[3],t[4]):(t=Ot.exec(e))?Lt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Pt.exec(e))?Yt(t[1],t[2]/100,t[3]/100,1):(t=Rt.exec(e))?Yt(t[1],t[2]/100,t[3]/100,t[4]):At.hasOwnProperty(e)?zt(At[e]):"transparent"===e?new Bt(NaN,NaN,NaN,0):null}function zt(e){return new Bt(e>>16&255,e>>8&255,255&e,1)}function Lt(e,t,n,o){return o<=0&&(e=t=n=NaN),new Bt(e,t,n,o)}function $t(e,t,n,o){return 1===arguments.length?((r=e)instanceof bt||(r=It(r)),r?new Bt((r=r.rgb()).r,r.g,r.b,r.opacity):new Bt):new Bt(e,t,n,null==o?1:o);var r}function Bt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Ht(){return`#${Wt(this.r)}${Wt(this.g)}${Wt(this.b)}`}function Ft(){const e=jt(this.opacity);return`${1===e?"rgb(":"rgba("}${Vt(this.r)}, ${Vt(this.g)}, ${Vt(this.b)}${1===e?")":`, ${e})`}`}function jt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wt(e){return((e=Vt(e))<16?"0":"")+e.toString(16)}function Yt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kt(e,t,n,o)}function Xt(e){if(e instanceof Kt)return new Kt(e.h,e.s,e.l,e.opacity);if(e instanceof bt||(e=It(e)),!e)return new Kt;if(e instanceof Kt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),a=Math.max(t,n,o),i=NaN,s=a-r,l=(a+r)/2;return s?(i=t===a?(n-o)/s+6*(n<o):n===a?(o-t)/s+2:(t-n)/s+4,s/=l<.5?a+r:2-a-r,i*=60):s=l>0&&l<1?0:i,new Kt(i,s,l,e.opacity)}function Kt(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function Ut(e){return(e=(e||0)%360)<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Zt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}yt(bt,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dt,formatHex:Dt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xt(this).formatHsl()},formatRgb:Tt,toString:Tt}),yt(Bt,$t,vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bt(Vt(this.r),Vt(this.g),Vt(this.b),jt(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:Ht,formatHex:Ht,formatHex8:function(){return`#${Wt(this.r)}${Wt(this.g)}${Wt(this.b)}${Wt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ft,toString:Ft})),yt(Kt,function(e,t,n,o){return 1===arguments.length?Xt(e):new Kt(e,t,n,null==o?1:o)},vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Bt(Zt(e>=240?e-240:e+120,r,o),Zt(e,r,o),Zt(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Kt(Ut(this.h),qt(this.s),qt(this.l),jt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jt(this.opacity);return`${1===e?"hsl(":"hsla("}${Ut(this.h)}, ${100*qt(this.s)}%, ${100*qt(this.l)}%${1===e?")":`, ${e})`}`}}));var Gt=e=>()=>e;function Qt(e){return 1===(e=+e)?Jt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Gt(isNaN(t)?n:t)}}function Jt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Gt(isNaN(e)?t:e)}var en=function e(t){var n=Qt(t);function o(e,t){var o=n((e=$t(e)).r,(t=$t(t)).r),r=n(e.g,t.g),a=n(e.b,t.b),i=Jt(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function tn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,on=new RegExp(nn.source,"g");function rn(e,t){var n,o,r,a=nn.lastIndex=on.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=nn.exec(e))&&(o=on.exec(t));)(r=o.index)>a&&(r=t.slice(a,r),s[i]?s[i]+=r:s[++i]=r),(n=n[0])===(o=o[0])?s[i]?s[i]+=o:s[++i]=o:(s[++i]=null,l.push({i:i,x:tn(n,o)})),a=on.lastIndex;return a<t.length&&(r=t.slice(a),s[i]?s[i]+=r:s[++i]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}var an,sn=180/Math.PI,ln={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cn(e,t,n,o,r,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*sn,skewX:Math.atan(l)*sn,scaleX:i,scaleY:s}}function un(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,o,r,a,i,s){if(e!==r||o!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:tn(e,r)},{i:l-2,x:tn(o,a)})}else(r||a)&&i.push("translate("+r+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(r(n)+"rotate(",null,o)-2,x:tn(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(r(n)+"skewX(",null,o)-2,x:tn(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(a.skewX,i.skewX,s,l),function(e,t,n,o,a,i){if(e!==n||t!==o){var s=a.push(r(a)+"scale(",null,",",null,")");i.push({i:s-4,x:tn(e,n)},{i:s-2,x:tn(t,o)})}else 1===n&&1===o||a.push(r(a)+"scale("+n+","+o+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var dn=un(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ln:cn(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),fn=un(function(e){return null==e?ln:(an||(an=document.createElementNS("http://www.w3.org/2000/svg","g")),an.setAttribute("transform",e),(e=an.transform.baseVal.consolidate())?cn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ln)},", ",")",")");function pn(e){return((e=Math.exp(e))+1/e)/2}var hn,mn,gn=function e(t,n,o){function r(e,r){var a,i,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],f=r[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),y=(f*f-c*c+o*m)/(2*c*n*g),v=(f*f-c*c-o*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);i=(w-b)/t,a=function(e){var o,r=e*i,a=pn(b),u=c/(n*g)*(a*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/pn(t*r+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),yn=0,vn=0,bn=0,wn=0,xn=0,En=0,Sn="object"==typeof performance&&performance.now?performance:Date,_n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nn(){return xn||(_n(Cn),xn=Sn.now()+En)}function Cn(){xn=0}function kn(){this._call=this._time=this._next=null}function Mn(e,t,n){var o=new kn;return o.restart(e,t,n),o}function On(){xn=(wn=Sn.now())+En,yn=vn=0;try{!function(){Nn(),++yn;for(var e,t=hn;t;)(e=xn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yn}()}finally{yn=0,function(){var e,t,n=hn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hn=t);mn=e,Rn(o)}(),xn=0}}function Pn(){var e=Sn.now(),t=e-wn;t>1e3&&(En-=t,wn=e)}function Rn(e){yn||(vn&&(vn=clearTimeout(vn)),e-xn>24?(e<1/0&&(vn=setTimeout(On,e-Sn.now()-En)),bn&&(bn=clearInterval(bn))):(bn||(wn=Sn.now(),bn=setInterval(Pn,1e3)),yn=1,_n(On)))}function An(e,t,n){var o=new kn;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}kn.prototype=Mn.prototype={constructor:kn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Nn():+n)+(null==t?0:+t),this._next||mn===this||(mn?mn._next=this:hn=this,mn=this),this._call=e,this._time=n,Rn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rn())}};var Dn=F("start","end","cancel","interrupt"),Tn=[];function In(e,t,n,o,r,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function a(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(a){var c,u,d,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return An(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[c])}if(An(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=f);o.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=o.length;++a<i;)o[a].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=Mn(a,0,n.time)}(e,n,{name:t,index:o,group:r,on:Dn,tween:Tn,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function zn(e,t){var n=$n(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Ln(e,t){var n=$n(e,t);if(n.state>3)throw new Error("too late; already running");return n}function $n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Bn(e,t){var n,o,r,a=e.__transition,i=!0;if(a){for(r in t=null==t?null:t+"",a)(n=a[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[r]):i=!1;i&&delete e.__transition}}function Hn(e,t){var n,o;return function(){var r=Ln(this,e),a=r.tween;if(a!==n)for(var i=0,s=(o=n=a).length;i<s;++i)if(o[i].name===t){(o=o.slice()).splice(i,1);break}r.tween=o}}function Fn(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var a=Ln(this,e),i=a.tween;if(i!==o){r=(o=i).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}a.tween=r}}function jn(e,t,n){var o=e._id;return e.each(function(){var e=Ln(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return $n(e,o).value[t]}}function Vn(e,t){var n;return("number"==typeof t?tn:t instanceof It?en:(n=It(t))?(t=n,en):rn)(e,t)}function Wn(e){return function(){this.removeAttribute(e)}}function Yn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xn(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===o?r:r=t(o=i,n)}}function Kn(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===o?r:r=t(o=i,n)}}function Un(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttribute(e)}}function qn(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttributeNS(e.space,e.local)}}function Zn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Gn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Qn(e,t){return function(){zn(this,e).delay=+t.apply(this,arguments)}}function Jn(e,t){return t=+t,function(){zn(this,e).delay=t}}function eo(e,t){return function(){Ln(this,e).duration=+t.apply(this,arguments)}}function to(e,t){return t=+t,function(){Ln(this,e).duration=t}}var no=nt.prototype.constructor;function oo(e){return function(){this.style.removeProperty(e)}}var ro=0;function ao(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function io(){return++ro}var so=nt.prototype;ao.prototype={constructor:ao,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Q(e));for(var o=this._groups,r=o.length,a=new Array(r),i=0;i<r;++i)for(var s,l,c=o[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,In(d[f],t,n,f,d,$n(s,n)));return new ao(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ee(e));for(var o=this._groups,r=o.length,a=[],i=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=$n(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&In(f,t,n,m,p,h);a.push(p),i.push(l)}return new ao(a,i,t,n)},selectChild:so.selectChild,selectChildren:so.selectChildren,filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new ao(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,a=Math.min(o,r),i=new Array(o),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<o;++s)i[s]=t[s];return new ao(i,this._parents,this._name,this._id)},selection:function(){return new no(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=io(),o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=$n(i,t);In(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ao(o,this._parents,e,n)},call:so.call,nodes:so.nodes,node:so.node,size:so.size,empty:so.empty,each:so.each,on:function(e,t){var n=this._id;return arguments.length<2?$n(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?zn:Ln;return function(){var i=a(this,e),s=i.on;s!==o&&(r=(o=s).copy()).on(t,n),i.on=r}}(n,e,t))},attr:function(e,t){var n=K(e),o="transform"===n?fn:Vn;return this.attrTween(e,"function"==typeof t?(n.local?qn:Un)(n,o,jn(this,"attr."+e,t)):null==t?(n.local?Yn:Wn)(n):(n.local?Kn:Xn)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=K(e);return this.tween(n,(o.local?Zn:Gn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?dn:Vn;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var a=Ne(this,e),i=(this.style.removeProperty(e),Ne(this,e));return a===i?null:a===n&&i===o?r:r=t(n=a,o=i)}}(e,o)).on("end.style."+e,oo(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,a;return function(){var i=Ne(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Ne(this,e)),i===l?null:i===o&&l===r?a:(r=l,a=t(o=i,s))}}(e,o,jn(this,"style."+e,t))).each(function(e,t){var n,o,r,a,i="style."+t,s="end."+i;return function(){var l=Ln(this,e),c=l.on,u=null==l.value[i]?a||(a=oo(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,a=n+"";return function(){var i=Ne(this,e);return i===a?null:i===o?r:r=t(o=i,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function a(){var a=t.apply(this,arguments);return a!==r&&(o=(r=a)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,a,n)),o}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(jn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=$n(this.node(),n).tween,a=0,i=r.length;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((null==t?Hn:Fn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Qn:Jn)(t,e)):$n(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?eo:to)(t,e)):$n(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Ln(this,e).ease=t}}(t,e)):$n(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Ln(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--r&&a()}};n.each(function(){var n=Ln(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===r&&a()})},[Symbol.iterator]:so[Symbol.iterator]};var lo={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function co(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}nt.prototype.interrupt=function(e){return this.each(function(){Bn(this,e)})},nt.prototype.transition=function(e){var t,n;e instanceof ao?(t=e._id,e=e._name):(t=io(),(n=lo).time=Nn(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)(i=s[c])&&In(i,e,t,c,s,n||co(i,t));return new ao(o,this._parents,e,t)};var uo=e=>()=>e;function fo(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function po(e,t,n){this.k=e,this.x=t,this.y=n}po.prototype={constructor:po,scale:function(e){return 1===e?this:new po(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new po(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ho=new po(1,0,0);function mo(e){e.stopImmediatePropagation()}function go(e){e.preventDefault(),e.stopImmediatePropagation()}function yo(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function vo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function bo(){return this.__zoom||ho}function wo(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xo(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eo(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}po.prototype;const So=n(null),_o=So.Provider,No=()=>"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.",Co=e=>`Node type "${e}" not found. Using fallback type "default".`,ko=()=>"The React Flow parent container needs a width and a height to render the graph.",Mo=()=>"Only child nodes can use a parent extent.",Oo=()=>"Can't create edge. An edge needs a source and a target.",Po=e=>`Marker type "${e}" doesn't exist.`,Ro=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Ao=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Do=e=>`Edge type "${e}" not found. Using fallback type "default".`,To=e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,Io=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function zo(e,t){const n=c(So);if(null===n)throw new Error(Io);return L(n,e,t)}const Lo=()=>{const e=c(So);if(null===e)throw new Error(Io);return r(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},$o=e=>e.userSelectionActive?"none":"all";function Bo({position:e,children:n,className:o,style:r,...a}){const i=zo($o),s=`${e}`.split("-");return t.createElement("div",{className:v(["react-flow__panel",o,...s]),style:{...r,pointerEvents:i},...a},n)}function Ho({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(Bo,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},t.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Fo=o(({x:e,y:n,label:o,labelStyle:r={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:f,className:p,...h})=>{const m=l(null),[g,y]=u({x:0,y:0,width:0,height:0}),b=v(["react-flow__edge-textwrapper",p]);return i(()=>{if(m.current){const e=m.current.getBBox();y({x:e.x,y:e.y,width:e.width,height:e.height})}},[o]),void 0!==o&&o?t.createElement("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...h},a&&t.createElement("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:d,ry:d}),t.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},o),f):null});const jo=e=>({width:e.offsetWidth,height:e.offsetHeight}),Vo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Wo=(e={x:0,y:0},t)=>({x:Vo(e.x,t[0][0],t[1][0]),y:Vo(e.y,t[0][1],t[1][1])}),Yo=(e,t,n)=>e<t?Vo(Math.abs(e-t),1,50)/50:e>n?-Vo(Math.abs(e-n),1,50)/50:0,Xo=(e,t)=>[20*Yo(e.x,35,t.width-35),20*Yo(e.y,35,t.height-35)],Ko=e=>e.getRootNode?.()||window?.document,Uo=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),qo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Zo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Go=e=>!isNaN(e)&&isFinite(e),Qo=Symbol.for("internals"),Jo=["Enter"," ","Escape"],er=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function tr(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const nr=e=>"clientX"in e,or=(e,t)=>{const n=nr(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},rr=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,ar=({id:e,path:n,labelX:o,labelY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>t.createElement(t.Fragment,null,t.createElement("path",{id:e,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&t.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Go(o)&&Go(r)?t.createElement(Fo,{x:o,y:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function ir(e,t,n){return void 0===n?n:o=>{const r=t().edges.find(t=>t.id===e);r&&n(o,{...r})}}function sr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,a=n<e?n+r:n-r,i=Math.abs(o-t)/2;return[a,o<t?o+i:o-i,r,i]}function lr({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*r+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var cr,ur,dr,fr,pr,hr;function mr({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===hr.Left||e===hr.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function gr({sourceX:e,sourceY:t,sourcePosition:n=hr.Bottom,targetX:o,targetY:r,targetPosition:a=hr.Top}){const[i,s]=mr({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=mr({pos:a,x1:o,y1:r,x2:e,y2:t}),[u,d,f,p]=lr({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${o},${r}`,u,d,f,p]}ar.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(cr||(cr={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(ur||(ur={})),function(e){e.Partial="partial",e.Full="full"}(dr||(dr={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(fr||(fr={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(pr||(pr={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(hr||(hr={}));const yr=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,sourcePosition:a=hr.Bottom,targetPosition:i=hr.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=gr({sourceX:e,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i});return t.createElement(ar,{path:y,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})});yr.displayName="SimpleBezierEdge";const vr={[hr.Left]:{x:-1,y:0},[hr.Right]:{x:1,y:0},[hr.Top]:{x:0,y:-1},[hr.Bottom]:{x:0,y:1}},br=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wr({source:e,sourcePosition:t=hr.Bottom,target:n,targetPosition:o=hr.Top,center:r,offset:a}){const i=vr[t],s=vr[o],l={x:e.x+i.x*a,y:e.y+i.y*a},c={x:n.x+s.x*a,y:n.y+s.y*a},u=(({source:e,sourcePosition:t=hr.Bottom,target:n})=>t===hr.Left||t===hr.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=sr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=r.x??v,h=r.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const r=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:r:i.y===f?r:u,t===o){const t=Math.abs(e[d]-n[d]);if(t<=a){const o=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*o:y[d]=(c[d]>n[d]?-1:1)*o}}if(t!==o){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],o=l[e]<c[e];(1===i[d]&&(!t&&n||t&&o)||1!==i[d]&&(!t&&o||t&&n))&&(m="x"===d?r:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function xr({sourceX:e,sourceY:t,sourcePosition:n=hr.Bottom,targetX:o,targetY:r,targetPosition:a=hr.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=wr({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let o="";return o=n>0&&n<u.length-1?function(e,t,n,o){const r=Math.min(br(e,t)/2,br(t,n)/2,o),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+r*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+r*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+r*(e.y<n.y?-1:1)}Q ${a},${i} ${a+r*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=o},"");return[m,d,f,p,h]}const Er=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=hr.Bottom,targetPosition:p=hr.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=xr({sourceX:e,sourceY:n,sourcePosition:f,targetX:o,targetY:r,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return t.createElement(ar,{path:v,labelX:b,labelY:w,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});Er.displayName="SmoothStepEdge";const Sr=o(e=>t.createElement(Er,{...e,pathOptions:r(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Sr.displayName="StepEdge";const _r=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,a,i,s]=sr({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,a,i,s]}({sourceX:e,sourceY:n,targetX:o,targetY:r});return t.createElement(ar,{path:m,labelX:g,labelY:y,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function Nr(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Cr({pos:e,x1:t,y1:n,x2:o,y2:r,c:a}){switch(e){case hr.Left:return[t-Nr(t-o,a),n];case hr.Right:return[t+Nr(o-t,a),n];case hr.Top:return[t,n-Nr(n-r,a)];case hr.Bottom:return[t,n+Nr(r-n,a)]}}function kr({sourceX:e,sourceY:t,sourcePosition:n=hr.Bottom,targetX:o,targetY:r,targetPosition:a=hr.Top,curvature:i=.25}){const[s,l]=Cr({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[c,u]=Cr({pos:a,x1:o,y1:r,x2:e,y2:t,c:i}),[d,f,p,h]=lr({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${o},${r}`,d,f,p,h]}_r.displayName="StraightEdge";const Mr=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,sourcePosition:a=hr.Bottom,targetPosition:i=hr.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=kr({sourceX:e,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i,curvature:g?.curvature});return t.createElement(ar,{path:v,labelX:b,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})});Mr.displayName="BezierEdge";const Or=n(null),Pr=Or.Provider;Or.Consumer;const Rr=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${n}${o||""}`,Ar=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},Dr=(e,t)=>{if(!e.source||!e.target)return er("006",Oo()),t;let n;var o;return n="id"in(o=e)&&"source"in o&&"target"in o?{...e}:{...e,id:Rr(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:t.concat(n)},Tr=({x:e,y:t},[n,o,r],a,[i,s])=>{const l={x:(e-n)/r,y:(t-o)/r};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},Ir=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o}),zr=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],o=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-o};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-o}:r}},Lr=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};return(({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}))(e.reduce((e,n)=>{const{x:o,y:r}=zr(n,t).positionAbsolute;return a=e,i=Uo({x:o,y:r,width:n.width||0,height:n.height||0}),{x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),x2:Math.max(a.x2,i.x2),y2:Math.max(a.y2,i.y2)};var a,i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0}))},$r=(e,t,[n,o,r]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/r,y:(t.y-o)/r,width:t.width/r,height:t.height/r},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:o=!0,hidden:r=!1}=e;if(i&&!o||r)return!1;const{positionAbsolute:u}=zr(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=Zo(l,d);(void 0===t||void 0===n||null===t||null===n||a&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},Br=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Hr=(e,t,n,o,r,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Vo(l,o,r);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Fr=(e,t=0)=>e.transition().duration(t);function jr(e,t,n,o){return(t[n]||[]).reduce((t,r)=>(`${e.id}-${r.id}-${n}`!==o&&t.push({id:r.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+r.x+r.width/2,y:(e.positionAbsolute?.y??0)+r.y+r.height/2}),t),[])}const Vr={source:null,target:null,sourceHandle:null,targetHandle:null},Wr=()=>({handleDomNode:null,isValid:!1,connection:Vr,endHandle:null});function Yr(e,t,n,o,r,a,i){const s="target"===r,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Wr(),handleDomNode:l};if(l){const e=Xr(void 0,l),r=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?r:n,sourceHandle:s?i:o,target:s?n:r,targetHandle:s?o:i};c.connection=f;u&&d&&(t===cr.Strict?s&&"source"===e||!s&&"target"===e:r!==n||i!==o)&&(c.endHandle={nodeId:r,handleId:i,type:e},c.isValid=a(f))}return c}function Xr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Kr(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Ur(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function qr({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Ko(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:E}=or(e),S=u?.elementFromPoint(x,E),_=Xr(l,S),N=f?.getBoundingClientRect();if(!N||!_)return;let C,k=or(e,N),M=!1,O=null,P=!1,R=null;const A=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((e,r)=>{if(r[Qo]){const{handleBounds:a}=r[Qo];let i=[],s=[];a&&(i=jr(r,a,"source",`${t}-${n}-${o}`),s=jr(r,a,"target",`${t}-${n}-${o}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),D=()=>{if(!p)return;const[e,t]=Xo(k,N);g({x:e,y:t}),w=requestAnimationFrame(D)};function T(e){const{transform:o}=a();k=or(e,N);const{handle:l,validHandleResult:c}=function(e,t,n,o,r,a){const{x:i,y:s}=or(e),l=t.elementsFromPoint(i,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Xr(void 0,l),o=l.getAttribute("data-handleid"),i=a({nodeId:e,id:o,type:t});if(i){const a=r.find(n=>n.nodeId===e&&n.type===t&&n.id===o);return{handle:{id:o,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(r.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=o){const n=a(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:Wr()};if(1===c.length)return c[0];const d=c.some(({validHandleResult:e})=>e.isValid),f=c.some(({handle:e})=>"target"===e.type);return c.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||c[0]}(e,u,Tr(k,o,!1,[1,1]),h,A,e=>Yr(e,d,n,t,r?"target":"source",s,u));if(b=l,M||(D(),M=!0),R=c.handleDomNode,O=c.connection,P=c.isValid,i({connectionPosition:b&&P?Ir({x:b.x,y:b.y},o):k,connectionStatus:Ur(!!b,P),connectionEndHandle:c.endHandle}),!b&&!P&&!R)return Kr(C);O.source!==O.target&&R&&(Kr(C),C=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",P),R.classList.toggle("react-flow__handle-valid",P))}function I(e){(b||R)&&O&&P&&o?.(O),a().onConnectEnd?.(e),l&&c?.(e),Kr(C),v(),cancelAnimationFrame(w),M=!1,P=!1,O=null,R=null,u.removeEventListener("mousemove",T),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",T),u.removeEventListener("touchend",I)}i({connectionPosition:k,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",T),u.addEventListener("mouseup",I),u.addEventListener("touchmove",T),u.addEventListener("touchend",I)}const Zr=()=>!0,Gr=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Qr=a(({type:e="source",position:n=hr.Top,isValidConnection:o,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=s||null,y="target"===e,b=Lo(),w=c(Or),{connectOnClick:x,noPanClassName:E}=zo(Gr,B),{connecting:S,clickConnecting:_}=zo(((e,t,n)=>o=>{const{connectionStartHandle:r,connectionEndHandle:a,connectionClickStartHandle:i}=o;return{connecting:r?.nodeId===e&&r?.handleId===t&&r?.type===n||a?.nodeId===e&&a?.handleId===t&&a?.type===n,clickConnecting:i?.nodeId===e&&i?.handleId===t&&i?.type===n}})(w,g,e),B);w||b.getState().onError?.("010",Ao());const N=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=b.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=b.getState();t(Dr(r,e))}n?.(r),l?.(r)},C=e=>{if(!w)return;const t=nr(e);a&&(t&&0===e.button||!t)&&qr({event:e,handleId:g,nodeId:w,onConnect:N,isTarget:y,getState:b.getState,setState:b.setState,isValidConnection:o||b.getState().isValidConnection||Zr}),t?f?.(e):p?.(e)};return t.createElement("div",{"data-handleid":g,"data-nodeid":w,"data-handlepos":n,"data-id":`${w}-${g}-${e}`,className:v(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,d,{source:!y,target:y,connectable:r,connectablestart:a,connectableend:i,connecting:_,connectionindicator:r&&(a&&!S||i&&S)}]),onMouseDown:C,onTouchStart:C,onClick:x?t=>{const{onClickConnectStart:n,onClickConnectEnd:r,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=b.getState();if(!w||!i&&!a)return;if(!i)return n?.(t,{nodeId:w,handleId:g,handleType:e}),void b.setState({connectionClickStartHandle:{nodeId:w,type:e,handleId:g}});const c=Ko(t.target),u=o||l||Zr,{connection:d,isValid:f}=Yr({nodeId:w,id:g,type:e},s,i.nodeId,i.handleId||null,i.type,u,c);f&&N(d),r?.(t),b.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Qr.displayName="Handle";var Jr=o(Qr);const ea=({data:e,isConnectable:n,targetPosition:o=hr.Top,sourcePosition:r=hr.Bottom})=>t.createElement(t.Fragment,null,t.createElement(Jr,{type:"target",position:o,isConnectable:n}),e?.label,t.createElement(Jr,{type:"source",position:r,isConnectable:n}));ea.displayName="DefaultNode";var ta=o(ea);const na=({data:e,isConnectable:n,sourcePosition:o=hr.Bottom})=>t.createElement(t.Fragment,null,e?.label,t.createElement(Jr,{type:"source",position:o,isConnectable:n}));na.displayName="InputNode";var oa=o(na);const ra=({data:e,isConnectable:n,targetPosition:o=hr.Top})=>t.createElement(t.Fragment,null,t.createElement(Jr,{type:"target",position:o,isConnectable:n}),e?.label);ra.displayName="OutputNode";var aa=o(ra);const ia=()=>null;ia.displayName="GroupNode";const sa=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),la=e=>e.id;function ca(e,t){return B(e.selectedNodes.map(la),t.selectedNodes.map(la))&&B(e.selectedEdges.map(la),t.selectedEdges.map(la))}const ua=o(({onSelectionChange:e})=>{const t=Lo(),{selectedNodes:n,selectedEdges:o}=zo(sa,ca);return i(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChange.forEach(e=>e(r))},[n,o,e]),null});ua.displayName="SelectionListener";const da=e=>!!e.onSelectionChange;function fa({onSelectionChange:e}){const n=zo(da);return e||n?t.createElement(ua,{onSelectionChange:e}):null}const pa=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ha(e,t){i(()=>{void 0!==e&&t(e)},[e])}function ma(e,t,n){i(()=>{void 0!==t&&n({[e]:t})},[t])}const ga=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:a,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:E,snapGrid:S,snapToGrid:_,translateExtent:N,connectOnClick:C,defaultEdgeOptions:k,fitView:M,fitViewOptions:O,onNodesDelete:P,onEdgesDelete:R,onNodeDrag:A,onNodeDragStart:D,onNodeDragStop:T,onSelectionDrag:I,onSelectionDragStart:z,onSelectionDragStop:L,noPanClassName:$,nodeOrigin:H,rfId:F,autoPanOnConnect:j,autoPanOnNodeDrag:V,onError:W,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=zo(pa,B),ne=Lo();return i(()=>{const e=o?.map(e=>({...e,...k}));return Z(n,e),()=>{te()}},[]),ma("defaultEdgeOptions",k,ne.setState),ma("connectionMode",E,ne.setState),ma("onConnect",r,ne.setState),ma("onConnectStart",a,ne.setState),ma("onConnectEnd",s,ne.setState),ma("onClickConnectStart",l,ne.setState),ma("onClickConnectEnd",c,ne.setState),ma("nodesDraggable",u,ne.setState),ma("nodesConnectable",d,ne.setState),ma("nodesFocusable",f,ne.setState),ma("edgesFocusable",p,ne.setState),ma("edgesUpdatable",h,ne.setState),ma("elementsSelectable",x,ne.setState),ma("elevateNodesOnSelect",m,ne.setState),ma("snapToGrid",_,ne.setState),ma("snapGrid",S,ne.setState),ma("onNodesChange",b,ne.setState),ma("onEdgesChange",w,ne.setState),ma("connectOnClick",C,ne.setState),ma("fitViewOnInit",M,ne.setState),ma("fitViewOnInitOptions",O,ne.setState),ma("onNodesDelete",P,ne.setState),ma("onEdgesDelete",R,ne.setState),ma("onNodeDrag",A,ne.setState),ma("onNodeDragStart",D,ne.setState),ma("onNodeDragStop",T,ne.setState),ma("onSelectionDrag",I,ne.setState),ma("onSelectionDragStart",z,ne.setState),ma("onSelectionDragStop",L,ne.setState),ma("noPanClassName",$,ne.setState),ma("nodeOrigin",H,ne.setState),ma("rfId",F,ne.setState),ma("autoPanOnConnect",j,ne.setState),ma("autoPanOnNodeDrag",V,ne.setState),ma("onError",W,ne.setState),ma("connectionRadius",Y,ne.setState),ma("isValidConnection",X,ne.setState),ma("nodeDragThreshold",K,ne.setState),ha(e,U),ha(t,q),ha(g,G),ha(y,Q),ha(N,J),ha(v,ee),null},ya={display:"none"},va={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ba="react-flow__node-desc",wa="react-flow__edge-desc",xa=e=>e.ariaLiveMessage;function Ea({rfId:e}){const n=zo(xa);return t.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:va},n)}function Sa({rfId:e,disableKeyboardA11y:n}){return t.createElement(t.Fragment,null,t.createElement("div",{id:`${ba}-${e}`,style:ya},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),t.createElement("div",{id:`${wa}-${e}`,style:ya},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&t.createElement(Ea,{rfId:e}))}var _a=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,o]=u(!1),a=l(!1),s=l(new Set([])),[c,d]=r(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return i(()=>{const n="undefined"!=typeof document?document:null,r=t?.target||n;if(null!==e){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!t.actInsideInputWithModifier)&&tr(e))return!1;const n=Ca(e.code,d);s.current.add(e[n]),Na(c,s.current,!1)&&(e.preventDefault(),o(!0))},n=e=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&tr(e))return!1;const n=Ca(e.code,d);Na(c,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(e[n]),"Meta"===e.key&&s.current.clear(),a.current=!1},i=()=>{s.current.clear(),o(!1)};return r?.addEventListener("keydown",e),r?.addEventListener("keyup",n),window.addEventListener("blur",i),()=>{r?.removeEventListener("keydown",e),r?.removeEventListener("keyup",n),window.removeEventListener("blur",i)}}},[e,o]),n};function Na(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Ca(e,t){return t.includes(e)?"code":"key"}function ka(e,t,n,o){const r=e.parentNode||e.parentId;if(!r)return n;const a=t.get(r),i=zr(a,o);return ka(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Qo]?.z??0)>(n.z??0)?a[Qo]?.z??0:n.z??0},o)}function Ma(e,t,n){e.forEach(o=>{const r=o.parentNode||o.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n?.[o.id]){const{x:r,y:a,z:i}=ka(o,e,{...o.position,z:o[Qo]?.z??0},t);o.positionAbsolute={x:r,y:a},o[Qo].z=i,n?.[o.id]&&(o[Qo].isParent=!0)}})}function Oa(e,t,n,o){const r=new Map,a={},i=o?1e3:0;return e.forEach(e=>{const n=(Go(e.zIndex)?e.zIndex:0)+(e.selected?i:0),o=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(a[l]=!0);const c=o?.type&&o?.type!==e.type;Object.defineProperty(s,Qo,{enumerable:!1,value:{handleBounds:c?void 0:o?.[Qo]?.handleBounds,z:n}}),r.set(e.id,s)}),Ma(r,n,a),r}function Pa(e,t={}){const{getNodes:n,width:o,height:r,minZoom:a,maxZoom:i,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=Lr(e,d),{x:c,y:u,zoom:f}=Hr(n,o,r,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=ho.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Fr(l,t.duration),p):s.transform(l,p),!0}}return!1}function Ra(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Qo]:n[Qo],selected:e.selected})}),new Map(t)}function Aa(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function Da({changedNodes:e,changedEdges:t,get:n,set:o}){const{nodeInternals:r,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&o({nodeInternals:Ra(e,r)}),i?.(e)),t?.length&&(c&&o({edges:Aa(t,a)}),s?.(t))}const Ta=()=>{},Ia={zoomIn:Ta,zoomOut:Ta,zoomTo:Ta,getZoom:()=>1,setViewport:Ta,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ta,fitBounds:Ta,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},za=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function La(){const e=(()=>{const e=Lo(),{d3Zoom:t,d3Selection:n}=zo(za,B),o=r(()=>n&&t?{zoomIn:e=>t.scaleBy(Fr(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(Fr(n,e?.duration),1/1.2),zoomTo:(e,o)=>t.scaleTo(Fr(n,o?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(o,r)=>{const[a,i,s]=e.getState().transform,l=ho.translate(o.x??a,o.y??i).scale(o.zoom??s);t.transform(Fr(n,r?.duration),l)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},fitView:t=>Pa(e.getState,t),setCenter:(o,r,a)=>{const{width:i,height:s,maxZoom:l}=e.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-o*c,d=s/2-r*c,f=ho.translate(u,d).scale(c);t.transform(Fr(n,a?.duration),f)},fitBounds:(o,r)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=e.getState(),{x:c,y:u,zoom:d}=Hr(o,a,i,s,l,r?.padding??.1),f=ho.translate(c,u).scale(d);t.transform(Fr(n,r?.duration),f)},project:t=>{const{transform:n,snapToGrid:o,snapGrid:r}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Tr(t,n,o,r)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:o,snapGrid:r,domNode:a}=e.getState();if(!a)return t;const{x:i,y:s}=a.getBoundingClientRect(),l={x:t.x-i,y:t.y-s};return Tr(l,n,o,r)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:a}=o.getBoundingClientRect(),i=Ir(t,n);return{x:i.x+r,y:i.y+a}},viewportInitialized:!0}:Ia,[t,n]);return o})(),t=Lo(),n=s(()=>t.getState().getNodes().map(e=>({...e})),[]),o=s(e=>t.getState().nodeInternals.get(e),[]),a=s(()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},[]),i=s(e=>{const{edges:n=[]}=t.getState();return n.find(t=>t.id===e)},[]),l=s(e=>{const{getNodes:n,setNodes:o,hasDefaultNodes:r,onNodesChange:a}=t.getState(),i=n(),s="function"==typeof e?e(i):e;if(r)o(s);else if(a){a(0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"})))}},[]),c=s(e=>{const{edges:n=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:a}=t.getState(),i="function"==typeof e?e(n):e;if(r)o(i);else if(a){a(0===i.length?n.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),u=s(e=>{const n=Array.isArray(e)?e:[e],{getNodes:o,setNodes:r,hasDefaultNodes:a,onNodesChange:i}=t.getState();if(a){r([...o(),...n])}else if(i){i(n.map(e=>({item:e,type:"add"})))}},[]),d=s(e=>{const n=Array.isArray(e)?e:[e],{edges:o=[],setEdges:r,hasDefaultEdges:a,onEdgesChange:i}=t.getState();if(a)r([...o,...n]);else if(i){i(n.map(e=>({item:e,type:"add"})))}},[]),f=s(()=>{const{getNodes:e,edges:n=[],transform:o}=t.getState(),[r,a,i]=o;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:r,y:a,zoom:i}}},[]),p=s(({nodes:e,edges:n})=>{const{nodeInternals:o,getNodes:r,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=t.getState(),f=(e||[]).map(e=>e.id),p=(n||[]).map(e=>e.id),h=r().reduce((e,t)=>{const n=t.parentNode||t.parentId,o=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||o)&&e.push(t),e},[]),m=a.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Br(h,m),n=[...g,...e],r=n.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&t.setState({edges:a.filter(e=>!r.includes(e.id))}),i&&(h.forEach(e=>{o.delete(e.id)}),t.setState({nodeInternals:new Map(o)}))),r.length>0&&(c?.(n),d&&d(r.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),h=s(e=>{const n=Go((o=e).width)&&Go(o.height)&&Go(o.x)&&Go(o.y);var o;const r=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!r)return[null,null,n];return[n?e:qo(r),r,n]},[]),m=s((e,n=!0,o)=>{const[r,a,i]=h(e);return r?(o||t.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const t=qo(e),o=Zo(t,r);return n&&o>0||o>=r.width*r.height}):[]},[]),g=s((e,t,n=!0)=>{const[o]=h(e);if(!o)return!1;const r=Zo(o,t);return n&&r>0||r>=o.width*o.height},[]);return r(()=>({...e,getNodes:n,getNode:o,getEdges:a,getEdge:i,setNodes:l,setEdges:c,addNodes:u,addEdges:d,toObject:f,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:g}),[e,n,o,a,i,l,c,u,d,f,p,m,g])}const $a={actInsideInputWithModifier:!1};const Ba={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ha=e=>({x:e.x,y:e.y,zoom:e.k}),Fa=(e,t)=>e.target.closest(`.${t}`),ja=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Va=e=>{const t=e.ctrlKey&&rr()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Wa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ya=({onMove:e,onMoveStart:n,onMoveEnd:o,onPaneContextMenu:r,zoomOnScroll:a=!0,zoomOnPinch:s=!0,panOnScroll:c=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=ur.Free,zoomOnDoubleClick:f=!0,elementsSelectable:p,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:y,maxZoom:v,zoomActivationKeyCode:b,preventScrolling:w=!0,children:x,noWheelClassName:E,noPanClassName:S})=>{const _=l(),N=Lo(),C=l(!1),k=l(!1),M=l(null),O=l({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:R,d3ZoomHandler:A,userSelectionActive:D}=zo(Wa,B),T=_a(b),I=l(0),z=l(!1),L=l();return function(e){const t=Lo();i(()=>{let n;const o=()=>{if(!e.current)return;const n=jo(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",ko()),t.setState({width:n.width||500,height:n.height||500})};return o(),window.addEventListener("resize",o),e.current&&(n=new ResizeObserver(()=>o()),n.observe(e.current)),()=>{window.removeEventListener("resize",o),n&&e.current&&n.unobserve(e.current)}},[])}(M),i(()=>{if(M.current){const e=M.current.getBoundingClientRect(),t=function(){var e,t,n,o=yo,r=vo,a=Eo,i=wo,s=xo,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=gn,f=F("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",bo).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",N).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new po(t,e.x,e.y)}function y(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new po(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",function(){w(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(o).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(o),s=r.apply(e,a),l=null==n?v(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new po(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function E(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,i.apply(this,arguments)))),u=rt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Bn(this),n.start()}go(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,i=w(this,t,!0).event(e),s=ot(e.view).on("mousemove.zoom",function(e){if(go(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(y(i.that.__zoom,i.mouse[0]=rt(e,r),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ut(e.view,i.moved),go(e),i.event(e).end()},!0),l=rt(e,r),u=e.clientX,d=e.clientY;ct(e.view),mo(e),i.mouse=[l,this.__zoom.invert(l)],Bn(this),i.start()}}function _(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,i=rt(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(y(g(n,l),i,s),r.apply(this,t),c);go(e),u>0?ot(this).transition().duration(u).call(b,d,i,e):ot(this).call(m.transform,d,i,e)}}function N(n,...r){if(o.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,r,n.changedTouches.length===u).event(n);for(mo(n),i=0;i<u;++i)l=[l=rt(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Bn(this),d.start())}}function C(e,...t){if(this.__zooming){var n,o,r,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(go(e),n=0;n<u;++n)r=rt(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;o=g(o,Math.sqrt(m/v)),r=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(o,r,i),s.extent,c))}}function k(e,...o){if(this.__zooming){var r,a,i=w(this,o).event(e),s=e.changedTouches,l=s.length;for(mo(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<l;++r)a=s[r],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=rt(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=ot(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",bo),e!==r?b(e,t,n,o):r.interrupt().each(function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,o){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,o)},m.scaleTo=function(e,t,n,o){m.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(o,l),i,s),e,c)},n,o)},m.translateBy=function(e,t,n,o){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,o)},m.translateTo=function(e,t,n,o,i){m.transform(e,function(){var e=r.apply(this,arguments),i=this.__zoom,s=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return a(ho.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},o,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ot(this.that).datum();f.call(e,this.that,new fo(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:uo(+e),m):i},m.filter=function(e){return arguments.length?(o="function"==typeof e?e:uo(!!e),m):o},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:uo(!!e),m):s},m.extent=function(e){return arguments.length?(r="function"==typeof e?e:uo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):r},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([y,v]).translateExtent(g),n=ot(M.current).call(t),o=ho.translate(m.x,m.y).scale(Vo(m.zoom,y,v)),r=[[0,0],[e.width,e.height]],a=t.constrain()(o,r,g);t.transform(n,a),t.wheelDelta(Va),N.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:M.current.closest(".react-flow")})}},[]),i(()=>{R&&P&&(!c||T||D?void 0!==A&&R.on("wheel.zoom",function(e,t){if(!w&&"wheel"===e.type&&!e.ctrlKey||Fa(e,E))return null;e.preventDefault(),A.call(this,e,t)},{passive:!1}):R.on("wheel.zoom",t=>{if(Fa(t,E))return!1;t.preventDefault(),t.stopImmediatePropagation();const r=R.property("__zoom").k||1;if(t.ctrlKey&&s){const e=rt(t),n=Va(t),o=r*Math.pow(2,n);return void P.scaleTo(R,o,e,t)}const a=1===t.deltaMode?20:1;let i=d===ur.Vertical?0:t.deltaX*a,l=d===ur.Horizontal?0:t.deltaY*a;!rr()&&t.shiftKey&&d!==ur.Vertical&&(i=t.deltaY*a,l=0),P.translateBy(R,-i/r*u,-l/r*u,{internal:!0});const c=Ha(R.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=N.getState();clearTimeout(L.current),z.current||(z.current=!0,n?.(t,c),f?.(c)),z.current&&(e?.(t,c),p?.(c),L.current=setTimeout(()=>{o?.(t,c),h?.(c),z.current=!1},150))},{passive:!1}))},[D,c,d,R,P,A,T,s,w,E,n,e,o]),i(()=>{P&&P.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;I.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=N.getState(),o=Ha(e.transform);C.current=!0,O.current=o,"mousedown"===e.sourceEvent?.type&&N.setState({paneDragging:!0}),t?.(o),n?.(e.sourceEvent,o)})},[P,n]),i(()=>{P&&(D&&!C.current?P.on("zoom",null):D||P.on("zoom",t=>{const{onViewportChange:n}=N.getState();if(N.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),k.current=!(!r||!ja(h,I.current??0)),(e||n)&&!t.sourceEvent?.internal){const o=Ha(t.transform);n?.(o),e?.(t.sourceEvent,o)}}))},[D,P,e,h,r]),i(()=>{P&&P.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=N.getState();if(C.current=!1,N.setState({paneDragging:!1}),r&&ja(h,I.current??0)&&!k.current&&r(e.sourceEvent),k.current=!1,(o||t)&&(n=O.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Ha(e.transform);O.current=n,clearTimeout(_.current),_.current=setTimeout(()=>{t?.(n),o?.(e.sourceEvent,n)},c?150:0)}var n,a})},[P,c,h,o,r]),i(()=>{P&&P.filter(e=>{const t=T||a,n=s&&e.ctrlKey;if((!0===h||Array.isArray(h)&&h.includes(1))&&1===e.button&&"mousedown"===e.type&&(Fa(e,"react-flow__node")||Fa(e,"react-flow__edge")))return!0;if(!(h||t||c||f||s))return!1;if(D)return!1;if(!f&&"dblclick"===e.type)return!1;if(Fa(e,E)&&"wheel"===e.type)return!1;if(Fa(e,S)&&("wheel"!==e.type||c&&"wheel"===e.type&&!T))return!1;if(!s&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!c&&!n&&"wheel"===e.type)return!1;if(!h&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(h)&&!h.includes(e.button)&&"mousedown"===e.type)return!1;const o=Array.isArray(h)&&h.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&o})},[D,P,a,s,c,f,h,p,T]),t.createElement("div",{className:"react-flow__renderer",ref:M,style:Ba},x)},Xa=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ka(){const{userSelectionActive:e,userSelectionRect:n}=zo(Xa,B);return e&&n?t.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Ua(e,t){const n=t.parentNode||t.parentId,o=e.find(e=>e.id===n);if(o){const e=t.position.x+t.width-o.width,n=t.position.y+t.height-o.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(o.style={...o.style}||{},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,e>0&&(o.style.width+=e),n>0&&(o.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);o.position.x=o.position.x-e,o.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);o.position.y=o.position.y-e,o.style.height+=e,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function qa(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const o=e.filter(e=>e.id===n.id);if(0===o.length)return t.push(n),t;const r={...n};for(const e of o)if(e)switch(e.type){case"select":r.selected=e.selected;break;case"position":void 0!==e.position&&(r.position=e.position),void 0!==e.positionAbsolute&&(r.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(r.dragging=e.dragging),r.expandParent&&Ua(t,r);break;case"dimensions":void 0!==e.dimensions&&(r.width=e.dimensions.width,r.height=e.dimensions.height),void 0!==e.updateStyle&&(r.style={...r.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(r.resizing=e.resizing),r.expandParent&&Ua(t,r);break;case"remove":return t}return t.push(r),t},n)}function Za(e,t){return qa(e,t)}const Ga=(e,t)=>({id:e,type:"select",selected:t});function Qa(e,t){return e.reduce((e,n)=>{const o=t.includes(n.id);return!n.selected&&o?(n.selected=!0,e.push(Ga(n.id,!0))):n.selected&&!o&&(n.selected=!1,e.push(Ga(n.id,!1))),e},[])}const Ja=(e,t)=>n=>{n.target===t.current&&e?.(n)},ei=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ti=o(({isSelecting:e,selectionMode:n=dr.Full,panOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=l(null),m=Lo(),g=l(0),y=l(0),b=l(),{userSelectionActive:w,elementsSelectable:x,dragging:E}=zo(ei,B),S=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},_=e=>{i?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},N=c?e=>c(e):void 0,C=x&&(e||w);return t.createElement("div",{className:v(["react-flow__pane",{dragging:E,selection:e}]),onClick:C?void 0:Ja(_,h),onContextMenu:Ja(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():s?.(e)},h),onWheel:Ja(N,h),onMouseEnter:C?void 0:u,onMouseDown:C?t=>{const{resetSelectedElements:n,domNode:o}=m.getState();if(b.current=o?.getBoundingClientRect(),!x||!e||0!==t.button||t.target!==h.current||!b.current)return;const{x:a,y:i}=or(t,b.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),r?.(t)}:void 0,onMouseMove:C?t=>{const{userSelectionRect:o,nodeInternals:r,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!b.current||!o)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=or(t,b.current),f=o.startX??0,p=o.startY??0,h={...o,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},v=u(),w=$r(r,h,i,n===dr.Partial,!0,c),x=Br(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Qa(v,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Qa(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:C?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!w&&t&&e.target===h.current&&_?.(e),m.setState({nodesSelectionActive:g.current>0}),S(),a?.(e)}:void 0,onMouseLeave:C?e=>{w&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),S()}:f,ref:h,style:Ba},p,t.createElement(Ka,null))});function ni(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return!!o&&(!!o.selected||ni(o,t))}function oi(e,t,n){let o=e;do{if(o?.matches(t))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function ri(e,t,n,o){return Array.from(e.values()).filter(n=>(n.selected||n.id===o)&&(!n.parentNode||n.parentId||!ni(n,e))&&(n.draggable||t&&void 0===n.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent}))}function ai(e,t,n,o,r=[0,0],a){const i=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||o);let s=i;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:o,y:a}=zr(t,r).positionAbsolute;s=[[e.extent[0][0]+o,e.extent[0][1]+a],[e.extent[1][0]+o,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:o,y:a}=zr(t,r).positionAbsolute;s=t&&Go(o)&&Go(a)&&Go(t.width)&&Go(t.height)?[[o+e.width*r[0],a+e.height*r[1]],[o+t.width-e.width+e.width*r[0],a+t.height-e.height+e.height*r[1]]]:s}else a?.("005",Mo()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=zr(e,r).positionAbsolute}const u=s&&"parent"!==s?Wo(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function ii({nodeId:e,dragItems:t,nodeInternals:n}){const o=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?o.find(t=>t.id===e):o[0],o]}ti.displayName="Pane";const si=(e,t,n,o)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const a=Array.from(r),i=t.getBoundingClientRect(),s=i.width*o[0],l=i.height*o[1];return a.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-i.left-s)/n,y:(t.top-i.top-l)/n,...jo(e)}})};function li(e,t,n){return void 0===n?n:o=>{const r=t().nodeInternals.get(e);r&&n(o,{...r})}}function ci({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:i,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):l?.("012",To(e))}function ui(e){return(t,n,o)=>e?.(t,o)}function di({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:a,selectNodesOnDrag:c}){const d=Lo(),[f,p]=u(!1),h=l([]),m=l({x:null,y:null}),g=l(0),y=l(null),v=l({x:0,y:0}),b=l(null),w=l(!1),x=l(!1),E=l(!1),S=function(){const e=Lo(),t=s(({sourceEvent:t})=>{const{transform:n,snapGrid:o,snapToGrid:r}=e.getState(),a=t.touches?t.touches[0].clientX:t.clientX,i=t.touches?t.touches[0].clientY:t.clientY,s={x:(a-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(s.x/o[0]):s.x,ySnapped:r?o[1]*Math.round(s.y/o[1]):s.y,...s}},[]);return t}();return i(()=>{if(e?.current){const i=ot(e.current),s=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:o,onSelectionDrag:a,updateNodePositions:i,nodeExtent:s,snapGrid:l,snapToGrid:c,nodeOrigin:u,onError:f}=d.getState();m.current={x:e,y:t};let g=!1,y={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&s){const e=Lr(h.current,u);y=Uo(e)}if(h.current=h.current.map(o=>{const r={x:e-o.distance.x,y:t-o.distance.y};c&&(r.x=l[0]*Math.round(r.x/l[0]),r.y=l[1]*Math.round(r.y/l[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];h.current.length>1&&s&&!o.extent&&(a[0][0]=o.positionAbsolute.x-y.x+s[0][0],a[1][0]=o.positionAbsolute.x+(o.width??0)-y.x2+s[1][0],a[0][1]=o.positionAbsolute.y-y.y+s[0][1],a[1][1]=o.positionAbsolute.y+(o.height??0)-y.y2+s[1][1]);const i=ai(o,r,n,a,u,f);return g=g||o.position.x!==i.position.x||o.position.y!==i.position.y,o.position=i.position,o.positionAbsolute=i.positionAbsolute,o}),!g)return;i(h.current,!0,!0),p(!0);const v=r?o:ui(a);if(v&&b.current){const[e,t]=ii({nodeId:r,dragItems:h.current,nodeInternals:n});v(b.current,e,t)}},l=()=>{if(!y.current)return;const[e,t]=Xo(v.current,y.current);if(0!==e||0!==t){const{transform:n,panBy:o}=d.getState();m.current.x=(m.current.x??0)-e/n[2],m.current.y=(m.current.y??0)-t/n[2],o({x:e,y:t})&&s(m.current)}g.current=requestAnimationFrame(l)},u=t=>{const{nodeInternals:n,multiSelectionActive:o,nodesDraggable:i,unselectNodesAndEdges:s,onNodeDragStart:l,onSelectionDragStart:u}=d.getState();x.current=!0;const f=r?l:ui(u);c&&a||o||!r||n.get(r)?.selected||s(),r&&a&&c&&ci({id:r,store:d,nodeRef:e});const p=S(t);if(m.current=p,h.current=ri(n,i,p,r),f&&h.current){const[e,o]=ii({nodeId:r,dragItems:h.current,nodeInternals:n});f(t.sourceEvent,e,o)}};if(!t){const t=function(){var e,t,n,o,r=pt,a=ht,i=mt,s=gt,l={},c=F("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,at).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!o&&r.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(ot(i.view).on("mousemove.drag",h,it).on("mouseup.drag",m,it),ct(i.view),st(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(o){if(lt(o),!n){var r=o.clientX-e,a=o.clientY-t;n=r*r+a*a>d}l.mouse("drag",o)}function m(e){ot(e.view).on("mousemove.drag mouseup.drag",null),ut(e.view,n),lt(e),l.mouse("end",e)}function g(e,t){if(r.call(this,e,t)){var n,o,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(o=b(this,s,e,t,i[n].identifier,i[n]))&&(st(e),o("start",e,i[n]))}}function y(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=l[o[t].identifier])&&(lt(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,a=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<a;++t)(n=l[r[t].identifier])&&(st(e),n("end",e,r[t]))}function b(e,t,n,o,r,a){var s,d,p,h=c.copy(),m=rt(a||n,t);if(null!=(p=i.call(e,new ft("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),o)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,y=m;switch(a){case"start":l[r]=n,g=u++;break;case"end":delete l[r],--u;case"drag":m=rt(c||i,t),g=u}h.call(a,e,new ft(a,{sourceEvent:i,subject:p,target:f,identifier:r,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:dt(!!e),f):r},f.container=function(e){return arguments.length?(a="function"==typeof e?e:dt(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:dt(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:dt(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",e=>{const{domNode:t,nodeDragThreshold:n}=d.getState();0===n&&u(e),E.current=!1;const o=S(e);m.current=o,y.current=t?.getBoundingClientRect()||null,v.current=or(e.sourceEvent,y.current)}).on("drag",e=>{const t=S(e),{autoPanOnNodeDrag:n,nodeDragThreshold:o}=d.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(E.current=!0),!E.current){if(!w.current&&x.current&&n&&(w.current=!0,l()),!x.current){const n=t.xSnapped-(m?.current?.x??0),r=t.ySnapped-(m?.current?.y??0);Math.sqrt(n*n+r*r)>o&&u(e)}(m.current.x!==t.xSnapped||m.current.y!==t.ySnapped)&&h.current&&x.current&&(b.current=e.sourceEvent,v.current=or(e.sourceEvent,y.current),s(t))}}).on("end",e=>{if(x.current&&!E.current&&(p(!1),w.current=!1,x.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:o,onSelectionDragStop:a}=d.getState(),i=r?o:ui(a);if(t(h.current,!1,!1),i){const[t,o]=ii({nodeId:r,dragItems:h.current,nodeInternals:n});i(e.sourceEvent,t,o)}}}).filter(t=>{const r=t.target;return!t.button&&(!n||!oi(r,`.${n}`,e))&&(!o||oi(r,o,e))});return i.call(t),()=>{i.on(".drag",null)}}i.on(".drag",null)}},[e,t,n,o,a,d,r,c,S]),f}function fi(){const e=Lo();return s(t=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=e.getState(),u=a().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=i?s[0]:5,f=i?s[1]:5,p=t.isShiftPressed?4:1,h=t.x*d*p,m=t.y*f*p;r(u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:r,position:a}=ai(e,t,n,o,void 0,l);e.position=a,e.positionAbsolute=r}return e}),!0,!1)},[])}const pi={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var hi=e=>{const n=({id:n,type:o,data:r,xPos:a,yPos:s,xPosOrigin:c,yPosOrigin:u,selected:d,onClick:f,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:g,onDoubleClick:y,style:b,className:w,isDraggable:x,isSelectable:E,isConnectable:S,isFocusable:_,selectNodesOnDrag:N,sourcePosition:C,targetPosition:k,hidden:M,resizeObserver:O,dragHandle:P,zIndex:R,isParent:A,noDragClassName:D,noPanClassName:T,initialized:I,disableKeyboardA11y:z,ariaLabel:L,rfId:$,hasHandleBounds:B})=>{const H=Lo(),F=l(null),j=l(null),V=l(C),W=l(k),Y=l(o),X=E||x||f||p||h||m,K=fi(),U=li(n,H.getState,p),q=li(n,H.getState,h),Z=li(n,H.getState,m),G=li(n,H.getState,g),Q=li(n,H.getState,y);i(()=>()=>{j.current&&(O?.unobserve(j.current),j.current=null)},[]),i(()=>{if(F.current&&!M){const e=F.current;I&&B&&j.current===e||(j.current&&O?.unobserve(j.current),O?.observe(e),j.current=e)}},[M,I,B]),i(()=>{const e=Y.current!==o,t=V.current!==C,r=W.current!==k;F.current&&(e||t||r)&&(e&&(Y.current=o),t&&(V.current=C),r&&(W.current=k),H.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,o,C,k]);const J=di({nodeRef:F,disabled:M||!x,noDragClassName:D,handleSelector:P,nodeId:n,isSelectable:E,selectNodesOnDrag:N});return M?null:t.createElement("div",{className:v(["react-flow__node",`react-flow__node-${o}`,{[T]:x},w,{selected:d,selectable:E,parent:A,dragging:J}]),ref:F,style:{zIndex:R,transform:`translate(${c}px,${u}px)`,pointerEvents:X?"all":"none",visibility:I?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:U,onMouseMove:q,onMouseLeave:Z,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:t}=H.getState();if(E&&(!N||!x||t>0)&&ci({id:n,store:H,nodeRef:F}),f){const t=H.getState().nodeInternals.get(n);t&&f(e,{...t})}},onDoubleClick:Q,onKeyDown:_?e=>{if(!tr(e)&&!z)if(Jo.includes(e.key)&&E){const t="Escape"===e.key;ci({id:n,store:H,unselect:t,nodeRef:F})}else x&&d&&Object.prototype.hasOwnProperty.call(pi,e.key)&&(H.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),K({x:pi[e.key].x,y:pi[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":z?void 0:`${ba}-${$}`,"aria-label":L},t.createElement(Pr,{value:n},t.createElement(e,{id:n,data:r,type:o,xPos:a,yPos:s,selected:d,isConnectable:S,sourcePosition:C,targetPosition:k,dragging:J,dragHandle:P,zIndex:R})))};return n.displayName="NodeWrapper",o(n)};const mi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...Lr(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var gi=o(function({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:o}){const r=Lo(),{width:a,height:s,x:c,y:u,transformString:d,userSelectionActive:f}=zo(mi,B),p=fi(),h=l(null);if(i(()=>{o||h.current?.focus({preventScroll:!0})},[o]),di({nodeRef:h}),f||!a||!s)return null;const m=e?t=>{const n=r.getState().getNodes().filter(e=>e.selected);e(t,n)}:void 0;return t.createElement("div",{className:v(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},t.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:o?void 0:-1,onKeyDown:o?void 0:e=>{Object.prototype.hasOwnProperty.call(pi,e.key)&&p({x:pi[e.key].x,y:pi[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:u,left:c}}))});const yi=e=>e.nodesSelectionActive,vi=({children:e,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,deleteKeyCode:c,onMove:u,onMoveStart:d,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:M,defaultViewport:O,translateExtent:P,minZoom:R,maxZoom:A,preventScrolling:D,onSelectionContextMenu:T,noWheelClassName:I,noPanClassName:z,disableKeyboardA11y:L})=>{const $=zo(yi),B=_a(p),H=_a(b),F=H||M,j=H||_,V=B||h&&!0!==F;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Lo(),{deleteElements:o}=La(),r=_a(e,$a),a=_a(t);i(()=>{if(r){const{edges:e,getNodes:t}=n.getState(),r=t().filter(e=>e.selected),a=e.filter(e=>e.selected);o({nodes:r,edges:a}),n.setState({nodesSelectionActive:!1})}},[r]),i(()=>{n.setState({multiSelectionActive:a})},[a])})({deleteKeyCode:c,multiSelectionKeyCode:v}),t.createElement(Ya,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!B&&F,defaultViewport:O,translateExtent:P,minZoom:R,maxZoom:A,zoomActivationKeyCode:w,preventScrolling:D,noWheelClassName:I,noPanClassName:z},t.createElement(ti,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:F,isSelecting:!!V,selectionMode:m},e,$&&t.createElement(gi,{onSelectionContextMenu:T,noPanClassName:z,disableKeyboardA11y:L})))};vi.displayName="FlowRenderer";var bi=o(vi);function wi(e){return{...{input:hi(e.input||oa),default:hi(e.default||ta),output:hi(e.output||aa),group:hi(e.group||ia)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=hi(e[n]||ta),t),{})}}const xi=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ei=e=>{const{nodesDraggable:n,nodesConnectable:o,nodesFocusable:a,elementsSelectable:c,updateNodeDimensions:u,onError:d}=zo(xi,B),f=(p=e.onlyRenderVisibleElements,zo(s(e=>p?$r(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[p])));var p;const h=l(),m=r(()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver(e=>{const t=e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}));u(t)});return h.current=e,e},[]);return i(()=>()=>{h?.current?.disconnect()},[]),t.createElement("div",{className:"react-flow__nodes",style:Ba},f.map(r=>{let i=r.type||"default";e.nodeTypes[i]||(d?.("003",Co(i)),i="default");const s=e.nodeTypes[i]||e.nodeTypes.default,l=!!(r.draggable||n&&void 0===r.draggable),u=!!(r.selectable||c&&void 0===r.selectable),f=!!(r.connectable||o&&void 0===r.connectable),p=!!(r.focusable||a&&void 0===r.focusable),h=e.nodeExtent?Wo(r.positionAbsolute,e.nodeExtent):r.positionAbsolute,g=h?.x??0,y=h?.y??0,v=(({x:e,y:t,width:n,height:o,origin:r})=>n&&o?r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-o*r[1]}:{x:e,y:t})({x:g,y:y,width:r.width??0,height:r.height??0,origin:e.nodeOrigin});return t.createElement(s,{key:r.id,id:r.id,className:r.className,style:r.style,type:i,data:r.data,sourcePosition:r.sourcePosition||hr.Bottom,targetPosition:r.targetPosition||hr.Top,hidden:r.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!r.selected,isDraggable:l,isSelectable:u,isConnectable:f,isFocusable:p,resizeObserver:m,dragHandle:r.dragHandle,zIndex:r[Qo]?.z??0,isParent:!!r[Qo]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!r.width&&!!r.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:r.ariaLabel,hasHandleBounds:!!r[Qo]?.handleBounds})}))};Ei.displayName="NodeRenderer";var Si=o(Ei);const _i=(e,t,n)=>n===hr.Left?e-t:n===hr.Right?e+t:e,Ni=(e,t,n)=>n===hr.Top?e-t:n===hr.Bottom?e+t:e,Ci="react-flow__edgeupdater",ki=({position:e,centerX:n,centerY:o,radius:r=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:l})=>t.createElement("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:v([Ci,`${Ci}-${l}`]),cx:_i(n,r,e),cy:Ni(o,r,e),r:r,stroke:"transparent",fill:"transparent"}),Mi=()=>!0;var Oi=e=>{const n=({id:n,className:o,type:a,data:i,onClick:s,onEdgeDoubleClick:c,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,style:w,source:x,target:E,sourceX:S,sourceY:_,targetX:N,targetY:C,sourcePosition:k,targetPosition:M,elementsSelectable:O,hidden:P,sourceHandleId:R,targetHandleId:A,onContextMenu:D,onMouseEnter:T,onMouseMove:I,onMouseLeave:z,reconnectRadius:L,onReconnect:$,onReconnectStart:B,onReconnectEnd:H,markerEnd:F,markerStart:j,rfId:V,ariaLabel:W,isFocusable:Y,isReconnectable:X,pathOptions:K,interactionWidth:U,disableKeyboardA11y:q})=>{const Z=l(null),[G,Q]=u(!1),[J,ee]=u(!1),te=Lo(),ne=r(()=>`url('#${Ar(j,V)}')`,[j,V]),oe=r(()=>`url('#${Ar(F,V)}')`,[F,V]);if(P)return null;const re=ir(n,te.getState,c),ae=ir(n,te.getState,D),ie=ir(n,te.getState,T),se=ir(n,te.getState,I),le=ir(n,te.getState,z),ce=(e,t)=>{if(0!==e.button)return;const{edges:o,isValidConnection:r}=te.getState(),a=t?E:x,i=(t?A:R)||null,s=t?"target":"source",l=r||Mi,c=t,u=o.find(e=>e.id===n);ee(!0),B?.(e,u,s);qr({event:e,handleId:i,nodeId:a,onConnect:e=>$?.(u,e),isTarget:c,getState:te.getState,setState:te.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{ee(!1),H?.(e,u,s)}})},ue=()=>Q(!0),de=()=>Q(!1),fe=!O&&!s;return t.createElement("g",{className:v(["react-flow__edge",`react-flow__edge-${a}`,o,{selected:d,animated:f,inactive:fe,updating:G}]),onClick:e=>{const{edges:t,addSelectedEdges:o,unselectNodesAndEdges:r,multiSelectionActive:a}=te.getState(),i=t.find(e=>e.id===n);i&&(O&&(te.setState({nodesSelectionActive:!1}),i.selected&&a?(r({nodes:[],edges:[i]}),Z.current?.blur()):o([n])),s&&s(e,i))},onDoubleClick:re,onContextMenu:ae,onMouseEnter:ie,onMouseMove:se,onMouseLeave:le,onKeyDown:Y?e=>{if(!q&&Jo.includes(e.key)&&O){const{unselectNodesAndEdges:t,addSelectedEdges:o,edges:r}=te.getState();"Escape"===e.key?(Z.current?.blur(),t({edges:[r.find(e=>e.id===n)]})):o([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===W?void 0:W||`Edge from ${x} to ${E}`,"aria-describedby":Y?`${wa}-${V}`:void 0,ref:Z},!J&&t.createElement(e,{id:n,source:x,target:E,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,data:i,style:w,sourceX:S,sourceY:_,targetX:N,targetY:C,sourcePosition:k,targetPosition:M,sourceHandleId:R,targetHandleId:A,markerStart:ne,markerEnd:oe,pathOptions:K,interactionWidth:U}),X&&t.createElement(t.Fragment,null,("source"===X||!0===X)&&t.createElement(ki,{position:k,centerX:S,centerY:_,radius:L,onMouseDown:e=>ce(e,!0),onMouseEnter:ue,onMouseOut:de,type:"source"}),("target"===X||!0===X)&&t.createElement(ki,{position:M,centerX:N,centerY:C,radius:L,onMouseDown:e=>ce(e,!1),onMouseEnter:ue,onMouseOut:de,type:"target"})))};return n.displayName="EdgeWrapper",o(n)};function Pi(e){return{...{default:Oi(e.default||Mr),straight:Oi(e.bezier||_r),step:Oi(e.step||Sr),smoothstep:Oi(e.step||Er),simplebezier:Oi(e.simplebezier||yr)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=Oi(e[n]||Mr),t),{})}}function Ri(e,t,n=null){const o=(n?.x||0)+t.x,r=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case hr.Top:return{x:o+a/2,y:r};case hr.Right:return{x:o+a,y:r+i/2};case hr.Bottom:return{x:o+a/2,y:r+i};case hr.Left:return{x:o,y:r+i/2}}}function Ai(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function Di(e){const t=e?.[Qo]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Ti=[{level:0,isMaxLevel:!0,edges:[]}];function Ii(e,t,n){return function(e,t,n=!1){let o=-1;const r=e.reduce((e,r)=>{const a=Go(r.zIndex);let i=a?r.zIndex:0;if(n){const e=t.get(r.target),n=t.get(r.source),o=r.selected||e?.selected||n?.selected,s=Math.max(n?.[Qo]?.z||0,e?.[Qo]?.z||0,1e3);i=(a?r.zIndex:0)+(o?s:0)}return e[i]?e[i].push(r):e[i]=[r],o=i>o?i:o,e},{}),a=Object.entries(r).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===o}});return 0===a.length?Ti:a}(zo(s(n=>e?n.edges.filter(e=>{const o=t.get(e.source),r=t.get(e.target);return o?.width&&o?.height&&r?.width&&r?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:a,width:i,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Uo({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:i/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:r.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:r.width,targetHeight:r.height,width:n.width,height:n.height,transform:n.transform})}):n.edges,[e,t])),t,n)}const zi={[pr.Arrow]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[pr.ArrowClosed]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const Li=({id:e,type:n,color:o,width:a=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=Lo();return r(()=>Object.prototype.hasOwnProperty.call(zi,e)?zi[e]:(t.getState().onError?.("009",Po(e)),null),[e])}(n);return u?t.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0"},t.createElement(u,{color:o,strokeWidth:l})):null},$i=({defaultColor:e,rfId:n})=>{const o=zo(s((({defaultColor:e,rfId:t})=>n=>{const o=[];return n.edges.reduce((n,r)=>([r.markerStart,r.markerEnd].forEach(r=>{if(r&&"object"==typeof r){const a=Ar(r,t);o.includes(a)||(n.push({id:a,color:r.color||e,...r}),o.push(a))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:e,rfId:n}),[e,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return t.createElement("defs",null,o.map(e=>t.createElement(Li,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient})))};$i.displayName="MarkerDefinitions";var Bi=o($i);const Hi=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Fi=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:o,rfId:r,edgeTypes:a,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:N,nodeInternals:C,onError:k}=zo(Hi,B),M=Ii(n,C,o);return S?t.createElement(t.Fragment,null,M.map(({level:n,edges:o,isMaxLevel:y})=>t.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},y&&t.createElement(Bi,{defaultColor:e,rfId:r}),t.createElement("g",null,o.map(e=>{const[n,o,y]=Di(C.get(e.source)),[S,_,M]=Di(C.get(e.target));if(!y||!M)return null;let O=e.type||"default";a[O]||(k?.("011",Do(O)),O="default");const P=a[O]||a.default,R=N===cr.Strict?_.target:(_.target??[]).concat(_.source??[]),A=Ai(o.source,e.sourceHandle),D=Ai(R,e.targetHandle),T=A?.position||hr.Bottom,I=D?.position||hr.Top,z=!!(e.focusable||w&&void 0===e.focusable),L=e.reconnectable||e.updatable,$=void 0!==p&&(L||x&&void 0===L);if(!A||!D)return k?.("008",Ro(A,e)),null;const{sourceX:B,sourceY:H,targetX:F,targetY:j}=((e,t,n,o,r,a)=>{const i=Ri(n,e,t),s=Ri(a,o,r);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,A,T,S,D,I);return t.createElement(P,{key:e.id,id:e.id,className:v([e.className,i]),type:O,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:B,sourceY:H,targetX:F,targetY:j,sourcePosition:T,targetPosition:I,elementsSelectable:E,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:r,ariaLabel:e.ariaLabel,isFocusable:z,isReconnectable:$,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:b})})))),y):null};Fi.displayName="EdgeRenderer";var ji=o(Fi);const Vi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Wi({children:e}){const n=zo(Vi);return t.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}const Yi={[hr.Left]:hr.Right,[hr.Right]:hr.Left,[hr.Top]:hr.Bottom,[hr.Bottom]:hr.Top},Xi=({nodeId:e,handleType:n,style:o,type:r=fr.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:l,handleId:c,toX:u,toY:d,connectionMode:f}=zo(s(t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode}),[e]),B),p=l?.[Qo]?.handleBounds;let h=p?.[n];if(f===cr.Loose&&(h=h||p?.["source"===n?"target":"source"]),!l||!h)return null;const m=c?h.find(e=>e.id===c):h[0],g=m?m.x+m.width/2:(l.width??0)/2,y=m?m.y+m.height/2:l.height??0,v=(l.positionAbsolute?.x??0)+g,b=(l.positionAbsolute?.y??0)+y,w=m?.position,x=w?Yi[w]:null;if(!w||!x)return null;if(a)return t.createElement(a,{connectionLineType:r,connectionLineStyle:o,fromNode:l,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:i});let E="";const S={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return r===fr.Bezier?[E]=kr(S):r===fr.Step?[E]=xr({...S,borderRadius:0}):r===fr.SmoothStep?[E]=xr(S):r===fr.SimpleBezier?[E]=gr(S):E=`M${v},${b} ${u},${d}`,t.createElement("path",{d:E,fill:"none",className:"react-flow__connection-path",style:o})};Xi.displayName="ConnectionLine";const Ki=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ui({containerStyle:e,style:n,type:o,component:r}){const{nodeId:a,handleType:i,nodesConnectable:s,width:l,height:c,connectionStatus:u}=zo(Ki,B);return!!(a&&i&&l&&s)?t.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},t.createElement("g",{className:v(["react-flow__connection",u])},t.createElement(Xi,{nodeId:a,handleType:i,style:n,type:o,CustomComponent:r,connectionStatus:u}))):null}function qi(e,t){const n=l(null),o=Lo();return r(()=>{if("development"===process.env.NODE_ENV){const t=Object.keys(e);B(n.current,t)&&o.getState().onError?.("002",No()),n.current=t}return t(e)},[e])}const Zi=({nodeTypes:e,edgeTypes:n,onMove:o,onMoveStart:r,onMoveEnd:a,onInit:s,onNodeClick:c,onEdgeClick:u,onNodeDoubleClick:d,onEdgeDoubleClick:f,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:x,connectionLineComponent:E,connectionLineContainerStyle:S,selectionKeyCode:_,selectionOnDrag:N,selectionMode:C,multiSelectionKeyCode:k,panActivationKeyCode:M,zoomActivationKeyCode:O,deleteKeyCode:P,onlyRenderVisibleElements:R,elementsSelectable:A,selectNodesOnDrag:D,defaultViewport:T,translateExtent:I,minZoom:z,maxZoom:L,preventScrolling:$,defaultMarkerColor:B,zoomOnScroll:H,zoomOnPinch:F,panOnScroll:j,panOnScrollSpeed:V,panOnScrollMode:W,zoomOnDoubleClick:Y,panOnDrag:X,onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneScroll:G,onPaneContextMenu:Q,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:oe,onReconnectStart:re,onReconnectEnd:ae,reconnectRadius:ie,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,elevateEdgesOnSelect:ue,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})=>{const me=qi(e,wi),ge=qi(n,Pi);return function(e){const t=La(),n=l(!1);i(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(s),t.createElement(bi,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:P,selectionKeyCode:_,selectionOnDrag:N,selectionMode:C,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:M,zoomActivationKeyCode:O,elementsSelectable:A,onMove:o,onMoveStart:r,onMoveEnd:a,zoomOnScroll:H,zoomOnPinch:F,zoomOnDoubleClick:Y,panOnScroll:j,panOnScrollSpeed:V,panOnScrollMode:W,panOnDrag:X,defaultViewport:T,translateExtent:I,minZoom:z,maxZoom:L,onSelectionContextMenu:y,preventScrolling:$,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,disableKeyboardA11y:de},t.createElement(Wi,null,t.createElement(ji,{edgeTypes:ge,onEdgeClick:u,onEdgeDoubleClick:f,onlyRenderVisibleElements:R,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:oe,onReconnectStart:re,onReconnectEnd:ae,reconnectRadius:ie,defaultMarkerColor:B,noPanClassName:ce,elevateEdgesOnSelect:!!ue,disableKeyboardA11y:de,rfId:he},t.createElement(Ui,{style:x,type:w,component:E,containerStyle:S})),t.createElement("div",{className:"react-flow__edgelabel-renderer"}),t.createElement(Si,{nodeTypes:me,onNodeClick:c,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,selectNodesOnDrag:D,onlyRenderVisibleElements:R,noPanClassName:ce,noDragClassName:se,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})))};Zi.displayName="GraphView";var Gi=o(Zi);const Qi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ji={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Qi,nodeExtent:Qi,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:cr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:er,isValidConnection:void 0},es=()=>{return e=(e,t)=>({...Ji,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:a}=t();e({nodeInternals:Oa(n,o,r,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=t();e({edges:n.map(e=>({...o,...e}))})},setDefaultNodesAndEdges:(n,o)=>{const r=void 0!==n,a=void 0!==o,i=r?Oa(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?o:[],hasDefaultNodes:r,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:a,fitViewOnInitDone:i,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=r.get(t.id);if(n?.hidden)r.set(n.id,{...n,[Qo]:{...n[Qo],handleBounds:void 0}});else if(n){const o=jo(t.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||t.forceUpdate)&&(r.set(n.id,{...n,[Qo]:{...n[Qo],handleBounds:{source:si(".source",t.nodeElement,f,c),target:si(".target",t.nodeElement,f,c)}},...o}),e.push({id:n.id,type:"dimensions",dimensions:o}))}return e},[]);Ma(r,c);const h=i||a&&!i&&Pa(t,{initial:!0,...s});e({nodeInternals:new Map(r),fitViewOnInitDone:h}),p?.length>0&&o?.(p)},updateNodePositions:(e,n=!0,o=!1)=>{const{triggerNodeChanges:r}=t();r(e.map(e=>{const t={id:e.id,type:"position",dragging:o};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}))},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=Oa(Za(n,s()),r,i,l);e({nodeInternals:t})}o?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ga(e,!0)):(i=Qa(a(),n),s=Qa(r,[])),Da({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ga(e,!0)):(i=Qa(r,n),s=Qa(a(),[])),Da({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:a}=t(),i=o||r;Da({changedNodes:(n||a()).map(e=>(e.selected=!1,Ga(e.id,!1))),changedEdges:i.map(e=>Ga(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=t();o?.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=t();o?.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=t();Da({changedNodes:o().filter(e=>e.selected).map(e=>Ga(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ga(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:o}=t();o.forEach(e=>{e.positionAbsolute=Wo(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(o)})},panBy:e=>{const{transform:n,width:o,height:r,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=ho.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[o,r]],u=a?.constrain()(l,c,s);return a.transform(i,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:Ji.connectionNodeId,connectionHandleId:Ji.connectionHandleId,connectionHandleType:Ji.connectionHandleType,connectionStatus:Ji.connectionStatus,connectionStartHandle:Ji.connectionStartHandle,connectionEndHandle:Ji.connectionEndHandle}),reset:()=>e({...Ji})}),t=Object.is,e?$(e,t):$;var e,t},ts=({children:e})=>{const n=l(null);return n.current||(n.current=es()),t.createElement(_o,{value:n.current},e)};ts.displayName="ReactFlowProvider";const ns=({children:e})=>c(So)?t.createElement(t.Fragment,null,e):t.createElement(ts,null,e);ns.displayName="ReactFlowWrapper";const os={input:oa,default:ta,output:aa,group:ia},rs={default:Mr,straight:_r,step:Sr,smoothstep:Er,simplebezier:yr},as=[0,0],is=[15,15],ss={x:0,y:0,zoom:1},ls={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},cs=a(({nodes:e,edges:n,defaultNodes:o,defaultEdges:r,className:a,nodeTypes:i=os,edgeTypes:s=rs,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:N,onNodeDrag:C,onNodeDragStop:k,onNodesDelete:M,onEdgesDelete:O,onSelectionChange:P,onSelectionDragStart:R,onSelectionDrag:A,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,connectionMode:L=cr.Strict,connectionLineType:$=fr.Bezier,connectionLineStyle:B,connectionLineComponent:H,connectionLineContainerStyle:F,deleteKeyCode:j="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:W=!1,selectionMode:Y=dr.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(rr()?"Meta":"Control"),zoomActivationKeyCode:U=(rr()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=is,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=as,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,defaultViewport:ie=ss,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Qi,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=ur.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ne,children:Ce,onEdgeContextMenu:ke,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Re,onEdgeUpdate:Ae,onEdgeUpdateStart:De,onEdgeUpdateEnd:Te,onReconnect:Ie,onReconnectStart:ze,onReconnectEnd:Le,reconnectRadius:$e=10,edgeUpdaterRadius:Be=10,onNodesChange:He,onEdgesChange:Fe,noDragClassName:je="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:ot,onError:rt,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return t.createElement("div",{...lt,style:{...at,...ls},ref:ct,className:v(["react-flow",a]),"data-testid":"rf__wrapper",id:it},t.createElement(ns,null,t.createElement(Gi,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:$,connectionLineStyle:B,connectionLineComponent:H,connectionLineContainerStyle:F,selectionKeyCode:V,selectionOnDrag:W,selectionMode:Y,deleteKeyCode:j,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ne,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,onEdgeContextMenu:ke,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Re,onReconnect:Ie??Ae,onReconnectStart:ze??De,onReconnectEnd:Le??Te,reconnectRadius:$e??Be,defaultMarkerColor:fe,noDragClassName:je,noWheelClassName:Ve,noPanClassName:We,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),t.createElement(ga,{nodes:e,edges:n,defaultNodes:o,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:He,onEdgesChange:Fe,snapToGrid:q,snapGrid:Z,connectionMode:L,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:O,onNodeDragStart:N,onNodeDrag:C,onNodeDragStop:k,onSelectionDrag:A,onSelectionDragStart:R,onSelectionDragStop:D,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:rt,connectionRadius:nt,isValidConnection:ot,nodeDragThreshold:st}),t.createElement(fa,{onSelectionChange:P}),Ce,t.createElement(Ho,{proOptions:qe,position:Ue}),t.createElement(Sa,{rfId:ut,disableKeyboardA11y:Je})))});function us(e){return t=>{const[n,o]=u(t),r=s(t=>o(n=>e(t,n)),[]);return[n,o,r]}}cs.displayName="ReactFlow";const ds=us(Za),fs=us(function(e,t){return qa(e,t)});var ps;function hs({color:e,dimensions:n,lineWidth:o}){return t.createElement("path",{stroke:e,strokeWidth:o,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function ms({color:e,radius:n}){return t.createElement("circle",{cx:n,cy:n,r:n,fill:e})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ps||(ps={}));const gs={[ps.Dots]:"#91919a",[ps.Lines]:"#eee",[ps.Cross]:"#e2e2e2"},ys={[ps.Dots]:1,[ps.Lines]:1,[ps.Cross]:6},vs=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bs({id:e,variant:n=ps.Dots,gap:o=20,size:r,lineWidth:a=1,offset:i=2,color:s,style:c,className:u}){const d=l(null),{transform:f,patternId:p}=zo(vs,B),h=s||gs[n],m=r||ys[n],g=n===ps.Dots,y=n===ps.Cross,b=Array.isArray(o)?o:[o,o],w=[b[0]*f[2]||1,b[1]*f[2]||1],x=m*f[2],E=y?[x,x]:w,S=g?[x/i,x/i]:[E[0]/i,E[1]/i];return t.createElement("svg",{className:v(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},t.createElement("pattern",{id:p+e,x:f[0]%w[0],y:f[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`},g?t.createElement(ms,{color:h,radius:x/i}):t.createElement(hs,{dimensions:E,color:h,lineWidth:a})),t.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}bs.displayName="Background";var ws=o(bs);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
28
+ */"production"===process.env.NODE_ENV?x.exports=function(){if(N)return E;N=1;var e=t,n=O(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return E.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},E}():x.exports=(P||(P=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=t,n=O(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;A.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),A);var R=b(x.exports);const D=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(o,r,a);return a},{useDebugValue:T}=t,{useSyncExternalStoreWithSelector:I}=R,z=e=>e;function $(e,t=z,n){const o=I(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return T(o),o}const L=(e,t)=>{const n=(e=>e?D(e):D)(e),o=(e,o=t)=>$(n,e,o);return Object.assign(o,n),o};function B(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var H={value:()=>{}};function F(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new j(o)}function j(e){this._=e}function W(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function V(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=H,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}j.prototype=F.prototype={constructor:j,on:function(e,t){var n,o,r=this._,a=(o=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)r[n]=V(r[n],e.name,t);else if(null==t)for(n in r)r[n]=V(r[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=W(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new j(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(o=this._[e]).length;a<n;++a)o[a].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,a=o.length;r<a;++r)o[r].value.apply(t,n)}};var Y="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function K(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),X.hasOwnProperty(t)?{space:X[t],local:e}:e}function U(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Y&&t.documentElement.namespaceURI===Y?t.createElement(e):t.createElementNS(n,e)}}function q(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Z(e){var t=K(e);return(t.local?q:U)(t)}function G(){}function Q(e){return null==e?G:function(){return this.querySelector(e)}}function J(){return[]}function ee(e){return null==e?J:function(){return this.querySelectorAll(e)}}function te(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ne(e){return function(){return this.matches(e)}}function oe(e){return function(t){return t.matches(e)}}var re=Array.prototype.find;function ae(){return this.firstElementChild}var ie=Array.prototype.filter;function se(){return Array.from(this.children)}function le(e){return new Array(e.length)}function ce(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ue(e,t,n,o,r,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],o[s]=i):n[s]=new ce(e,a[s]);for(;s<l;++s)(i=t[s])&&(r[s]=i)}function de(e,t,n,o,r,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(o[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new ce(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(r[s]=l)}function fe(e){return e.__data__}function pe(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function me(e){return function(){this.removeAttribute(e)}}function ge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ye(e,t){return function(){this.setAttribute(e,t)}}function ve(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function be(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function we(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xe(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ee(e){return function(){this.style.removeProperty(e)}}function Se(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _e(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ke(e,t){return e.style.getPropertyValue(t)||xe(e).getComputedStyle(e,null).getPropertyValue(t)}function Ce(e){return function(){delete this[e]}}function Ne(e,t){return function(){this[e]=t}}function Me(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Oe(e){return e.trim().split(/^|\s+/)}function Pe(e){return e.classList||new Ae(e)}function Ae(e){this._node=e,this._names=Oe(e.getAttribute("class")||"")}function Re(e,t){for(var n=Pe(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function De(e,t){for(var n=Pe(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Te(e){return function(){Re(this,e)}}function Ie(e){return function(){De(this,e)}}function ze(e,t){return function(){(t.apply(this,arguments)?Re:De)(this,e)}}function $e(){this.textContent=""}function Le(e){return function(){this.textContent=e}}function Be(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function He(){this.innerHTML=""}function Fe(e){return function(){this.innerHTML=e}}function je(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function We(){this.nextSibling&&this.parentNode.appendChild(this)}function Ve(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ye(){return null}function Xe(){var e=this.parentNode;e&&e.removeChild(this)}function Ke(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ue(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qe(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,a=t.length;o<a;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function Ze(e,t,n){return function(){var o,r=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var i=0,s=r.length;i<s;++i)if((o=r[i]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),void(o.value=t);this.addEventListener(e.type,a,n),o={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(o):this.__on=[o]}}function Ge(e,t,n){var o=xe(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Qe(e,t){return function(){return Ge(this,e,t)}}function Je(e,t){return function(){return Ge(this,e,t.apply(this,arguments))}}ce.prototype={constructor:ce,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},Ae.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var et=[null];function tt(e,t){this._groups=e,this._parents=t}function nt(){return new tt([[document.documentElement]],et)}function ot(e){return"string"==typeof e?new tt([[document.querySelector(e)]],[document.documentElement]):new tt([[e]],et)}function rt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}tt.prototype=nt.prototype={constructor:tt,select:function(e){"function"!=typeof e&&(e=Q(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new tt(o,this._parents)},selectAll:function(e){e="function"==typeof e?te(e):ee(e);for(var t=this._groups,n=t.length,o=[],r=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(o.push(e.call(i,i.__data__,c,s)),r.push(i));return new tt(o,r)},selectChild:function(e){return this.select(null==e?ae:function(e){return function(){return re.call(this.children,e)}}("function"==typeof e?e:oe(e)))},selectChildren:function(e){return this.selectAll(null==e?se:function(e){return function(){return ie.call(this.children,e)}}("function"==typeof e?e:oe(e)))},filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new tt(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,fe);var n,o=t?de:ue,r=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=r[u],f=a[u],p=f.length,h=pe(e.call(d,d&&d.__data__,u,r)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);o(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new tt(s,r))._enter=l,s._exit=c,s},enter:function(){return new tt(this._enter||this._groups.map(le),this._parents)},exit:function(){return new tt(this._exit||this._groups.map(le),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,a=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?a.remove():n(a),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,a=o.length,i=Math.min(r,a),s=new Array(r),l=0;l<i;++l)for(var c,u=n[l],d=o[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<r;++l)s[l]=n[l];return new tt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],a=r.length-1,i=r[a];--a>=0;)(o=r[a])&&(i&&4^o.compareDocumentPosition(i)&&i.parentNode.insertBefore(o,i),i=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=he);for(var n=this._groups,o=n.length,r=new Array(o),a=0;a<o;++a){for(var i,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new tt(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,a=o.length;r<a;++r){var i=o[r];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,a=t[n],i=0,s=a.length;i<s;++i)(r=a[i])&&e.call(r,r.__data__,i,a);return this},attr:function(e,t){var n=K(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?ge:me:"function"==typeof t?n.local?we:be:n.local?ve:ye)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Ee:"function"==typeof t?_e:Se)(e,t,null==n?"":n)):ke(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Ce:"function"==typeof t?Me:Ne)(e,t)):this.node()[e]},classed:function(e,t){var n=Oe(e+"");if(arguments.length<2){for(var o=Pe(this.node()),r=-1,a=n.length;++r<a;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?ze:t?Te:Ie)(n,t))},text:function(e){return arguments.length?this.each(null==e?$e:("function"==typeof e?Be:Le)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?He:("function"==typeof e?je:Fe)(e)):this.node().innerHTML},raise:function(){return this.each(We)},lower:function(){return this.each(Ve)},append:function(e){var t="function"==typeof e?e:Z(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Z(e),o=null==t?Ye:"function"==typeof t?t:Q(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Xe)},clone:function(e){return this.select(e?Ue:Ke)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Ze:qe,o=0;o<i;++o)this.each(s(a[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<i;++o)if((r=a[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Je:Qe)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],a=0,i=r.length;a<i;++a)(o=r[a])&&(yield o)}};const at={passive:!1},it={capture:!0,passive:!1};function st(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function ct(e){var t=e.document.documentElement,n=ot(e).on("dragstart.drag",lt,it);"onselectstart"in t?n.on("selectstart.drag",lt,it):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ut(e,t){var n=e.document.documentElement,o=ot(e).on("dragstart.drag",null);t&&(o.on("click.drag",lt,it),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var dt=e=>()=>e;function ft(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function pt(e){return!e.ctrlKey&&!e.button}function ht(){return this.parentNode}function mt(e,t){return null==t?{x:e.x,y:e.y}:t}function gt(){return navigator.maxTouchPoints||"ontouchstart"in this}function yt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vt(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function bt(){}ft.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var wt=.7,xt=1/wt,Et="\\s*([+-]?\\d+)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kt=/^#([0-9a-f]{3,8})$/,Ct=new RegExp(`^rgb\\(${Et},${Et},${Et}\\)$`),Nt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),Mt=new RegExp(`^rgba\\(${Et},${Et},${Et},${St}\\)$`),Ot=new RegExp(`^rgba\\(${_t},${_t},${_t},${St}\\)$`),Pt=new RegExp(`^hsl\\(${St},${_t},${_t}\\)$`),At=new RegExp(`^hsla\\(${St},${_t},${_t},${St}\\)$`),Rt={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 Dt(){return this.rgb().formatHex()}function Tt(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=kt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?zt(t):3===n?new Bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?$t(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?$t(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ct.exec(e))?new Bt(t[1],t[2],t[3],1):(t=Nt.exec(e))?new Bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Mt.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=Ot.exec(e))?$t(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Pt.exec(e))?Yt(t[1],t[2]/100,t[3]/100,1):(t=At.exec(e))?Yt(t[1],t[2]/100,t[3]/100,t[4]):Rt.hasOwnProperty(e)?zt(Rt[e]):"transparent"===e?new Bt(NaN,NaN,NaN,0):null}function zt(e){return new Bt(e>>16&255,e>>8&255,255&e,1)}function $t(e,t,n,o){return o<=0&&(e=t=n=NaN),new Bt(e,t,n,o)}function Lt(e,t,n,o){return 1===arguments.length?((r=e)instanceof bt||(r=It(r)),r?new Bt((r=r.rgb()).r,r.g,r.b,r.opacity):new Bt):new Bt(e,t,n,null==o?1:o);var r}function Bt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Ht(){return`#${Vt(this.r)}${Vt(this.g)}${Vt(this.b)}`}function Ft(){const e=jt(this.opacity);return`${1===e?"rgb(":"rgba("}${Wt(this.r)}, ${Wt(this.g)}, ${Wt(this.b)}${1===e?")":`, ${e})`}`}function jt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vt(e){return((e=Wt(e))<16?"0":"")+e.toString(16)}function Yt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kt(e,t,n,o)}function Xt(e){if(e instanceof Kt)return new Kt(e.h,e.s,e.l,e.opacity);if(e instanceof bt||(e=It(e)),!e)return new Kt;if(e instanceof Kt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),a=Math.max(t,n,o),i=NaN,s=a-r,l=(a+r)/2;return s?(i=t===a?(n-o)/s+6*(n<o):n===a?(o-t)/s+2:(t-n)/s+4,s/=l<.5?a+r:2-a-r,i*=60):s=l>0&&l<1?0:i,new Kt(i,s,l,e.opacity)}function Kt(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function Ut(e){return(e=(e||0)%360)<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Zt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}yt(bt,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dt,formatHex:Dt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xt(this).formatHsl()},formatRgb:Tt,toString:Tt}),yt(Bt,Lt,vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bt(Wt(this.r),Wt(this.g),Wt(this.b),jt(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:Ht,formatHex:Ht,formatHex8:function(){return`#${Vt(this.r)}${Vt(this.g)}${Vt(this.b)}${Vt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ft,toString:Ft})),yt(Kt,function(e,t,n,o){return 1===arguments.length?Xt(e):new Kt(e,t,n,null==o?1:o)},vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Bt(Zt(e>=240?e-240:e+120,r,o),Zt(e,r,o),Zt(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Kt(Ut(this.h),qt(this.s),qt(this.l),jt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jt(this.opacity);return`${1===e?"hsl(":"hsla("}${Ut(this.h)}, ${100*qt(this.s)}%, ${100*qt(this.l)}%${1===e?")":`, ${e})`}`}}));var Gt=e=>()=>e;function Qt(e){return 1===(e=+e)?Jt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Gt(isNaN(t)?n:t)}}function Jt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Gt(isNaN(e)?t:e)}var en=function e(t){var n=Qt(t);function o(e,t){var o=n((e=Lt(e)).r,(t=Lt(t)).r),r=n(e.g,t.g),a=n(e.b,t.b),i=Jt(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function tn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,on=new RegExp(nn.source,"g");function rn(e,t){var n,o,r,a=nn.lastIndex=on.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=nn.exec(e))&&(o=on.exec(t));)(r=o.index)>a&&(r=t.slice(a,r),s[i]?s[i]+=r:s[++i]=r),(n=n[0])===(o=o[0])?s[i]?s[i]+=o:s[++i]=o:(s[++i]=null,l.push({i:i,x:tn(n,o)})),a=on.lastIndex;return a<t.length&&(r=t.slice(a),s[i]?s[i]+=r:s[++i]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}var an,sn=180/Math.PI,ln={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cn(e,t,n,o,r,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*sn,skewX:Math.atan(l)*sn,scaleX:i,scaleY:s}}function un(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,o,r,a,i,s){if(e!==r||o!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:tn(e,r)},{i:l-2,x:tn(o,a)})}else(r||a)&&i.push("translate("+r+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(r(n)+"rotate(",null,o)-2,x:tn(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(r(n)+"skewX(",null,o)-2,x:tn(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(a.skewX,i.skewX,s,l),function(e,t,n,o,a,i){if(e!==n||t!==o){var s=a.push(r(a)+"scale(",null,",",null,")");i.push({i:s-4,x:tn(e,n)},{i:s-2,x:tn(t,o)})}else 1===n&&1===o||a.push(r(a)+"scale("+n+","+o+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var dn=un(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ln:cn(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),fn=un(function(e){return null==e?ln:(an||(an=document.createElementNS("http://www.w3.org/2000/svg","g")),an.setAttribute("transform",e),(e=an.transform.baseVal.consolidate())?cn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ln)},", ",")",")");function pn(e){return((e=Math.exp(e))+1/e)/2}var hn,mn,gn=function e(t,n,o){function r(e,r){var a,i,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],f=r[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),y=(f*f-c*c+o*m)/(2*c*n*g),v=(f*f-c*c-o*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);i=(w-b)/t,a=function(e){var o,r=e*i,a=pn(b),u=c/(n*g)*(a*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/pn(t*r+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),yn=0,vn=0,bn=0,wn=0,xn=0,En=0,Sn="object"==typeof performance&&performance.now?performance:Date,_n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kn(){return xn||(_n(Cn),xn=Sn.now()+En)}function Cn(){xn=0}function Nn(){this._call=this._time=this._next=null}function Mn(e,t,n){var o=new Nn;return o.restart(e,t,n),o}function On(){xn=(wn=Sn.now())+En,yn=vn=0;try{!function(){kn(),++yn;for(var e,t=hn;t;)(e=xn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yn}()}finally{yn=0,function(){var e,t,n=hn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hn=t);mn=e,An(o)}(),xn=0}}function Pn(){var e=Sn.now(),t=e-wn;t>1e3&&(En-=t,wn=e)}function An(e){yn||(vn&&(vn=clearTimeout(vn)),e-xn>24?(e<1/0&&(vn=setTimeout(On,e-Sn.now()-En)),bn&&(bn=clearInterval(bn))):(bn||(wn=Sn.now(),bn=setInterval(Pn,1e3)),yn=1,_n(On)))}function Rn(e,t,n){var o=new Nn;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}Nn.prototype=Mn.prototype={constructor:Nn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?kn():+n)+(null==t?0:+t),this._next||mn===this||(mn?mn._next=this:hn=this,mn=this),this._call=e,this._time=n,An()},stop:function(){this._call&&(this._call=null,this._time=1/0,An())}};var Dn=F("start","end","cancel","interrupt"),Tn=[];function In(e,t,n,o,r,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function a(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(a){var c,u,d,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return Rn(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[c])}if(Rn(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=f);o.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=o.length;++a<i;)o[a].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=Mn(a,0,n.time)}(e,n,{name:t,index:o,group:r,on:Dn,tween:Tn,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function zn(e,t){var n=Ln(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function $n(e,t){var n=Ln(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Ln(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Bn(e,t){var n,o,r,a=e.__transition,i=!0;if(a){for(r in t=null==t?null:t+"",a)(n=a[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[r]):i=!1;i&&delete e.__transition}}function Hn(e,t){var n,o;return function(){var r=$n(this,e),a=r.tween;if(a!==n)for(var i=0,s=(o=n=a).length;i<s;++i)if(o[i].name===t){(o=o.slice()).splice(i,1);break}r.tween=o}}function Fn(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var a=$n(this,e),i=a.tween;if(i!==o){r=(o=i).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}a.tween=r}}function jn(e,t,n){var o=e._id;return e.each(function(){var e=$n(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Ln(e,o).value[t]}}function Wn(e,t){var n;return("number"==typeof t?tn:t instanceof It?en:(n=It(t))?(t=n,en):rn)(e,t)}function Vn(e){return function(){this.removeAttribute(e)}}function Yn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xn(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===o?r:r=t(o=i,n)}}function Kn(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===o?r:r=t(o=i,n)}}function Un(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttribute(e)}}function qn(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttributeNS(e.space,e.local)}}function Zn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Gn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Qn(e,t){return function(){zn(this,e).delay=+t.apply(this,arguments)}}function Jn(e,t){return t=+t,function(){zn(this,e).delay=t}}function eo(e,t){return function(){$n(this,e).duration=+t.apply(this,arguments)}}function to(e,t){return t=+t,function(){$n(this,e).duration=t}}var no=nt.prototype.constructor;function oo(e){return function(){this.style.removeProperty(e)}}var ro=0;function ao(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function io(){return++ro}var so=nt.prototype;ao.prototype={constructor:ao,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Q(e));for(var o=this._groups,r=o.length,a=new Array(r),i=0;i<r;++i)for(var s,l,c=o[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,In(d[f],t,n,f,d,Ln(s,n)));return new ao(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ee(e));for(var o=this._groups,r=o.length,a=[],i=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=Ln(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&In(f,t,n,m,p,h);a.push(p),i.push(l)}return new ao(a,i,t,n)},selectChild:so.selectChild,selectChildren:so.selectChildren,filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new ao(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,a=Math.min(o,r),i=new Array(o),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<o;++s)i[s]=t[s];return new ao(i,this._parents,this._name,this._id)},selection:function(){return new no(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=io(),o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=Ln(i,t);In(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ao(o,this._parents,e,n)},call:so.call,nodes:so.nodes,node:so.node,size:so.size,empty:so.empty,each:so.each,on:function(e,t){var n=this._id;return arguments.length<2?Ln(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?zn:$n;return function(){var i=a(this,e),s=i.on;s!==o&&(r=(o=s).copy()).on(t,n),i.on=r}}(n,e,t))},attr:function(e,t){var n=K(e),o="transform"===n?fn:Wn;return this.attrTween(e,"function"==typeof t?(n.local?qn:Un)(n,o,jn(this,"attr."+e,t)):null==t?(n.local?Yn:Vn)(n):(n.local?Kn:Xn)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=K(e);return this.tween(n,(o.local?Zn:Gn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?dn:Wn;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var a=ke(this,e),i=(this.style.removeProperty(e),ke(this,e));return a===i?null:a===n&&i===o?r:r=t(n=a,o=i)}}(e,o)).on("end.style."+e,oo(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,a;return function(){var i=ke(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=ke(this,e)),i===l?null:i===o&&l===r?a:(r=l,a=t(o=i,s))}}(e,o,jn(this,"style."+e,t))).each(function(e,t){var n,o,r,a,i="style."+t,s="end."+i;return function(){var l=$n(this,e),c=l.on,u=null==l.value[i]?a||(a=oo(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,a=n+"";return function(){var i=ke(this,e);return i===a?null:i===o?r:r=t(o=i,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function a(){var a=t.apply(this,arguments);return a!==r&&(o=(r=a)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,a,n)),o}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(jn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=Ln(this.node(),n).tween,a=0,i=r.length;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((null==t?Hn:Fn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Qn:Jn)(t,e)):Ln(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?eo:to)(t,e)):Ln(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){$n(this,e).ease=t}}(t,e)):Ln(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;$n(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--r&&a()}};n.each(function(){var n=$n(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===r&&a()})},[Symbol.iterator]:so[Symbol.iterator]};var lo={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function co(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}nt.prototype.interrupt=function(e){return this.each(function(){Bn(this,e)})},nt.prototype.transition=function(e){var t,n;e instanceof ao?(t=e._id,e=e._name):(t=io(),(n=lo).time=kn(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)(i=s[c])&&In(i,e,t,c,s,n||co(i,t));return new ao(o,this._parents,e,t)};var uo=e=>()=>e;function fo(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function po(e,t,n){this.k=e,this.x=t,this.y=n}po.prototype={constructor:po,scale:function(e){return 1===e?this:new po(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new po(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ho=new po(1,0,0);function mo(e){e.stopImmediatePropagation()}function go(e){e.preventDefault(),e.stopImmediatePropagation()}function yo(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function vo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function bo(){return this.__zoom||ho}function wo(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xo(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eo(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}po.prototype;const So=n(null),_o=So.Provider,ko=()=>"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.",Co=e=>`Node type "${e}" not found. Using fallback type "default".`,No=()=>"The React Flow parent container needs a width and a height to render the graph.",Mo=()=>"Only child nodes can use a parent extent.",Oo=()=>"Can't create edge. An edge needs a source and a target.",Po=e=>`Marker type "${e}" doesn't exist.`,Ao=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Ro=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Do=e=>`Edge type "${e}" not found. Using fallback type "default".`,To=e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,Io=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function zo(e,t){const n=c(So);if(null===n)throw new Error(Io);return $(n,e,t)}const $o=()=>{const e=c(So);if(null===e)throw new Error(Io);return r(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Lo=e=>e.userSelectionActive?"none":"all";function Bo({position:e,children:n,className:o,style:r,...a}){const i=zo(Lo),s=`${e}`.split("-");return t.createElement("div",{className:v(["react-flow__panel",o,...s]),style:{...r,pointerEvents:i},...a},n)}function Ho({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(Bo,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},t.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Fo=o(({x:e,y:n,label:o,labelStyle:r={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:f,className:p,...h})=>{const m=l(null),[g,y]=u({x:0,y:0,width:0,height:0}),b=v(["react-flow__edge-textwrapper",p]);return i(()=>{if(m.current){const e=m.current.getBBox();y({x:e.x,y:e.y,width:e.width,height:e.height})}},[o]),void 0!==o&&o?t.createElement("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...h},a&&t.createElement("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:d,ry:d}),t.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},o),f):null});const jo=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vo=(e={x:0,y:0},t)=>({x:Wo(e.x,t[0][0],t[1][0]),y:Wo(e.y,t[0][1],t[1][1])}),Yo=(e,t,n)=>e<t?Wo(Math.abs(e-t),1,50)/50:e>n?-Wo(Math.abs(e-n),1,50)/50:0,Xo=(e,t)=>[20*Yo(e.x,35,t.width-35),20*Yo(e.y,35,t.height-35)],Ko=e=>e.getRootNode?.()||window?.document,Uo=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),qo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Zo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Go=e=>!isNaN(e)&&isFinite(e),Qo=Symbol.for("internals"),Jo=["Enter"," ","Escape"],er=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function tr(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const nr=e=>"clientX"in e,or=(e,t)=>{const n=nr(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},rr=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,ar=({id:e,path:n,labelX:o,labelY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>t.createElement(t.Fragment,null,t.createElement("path",{id:e,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&t.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Go(o)&&Go(r)?t.createElement(Fo,{x:o,y:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function ir(e,t,n){return void 0===n?n:o=>{const r=t().edges.find(t=>t.id===e);r&&n(o,{...r})}}function sr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,a=n<e?n+r:n-r,i=Math.abs(o-t)/2;return[a,o<t?o+i:o-i,r,i]}function lr({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*r+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var cr,ur,dr,fr,pr,hr;function mr({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===hr.Left||e===hr.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function gr({sourceX:e,sourceY:t,sourcePosition:n=hr.Bottom,targetX:o,targetY:r,targetPosition:a=hr.Top}){const[i,s]=mr({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=mr({pos:a,x1:o,y1:r,x2:e,y2:t}),[u,d,f,p]=lr({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${o},${r}`,u,d,f,p]}ar.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(cr||(cr={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(ur||(ur={})),function(e){e.Partial="partial",e.Full="full"}(dr||(dr={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(fr||(fr={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(pr||(pr={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(hr||(hr={}));const yr=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,sourcePosition:a=hr.Bottom,targetPosition:i=hr.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=gr({sourceX:e,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i});return t.createElement(ar,{path:y,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})});yr.displayName="SimpleBezierEdge";const vr={[hr.Left]:{x:-1,y:0},[hr.Right]:{x:1,y:0},[hr.Top]:{x:0,y:-1},[hr.Bottom]:{x:0,y:1}},br=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wr({source:e,sourcePosition:t=hr.Bottom,target:n,targetPosition:o=hr.Top,center:r,offset:a}){const i=vr[t],s=vr[o],l={x:e.x+i.x*a,y:e.y+i.y*a},c={x:n.x+s.x*a,y:n.y+s.y*a},u=(({source:e,sourcePosition:t=hr.Bottom,target:n})=>t===hr.Left||t===hr.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=sr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=r.x??v,h=r.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const r=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:r:i.y===f?r:u,t===o){const t=Math.abs(e[d]-n[d]);if(t<=a){const o=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*o:y[d]=(c[d]>n[d]?-1:1)*o}}if(t!==o){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],o=l[e]<c[e];(1===i[d]&&(!t&&n||t&&o)||1!==i[d]&&(!t&&o||t&&n))&&(m="x"===d?r:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function xr({sourceX:e,sourceY:t,sourcePosition:n=hr.Bottom,targetX:o,targetY:r,targetPosition:a=hr.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=wr({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let o="";return o=n>0&&n<u.length-1?function(e,t,n,o){const r=Math.min(br(e,t)/2,br(t,n)/2,o),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+r*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+r*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+r*(e.y<n.y?-1:1)}Q ${a},${i} ${a+r*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=o},"");return[m,d,f,p,h]}const Er=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=hr.Bottom,targetPosition:p=hr.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=xr({sourceX:e,sourceY:n,sourcePosition:f,targetX:o,targetY:r,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return t.createElement(ar,{path:v,labelX:b,labelY:w,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});Er.displayName="SmoothStepEdge";const Sr=o(e=>t.createElement(Er,{...e,pathOptions:r(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Sr.displayName="StepEdge";const _r=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,a,i,s]=sr({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,a,i,s]}({sourceX:e,sourceY:n,targetX:o,targetY:r});return t.createElement(ar,{path:m,labelX:g,labelY:y,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function kr(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Cr({pos:e,x1:t,y1:n,x2:o,y2:r,c:a}){switch(e){case hr.Left:return[t-kr(t-o,a),n];case hr.Right:return[t+kr(o-t,a),n];case hr.Top:return[t,n-kr(n-r,a)];case hr.Bottom:return[t,n+kr(r-n,a)]}}function Nr({sourceX:e,sourceY:t,sourcePosition:n=hr.Bottom,targetX:o,targetY:r,targetPosition:a=hr.Top,curvature:i=.25}){const[s,l]=Cr({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[c,u]=Cr({pos:a,x1:o,y1:r,x2:e,y2:t,c:i}),[d,f,p,h]=lr({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${o},${r}`,d,f,p,h]}_r.displayName="StraightEdge";const Mr=o(({sourceX:e,sourceY:n,targetX:o,targetY:r,sourcePosition:a=hr.Bottom,targetPosition:i=hr.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=Nr({sourceX:e,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i,curvature:g?.curvature});return t.createElement(ar,{path:v,labelX:b,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})});Mr.displayName="BezierEdge";const Or=n(null),Pr=Or.Provider;Or.Consumer;const Ar=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${n}${o||""}`,Rr=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},Dr=(e,t)=>{if(!e.source||!e.target)return er("006",Oo()),t;let n;var o;return n="id"in(o=e)&&"source"in o&&"target"in o?{...e}:{...e,id:Ar(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:t.concat(n)},Tr=({x:e,y:t},[n,o,r],a,[i,s])=>{const l={x:(e-n)/r,y:(t-o)/r};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},Ir=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o}),zr=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],o=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-o};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-o}:r}},$r=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const{x:o,y:r}=zr(n,t).positionAbsolute;return a=e,i=Uo({x:o,y:r,width:n.width||0,height:n.height||0}),{x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),x2:Math.max(a.x2,i.x2),y2:Math.max(a.y2,i.y2)};var a,i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}))(n)},Lr=(e,t,[n,o,r]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/r,y:(t.y-o)/r,width:t.width/r,height:t.height/r},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:o=!0,hidden:r=!1}=e;if(i&&!o||r)return!1;const{positionAbsolute:u}=zr(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=Zo(l,d);(void 0===t||void 0===n||null===t||null===n||a&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},Br=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Hr=(e,t,n,o,r,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Wo(l,o,r);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Fr=(e,t=0)=>e.transition().duration(t);function jr(e,t,n,o){return(t[n]||[]).reduce((t,r)=>(`${e.id}-${r.id}-${n}`!==o&&t.push({id:r.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+r.x+r.width/2,y:(e.positionAbsolute?.y??0)+r.y+r.height/2}),t),[])}const Wr={source:null,target:null,sourceHandle:null,targetHandle:null},Vr=()=>({handleDomNode:null,isValid:!1,connection:Wr,endHandle:null});function Yr(e,t,n,o,r,a,i){const s="target"===r,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Vr(),handleDomNode:l};if(l){const e=Xr(void 0,l),r=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?r:n,sourceHandle:s?i:o,target:s?n:r,targetHandle:s?o:i};c.connection=f;u&&d&&(t===cr.Strict?s&&"source"===e||!s&&"target"===e:r!==n||i!==o)&&(c.endHandle={nodeId:r,handleId:i,type:e},c.isValid=a(f))}return c}function Xr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Kr(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Ur(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function qr({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Ko(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:E}=or(e),S=u?.elementFromPoint(x,E),_=Xr(l,S),k=f?.getBoundingClientRect();if(!k||!_)return;let C,N=or(e,k),M=!1,O=null,P=!1,A=null;const R=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((e,r)=>{if(r[Qo]){const{handleBounds:a}=r[Qo];let i=[],s=[];a&&(i=jr(r,a,"source",`${t}-${n}-${o}`),s=jr(r,a,"target",`${t}-${n}-${o}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),D=()=>{if(!p)return;const[e,t]=Xo(N,k);g({x:e,y:t}),w=requestAnimationFrame(D)};function T(e){const{transform:o}=a();N=or(e,k);const{handle:l,validHandleResult:c}=function(e,t,n,o,r,a){const{x:i,y:s}=or(e),l=t.elementsFromPoint(i,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Xr(void 0,l),o=l.getAttribute("data-handleid"),i=a({nodeId:e,id:o,type:t});if(i){const a=r.find(n=>n.nodeId===e&&n.type===t&&n.id===o);return{handle:{id:o,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(r.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=o){const n=a(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:Vr()};if(1===c.length)return c[0];const d=c.some(({validHandleResult:e})=>e.isValid),f=c.some(({handle:e})=>"target"===e.type);return c.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||c[0]}(e,u,Tr(N,o,!1,[1,1]),h,R,e=>Yr(e,d,n,t,r?"target":"source",s,u));if(b=l,M||(D(),M=!0),A=c.handleDomNode,O=c.connection,P=c.isValid,i({connectionPosition:b&&P?Ir({x:b.x,y:b.y},o):N,connectionStatus:Ur(!!b,P),connectionEndHandle:c.endHandle}),!b&&!P&&!A)return Kr(C);O.source!==O.target&&A&&(Kr(C),C=A,A.classList.add("connecting","react-flow__handle-connecting"),A.classList.toggle("valid",P),A.classList.toggle("react-flow__handle-valid",P))}function I(e){(b||A)&&O&&P&&o?.(O),a().onConnectEnd?.(e),l&&c?.(e),Kr(C),v(),cancelAnimationFrame(w),M=!1,P=!1,O=null,A=null,u.removeEventListener("mousemove",T),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",T),u.removeEventListener("touchend",I)}i({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",T),u.addEventListener("mouseup",I),u.addEventListener("touchmove",T),u.addEventListener("touchend",I)}const Zr=()=>!0,Gr=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Qr=a(({type:e="source",position:n=hr.Top,isValidConnection:o,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=s||null,y="target"===e,b=$o(),w=c(Or),{connectOnClick:x,noPanClassName:E}=zo(Gr,B),{connecting:S,clickConnecting:_}=zo(((e,t,n)=>o=>{const{connectionStartHandle:r,connectionEndHandle:a,connectionClickStartHandle:i}=o;return{connecting:r?.nodeId===e&&r?.handleId===t&&r?.type===n||a?.nodeId===e&&a?.handleId===t&&a?.type===n,clickConnecting:i?.nodeId===e&&i?.handleId===t&&i?.type===n}})(w,g,e),B);w||b.getState().onError?.("010",Ro());const k=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=b.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=b.getState();t(Dr(r,e))}n?.(r),l?.(r)},C=e=>{if(!w)return;const t=nr(e);a&&(t&&0===e.button||!t)&&qr({event:e,handleId:g,nodeId:w,onConnect:k,isTarget:y,getState:b.getState,setState:b.setState,isValidConnection:o||b.getState().isValidConnection||Zr}),t?f?.(e):p?.(e)};return t.createElement("div",{"data-handleid":g,"data-nodeid":w,"data-handlepos":n,"data-id":`${w}-${g}-${e}`,className:v(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,d,{source:!y,target:y,connectable:r,connectablestart:a,connectableend:i,connecting:_,connectionindicator:r&&(a&&!S||i&&S)}]),onMouseDown:C,onTouchStart:C,onClick:x?t=>{const{onClickConnectStart:n,onClickConnectEnd:r,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=b.getState();if(!w||!i&&!a)return;if(!i)return n?.(t,{nodeId:w,handleId:g,handleType:e}),void b.setState({connectionClickStartHandle:{nodeId:w,type:e,handleId:g}});const c=Ko(t.target),u=o||l||Zr,{connection:d,isValid:f}=Yr({nodeId:w,id:g,type:e},s,i.nodeId,i.handleId||null,i.type,u,c);f&&k(d),r?.(t),b.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Qr.displayName="Handle";var Jr=o(Qr);const ea=({data:e,isConnectable:n,targetPosition:o=hr.Top,sourcePosition:r=hr.Bottom})=>t.createElement(t.Fragment,null,t.createElement(Jr,{type:"target",position:o,isConnectable:n}),e?.label,t.createElement(Jr,{type:"source",position:r,isConnectable:n}));ea.displayName="DefaultNode";var ta=o(ea);const na=({data:e,isConnectable:n,sourcePosition:o=hr.Bottom})=>t.createElement(t.Fragment,null,e?.label,t.createElement(Jr,{type:"source",position:o,isConnectable:n}));na.displayName="InputNode";var oa=o(na);const ra=({data:e,isConnectable:n,targetPosition:o=hr.Top})=>t.createElement(t.Fragment,null,t.createElement(Jr,{type:"target",position:o,isConnectable:n}),e?.label);ra.displayName="OutputNode";var aa=o(ra);const ia=()=>null;ia.displayName="GroupNode";const sa=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),la=e=>e.id;function ca(e,t){return B(e.selectedNodes.map(la),t.selectedNodes.map(la))&&B(e.selectedEdges.map(la),t.selectedEdges.map(la))}const ua=o(({onSelectionChange:e})=>{const t=$o(),{selectedNodes:n,selectedEdges:o}=zo(sa,ca);return i(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChange.forEach(e=>e(r))},[n,o,e]),null});ua.displayName="SelectionListener";const da=e=>!!e.onSelectionChange;function fa({onSelectionChange:e}){const n=zo(da);return e||n?t.createElement(ua,{onSelectionChange:e}):null}const pa=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ha(e,t){i(()=>{void 0!==e&&t(e)},[e])}function ma(e,t,n){i(()=>{void 0!==t&&n({[e]:t})},[t])}const ga=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:a,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:E,snapGrid:S,snapToGrid:_,translateExtent:k,connectOnClick:C,defaultEdgeOptions:N,fitView:M,fitViewOptions:O,onNodesDelete:P,onEdgesDelete:A,onNodeDrag:R,onNodeDragStart:D,onNodeDragStop:T,onSelectionDrag:I,onSelectionDragStart:z,onSelectionDragStop:$,noPanClassName:L,nodeOrigin:H,rfId:F,autoPanOnConnect:j,autoPanOnNodeDrag:W,onError:V,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=zo(pa,B),ne=$o();return i(()=>{const e=o?.map(e=>({...e,...N}));return Z(n,e),()=>{te()}},[]),ma("defaultEdgeOptions",N,ne.setState),ma("connectionMode",E,ne.setState),ma("onConnect",r,ne.setState),ma("onConnectStart",a,ne.setState),ma("onConnectEnd",s,ne.setState),ma("onClickConnectStart",l,ne.setState),ma("onClickConnectEnd",c,ne.setState),ma("nodesDraggable",u,ne.setState),ma("nodesConnectable",d,ne.setState),ma("nodesFocusable",f,ne.setState),ma("edgesFocusable",p,ne.setState),ma("edgesUpdatable",h,ne.setState),ma("elementsSelectable",x,ne.setState),ma("elevateNodesOnSelect",m,ne.setState),ma("snapToGrid",_,ne.setState),ma("snapGrid",S,ne.setState),ma("onNodesChange",b,ne.setState),ma("onEdgesChange",w,ne.setState),ma("connectOnClick",C,ne.setState),ma("fitViewOnInit",M,ne.setState),ma("fitViewOnInitOptions",O,ne.setState),ma("onNodesDelete",P,ne.setState),ma("onEdgesDelete",A,ne.setState),ma("onNodeDrag",R,ne.setState),ma("onNodeDragStart",D,ne.setState),ma("onNodeDragStop",T,ne.setState),ma("onSelectionDrag",I,ne.setState),ma("onSelectionDragStart",z,ne.setState),ma("onSelectionDragStop",$,ne.setState),ma("noPanClassName",L,ne.setState),ma("nodeOrigin",H,ne.setState),ma("rfId",F,ne.setState),ma("autoPanOnConnect",j,ne.setState),ma("autoPanOnNodeDrag",W,ne.setState),ma("onError",V,ne.setState),ma("connectionRadius",Y,ne.setState),ma("isValidConnection",X,ne.setState),ma("nodeDragThreshold",K,ne.setState),ha(e,U),ha(t,q),ha(g,G),ha(y,Q),ha(k,J),ha(v,ee),null},ya={display:"none"},va={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ba="react-flow__node-desc",wa="react-flow__edge-desc",xa=e=>e.ariaLiveMessage;function Ea({rfId:e}){const n=zo(xa);return t.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:va},n)}function Sa({rfId:e,disableKeyboardA11y:n}){return t.createElement(t.Fragment,null,t.createElement("div",{id:`${ba}-${e}`,style:ya},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),t.createElement("div",{id:`${wa}-${e}`,style:ya},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&t.createElement(Ea,{rfId:e}))}var _a=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,o]=u(!1),a=l(!1),s=l(new Set([])),[c,d]=r(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return i(()=>{const n="undefined"!=typeof document?document:null,r=t?.target||n;if(null!==e){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!t.actInsideInputWithModifier)&&tr(e))return!1;const n=Ca(e.code,d);s.current.add(e[n]),ka(c,s.current,!1)&&(e.preventDefault(),o(!0))},n=e=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&tr(e))return!1;const n=Ca(e.code,d);ka(c,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(e[n]),"Meta"===e.key&&s.current.clear(),a.current=!1},i=()=>{s.current.clear(),o(!1)};return r?.addEventListener("keydown",e),r?.addEventListener("keyup",n),window.addEventListener("blur",i),()=>{r?.removeEventListener("keydown",e),r?.removeEventListener("keyup",n),window.removeEventListener("blur",i)}}},[e,o]),n};function ka(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Ca(e,t){return t.includes(e)?"code":"key"}function Na(e,t,n,o){const r=e.parentNode||e.parentId;if(!r)return n;const a=t.get(r),i=zr(a,o);return Na(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Qo]?.z??0)>(n.z??0)?a[Qo]?.z??0:n.z??0},o)}function Ma(e,t,n){e.forEach(o=>{const r=o.parentNode||o.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n?.[o.id]){const{x:r,y:a,z:i}=Na(o,e,{...o.position,z:o[Qo]?.z??0},t);o.positionAbsolute={x:r,y:a},o[Qo].z=i,n?.[o.id]&&(o[Qo].isParent=!0)}})}function Oa(e,t,n,o){const r=new Map,a={},i=o?1e3:0;return e.forEach(e=>{const n=(Go(e.zIndex)?e.zIndex:0)+(e.selected?i:0),o=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(a[l]=!0);const c=o?.type&&o?.type!==e.type;Object.defineProperty(s,Qo,{enumerable:!1,value:{handleBounds:c?void 0:o?.[Qo]?.handleBounds,z:n}}),r.set(e.id,s)}),Ma(r,n,a),r}function Pa(e,t={}){const{getNodes:n,width:o,height:r,minZoom:a,maxZoom:i,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=$r(e,d),{x:c,y:u,zoom:f}=Hr(n,o,r,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=ho.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Fr(l,t.duration),p):s.transform(l,p),!0}}return!1}function Aa(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Qo]:n[Qo],selected:e.selected})}),new Map(t)}function Ra(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function Da({changedNodes:e,changedEdges:t,get:n,set:o}){const{nodeInternals:r,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&o({nodeInternals:Aa(e,r)}),i?.(e)),t?.length&&(c&&o({edges:Ra(t,a)}),s?.(t))}const Ta=()=>{},Ia={zoomIn:Ta,zoomOut:Ta,zoomTo:Ta,getZoom:()=>1,setViewport:Ta,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ta,fitBounds:Ta,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},za=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function $a(){const e=(()=>{const e=$o(),{d3Zoom:t,d3Selection:n}=zo(za,B),o=r(()=>n&&t?{zoomIn:e=>t.scaleBy(Fr(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(Fr(n,e?.duration),1/1.2),zoomTo:(e,o)=>t.scaleTo(Fr(n,o?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(o,r)=>{const[a,i,s]=e.getState().transform,l=ho.translate(o.x??a,o.y??i).scale(o.zoom??s);t.transform(Fr(n,r?.duration),l)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},fitView:t=>Pa(e.getState,t),setCenter:(o,r,a)=>{const{width:i,height:s,maxZoom:l}=e.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-o*c,d=s/2-r*c,f=ho.translate(u,d).scale(c);t.transform(Fr(n,a?.duration),f)},fitBounds:(o,r)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=e.getState(),{x:c,y:u,zoom:d}=Hr(o,a,i,s,l,r?.padding??.1),f=ho.translate(c,u).scale(d);t.transform(Fr(n,r?.duration),f)},project:t=>{const{transform:n,snapToGrid:o,snapGrid:r}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Tr(t,n,o,r)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:o,snapGrid:r,domNode:a}=e.getState();if(!a)return t;const{x:i,y:s}=a.getBoundingClientRect(),l={x:t.x-i,y:t.y-s};return Tr(l,n,o,r)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:a}=o.getBoundingClientRect(),i=Ir(t,n);return{x:i.x+r,y:i.y+a}},viewportInitialized:!0}:Ia,[t,n]);return o})(),t=$o(),n=s(()=>t.getState().getNodes().map(e=>({...e})),[]),o=s(e=>t.getState().nodeInternals.get(e),[]),a=s(()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},[]),i=s(e=>{const{edges:n=[]}=t.getState();return n.find(t=>t.id===e)},[]),l=s(e=>{const{getNodes:n,setNodes:o,hasDefaultNodes:r,onNodesChange:a}=t.getState(),i=n(),s="function"==typeof e?e(i):e;if(r)o(s);else if(a){const e=0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));a(e)}},[]),c=s(e=>{const{edges:n=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:a}=t.getState(),i="function"==typeof e?e(n):e;if(r)o(i);else if(a){a(0===i.length?n.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),u=s(e=>{const n=Array.isArray(e)?e:[e],{getNodes:o,setNodes:r,hasDefaultNodes:a,onNodesChange:i}=t.getState();if(a){r([...o(),...n])}else if(i){const e=n.map(e=>({item:e,type:"add"}));i(e)}},[]),d=s(e=>{const n=Array.isArray(e)?e:[e],{edges:o=[],setEdges:r,hasDefaultEdges:a,onEdgesChange:i}=t.getState();if(a)r([...o,...n]);else if(i){i(n.map(e=>({item:e,type:"add"})))}},[]),f=s(()=>{const{getNodes:e,edges:n=[],transform:o}=t.getState(),[r,a,i]=o;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:r,y:a,zoom:i}}},[]),p=s(({nodes:e,edges:n})=>{const{nodeInternals:o,getNodes:r,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=t.getState(),f=(e||[]).map(e=>e.id),p=(n||[]).map(e=>e.id),h=r().reduce((e,t)=>{const n=t.parentNode||t.parentId,o=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||o)&&e.push(t),e},[]),m=a.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Br(h,m),n=[...g,...e],r=n.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&t.setState({edges:a.filter(e=>!r.includes(e.id))}),i&&(h.forEach(e=>{o.delete(e.id)}),t.setState({nodeInternals:new Map(o)}))),r.length>0&&(c?.(n),d&&d(r.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),h=s(e=>{const n=Go((o=e).width)&&Go(o.height)&&Go(o.x)&&Go(o.y);var o;const r=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!r)return[null,null,n];return[n?e:qo(r),r,n]},[]),m=s((e,n=!0,o)=>{const[r,a,i]=h(e);return r?(o||t.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const t=qo(e),o=Zo(t,r);return n&&o>0||o>=r.width*r.height}):[]},[]),g=s((e,t,n=!0)=>{const[o]=h(e);if(!o)return!1;const r=Zo(o,t);return n&&r>0||r>=o.width*o.height},[]);return r(()=>({...e,getNodes:n,getNode:o,getEdges:a,getEdge:i,setNodes:l,setEdges:c,addNodes:u,addEdges:d,toObject:f,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:g}),[e,n,o,a,i,l,c,u,d,f,p,m,g])}const La={actInsideInputWithModifier:!1};const Ba={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ha=e=>({x:e.x,y:e.y,zoom:e.k}),Fa=(e,t)=>e.target.closest(`.${t}`),ja=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Wa=e=>{const t=e.ctrlKey&&rr()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Va=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ya=({onMove:e,onMoveStart:n,onMoveEnd:o,onPaneContextMenu:r,zoomOnScroll:a=!0,zoomOnPinch:s=!0,panOnScroll:c=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=ur.Free,zoomOnDoubleClick:f=!0,elementsSelectable:p,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:y,maxZoom:v,zoomActivationKeyCode:b,preventScrolling:w=!0,children:x,noWheelClassName:E,noPanClassName:S})=>{const _=l(),k=$o(),C=l(!1),N=l(!1),M=l(null),O=l({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:A,d3ZoomHandler:R,userSelectionActive:D}=zo(Va,B),T=_a(b),I=l(0),z=l(!1),$=l();return function(e){const t=$o();i(()=>{let n;const o=()=>{if(!e.current)return;const n=jo(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",No()),t.setState({width:n.width||500,height:n.height||500})};return o(),window.addEventListener("resize",o),e.current&&(n=new ResizeObserver(()=>o()),n.observe(e.current)),()=>{window.removeEventListener("resize",o),n&&e.current&&n.unobserve(e.current)}},[])}(M),i(()=>{if(M.current){const e=M.current.getBoundingClientRect(),t=function(){var e,t,n,o=yo,r=vo,a=Eo,i=wo,s=xo,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=gn,f=F("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",bo).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new po(t,e.x,e.y)}function y(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new po(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",function(){w(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(o).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(o),s=r.apply(e,a),l=null==n?v(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new po(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function E(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,i.apply(this,arguments)))),u=rt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Bn(this),n.start()}go(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,i=w(this,t,!0).event(e),s=ot(e.view).on("mousemove.zoom",function(e){if(go(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(y(i.that.__zoom,i.mouse[0]=rt(e,r),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ut(e.view,i.moved),go(e),i.event(e).end()},!0),l=rt(e,r),u=e.clientX,d=e.clientY;ct(e.view),mo(e),i.mouse=[l,this.__zoom.invert(l)],Bn(this),i.start()}}function _(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,i=rt(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(y(g(n,l),i,s),r.apply(this,t),c);go(e),u>0?ot(this).transition().duration(u).call(b,d,i,e):ot(this).call(m.transform,d,i,e)}}function k(n,...r){if(o.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,r,n.changedTouches.length===u).event(n);for(mo(n),i=0;i<u;++i)l=[l=rt(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Bn(this),d.start())}}function C(e,...t){if(this.__zooming){var n,o,r,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(go(e),n=0;n<u;++n)r=rt(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;o=g(o,Math.sqrt(m/v)),r=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(o,r,i),s.extent,c))}}function N(e,...o){if(this.__zooming){var r,a,i=w(this,o).event(e),s=e.changedTouches,l=s.length;for(mo(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<l;++r)a=s[r],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=rt(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=ot(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",bo),e!==r?b(e,t,n,o):r.interrupt().each(function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,o){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,o)},m.scaleTo=function(e,t,n,o){m.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(o,l),i,s),e,c)},n,o)},m.translateBy=function(e,t,n,o){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,o)},m.translateTo=function(e,t,n,o,i){m.transform(e,function(){var e=r.apply(this,arguments),i=this.__zoom,s=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return a(ho.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},o,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ot(this.that).datum();f.call(e,this.that,new fo(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:uo(+e),m):i},m.filter=function(e){return arguments.length?(o="function"==typeof e?e:uo(!!e),m):o},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:uo(!!e),m):s},m.extent=function(e){return arguments.length?(r="function"==typeof e?e:uo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):r},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([y,v]).translateExtent(g),n=ot(M.current).call(t),o=ho.translate(m.x,m.y).scale(Wo(m.zoom,y,v)),r=[[0,0],[e.width,e.height]],a=t.constrain()(o,r,g);t.transform(n,a),t.wheelDelta(Wa),k.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:M.current.closest(".react-flow")})}},[]),i(()=>{A&&P&&(!c||T||D?void 0!==R&&A.on("wheel.zoom",function(e,t){if(!w&&"wheel"===e.type&&!e.ctrlKey||Fa(e,E))return null;e.preventDefault(),R.call(this,e,t)},{passive:!1}):A.on("wheel.zoom",t=>{if(Fa(t,E))return!1;t.preventDefault(),t.stopImmediatePropagation();const r=A.property("__zoom").k||1;if(t.ctrlKey&&s){const e=rt(t),n=Wa(t),o=r*Math.pow(2,n);return void P.scaleTo(A,o,e,t)}const a=1===t.deltaMode?20:1;let i=d===ur.Vertical?0:t.deltaX*a,l=d===ur.Horizontal?0:t.deltaY*a;!rr()&&t.shiftKey&&d!==ur.Vertical&&(i=t.deltaY*a,l=0),P.translateBy(A,-i/r*u,-l/r*u,{internal:!0});const c=Ha(A.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=k.getState();clearTimeout($.current),z.current||(z.current=!0,n?.(t,c),f?.(c)),z.current&&(e?.(t,c),p?.(c),$.current=setTimeout(()=>{o?.(t,c),h?.(c),z.current=!1},150))},{passive:!1}))},[D,c,d,A,P,R,T,s,w,E,n,e,o]),i(()=>{P&&P.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;I.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=k.getState(),o=Ha(e.transform);C.current=!0,O.current=o,"mousedown"===e.sourceEvent?.type&&k.setState({paneDragging:!0}),t?.(o),n?.(e.sourceEvent,o)})},[P,n]),i(()=>{P&&(D&&!C.current?P.on("zoom",null):D||P.on("zoom",t=>{const{onViewportChange:n}=k.getState();if(k.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),N.current=!(!r||!ja(h,I.current??0)),(e||n)&&!t.sourceEvent?.internal){const o=Ha(t.transform);n?.(o),e?.(t.sourceEvent,o)}}))},[D,P,e,h,r]),i(()=>{P&&P.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=k.getState();if(C.current=!1,k.setState({paneDragging:!1}),r&&ja(h,I.current??0)&&!N.current&&r(e.sourceEvent),N.current=!1,(o||t)&&(n=O.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Ha(e.transform);O.current=n,clearTimeout(_.current),_.current=setTimeout(()=>{t?.(n),o?.(e.sourceEvent,n)},c?150:0)}var n,a})},[P,c,h,o,r]),i(()=>{P&&P.filter(e=>{const t=T||a,n=s&&e.ctrlKey;if((!0===h||Array.isArray(h)&&h.includes(1))&&1===e.button&&"mousedown"===e.type&&(Fa(e,"react-flow__node")||Fa(e,"react-flow__edge")))return!0;if(!(h||t||c||f||s))return!1;if(D)return!1;if(!f&&"dblclick"===e.type)return!1;if(Fa(e,E)&&"wheel"===e.type)return!1;if(Fa(e,S)&&("wheel"!==e.type||c&&"wheel"===e.type&&!T))return!1;if(!s&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!c&&!n&&"wheel"===e.type)return!1;if(!h&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(h)&&!h.includes(e.button)&&"mousedown"===e.type)return!1;const o=Array.isArray(h)&&h.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&o})},[D,P,a,s,c,f,h,p,T]),t.createElement("div",{className:"react-flow__renderer",ref:M,style:Ba},x)},Xa=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ka(){const{userSelectionActive:e,userSelectionRect:n}=zo(Xa,B);return e&&n?t.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Ua(e,t){const n=t.parentNode||t.parentId,o=e.find(e=>e.id===n);if(o){const e=t.position.x+t.width-o.width,n=t.position.y+t.height-o.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(o.style={...o.style}||{},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,e>0&&(o.style.width+=e),n>0&&(o.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);o.position.x=o.position.x-e,o.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);o.position.y=o.position.y-e,o.style.height+=e,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function qa(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const o=e.filter(e=>e.id===n.id);if(0===o.length)return t.push(n),t;const r={...n};for(const e of o)if(e)switch(e.type){case"select":r.selected=e.selected;break;case"position":void 0!==e.position&&(r.position=e.position),void 0!==e.positionAbsolute&&(r.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(r.dragging=e.dragging),r.expandParent&&Ua(t,r);break;case"dimensions":void 0!==e.dimensions&&(r.width=e.dimensions.width,r.height=e.dimensions.height),void 0!==e.updateStyle&&(r.style={...r.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(r.resizing=e.resizing),r.expandParent&&Ua(t,r);break;case"remove":return t}return t.push(r),t},n)}function Za(e,t){return qa(e,t)}const Ga=(e,t)=>({id:e,type:"select",selected:t});function Qa(e,t){return e.reduce((e,n)=>{const o=t.includes(n.id);return!n.selected&&o?(n.selected=!0,e.push(Ga(n.id,!0))):n.selected&&!o&&(n.selected=!1,e.push(Ga(n.id,!1))),e},[])}const Ja=(e,t)=>n=>{n.target===t.current&&e?.(n)},ei=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ti=o(({isSelecting:e,selectionMode:n=dr.Full,panOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=l(null),m=$o(),g=l(0),y=l(0),b=l(),{userSelectionActive:w,elementsSelectable:x,dragging:E}=zo(ei,B),S=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},_=e=>{i?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},k=c?e=>c(e):void 0,C=x&&(e||w);return t.createElement("div",{className:v(["react-flow__pane",{dragging:E,selection:e}]),onClick:C?void 0:Ja(_,h),onContextMenu:Ja(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():s?.(e)},h),onWheel:Ja(k,h),onMouseEnter:C?void 0:u,onMouseDown:C?t=>{const{resetSelectedElements:n,domNode:o}=m.getState();if(b.current=o?.getBoundingClientRect(),!x||!e||0!==t.button||t.target!==h.current||!b.current)return;const{x:a,y:i}=or(t,b.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),r?.(t)}:void 0,onMouseMove:C?t=>{const{userSelectionRect:o,nodeInternals:r,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!b.current||!o)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=or(t,b.current),f=o.startX??0,p=o.startY??0,h={...o,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},v=u(),w=Lr(r,h,i,n===dr.Partial,!0,c),x=Br(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Qa(v,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Qa(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:C?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!w&&t&&e.target===h.current&&_?.(e),m.setState({nodesSelectionActive:g.current>0}),S(),a?.(e)}:void 0,onMouseLeave:C?e=>{w&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),S()}:f,ref:h,style:Ba},p,t.createElement(Ka,null))});function ni(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return!!o&&(!!o.selected||ni(o,t))}function oi(e,t,n){let o=e;do{if(o?.matches(t))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function ri(e,t,n,o){return Array.from(e.values()).filter(n=>(n.selected||n.id===o)&&(!n.parentNode||n.parentId||!ni(n,e))&&(n.draggable||t&&void 0===n.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent}))}function ai(e,t,n,o,r=[0,0],a){const i=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||o);let s=i;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:o,y:a}=zr(t,r).positionAbsolute;s=[[e.extent[0][0]+o,e.extent[0][1]+a],[e.extent[1][0]+o,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:o,y:a}=zr(t,r).positionAbsolute;s=t&&Go(o)&&Go(a)&&Go(t.width)&&Go(t.height)?[[o+e.width*r[0],a+e.height*r[1]],[o+t.width-e.width+e.width*r[0],a+t.height-e.height+e.height*r[1]]]:s}else a?.("005",Mo()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=zr(e,r).positionAbsolute}const u=s&&"parent"!==s?Vo(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function ii({nodeId:e,dragItems:t,nodeInternals:n}){const o=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?o.find(t=>t.id===e):o[0],o]}ti.displayName="Pane";const si=(e,t,n,o)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const a=Array.from(r),i=t.getBoundingClientRect(),s=i.width*o[0],l=i.height*o[1];return a.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-i.left-s)/n,y:(t.top-i.top-l)/n,...jo(e)}})};function li(e,t,n){return void 0===n?n:o=>{const r=t().nodeInternals.get(e);r&&n(o,{...r})}}function ci({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:i,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):l?.("012",To(e))}function ui(e){return(t,n,o)=>e?.(t,o)}function di({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:a,selectNodesOnDrag:c}){const d=$o(),[f,p]=u(!1),h=l([]),m=l({x:null,y:null}),g=l(0),y=l(null),v=l({x:0,y:0}),b=l(null),w=l(!1),x=l(!1),E=l(!1),S=function(){const e=$o(),t=s(({sourceEvent:t})=>{const{transform:n,snapGrid:o,snapToGrid:r}=e.getState(),a=t.touches?t.touches[0].clientX:t.clientX,i=t.touches?t.touches[0].clientY:t.clientY,s={x:(a-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(s.x/o[0]):s.x,ySnapped:r?o[1]*Math.round(s.y/o[1]):s.y,...s}},[]);return t}();return i(()=>{if(e?.current){const i=ot(e.current),s=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:o,onSelectionDrag:a,updateNodePositions:i,nodeExtent:s,snapGrid:l,snapToGrid:c,nodeOrigin:u,onError:f}=d.getState();m.current={x:e,y:t};let g=!1,y={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&s){const e=$r(h.current,u);y=Uo(e)}if(h.current=h.current.map(o=>{const r={x:e-o.distance.x,y:t-o.distance.y};c&&(r.x=l[0]*Math.round(r.x/l[0]),r.y=l[1]*Math.round(r.y/l[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];h.current.length>1&&s&&!o.extent&&(a[0][0]=o.positionAbsolute.x-y.x+s[0][0],a[1][0]=o.positionAbsolute.x+(o.width??0)-y.x2+s[1][0],a[0][1]=o.positionAbsolute.y-y.y+s[0][1],a[1][1]=o.positionAbsolute.y+(o.height??0)-y.y2+s[1][1]);const i=ai(o,r,n,a,u,f);return g=g||o.position.x!==i.position.x||o.position.y!==i.position.y,o.position=i.position,o.positionAbsolute=i.positionAbsolute,o}),!g)return;i(h.current,!0,!0),p(!0);const v=r?o:ui(a);if(v&&b.current){const[e,t]=ii({nodeId:r,dragItems:h.current,nodeInternals:n});v(b.current,e,t)}},l=()=>{if(!y.current)return;const[e,t]=Xo(v.current,y.current);if(0!==e||0!==t){const{transform:n,panBy:o}=d.getState();m.current.x=(m.current.x??0)-e/n[2],m.current.y=(m.current.y??0)-t/n[2],o({x:e,y:t})&&s(m.current)}g.current=requestAnimationFrame(l)},u=t=>{const{nodeInternals:n,multiSelectionActive:o,nodesDraggable:i,unselectNodesAndEdges:s,onNodeDragStart:l,onSelectionDragStart:u}=d.getState();x.current=!0;const f=r?l:ui(u);c&&a||o||!r||n.get(r)?.selected||s(),r&&a&&c&&ci({id:r,store:d,nodeRef:e});const p=S(t);if(m.current=p,h.current=ri(n,i,p,r),f&&h.current){const[e,o]=ii({nodeId:r,dragItems:h.current,nodeInternals:n});f(t.sourceEvent,e,o)}};if(!t){const t=function(){var e,t,n,o,r=pt,a=ht,i=mt,s=gt,l={},c=F("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,at).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!o&&r.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(ot(i.view).on("mousemove.drag",h,it).on("mouseup.drag",m,it),ct(i.view),st(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(o){if(lt(o),!n){var r=o.clientX-e,a=o.clientY-t;n=r*r+a*a>d}l.mouse("drag",o)}function m(e){ot(e.view).on("mousemove.drag mouseup.drag",null),ut(e.view,n),lt(e),l.mouse("end",e)}function g(e,t){if(r.call(this,e,t)){var n,o,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(o=b(this,s,e,t,i[n].identifier,i[n]))&&(st(e),o("start",e,i[n]))}}function y(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=l[o[t].identifier])&&(lt(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,a=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<a;++t)(n=l[r[t].identifier])&&(st(e),n("end",e,r[t]))}function b(e,t,n,o,r,a){var s,d,p,h=c.copy(),m=rt(a||n,t);if(null!=(p=i.call(e,new ft("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),o)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,y=m;switch(a){case"start":l[r]=n,g=u++;break;case"end":delete l[r],--u;case"drag":m=rt(c||i,t),g=u}h.call(a,e,new ft(a,{sourceEvent:i,subject:p,target:f,identifier:r,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:dt(!!e),f):r},f.container=function(e){return arguments.length?(a="function"==typeof e?e:dt(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:dt(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:dt(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",e=>{const{domNode:t,nodeDragThreshold:n}=d.getState();0===n&&u(e),E.current=!1;const o=S(e);m.current=o,y.current=t?.getBoundingClientRect()||null,v.current=or(e.sourceEvent,y.current)}).on("drag",e=>{const t=S(e),{autoPanOnNodeDrag:n,nodeDragThreshold:o}=d.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(E.current=!0),!E.current){if(!w.current&&x.current&&n&&(w.current=!0,l()),!x.current){const n=t.xSnapped-(m?.current?.x??0),r=t.ySnapped-(m?.current?.y??0);Math.sqrt(n*n+r*r)>o&&u(e)}(m.current.x!==t.xSnapped||m.current.y!==t.ySnapped)&&h.current&&x.current&&(b.current=e.sourceEvent,v.current=or(e.sourceEvent,y.current),s(t))}}).on("end",e=>{if(x.current&&!E.current&&(p(!1),w.current=!1,x.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:o,onSelectionDragStop:a}=d.getState(),i=r?o:ui(a);if(t(h.current,!1,!1),i){const[t,o]=ii({nodeId:r,dragItems:h.current,nodeInternals:n});i(e.sourceEvent,t,o)}}}).filter(t=>{const r=t.target;return!t.button&&(!n||!oi(r,`.${n}`,e))&&(!o||oi(r,o,e))});return i.call(t),()=>{i.on(".drag",null)}}i.on(".drag",null)}},[e,t,n,o,a,d,r,c,S]),f}function fi(){const e=$o(),t=s(t=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=e.getState(),u=a().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=i?s[0]:5,f=i?s[1]:5,p=t.isShiftPressed?4:1,h=t.x*d*p,m=t.y*f*p,g=u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:r,position:a}=ai(e,t,n,o,void 0,l);e.position=a,e.positionAbsolute=r}return e});r(g,!0,!1)},[]);return t}const pi={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var hi=e=>{const n=({id:n,type:o,data:r,xPos:a,yPos:s,xPosOrigin:c,yPosOrigin:u,selected:d,onClick:f,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:g,onDoubleClick:y,style:b,className:w,isDraggable:x,isSelectable:E,isConnectable:S,isFocusable:_,selectNodesOnDrag:k,sourcePosition:C,targetPosition:N,hidden:M,resizeObserver:O,dragHandle:P,zIndex:A,isParent:R,noDragClassName:D,noPanClassName:T,initialized:I,disableKeyboardA11y:z,ariaLabel:$,rfId:L,hasHandleBounds:B})=>{const H=$o(),F=l(null),j=l(null),W=l(C),V=l(N),Y=l(o),X=E||x||f||p||h||m,K=fi(),U=li(n,H.getState,p),q=li(n,H.getState,h),Z=li(n,H.getState,m),G=li(n,H.getState,g),Q=li(n,H.getState,y);i(()=>()=>{j.current&&(O?.unobserve(j.current),j.current=null)},[]),i(()=>{if(F.current&&!M){const e=F.current;I&&B&&j.current===e||(j.current&&O?.unobserve(j.current),O?.observe(e),j.current=e)}},[M,I,B]),i(()=>{const e=Y.current!==o,t=W.current!==C,r=V.current!==N;F.current&&(e||t||r)&&(e&&(Y.current=o),t&&(W.current=C),r&&(V.current=N),H.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,o,C,N]);const J=di({nodeRef:F,disabled:M||!x,noDragClassName:D,handleSelector:P,nodeId:n,isSelectable:E,selectNodesOnDrag:k});return M?null:t.createElement("div",{className:v(["react-flow__node",`react-flow__node-${o}`,{[T]:x},w,{selected:d,selectable:E,parent:R,dragging:J}]),ref:F,style:{zIndex:A,transform:`translate(${c}px,${u}px)`,pointerEvents:X?"all":"none",visibility:I?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:U,onMouseMove:q,onMouseLeave:Z,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:t}=H.getState();if(E&&(!k||!x||t>0)&&ci({id:n,store:H,nodeRef:F}),f){const t=H.getState().nodeInternals.get(n);t&&f(e,{...t})}},onDoubleClick:Q,onKeyDown:_?e=>{if(!tr(e)&&!z)if(Jo.includes(e.key)&&E){const t="Escape"===e.key;ci({id:n,store:H,unselect:t,nodeRef:F})}else x&&d&&Object.prototype.hasOwnProperty.call(pi,e.key)&&(H.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),K({x:pi[e.key].x,y:pi[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":z?void 0:`${ba}-${L}`,"aria-label":$},t.createElement(Pr,{value:n},t.createElement(e,{id:n,data:r,type:o,xPos:a,yPos:s,selected:d,isConnectable:S,sourcePosition:C,targetPosition:N,dragging:J,dragHandle:P,zIndex:A})))};return n.displayName="NodeWrapper",o(n)};const mi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...$r(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var gi=o(function({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:o}){const r=$o(),{width:a,height:s,x:c,y:u,transformString:d,userSelectionActive:f}=zo(mi,B),p=fi(),h=l(null);if(i(()=>{o||h.current?.focus({preventScroll:!0})},[o]),di({nodeRef:h}),f||!a||!s)return null;const m=e?t=>{const n=r.getState().getNodes().filter(e=>e.selected);e(t,n)}:void 0;return t.createElement("div",{className:v(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},t.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:o?void 0:-1,onKeyDown:o?void 0:e=>{Object.prototype.hasOwnProperty.call(pi,e.key)&&p({x:pi[e.key].x,y:pi[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:u,left:c}}))});const yi=e=>e.nodesSelectionActive,vi=({children:e,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,deleteKeyCode:c,onMove:u,onMoveStart:d,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:C,zoomOnDoubleClick:N,panOnDrag:M,defaultViewport:O,translateExtent:P,minZoom:A,maxZoom:R,preventScrolling:D,onSelectionContextMenu:T,noWheelClassName:I,noPanClassName:z,disableKeyboardA11y:$})=>{const L=zo(yi),B=_a(p),H=_a(b),F=H||M,j=H||_,W=B||h&&!0!==F;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=$o(),{deleteElements:o}=$a(),r=_a(e,La),a=_a(t);i(()=>{if(r){const{edges:e,getNodes:t}=n.getState(),r=t().filter(e=>e.selected),a=e.filter(e=>e.selected);o({nodes:r,edges:a}),n.setState({nodesSelectionActive:!1})}},[r]),i(()=>{n.setState({multiSelectionActive:a})},[a])})({deleteKeyCode:c,multiSelectionKeyCode:v}),t.createElement(Ya,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:k,panOnScrollMode:C,zoomOnDoubleClick:N,panOnDrag:!B&&F,defaultViewport:O,translateExtent:P,minZoom:A,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:D,noWheelClassName:I,noPanClassName:z},t.createElement(ti,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:F,isSelecting:!!W,selectionMode:m},e,L&&t.createElement(gi,{onSelectionContextMenu:T,noPanClassName:z,disableKeyboardA11y:$})))};vi.displayName="FlowRenderer";var bi=o(vi);function wi(e){return{...{input:hi(e.input||oa),default:hi(e.default||ta),output:hi(e.output||aa),group:hi(e.group||ia)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=hi(e[n]||ta),t),{})}}const xi=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ei=e=>{const{nodesDraggable:n,nodesConnectable:o,nodesFocusable:a,elementsSelectable:c,updateNodeDimensions:u,onError:d}=zo(xi,B),f=(p=e.onlyRenderVisibleElements,zo(s(e=>p?Lr(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[p])));var p;const h=l(),m=r(()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver(e=>{const t=e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}));u(t)});return h.current=e,e},[]);return i(()=>()=>{h?.current?.disconnect()},[]),t.createElement("div",{className:"react-flow__nodes",style:Ba},f.map(r=>{let i=r.type||"default";e.nodeTypes[i]||(d?.("003",Co(i)),i="default");const s=e.nodeTypes[i]||e.nodeTypes.default,l=!!(r.draggable||n&&void 0===r.draggable),u=!!(r.selectable||c&&void 0===r.selectable),f=!!(r.connectable||o&&void 0===r.connectable),p=!!(r.focusable||a&&void 0===r.focusable),h=e.nodeExtent?Vo(r.positionAbsolute,e.nodeExtent):r.positionAbsolute,g=h?.x??0,y=h?.y??0,v=(({x:e,y:t,width:n,height:o,origin:r})=>n&&o?r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-o*r[1]}:{x:e,y:t})({x:g,y:y,width:r.width??0,height:r.height??0,origin:e.nodeOrigin});return t.createElement(s,{key:r.id,id:r.id,className:r.className,style:r.style,type:i,data:r.data,sourcePosition:r.sourcePosition||hr.Bottom,targetPosition:r.targetPosition||hr.Top,hidden:r.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!r.selected,isDraggable:l,isSelectable:u,isConnectable:f,isFocusable:p,resizeObserver:m,dragHandle:r.dragHandle,zIndex:r[Qo]?.z??0,isParent:!!r[Qo]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!r.width&&!!r.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:r.ariaLabel,hasHandleBounds:!!r[Qo]?.handleBounds})}))};Ei.displayName="NodeRenderer";var Si=o(Ei);const _i=(e,t,n)=>n===hr.Left?e-t:n===hr.Right?e+t:e,ki=(e,t,n)=>n===hr.Top?e-t:n===hr.Bottom?e+t:e,Ci="react-flow__edgeupdater",Ni=({position:e,centerX:n,centerY:o,radius:r=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:l})=>t.createElement("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:v([Ci,`${Ci}-${l}`]),cx:_i(n,r,e),cy:ki(o,r,e),r:r,stroke:"transparent",fill:"transparent"}),Mi=()=>!0;var Oi=e=>{const n=({id:n,className:o,type:a,data:i,onClick:s,onEdgeDoubleClick:c,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,style:w,source:x,target:E,sourceX:S,sourceY:_,targetX:k,targetY:C,sourcePosition:N,targetPosition:M,elementsSelectable:O,hidden:P,sourceHandleId:A,targetHandleId:R,onContextMenu:D,onMouseEnter:T,onMouseMove:I,onMouseLeave:z,reconnectRadius:$,onReconnect:L,onReconnectStart:B,onReconnectEnd:H,markerEnd:F,markerStart:j,rfId:W,ariaLabel:V,isFocusable:Y,isReconnectable:X,pathOptions:K,interactionWidth:U,disableKeyboardA11y:q})=>{const Z=l(null),[G,Q]=u(!1),[J,ee]=u(!1),te=$o(),ne=r(()=>`url('#${Rr(j,W)}')`,[j,W]),oe=r(()=>`url('#${Rr(F,W)}')`,[F,W]);if(P)return null;const re=ir(n,te.getState,c),ae=ir(n,te.getState,D),ie=ir(n,te.getState,T),se=ir(n,te.getState,I),le=ir(n,te.getState,z),ce=(e,t)=>{if(0!==e.button)return;const{edges:o,isValidConnection:r}=te.getState(),a=t?E:x,i=(t?R:A)||null,s=t?"target":"source",l=r||Mi,c=t,u=o.find(e=>e.id===n);ee(!0),B?.(e,u,s);qr({event:e,handleId:i,nodeId:a,onConnect:e=>L?.(u,e),isTarget:c,getState:te.getState,setState:te.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{ee(!1),H?.(e,u,s)}})},ue=()=>Q(!0),de=()=>Q(!1),fe=!O&&!s;return t.createElement("g",{className:v(["react-flow__edge",`react-flow__edge-${a}`,o,{selected:d,animated:f,inactive:fe,updating:G}]),onClick:e=>{const{edges:t,addSelectedEdges:o,unselectNodesAndEdges:r,multiSelectionActive:a}=te.getState(),i=t.find(e=>e.id===n);i&&(O&&(te.setState({nodesSelectionActive:!1}),i.selected&&a?(r({nodes:[],edges:[i]}),Z.current?.blur()):o([n])),s&&s(e,i))},onDoubleClick:re,onContextMenu:ae,onMouseEnter:ie,onMouseMove:se,onMouseLeave:le,onKeyDown:Y?e=>{if(!q&&Jo.includes(e.key)&&O){const{unselectNodesAndEdges:t,addSelectedEdges:o,edges:r}=te.getState();"Escape"===e.key?(Z.current?.blur(),t({edges:[r.find(e=>e.id===n)]})):o([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===V?void 0:V||`Edge from ${x} to ${E}`,"aria-describedby":Y?`${wa}-${W}`:void 0,ref:Z},!J&&t.createElement(e,{id:n,source:x,target:E,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,data:i,style:w,sourceX:S,sourceY:_,targetX:k,targetY:C,sourcePosition:N,targetPosition:M,sourceHandleId:A,targetHandleId:R,markerStart:ne,markerEnd:oe,pathOptions:K,interactionWidth:U}),X&&t.createElement(t.Fragment,null,("source"===X||!0===X)&&t.createElement(Ni,{position:N,centerX:S,centerY:_,radius:$,onMouseDown:e=>ce(e,!0),onMouseEnter:ue,onMouseOut:de,type:"source"}),("target"===X||!0===X)&&t.createElement(Ni,{position:M,centerX:k,centerY:C,radius:$,onMouseDown:e=>ce(e,!1),onMouseEnter:ue,onMouseOut:de,type:"target"})))};return n.displayName="EdgeWrapper",o(n)};function Pi(e){return{...{default:Oi(e.default||Mr),straight:Oi(e.bezier||_r),step:Oi(e.step||Sr),smoothstep:Oi(e.step||Er),simplebezier:Oi(e.simplebezier||yr)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=Oi(e[n]||Mr),t),{})}}function Ai(e,t,n=null){const o=(n?.x||0)+t.x,r=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case hr.Top:return{x:o+a/2,y:r};case hr.Right:return{x:o+a,y:r+i/2};case hr.Bottom:return{x:o+a/2,y:r+i};case hr.Left:return{x:o,y:r+i/2}}}function Ri(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function Di(e){const t=e?.[Qo]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Ti=[{level:0,isMaxLevel:!0,edges:[]}];function Ii(e,t,n){return function(e,t,n=!1){let o=-1;const r=e.reduce((e,r)=>{const a=Go(r.zIndex);let i=a?r.zIndex:0;if(n){const e=t.get(r.target),n=t.get(r.source),o=r.selected||e?.selected||n?.selected,s=Math.max(n?.[Qo]?.z||0,e?.[Qo]?.z||0,1e3);i=(a?r.zIndex:0)+(o?s:0)}return e[i]?e[i].push(r):e[i]=[r],o=i>o?i:o,e},{}),a=Object.entries(r).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===o}});return 0===a.length?Ti:a}(zo(s(n=>e?n.edges.filter(e=>{const o=t.get(e.source),r=t.get(e.target);return o?.width&&o?.height&&r?.width&&r?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:a,width:i,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Uo({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:i/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:r.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:r.width,targetHeight:r.height,width:n.width,height:n.height,transform:n.transform})}):n.edges,[e,t])),t,n)}const zi={[pr.Arrow]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[pr.ArrowClosed]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const $i=({id:e,type:n,color:o,width:a=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=$o();return r(()=>Object.prototype.hasOwnProperty.call(zi,e)?zi[e]:(t.getState().onError?.("009",Po(e)),null),[e])}(n);return u?t.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0"},t.createElement(u,{color:o,strokeWidth:l})):null},Li=({defaultColor:e,rfId:n})=>{const o=zo(s((({defaultColor:e,rfId:t})=>n=>{const o=[];return n.edges.reduce((n,r)=>([r.markerStart,r.markerEnd].forEach(r=>{if(r&&"object"==typeof r){const a=Rr(r,t);o.includes(a)||(n.push({id:a,color:r.color||e,...r}),o.push(a))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:e,rfId:n}),[e,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return t.createElement("defs",null,o.map(e=>t.createElement($i,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient})))};Li.displayName="MarkerDefinitions";var Bi=o(Li);const Hi=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Fi=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:o,rfId:r,edgeTypes:a,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:k,nodeInternals:C,onError:N}=zo(Hi,B),M=Ii(n,C,o);return S?t.createElement(t.Fragment,null,M.map(({level:n,edges:o,isMaxLevel:y})=>t.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},y&&t.createElement(Bi,{defaultColor:e,rfId:r}),t.createElement("g",null,o.map(e=>{const[n,o,y]=Di(C.get(e.source)),[S,_,M]=Di(C.get(e.target));if(!y||!M)return null;let O=e.type||"default";a[O]||(N?.("011",Do(O)),O="default");const P=a[O]||a.default,A=k===cr.Strict?_.target:(_.target??[]).concat(_.source??[]),R=Ri(o.source,e.sourceHandle),D=Ri(A,e.targetHandle),T=R?.position||hr.Bottom,I=D?.position||hr.Top,z=!!(e.focusable||w&&void 0===e.focusable),$=e.reconnectable||e.updatable,L=void 0!==p&&($||x&&void 0===$);if(!R||!D)return N?.("008",Ao(R,e)),null;const{sourceX:B,sourceY:H,targetX:F,targetY:j}=((e,t,n,o,r,a)=>{const i=Ai(n,e,t),s=Ai(a,o,r);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,R,T,S,D,I);return t.createElement(P,{key:e.id,id:e.id,className:v([e.className,i]),type:O,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:B,sourceY:H,targetX:F,targetY:j,sourcePosition:T,targetPosition:I,elementsSelectable:E,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:r,ariaLabel:e.ariaLabel,isFocusable:z,isReconnectable:L,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:b})})))),y):null};Fi.displayName="EdgeRenderer";var ji=o(Fi);const Wi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Vi({children:e}){const n=zo(Wi);return t.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}const Yi={[hr.Left]:hr.Right,[hr.Right]:hr.Left,[hr.Top]:hr.Bottom,[hr.Bottom]:hr.Top},Xi=({nodeId:e,handleType:n,style:o,type:r=fr.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:l,handleId:c,toX:u,toY:d,connectionMode:f}=zo(s(t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode}),[e]),B),p=l?.[Qo]?.handleBounds;let h=p?.[n];if(f===cr.Loose&&(h=h||p?.["source"===n?"target":"source"]),!l||!h)return null;const m=c?h.find(e=>e.id===c):h[0],g=m?m.x+m.width/2:(l.width??0)/2,y=m?m.y+m.height/2:l.height??0,v=(l.positionAbsolute?.x??0)+g,b=(l.positionAbsolute?.y??0)+y,w=m?.position,x=w?Yi[w]:null;if(!w||!x)return null;if(a)return t.createElement(a,{connectionLineType:r,connectionLineStyle:o,fromNode:l,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:i});let E="";const S={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return r===fr.Bezier?[E]=Nr(S):r===fr.Step?[E]=xr({...S,borderRadius:0}):r===fr.SmoothStep?[E]=xr(S):r===fr.SimpleBezier?[E]=gr(S):E=`M${v},${b} ${u},${d}`,t.createElement("path",{d:E,fill:"none",className:"react-flow__connection-path",style:o})};Xi.displayName="ConnectionLine";const Ki=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ui({containerStyle:e,style:n,type:o,component:r}){const{nodeId:a,handleType:i,nodesConnectable:s,width:l,height:c,connectionStatus:u}=zo(Ki,B);return!!(a&&i&&l&&s)?t.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},t.createElement("g",{className:v(["react-flow__connection",u])},t.createElement(Xi,{nodeId:a,handleType:i,style:n,type:o,CustomComponent:r,connectionStatus:u}))):null}function qi(e,t){const n=l(null),o=$o();return r(()=>{if("development"===process.env.NODE_ENV){const t=Object.keys(e);B(n.current,t)&&o.getState().onError?.("002",ko()),n.current=t}return t(e)},[e])}const Zi=({nodeTypes:e,edgeTypes:n,onMove:o,onMoveStart:r,onMoveEnd:a,onInit:s,onNodeClick:c,onEdgeClick:u,onNodeDoubleClick:d,onEdgeDoubleClick:f,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:x,connectionLineComponent:E,connectionLineContainerStyle:S,selectionKeyCode:_,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:O,deleteKeyCode:P,onlyRenderVisibleElements:A,elementsSelectable:R,selectNodesOnDrag:D,defaultViewport:T,translateExtent:I,minZoom:z,maxZoom:$,preventScrolling:L,defaultMarkerColor:B,zoomOnScroll:H,zoomOnPinch:F,panOnScroll:j,panOnScrollSpeed:W,panOnScrollMode:V,zoomOnDoubleClick:Y,panOnDrag:X,onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneScroll:G,onPaneContextMenu:Q,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:oe,onReconnectStart:re,onReconnectEnd:ae,reconnectRadius:ie,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,elevateEdgesOnSelect:ue,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})=>{const me=qi(e,wi),ge=qi(n,Pi);return function(e){const t=$a(),n=l(!1);i(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(s),t.createElement(bi,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:P,selectionKeyCode:_,selectionOnDrag:k,selectionMode:C,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:O,elementsSelectable:R,onMove:o,onMoveStart:r,onMoveEnd:a,zoomOnScroll:H,zoomOnPinch:F,zoomOnDoubleClick:Y,panOnScroll:j,panOnScrollSpeed:W,panOnScrollMode:V,panOnDrag:X,defaultViewport:T,translateExtent:I,minZoom:z,maxZoom:$,onSelectionContextMenu:y,preventScrolling:L,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,disableKeyboardA11y:de},t.createElement(Vi,null,t.createElement(ji,{edgeTypes:ge,onEdgeClick:u,onEdgeDoubleClick:f,onlyRenderVisibleElements:A,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:oe,onReconnectStart:re,onReconnectEnd:ae,reconnectRadius:ie,defaultMarkerColor:B,noPanClassName:ce,elevateEdgesOnSelect:!!ue,disableKeyboardA11y:de,rfId:he},t.createElement(Ui,{style:x,type:w,component:E,containerStyle:S})),t.createElement("div",{className:"react-flow__edgelabel-renderer"}),t.createElement(Si,{nodeTypes:me,onNodeClick:c,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,selectNodesOnDrag:D,onlyRenderVisibleElements:A,noPanClassName:ce,noDragClassName:se,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})))};Zi.displayName="GraphView";var Gi=o(Zi);const Qi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ji={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Qi,nodeExtent:Qi,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:cr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:er,isValidConnection:void 0},es=()=>{return e=(e,t)=>({...Ji,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:a}=t();e({nodeInternals:Oa(n,o,r,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=t();e({edges:n.map(e=>({...o,...e}))})},setDefaultNodesAndEdges:(n,o)=>{const r=void 0!==n,a=void 0!==o,i=r?Oa(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?o:[],hasDefaultNodes:r,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:a,fitViewOnInitDone:i,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=r.get(t.id);if(n?.hidden)r.set(n.id,{...n,[Qo]:{...n[Qo],handleBounds:void 0}});else if(n){const o=jo(t.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||t.forceUpdate)&&(r.set(n.id,{...n,[Qo]:{...n[Qo],handleBounds:{source:si(".source",t.nodeElement,f,c),target:si(".target",t.nodeElement,f,c)}},...o}),e.push({id:n.id,type:"dimensions",dimensions:o}))}return e},[]);Ma(r,c);const h=i||a&&!i&&Pa(t,{initial:!0,...s});e({nodeInternals:new Map(r),fitViewOnInitDone:h}),p?.length>0&&o?.(p)},updateNodePositions:(e,n=!0,o=!1)=>{const{triggerNodeChanges:r}=t(),a=e.map(e=>{const t={id:e.id,type:"position",dragging:o};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});r(a)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=Oa(Za(n,s()),r,i,l);e({nodeInternals:t})}o?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ga(e,!0)):(i=Qa(a(),n),s=Qa(r,[])),Da({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ga(e,!0)):(i=Qa(r,n),s=Qa(a(),[])),Da({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:a}=t(),i=o||r;Da({changedNodes:(n||a()).map(e=>(e.selected=!1,Ga(e.id,!1))),changedEdges:i.map(e=>Ga(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=t();o?.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=t();o?.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=t();Da({changedNodes:o().filter(e=>e.selected).map(e=>Ga(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ga(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:o}=t();o.forEach(e=>{e.positionAbsolute=Vo(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(o)})},panBy:e=>{const{transform:n,width:o,height:r,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=ho.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[o,r]],u=a?.constrain()(l,c,s);return a.transform(i,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:Ji.connectionNodeId,connectionHandleId:Ji.connectionHandleId,connectionHandleType:Ji.connectionHandleType,connectionStatus:Ji.connectionStatus,connectionStartHandle:Ji.connectionStartHandle,connectionEndHandle:Ji.connectionEndHandle}),reset:()=>e({...Ji})}),t=Object.is,e?L(e,t):L;var e,t},ts=({children:e})=>{const n=l(null);return n.current||(n.current=es()),t.createElement(_o,{value:n.current},e)};ts.displayName="ReactFlowProvider";const ns=({children:e})=>c(So)?t.createElement(t.Fragment,null,e):t.createElement(ts,null,e);ns.displayName="ReactFlowWrapper";const os={input:oa,default:ta,output:aa,group:ia},rs={default:Mr,straight:_r,step:Sr,smoothstep:Er,simplebezier:yr},as=[0,0],is=[15,15],ss={x:0,y:0,zoom:1},ls={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},cs=a(({nodes:e,edges:n,defaultNodes:o,defaultEdges:r,className:a,nodeTypes:i=os,edgeTypes:s=rs,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:O,onSelectionChange:P,onSelectionDragStart:A,onSelectionDrag:R,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,connectionMode:$=cr.Strict,connectionLineType:L=fr.Bezier,connectionLineStyle:B,connectionLineComponent:H,connectionLineContainerStyle:F,deleteKeyCode:j="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:V=!1,selectionMode:Y=dr.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(rr()?"Meta":"Control"),zoomActivationKeyCode:U=(rr()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=is,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=as,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,defaultViewport:ie=ss,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Qi,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=ur.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:ke,children:Ce,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ae,onEdgeUpdate:Re,onEdgeUpdateStart:De,onEdgeUpdateEnd:Te,onReconnect:Ie,onReconnectStart:ze,onReconnectEnd:$e,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:He,onEdgesChange:Fe,noDragClassName:je="nodrag",noWheelClassName:We="nowheel",noPanClassName:Ve="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:ot,onError:rt,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return t.createElement("div",{...lt,style:{...at,...ls},ref:ct,className:v(["react-flow",a]),"data-testid":"rf__wrapper",id:it},t.createElement(ns,null,t.createElement(Gi,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:H,connectionLineContainerStyle:F,selectionKeyCode:W,selectionOnDrag:V,selectionMode:Y,deleteKeyCode:j,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:ke,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Ae,onReconnect:Ie??Re,onReconnectStart:ze??De,onReconnectEnd:$e??Te,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:je,noWheelClassName:We,noPanClassName:Ve,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),t.createElement(ga,{nodes:e,edges:n,defaultNodes:o,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:He,onEdgesChange:Fe,snapToGrid:q,snapGrid:Z,connectionMode:$,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:O,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:R,onSelectionDragStart:A,onSelectionDragStop:D,noPanClassName:Ve,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:rt,connectionRadius:nt,isValidConnection:ot,nodeDragThreshold:st}),t.createElement(fa,{onSelectionChange:P}),Ce,t.createElement(Ho,{proOptions:qe,position:Ue}),t.createElement(Sa,{rfId:ut,disableKeyboardA11y:Je})))});function us(e){return t=>{const[n,o]=u(t),r=s(t=>o(n=>e(t,n)),[]);return[n,o,r]}}cs.displayName="ReactFlow";const ds=us(Za),fs=us(function(e,t){return qa(e,t)});var ps;function hs({color:e,dimensions:n,lineWidth:o}){return t.createElement("path",{stroke:e,strokeWidth:o,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function ms({color:e,radius:n}){return t.createElement("circle",{cx:n,cy:n,r:n,fill:e})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ps||(ps={}));const gs={[ps.Dots]:"#91919a",[ps.Lines]:"#eee",[ps.Cross]:"#e2e2e2"},ys={[ps.Dots]:1,[ps.Lines]:1,[ps.Cross]:6},vs=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bs({id:e,variant:n=ps.Dots,gap:o=20,size:r,lineWidth:a=1,offset:i=2,color:s,style:c,className:u}){const d=l(null),{transform:f,patternId:p}=zo(vs,B),h=s||gs[n],m=r||ys[n],g=n===ps.Dots,y=n===ps.Cross,b=Array.isArray(o)?o:[o,o],w=[b[0]*f[2]||1,b[1]*f[2]||1],x=m*f[2],E=y?[x,x]:w,S=g?[x/i,x/i]:[E[0]/i,E[1]/i];return t.createElement("svg",{className:v(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},t.createElement("pattern",{id:p+e,x:f[0]%w[0],y:f[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`},g?t.createElement(ms,{color:h,radius:x/i}):t.createElement(hs,{dimensions:E,color:h,lineWidth:a})),t.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}bs.displayName="Background";var ws=o(bs);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
29
29
  /**
30
30
  * @license lucide-react v0.525.0 - ISC
31
31
  *
@@ -45,11 +45,119 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
45
45
  *
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
- */const Ns=a(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:i,...s},l)=>d("svg",{ref:l,..._s,width:t,height:t,stroke:e,strokeWidth:o?24*Number(n)/Number(t):n,className:Es("lucide",r),...!a&&!Ss(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>d(e,t)),...Array.isArray(a)?a:[a]])),Cs=(e,t)=>{const n=a(({className:n,...o},r)=>{return d(Ns,{ref:r,iconNode:t,className:Es(`lucide-${a=xs(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o});var a});return n.displayName=xs(e),n},ks=Cs("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ms=Cs("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Os=Cs("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ps=Cs("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Rs=Cs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),As=Cs("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ds=Cs("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Ts=({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,style:c={},markerEnd:d,bidirectional:f=!1,data:p,clientToSvgCoords:h,svgRef:m})=>{u(!1);const[g,y,v]=r(()=>kr({sourceX:n,sourceY:o,targetX:a,targetY:i}),[n,o,a,i]),b=Object.assign(Object.assign({},c),{stroke:(()=>{var e;switch(null===(e=null==p?void 0:p.details)||void 0===e?void 0:e.state){case"Open":case"Completed":return"#000000";case"Error":return"#ef4444";default:return c.stroke||"#000000"}})(),strokeWidth:c.strokeWidth||2});return t.createElement(t.Fragment,null,t.createElement(ar,{path:g,style:b}))};
48
+ */const ks=a(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:i,...s},l)=>d("svg",{ref:l,..._s,width:t,height:t,stroke:e,strokeWidth:o?24*Number(n)/Number(t):n,className:Es("lucide",r),...!a&&!Ss(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>d(e,t)),...Array.isArray(a)?a:[a]])),Cs=(e,t)=>{const n=a(({className:n,...o},r)=>{return d(ks,{ref:r,iconNode:t,className:Es(`lucide-${a=xs(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o});var a});return n.displayName=xs(e),n},Ns=Cs("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ms=Cs("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Os=Cs("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ps=Cs("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),As=Cs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Rs=Cs("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ds=Cs("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Ts=({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,style:c={},markerEnd:d,bidirectional:f=!1,data:p,clientToSvgCoords:h,svgRef:m})=>{u(!1);const[g,y,v]=r(()=>Nr({sourceX:n,sourceY:o,targetX:a,targetY:i}),[n,o,a,i]),b=Object.assign(Object.assign({},c),{stroke:(()=>{var e;switch(null===(e=null==p?void 0:p.details)||void 0===e?void 0:e.state){case"Open":case"Completed":return"#000000";case"Error":return"#ef4444";default:return c.stroke||"#000000"}})(),strokeWidth:c.strokeWidth||2});return t.createElement(t.Fragment,null,t.createElement(ar,{path:g,style:b}))};
49
49
  /**
50
50
  * @license lucide-react v0.525.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */function Is(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Is(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function zs(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Is(e))&&(o&&(o+=" "),o+=t);return o}const Ls=e=>{const t=Fs(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),$s(n,t)||Hs(e)},getConflictingClassGroupIds:(e,t)=>{const r=n[e]||[];return t&&o[e]?[...r,...o[e]]:r}}},$s=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?$s(e.slice(1),o):void 0;if(r)return r;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},Bs=/^\[(.+)\]$/,Hs=e=>{if(Bs.test(e)){const t=Bs.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Fs=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const e in n)js(n[e],o,e,t);return o},js=(e,t,n,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Vs(t,e)).classGroupId=n)}if("function"==typeof e)return Ws(e)?void js(e(o),t,n,o):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,r])=>{js(r,Vs(t,e),n,o)})})},Vs=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Ws=e=>e.isThemeGetter,Ys=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(r,a)=>{n.set(r,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(r(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):r(e,t)}}},Xs=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=e=>{const t=[];let n,o=0,r=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===o&&0===r){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?o++:"]"===s?o--:"("===s?r++:")"===s&&r--}const i=0===t.length?e:e.substring(a),s=Ks(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=o;o=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=o;o=t=>n({className:t,parseClassName:e})}return o},Ks=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Us=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...o.sort(),e),o=[]):o.push(e)}),n.push(...o.sort()),n}},qs=/\s+/;function Zs(){let e,t,n=0,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Gs(e))&&(o&&(o+=" "),o+=t);return o}const Gs=e=>{if("string"==typeof e)return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Gs(e[o]))&&(n&&(n+=" "),n+=t);return n};function Qs(e,...t){let n,o,r,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Ys(e.cacheSize),parseClassName:Xs(e),sortModifiers:Us(e),...Ls(e)}))(l),o=n.cache.get,r=n.cache.set,a=i,i(s)};function i(e){const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a}=t,i=[],s=e.trim().split(qs);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=o(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=o(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=a(u).join(":"),y=d?g+"!":g,v=y+m;if(i.includes(v))continue;i.push(v);const b=r(m,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return r(e,a),a}return function(){return a(Zs.apply(null,arguments))}}const Js=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},el=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nl=/^\d+\/\d+$/,ol=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,al=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,il=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ll=e=>nl.test(e),cl=e=>!!e&&!Number.isNaN(Number(e)),ul=e=>!!e&&Number.isInteger(Number(e)),dl=e=>e.endsWith("%")&&cl(e.slice(0,-1)),fl=e=>ol.test(e),pl=()=>!0,hl=e=>rl.test(e)&&!al.test(e),ml=()=>!1,gl=e=>il.test(e),yl=e=>sl.test(e),vl=e=>!wl(e)&&!Cl(e),bl=e=>Dl(e,Ll,ml),wl=e=>el.test(e),xl=e=>Dl(e,$l,hl),El=e=>Dl(e,Bl,cl),Sl=e=>Dl(e,Il,ml),_l=e=>Dl(e,zl,yl),Nl=e=>Dl(e,Fl,gl),Cl=e=>tl.test(e),kl=e=>Tl(e,$l),Ml=e=>Tl(e,Hl),Ol=e=>Tl(e,Il),Pl=e=>Tl(e,Ll),Rl=e=>Tl(e,zl),Al=e=>Tl(e,Fl,!0),Dl=(e,t,n)=>{const o=el.exec(e);return!!o&&(o[1]?t(o[1]):n(o[2]))},Tl=(e,t,n=!1)=>{const o=tl.exec(e);return!!o&&(o[1]?t(o[1]):n)},Il=e=>"position"===e||"percentage"===e,zl=e=>"image"===e||"url"===e,Ll=e=>"length"===e||"size"===e||"bg-size"===e,$l=e=>"length"===e,Bl=e=>"number"===e,Hl=e=>"family-name"===e,Fl=e=>"shadow"===e,jl=Qs(()=>{const e=Js("color"),t=Js("font"),n=Js("text"),o=Js("font-weight"),r=Js("tracking"),a=Js("leading"),i=Js("breakpoint"),s=Js("container"),l=Js("spacing"),c=Js("radius"),u=Js("shadow"),d=Js("inset-shadow"),f=Js("text-shadow"),p=Js("drop-shadow"),h=Js("blur"),m=Js("perspective"),g=Js("aspect"),y=Js("ease"),v=Js("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Cl,wl],w=()=>[Cl,wl,l],x=()=>[ll,"full","auto",...w()],E=()=>[ul,"none","subgrid",Cl,wl],S=()=>["auto",{span:["full",ul,Cl,wl]},ul,Cl,wl],_=()=>[ul,"auto",Cl,wl],N=()=>["auto","min","max","fr",Cl,wl],C=()=>["auto",...w()],k=()=>[ll,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,Cl,wl],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ol,Sl,{position:[Cl,wl]}],P=()=>["auto","cover","contain",Pl,bl,{size:[Cl,wl]}],R=()=>[dl,kl,xl],A=()=>["","none","full",c,Cl,wl],D=()=>["",cl,kl,xl],T=()=>[cl,dl,Ol,Sl],I=()=>["","none",h,Cl,wl],z=()=>["none",cl,Cl,wl],L=()=>["none",cl,Cl,wl],$=()=>[cl,Cl,wl],B=()=>[ll,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fl],breakpoint:[fl],color:[pl],container:[fl],"drop-shadow":[fl],ease:["in","out","in-out"],font:[vl],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fl],shadow:[fl],spacing:["px",cl],text:[fl],"text-shadow":[fl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ll,wl,Cl,g]}],container:["container"],columns:[{columns:[cl,wl,Cl,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[ul,"auto",Cl,wl]}],basis:[{basis:[ll,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[cl,ll,"auto","initial","none",wl]}],grow:[{grow:["",cl,Cl,wl]}],shrink:[{shrink:["",cl,Cl,wl]}],order:[{order:[ul,"first","last","none",Cl,wl]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[s,"screen",...k()]}],"min-w":[{"min-w":[s,"screen","none",...k()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,kl,xl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Cl,El]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dl,wl]}],"font-family":[{font:[Ml,wl,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Cl,wl]}],"line-clamp":[{"line-clamp":[cl,"none",Cl,El]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Cl,wl]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Cl,wl]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[cl,"from-font","auto",Cl,xl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[cl,"auto",Cl,wl]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Cl,wl]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Cl,wl]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ul,Cl,wl],radial:["",Cl,wl],conic:[ul,Cl,wl]},Rl,_l]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[cl,Cl,wl]}],"outline-w":[{outline:["",cl,kl,xl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,Al,Nl]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,Al,Nl]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[cl,xl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,Al,Nl]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[cl,Cl,wl]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[cl]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Cl,wl]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[cl]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Cl,wl]}],filter:[{filter:["","none",Cl,wl]}],blur:[{blur:I()}],brightness:[{brightness:[cl,Cl,wl]}],contrast:[{contrast:[cl,Cl,wl]}],"drop-shadow":[{"drop-shadow":["","none",p,Al,Nl]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",cl,Cl,wl]}],"hue-rotate":[{"hue-rotate":[cl,Cl,wl]}],invert:[{invert:["",cl,Cl,wl]}],saturate:[{saturate:[cl,Cl,wl]}],sepia:[{sepia:["",cl,Cl,wl]}],"backdrop-filter":[{"backdrop-filter":["","none",Cl,wl]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[cl,Cl,wl]}],"backdrop-contrast":[{"backdrop-contrast":[cl,Cl,wl]}],"backdrop-grayscale":[{"backdrop-grayscale":["",cl,Cl,wl]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[cl,Cl,wl]}],"backdrop-invert":[{"backdrop-invert":["",cl,Cl,wl]}],"backdrop-opacity":[{"backdrop-opacity":[cl,Cl,wl]}],"backdrop-saturate":[{"backdrop-saturate":[cl,Cl,wl]}],"backdrop-sepia":[{"backdrop-sepia":["",cl,Cl,wl]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Cl,wl]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[cl,"initial",Cl,wl]}],ease:[{ease:["linear","initial",y,Cl,wl]}],delay:[{delay:[cl,Cl,wl]}],animate:[{animate:["none",v,Cl,wl]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Cl,wl]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[Cl,wl,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Cl,wl]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Cl,wl]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[cl,kl,xl,El]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Vl(...e){return jl(zs(e))}function Wl(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Yl(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function Xl(e){if(null==e)return"$0.00";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}function Kl(e){if(null==e)return"0ms";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0ms":`${Math.round(t)}ms`}var Ul=function(){return Ul=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ul.apply(this,arguments)};function ql(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const Zl=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Gl=zs,Ql=(e,t)=>n=>{var o;if(null==(null==t?void 0:t.variants))return Gl(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:r,defaultVariants:a}=t,i=Object.keys(r).map(e=>{const t=null==n?void 0:n[e],o=null==a?void 0:a[e];if(null===t)return null;const i=Zl(t)||Zl(o);return r[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,o]=t;return void 0===o||(e[n]=o),e},{}),l=null==t||null===(o=t.compoundVariants)||void 0===o?void 0:o.reduce((e,t)=>{let{class:n,className:o,...r}=t;return Object.entries(r).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,o]:e},[]);return Gl(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},Jl=Ql("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",cost:"border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200",gray:"border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200",latency:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200",latencyLow:"border-transparent bg-green-100 text-green-800 hover:bg-green-200",latencyMedium:"border-transparent bg-orange-100 text-orange-800 hover:bg-orange-200",latencyHigh:"border-transparent bg-red-100 text-red-800 hover:bg-red-200"}},defaultVariants:{variant:"default"}});function ec(t){var{className:n,variant:o}=t,r=ql(t,["className","variant"]);return e.createElement("div",Object.assign({className:Vl(Jl({variant:o}),n)},r))}const tc=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const o=t.indexOf(e),r=t.indexOf(n);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:e.localeCompare(n)}),nc=({data:e,label:n,depth:o,maxDepth:r,path:a,priorityKeys:i})=>{const[s,l]=u(!1),c=null!==e&&"object"==typeof e&&!Array.isArray(e),d=Array.isArray(e),f=(c||d)&&o<r,p=f&&Object.keys(e).length>0;return t.createElement("div",{className:"select-none"},t.createElement("div",{className:"flex items-center gap-1 py-1 px-2 hover:bg-gray-50 rounded cursor-pointer transition-colors duration-150 "+(f?"hover:bg-gray-50":""),onClick:()=>{f&&l(!s)},style:{paddingLeft:12*o+8+"px"}},f&&p?s?t.createElement(Ms,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):t.createElement(Os,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):t.createElement("div",{className:"w-3 h-3 flex-shrink-0"}),t.createElement("span",{className:"font-medium text-gray-800 text-xs"},n,":"),!f&&t.createElement("span",{className:"text-xs "+(h=e,null==h?"text-gray-500":"string"==typeof h?"text-green-600":"number"==typeof h?"text-blue-600":"boolean"==typeof h?"text-purple-600":"text-gray-700")},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(e)),f&&!p&&t.createElement("span",{className:"text-xs text-gray-500"},d?"[]":"{}"),f&&p&&!s&&t.createElement("span",{className:"text-xs text-gray-500"},d?`[${Object.keys(e).length} items]`:`{${Object.keys(e).length} keys}`)),s&&p&&t.createElement("div",{className:"border-l border-gray-200 ml-3"},tc(e,i).map(([e,n])=>t.createElement(nc,{key:`${a}.${e}`,data:n,label:e,depth:o+1,maxDepth:r,path:`${a}.${e}`,priorityKeys:i}))));var h},oc=({data:e,maxDepth:n=4,initialExpanded:o=!1,className:r="",priorityKeys:a=["input","output"]})=>null==e?t.createElement("div",{className:`text-xs text-gray-500 italic ${r}`},"No data available"):"object"!=typeof e?t.createElement("div",{className:`text-xs ${r}`},t.createElement("span",{className:"font-medium text-gray-800"},"Value:")," ",t.createElement("span",{className:"text-gray-600"},String(e))):0===Object.keys(e).length?t.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 p-4 text-center ${r}`},t.createElement("div",{className:"text-xs text-gray-500 italic"},Array.isArray(e)?"Empty array":"Empty object")):t.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 overflow-hidden ${r}`},t.createElement("div",{className:"w-full max-h-64 overflow-y-auto"},tc(e,a).map(([e,o])=>t.createElement(nc,{key:e,data:o,label:e,depth:0,maxDepth:n,path:e,priorityKeys:a})))),rc=({label:e,content:n,isExpanded:o,onToggle:r})=>{const a=o?n:(null==n?void 0:n.slice(0,100))+((null==n?void 0:n.length)>100?"...":"");return t.createElement("div",{className:"w-full"},t.createElement("div",{className:"flex justify-between items-center py-1 cursor-pointer select-none hover:bg-gray-50 rounded px-1",onClick:r},t.createElement("span",{className:"font-semibold text-gray-700 text-xs"},e),o?t.createElement(Ms,{className:"w-3 h-3 text-gray-500 transition-transform duration-200"}):t.createElement(Os,{className:"w-3 h-3 text-gray-500 transition-transform duration-200"})),t.createElement("textarea",{className:"w-full border border-gray-300 rounded px-2 py-2 text-xs bg-gray-50 resize-none min-h-[40px] focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-all duration-200",value:a||"",readOnly:!0,rows:o?Math.max(3,Math.max((null==n?void 0:n.split("\n").length)||0,Math.ceil(((null==n?void 0:n.length)||0)/60))):2}))},ac=({data:e,id:n})=>{var o,r,a,i,s,l,c,d,f,p,h,m,g,y,v,b,w,x,E,S,_,N,C,k,M,O,P,R,A,D;La();const[T,I]=u(!1),[z,L]=u(!1),$=(null===(o=e.edges)||void 0===o?void 0:o.some(e=>e.source===n))||!1,B=(null===(r=e.edges)||void 0===r?void 0:r.some(e=>e.target===n))||!1,H=e.nodeType||"Agent",F=e.label||Wl(H)||"Agent",j=null===(l=null===(s=null===(i=null===(a=e.details)||void 0===a?void 0:a.internals)||void 0===i?void 0:i.llm_details)||void 0===s?void 0:s[0])||void 0===l?void 0:l.model_provider,V=((e,n)=>{if("tool"===e)return"🔧";if("coordinator"===e)return"🎯";if("agent"===e){if("OpenAI"===n)return t.createElement("img",{src:"/icon-openai.svg",alt:"OpenAI",className:"w-6 h-6",style:{filter:"brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%)"}});if("Anthropic"===n)return t.createElement("img",{src:"/icon-anthropic.svg",alt:"Anthropic",className:"w-6 h-6",style:{filter:"brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%)"}});if("Google"===n||"Vertex_AI"===n)return t.createElement("img",{src:"/icon-google.svg",alt:"Google",className:"w-6 h-6"})}return"🤖"})(H.toLowerCase(),j),W=(null===(p=null===(f=null===(d=null===(c=e.details)||void 0===c?void 0:c.internals)||void 0===d?void 0:d.llm_details)||void 0===f?void 0:f[0])||void 0===p?void 0:p.model_name)||"Unknown",Y=Xl(null===(y=null===(g=null===(m=null===(h=e.details)||void 0===h?void 0:h.internals)||void 0===m?void 0:m.llm_details)||void 0===g?void 0:g[0])||void 0===y?void 0:y.total_cost),X=(null===(S=null===(E=null===(x=null===(w=null===(b=null===(v=e.details)||void 0===v?void 0:v.internals)||void 0===b?void 0:b.llm_details)||void 0===w?void 0:w[0])||void 0===x?void 0:x.input)||void 0===E?void 0:E[0])||void 0===S?void 0:S.content)||"",K=(null===(O=null===(M=null===(k=null===(C=null===(N=null===(_=e.details)||void 0===_?void 0:_.internals)||void 0===N?void 0:N.llm_details)||void 0===C?void 0:C[0])||void 0===k?void 0:k.input)||void 0===M?void 0:M[1])||void 0===O?void 0:O.content)||"",U=null===(A=null===(R=null===(P=e.details)||void 0===P?void 0:P.internals)||void 0===R?void 0:R.latency)||void 0===A?void 0:A.total_time;return t.createElement("div",{className:"font-sans rounded-lg bg-white border-2 border-gray-200 shadow-sm min-w-[300px] max-w-[500px] transition-all duration-200 relative hover:border-indigo-500 hover:shadow-md",onClick:()=>{console.log("Node clicked:",{label:e.label,nodeType:e.nodeType,details:e.details})}},B&&t.createElement(Jr,{type:"target",position:hr.Top,className:"w-2 h-2 border-2 border-indigo-500 bg-white cursor-default",isConnectable:!1}),t.createElement("div",{className:"flex justify-between items-center gap-2 p-3 border-b border-gray-200"},t.createElement("div",{className:"flex items-center gap-2"},t.createElement("div",{className:"text-xl flex items-center justify-center"},V),t.createElement("div",{className:"font-semibold text-gray-800 text-sm break-words"},F)),"Agent"===H&&t.createElement("div",{className:"flex gap-2 justify-end items-center"},t.createElement(ec,{variant:"gray",className:"text-xs"},W),t.createElement(ec,{variant:"cost",className:"text-xs"},Y)),"Tool"===H&&U&&t.createElement("div",{className:"flex gap-2 justify-end items-center"},t.createElement(ec,{variant:"latency",className:"text-xs"},Kl(U))),"Coordinator"===H&&t.createElement("div",{className:"flex gap-2 justify-end items-center"},t.createElement(ec,{variant:"gray",className:"text-xs"},"Coordinator"))),t.createElement("div",{className:"p-3 flex flex-col items-start justify-center gap-2"},"Agent"===H?t.createElement(t.Fragment,null,t.createElement(rc,{label:"System Message",content:X,isExpanded:T,onToggle:()=>I(!T)}),t.createElement(rc,{label:"User Message",content:K,isExpanded:z,onToggle:()=>L(!z)})):"Tool"===H?t.createElement(oc,{data:(()=>{var t,n,o,r,a,i;const s=(null===(t=e.details)||void 0===t?void 0:t.internals)||{};return e.edgeDetails&&e.edgeDetails.length>0?Object.assign(Object.assign({},s),{input:{args:null===(n=e.edgeDetails[0])||void 0===n?void 0:n.input_args,kwargs:null===(o=e.edgeDetails[0])||void 0===o?void 0:o.input_kwargs},output:null===(r=e.edgeDetails[0])||void 0===r?void 0:r.output,state:null===(a=e.edgeDetails[0])||void 0===a?void 0:a.state,status:null===(i=e.edgeDetails[0])||void 0===i?void 0:i.status}):s})()}):"Coordinator"===H?t.createElement(oc,{data:(null===(D=e.details)||void 0===D?void 0:D.internals)||{}}):null),$&&t.createElement(Jr,{type:"source",position:hr.Bottom,className:"w-2 h-2 border-2 border-indigo-500 bg-white cursor-default",isConnectable:!1}))},ic=({stamps:e,currentStep:n,onStepChange:o,onToggle:r})=>{const a=e.length>0?Math.max(...e.map(e=>e.step)):0,i=e.length>0?Math.min(...e.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return t.createElement("div",{className:"w-full h-full bg-white flex flex-col overflow-hidden"},t.createElement("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex justify-between items-start"},t.createElement("div",null,t.createElement("h3",{className:"m-0 text-base font-semibold text-gray-800"},"Timeline")),r&&t.createElement("button",{onClick:r,className:"border-none bg-transparent cursor-pointer text-gray-500 p-1 flex items-center justify-center transition-colors duration-200 hover:text-gray-700",title:"Collapse Panel"},t.createElement(As,{size:16}))),t.createElement("div",{className:"flex-1 overflow-y-auto py-2 pb-4"},Array.from({length:s},(r,a)=>{const s=i+a,c=s===n,u=s<n,d=e.some(e=>e.step===s),f=(t=>{const n=e.filter(e=>e.step===t);if(0===n.length)return null;const o=t-1,r=e.filter(e=>e.step===o);return 0===r.length?null:Math.min(...n.map(e=>e.time))-Math.max(...r.map(e=>e.time))})(s),p=(t=>{var n;const o=e.filter(e=>e.step===t);return 0===o.length?`Step ${t}`:(null===(n=o[0])||void 0===n?void 0:n.identifier)||`Step ${t}`})(s);return t.createElement("div",{key:s,onClick:()=>d&&o(s),className:`\n px-4 py-3 border-b border-gray-100 relative transition-all duration-200\n ${d?"cursor-pointer":"cursor-default"}\n ${c?"bg-blue-50 border-l-4 border-l-indigo-500":"border-l-4 border-l-transparent"}\n ${d&&!c?"hover:bg-gray-50":""}\n `},t.createElement("div",{className:"flex items-center gap-2 mb-1"},t.createElement("div",{className:`\n w-3 h-3 rounded-full border flex-shrink-0\n ${c?"bg-indigo-500 border-indigo-500":u?"bg-yellow-400 border-gray-300":d?"bg-gray-400 border-gray-300":"bg-gray-200 border-gray-300"}\n `}),t.createElement("span",{className:`\n text-sm font-medium\n ${c?"font-semibold text-gray-800":"text-gray-500"}\n `},"Step ",s),f&&t.createElement(ec,{variant:l(f),className:"ml-auto"},Kl(f))),t.createElement("div",{className:`\n text-sm leading-relaxed break-words\n ${d?"text-gray-800":"text-gray-400 italic"}\n `},d?p:"No activity"),c&&t.createElement("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-indigo-500 animate-pulse"}))})))};function sc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function lc(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function cc(...e){return t=>{let n=!1;const o=e.map(e=>{const o=lc(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():lc(e[t],null)}}}}function uc(...t){return e.useCallback(cc(...t),t)}function dc(t,n=[]){let o=[];const r=()=>{const n=o.map(t=>e.createContext(t));return function(o){const r=o?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...o,[t]:r}}),[o,r])}};return r.scopeName=t,[function(n,r){const a=e.createContext(r),i=o.length;o=[...o,r];const s=n=>{const{scope:o,children:r,...s}=n,l=o?.[t]?.[i]||a,c=e.useMemo(()=>s,Object.values(s));return m(l.Provider,{value:c,children:r})};return s.displayName=n+"Provider",[s,function(o,s){const l=s?.[t]?.[i]||a,c=e.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${o}\` must be used within \`${n}\``)}]},fc(r,...n)]}function fc(...t){const n=t[0];if(1===t.length)return n;const o=()=>{const o=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const r=o.reduce((e,{useScope:n,scopeName:o})=>({...e,...n(t)[`__scope${o}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:r}),[r])}};return o.scopeName=n.scopeName,o}var pc=globalThis?.document?e.useLayoutEffect:()=>{},hc=e[" useId ".trim().toString()]||(()=>{}),mc=0;function gc(t){const[n,o]=e.useState(hc());return pc(()=>{t||o(e=>e??String(mc++))},[t]),t||(n?`radix-${n}`:"")}var yc=e[" useInsertionEffect ".trim().toString()]||pc;function vc({prop:t,defaultProp:n,onChange:o=()=>{},caller:r}){const[a,i,s]=function({defaultProp:t,onChange:n}){const[o,r]=e.useState(t),a=e.useRef(o),i=e.useRef(n);return yc(()=>{i.current=n},[n]),e.useEffect(()=>{a.current!==o&&(i.current?.(o),a.current=o)},[o,a]),[o,r,i]}({defaultProp:n,onChange:o}),l=void 0!==t,c=l?t:a;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=l},[l,r])}const u=e.useCallback(e=>{if(l){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else i(e)},[l,t,i,s]);return[c,u]}function bc(t){const n=wc(t),o=e.forwardRef((t,o)=>{const{children:r,...a}=t,i=e.Children.toArray(r),s=i.find(Ec);if(s){const t=s.props.children,r=i.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return m(n,{...a,ref:o,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return m(n,{...a,ref:o,children:r})});return o.displayName=`${t}.Slot`,o}function wc(t){const n=e.forwardRef((t,n)=>{const{children:o,...r}=t;if(e.isValidElement(o)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(r,o.props);return o.type!==e.Fragment&&(a.ref=n?cc(n,t):t),e.cloneElement(o,a)}return e.Children.count(o)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var xc=Symbol("radix.slottable");function Ec(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===xc}var Sc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=bc(`Primitive.${n}`),r=e.forwardRef((e,t)=>{const{asChild:r,...a}=e,i=r?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m(i,{...a,ref:t})});return r.displayName=`Primitive.${n}`,{...t,[n]:r}},{});function _c(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var Nc,Cc="dismissableLayer.update",kc="dismissableLayer.pointerDownOutside",Mc="dismissableLayer.focusOutside",Oc=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pc=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=t,u=e.useContext(Oc),[d,f]=e.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=e.useState({}),g=uc(n,e=>f(e)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(t,n=globalThis?.document){const o=_c(t),r=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let t=function(){Ac(kc,o,r,{discrete:!0})};const r={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);r.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}},[n,o]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));E&&!n&&(a?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(t,n=globalThis?.document){const o=_c(t),r=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Ac(Mc,o,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,o]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),s?.(e),e.defaultPrevented||l?.())},p);return function(t,n=globalThis?.document){const o=_c(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&o(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[o,n])}(e=>{w===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Nc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Rc(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Nc)}},[d,p,o,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Rc())},[d,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(Cc,e),()=>document.removeEventListener(Cc,e)},[]),m(Sc.div,{...c,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:sc(t.onFocusCapture,_.onFocusCapture),onBlurCapture:sc(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:sc(t.onPointerDownCapture,S.onPointerDownCapture)})});Pc.displayName="DismissableLayer";function Rc(){const e=new CustomEvent(Cc);document.dispatchEvent(e)}function Ac(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}(r,a):r.dispatchEvent(a)}e.forwardRef((t,n)=>{const o=e.useContext(Oc),r=e.useRef(null),a=uc(n,r);return e.useEffect(()=>{const e=r.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),m(Sc.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var Dc="focusScope.autoFocusOnMount",Tc="focusScope.autoFocusOnUnmount",Ic={bubbles:!1,cancelable:!0},zc=e.forwardRef((t,n)=>{const{loop:o=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=_c(a),d=_c(i),f=e.useRef(null),p=uc(n,e=>c(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(r){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:Hc(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Hc(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Hc(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return l&&o.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[r,l,h.paused]),e.useEffect(()=>{if(l){Fc.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Dc,Ic);l.addEventListener(Dc,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Hc(o,{select:t}),document.activeElement!==n)return}((e=Lc(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Hc(l))}return()=>{l.removeEventListener(Dc,u),setTimeout(()=>{const e=new CustomEvent(Tc,Ic);l.addEventListener(Tc,d),l.dispatchEvent(e),e.defaultPrevented||Hc(t??document.body,{select:!0}),l.removeEventListener(Tc,d),Fc.remove(h)},0)}}var e},[l,u,d,h]);const g=e.useCallback(e=>{if(!o&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=Lc(e),n=$c(t,e),o=$c(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&Hc(a,{select:!0})):(e.preventDefault(),o&&Hc(r,{select:!0})):n===t&&e.preventDefault()}},[o,r,h.paused]);return m(Sc.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});function Lc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $c(e,t){for(const n of e)if(!Bc(n,{upTo:t}))return n}function Bc(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Hc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}zc.displayName="FocusScope";var Fc=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=jc(e,t),e.unshift(t)},remove(t){e=jc(e,t),e[0]?.resume()}}}();function jc(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Vc=e.forwardRef((t,n)=>{const{container:o,...r}=t,[a,i]=e.useState(!1);pc(()=>i(!0),[]);const s=o||a&&globalThis?.document?.body;return s?h.createPortal(m(Sc.div,{...r,ref:n}),s):null});Vc.displayName="Portal";var Wc=t=>{const{present:n,children:o}=t,r=function(t){const[n,o]=e.useState(),r=e.useRef(null),a=e.useRef(t),i=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Yc(r.current);i.current="mounted"===l?e:"none"},[l]),pc(()=>{const e=r.current,n=a.current;if(n!==t){const o=i.current,r=Yc(e);if(t)c("MOUNT");else if("none"===r||"none"===e?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,c]),pc(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,o=o=>{const i=Yc(r.current).includes(CSS.escape(o.animationName));if(o.target===n&&i&&(c("ANIMATION_END"),!a.current)){const o=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=o)})}},s=e=>{e.target===n&&(i.current=Yc(r.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",o),n.addEventListener("animationend",o),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",o),n.removeEventListener("animationend",o)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{r.current=e?getComputedStyle(e):null,o(e)},[])}}(n),a="function"==typeof o?o({present:r.isPresent}):e.Children.only(o),i=uc(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof o||r.isPresent?e.cloneElement(a,{ref:i}):null};function Yc(e){return e?.animationName||"none"}Wc.displayName="Presence";var Xc=0;function Kc(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Uc()),document.body.insertAdjacentElement("beforeend",e[1]??Uc()),Xc++,()=>{1===Xc&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Xc--}},[])}function Uc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qc="right-scroll-bar-position",Zc="width-before-scroll-bar";function Gc(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Qc="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Jc=new WeakMap;function eu(e,t){var n,o,r,a=(n=t||null,o=function(t){return e.forEach(function(e){return Gc(e,t)})},(r=u(function(){return{value:n,callback:o,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0]).callback=o,r.facade);return Qc(function(){var t=Jc.get(a);if(t){var n=new Set(t),o=new Set(e),r=a.current;n.forEach(function(e){o.has(e)||Gc(e,null)}),o.forEach(function(e){n.has(e)||Gc(e,r)})}Jc.set(a,e)},[e]),a}function tu(e){return e}var nu=function(t){var n=t.sideCar,o=ql(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=n.read();if(!r)throw new Error("Sidecar medium not found");return e.createElement(r,Ul({},o))};nu.isSideCarExport=!0;var ou=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=tu);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return r}(null);return t.options=Ul({async:!0,ssr:!1},e),t}(),ru=function(){},au=e.forwardRef(function(t,n){var o=e.useRef(null),r=e.useState({onScrollCapture:ru,onWheelCapture:ru,onTouchMoveCapture:ru}),a=r[0],i=r[1],s=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,h=t.noRelative,m=t.noIsolation,g=t.inert,y=t.allowPinchZoom,v=t.as,b=void 0===v?"div":v,w=t.gapMode,x=ql(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=eu([o,n]),_=Ul(Ul({},x),a);return e.createElement(e.Fragment,null,d&&e.createElement(E,{sideCar:ou,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:o,gapMode:w}),s?e.cloneElement(e.Children.only(l),Ul(Ul({},_),{ref:S})):e.createElement(b,Ul({},_,{className:c,ref:S}),l))});au.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},au.classNames={fullWidth:Zc,zeroRight:qc};function iu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var su=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=iu())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lu=function(){var t,n=(t=su(),function(n,o){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&o])});return function(e){var t=e.styles,o=e.dynamic;return n(t,o),null}},cu={left:0,top:0,right:0,gap:0},uu=function(e){return parseInt(e||"",10)||0},du=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return cu;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[uu(n),uu(o),uu(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},fu=lu(),pu="data-scroll-locked",hu=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(pu,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(qc," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Zc," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(qc," .").concat(qc," {\n right: 0 ").concat(o,";\n }\n \n .").concat(Zc," .").concat(Zc," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(pu,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},mu=function(){var e=parseInt(document.body.getAttribute(pu)||"0",10);return isFinite(e)?e:0},gu=function(t){var n=t.noRelative,o=t.noImportant,r=t.gapMode,a=void 0===r?"margin":r;e.useEffect(function(){return document.body.setAttribute(pu,(mu()+1).toString()),function(){var e=mu()-1;e<=0?document.body.removeAttribute(pu):document.body.setAttribute(pu,e.toString())}},[]);var i=e.useMemo(function(){return du(a)},[a]);return e.createElement(fu,{styles:hu(i,!n,a,o?"":"!important")})},yu=!1;if("undefined"!=typeof window)try{var vu=Object.defineProperty({},"passive",{get:function(){return yu=!0,!0}});window.addEventListener("test",vu,vu),window.removeEventListener("test",vu,vu)}catch(e){yu=!1}var bu=!!yu&&{passive:!1},wu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},xu=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),Eu(e,o)){var r=Su(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Eu=function(e,t){return"v"===e?function(e){return wu(e,"overflowY")}(t):function(e){return wu(e,"overflowX")}(t)},Su=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},_u=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nu=function(e){return[e.deltaX,e.deltaY]},Cu=function(e){return e&&"current"in e?e.current:e},ku=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Mu=0,Ou=[];function Pu(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ru,Au=(Ru=function(t){var n=e.useRef([]),o=e.useRef([0,0]),r=e.useRef(),a=e.useState(Mu++)[0],i=e.useState(lu)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(Cu),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,a=_u(e),i=o.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=xu(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=xu(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=n),!n)return!0;var p=r.current||n;return function(e,t,n,o,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*o,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=Su(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&Eu(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(d)<1||!r&&i>d)||!u&&(r&&Math.abs(f)<1||!r&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(Ou.length&&Ou[Ou.length-1]===i){var o="deltaY"in t?Nu(t):_u(t),r=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,r=o,n[0]===r[0]&&n[1]===r[1]);var n,r})[0];if(r&&r.should)t.cancelable&&t.preventDefault();else if(!r){var a=(s.current.shards||[]).map(Cu).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?l(t,a[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,o,r){var a={name:e,delta:t,target:o,should:r,shadowParent:Pu(o)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),d=e.useCallback(function(e){o.current=_u(e),r.current=void 0},[]),f=e.useCallback(function(e){u(e.type,Nu(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,_u(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return Ou.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,bu),document.addEventListener("touchmove",c,bu),document.addEventListener("touchstart",d,bu),function(){Ou=Ou.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,bu),document.removeEventListener("touchmove",c,bu),document.removeEventListener("touchstart",d,bu)}},[]);var h=t.removeScrollBar,m=t.inert;return e.createElement(e.Fragment,null,m?e.createElement(i,{styles:ku(a)}):null,h?e.createElement(gu,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},ou.useMedium(Ru),nu),Du=e.forwardRef(function(t,n){return e.createElement(au,Ul({},t,{ref:n,sideCar:Au}))});Du.classNames=au.classNames;var Tu=Du,Iu=new WeakMap,zu=new WeakMap,Lu={},$u=0,Bu=function(e){return e&&(e.host||Bu(e.parentNode))},Hu=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Bu(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Lu[n]||(Lu[n]=new WeakMap);var a=Lu[n],i=[],s=new Set,l=new Set(r),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};r.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,l=(Iu.get(e)||0)+1,c=(a.get(e)||0)+1;Iu.set(e,l),a.set(e,c),i.push(e),1===l&&r&&zu.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),$u++,function(){i.forEach(function(e){var t=Iu.get(e)-1,r=a.get(e)-1;Iu.set(e,t),a.set(e,r),t||(zu.has(e)||e.removeAttribute(o),zu.delete(e)),r||e.removeAttribute(n)}),--$u||(Iu=new WeakMap,Iu=new WeakMap,zu=new WeakMap,Lu={})}},Fu=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Hu(o,r,n,"aria-hidden")):function(){return null}},ju="Dialog",[Vu,Wu]=dc(ju),[Yu,Xu]=Vu(ju),Ku=t=>{const{__scopeDialog:n,children:o,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u,d]=vc({prop:r,defaultProp:a??!1,onChange:i,caller:ju});return m(Yu,{scope:n,triggerRef:l,contentRef:c,contentId:gc(),titleId:gc(),descriptionId:gc(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:o})};Ku.displayName=ju;var Uu="DialogTrigger",qu=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Xu(Uu,n),a=uc(t,r.triggerRef);return m(Sc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":md(r.open),...o,ref:a,onClick:sc(e.onClick,r.onOpenToggle)})});qu.displayName=Uu;var Zu="DialogPortal",[Gu,Qu]=Vu(Zu,{forceMount:void 0}),Ju=t=>{const{__scopeDialog:n,forceMount:o,children:r,container:a}=t,i=Xu(Zu,n);return m(Gu,{scope:n,forceMount:o,children:e.Children.map(r,e=>m(Wc,{present:o||i.open,children:m(Vc,{asChild:!0,container:a,children:e})}))})};Ju.displayName=Zu;var ed="DialogOverlay",td=e.forwardRef((e,t)=>{const n=Qu(ed,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=Xu(ed,e.__scopeDialog);return a.modal?m(Wc,{present:o||a.open,children:m(od,{...r,ref:t})}):null});td.displayName=ed;var nd=bc("DialogOverlay.RemoveScroll"),od=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Xu(ed,n);return m(Tu,{as:nd,allowPinchZoom:!0,shards:[r.contentRef],children:m(Sc.div,{"data-state":md(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),rd="DialogContent",ad=e.forwardRef((e,t)=>{const n=Qu(rd,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=Xu(rd,e.__scopeDialog);return m(Wc,{present:o||a.open,children:a.modal?m(id,{...r,ref:t}):m(sd,{...r,ref:t})})});ad.displayName=rd;var id=e.forwardRef((t,n)=>{const o=Xu(rd,t.__scopeDialog),r=e.useRef(null),a=uc(n,o.contentRef,r);return e.useEffect(()=>{const e=r.current;if(e)return Fu(e)},[]),m(ld,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:sc(t.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:sc(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:sc(t.onFocusOutside,e=>e.preventDefault())})}),sd=e.forwardRef((t,n)=>{const o=Xu(rd,t.__scopeDialog),r=e.useRef(!1),a=e.useRef(!1);return m(ld,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(r.current||o.triggerRef.current?.focus(),e.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(r.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=o.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ld=e.forwardRef((t,n)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=Xu(rd,o),c=e.useRef(null),u=uc(n,c);return Kc(),g(y,{children:[m(zc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:m(Pc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":md(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),g(y,{children:[m(bd,{titleId:l.titleId}),m(wd,{contentRef:c,descriptionId:l.descriptionId})]})]})}),cd="DialogTitle",ud=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Xu(cd,n);return m(Sc.h2,{id:r.titleId,...o,ref:t})});ud.displayName=cd;var dd="DialogDescription",fd=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Xu(dd,n);return m(Sc.p,{id:r.descriptionId,...o,ref:t})});fd.displayName=dd;var pd="DialogClose",hd=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Xu(pd,n);return m(Sc.button,{type:"button",...o,ref:t,onClick:sc(e.onClick,()=>r.onOpenChange(!1))})});function md(e){return e?"open":"closed"}hd.displayName=pd;var gd="DialogTitleWarning",[yd,vd]=function(t,n){const o=e.createContext(n),r=t=>{const{children:n,...r}=t,a=e.useMemo(()=>r,Object.values(r));return m(o.Provider,{value:a,children:n})};return r.displayName=t+"Provider",[r,function(r){const a=e.useContext(o);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]}(gd,{contentName:rd,titleName:cd,docsSlug:"dialog"}),bd=({titleId:t})=>{const n=vd(gd),o=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(o)}},[o,t]),null},wd=({contentRef:t,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vd("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(o)}},[o,t,n]),null},xd=Ku,Ed=qu,Sd=Ju,_d=td,Nd=ad,Cd=ud,kd=fd,Md=hd;const Od=xd,Pd=Ed,Rd=Sd,Ad=e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(_d,Object.assign({className:Vl("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",o)},r,{ref:n}))});Ad.displayName=_d.displayName;const Dd=Ql("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Td=e.forwardRef((t,n)=>{var{side:o="right",className:r,children:a}=t,i=ql(t,["side","className","children"]);return e.createElement(Rd,null,e.createElement(Ad,null),e.createElement(Nd,Object.assign({ref:n,className:Vl(Dd({side:o}),r)},i),a,e.createElement(Md,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},e.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{className:"sr-only"},"Close"))))});Td.displayName=Nd.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(Cd,Object.assign({ref:n,className:Vl("text-lg font-semibold text-foreground",o)},r))}).displayName=Cd.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(kd,Object.assign({ref:n,className:Vl("text-sm text-muted-foreground",o)},r))}).displayName=kd.displayName;const Id=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{var t;e.source&&e.target&&(null===(t=a.get(e.source))||void 0===t||t.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{var t;e.parent&&e.parent.identifier!==e.identifier&&(null===(t=a.get(e.parent.identifier))||void 0===t||t.push(e.identifier),i.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!i.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of a.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{var t;const n=null!==(t=l.get(e.identifier))&&void 0!==t?t:0;u[n]||(u[n]=[]),u[n].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,o+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of i){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=o,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),o=m.get(x[t]);if(Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2))<w){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const a=w/r,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,o.x+=i,o.y+=s}else n.x-=w/2,o.x+=w/2}}return m},zd={Agent:ac,Tool:ac,Coordinator:ac},Ld=({flowData:e,width:n="100%",height:o="1000px",className:a="",defaultZoom:c=1,defaultPan:d={x:0,y:0},disableAutoFit:f=!0,showTimeline:p=!1,minNodeSpacing:h=200})=>{const m=e;if(!m)return t.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",background:"#f9fafb",position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:a},t.createElement("div",{style:{textAlign:"center"}},t.createElement("div",{style:{fontSize:"16px",color:"#6b7280",marginBottom:"8px"}},"No flow data available"),t.createElement("div",{style:{fontSize:"14px",color:"#9ca3af"}},"Please provide flowData prop")));const g=l(null),y=l(null),[v,b]=u({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[w,x]=u(0),[E,S]=u(!1),_=l(null),[N,C]=u(!1),k=r(()=>{const e=m.stamps||m.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[m.stamps,m.steps]);i(()=>(E?_.current=setInterval(()=>{x(e=>e>=k?(S(!1),e):e+1)},250):_.current&&(clearInterval(_.current),_.current=null),()=>{_.current&&clearInterval(_.current)}),[E,k]),i(()=>{const e=m.stamps||m.steps||[];e.length>0&&x(Math.max(...e.map(e=>e.step)))},[m.stamps,m.steps]),i(()=>{const e=()=>{if(g.current){const e=g.current.getBoundingClientRect();b({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&g.current){const t=new ResizeObserver(e);return t.observe(g.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const M=r(()=>{if(!m.nodes)return new Map;const e=Math.max(v.width||800,1200);return Id(m.nodes,m.edges||[],{minNodeSpacing:h,containerWidth:e})},[m.nodes,m.edges,v.width,h]),O=s(e=>m.nodes?m.nodes.filter(t=>t.stamp.step<=e):[],[m.nodes]),P=s(e=>(m.edges||[]).filter(t=>t.stamp.step<=e),[m.edges]),R=r(()=>{const e=O(w),t=P(w);return e.map(e=>{const n=M.get(e.identifier)||{x:0,y:0},o=e.stamp.step===w,r="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:o,id:e.identifier,edges:t,edgeDetails:r},style:{filter:o?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[M,w,O,P]),A=r(()=>P(w).filter(e=>e.source&&e.target).map(e=>{var t,n,o,r;const a=e.stamp.step===w;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:a,bidirectional:!0,style:{stroke:a?"#6366f1":"#9ca3af",strokeWidth:a?3:2},label:(null===(t=e.stamp)||void 0===t?void 0:t.identifier)?Yl(String(e.stamp.identifier),50):void 0,data:{label:(null===(n=e.stamp)||void 0===n?void 0:n.identifier)?Yl(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:null===(o=e.stamp)||void 0===o?void 0:o.step,time:null===(r=e.stamp)||void 0===r?void 0:r.time,details:e.details}}}),[w,P]),[D,T,I]=ds(R),[z,L,$]=fs(A);i(()=>{T(R)},[R,T]),i(()=>{L(A)},[A,L]);const B=s(e=>L(t=>Dr(e,t)),[L]),H=s(e=>{x(e),S(!1)},[]);s(()=>{S(e=>!e)},[]);const F=(e,t)=>{var n;if(!y.current)return{x:0,y:0};const o=y.current.createSVGPoint();o.x=e,o.y=t;const r=o.matrixTransform(null===(n=y.current.getScreenCTM())||void 0===n?void 0:n.inverse());return{x:r.x,y:r.y}},j=La();return i(()=>{if(f||!j||0===R.length)return;const e=new Map;A.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const o=e.get(t.target)||0;e.set(t.target,o+1)});let t="",n=0;e.forEach((e,o)=>{e>n&&(n=e,t=o)}),!t&&R.length>0&&(t=R[0].id),t&&setTimeout(()=>{j.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:c,maxZoom:1})},500)},[R,A,j,f,c]),t.createElement("div",{ref:g,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px"},className:a},p&&t.createElement(Od,{open:N,onOpenChange:C},t.createElement(Pd,{asChild:!0},t.createElement("button",{className:"absolute top-4 left-4 z-50 w-10 h-10 bg-white border border-gray-300 rounded-lg shadow-sm hover:bg-gray-50 flex items-center justify-center transition-colors duration-200",title:"Open Timeline"},t.createElement(As,{size:20,className:"text-gray-600"}))),t.createElement(Rd,null,t.createElement(Nd,{className:"fixed inset-y-0 left-0 h-full w-[280px] z-50 bg-background border-r shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left p-0",onPointerDownOutside:e=>e.preventDefault()},t.createElement("div",{className:"flex flex-col h-full"},t.createElement("div",{className:"flex-1 overflow-y-auto"},t.createElement(ic,{stamps:m.stamps||m.steps||[],currentStep:w,onStepChange:H}))),t.createElement(Md,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},t.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),t.createElement("span",{className:"sr-only"},"Close"))))),t.createElement(cs,{nodes:D,edges:z,onNodesChange:I,onEdgesChange:$,onConnect:B,nodeTypes:zd,edgeTypes:{default:e=>t.createElement(Ts,Object.assign({},e,{clientToSvgCoords:F,svgRef:y}))},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:d.x,y:d.y,zoom:c},onInit:()=>{if(g.current){const e=g.current.querySelector("svg");e&&(y.current=e)}}},t.createElement(ws,{variant:ps.Lines,color:"#EEEEEE",gap:16})),t.createElement("style",null,"\n .react-flow__edge-label {\n font-size: 10px;\n background: white;\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid #e5e7eb;\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n "))},$d=e=>t.createElement(ts,null,t.createElement(Ld,Object.assign({},e)));function Bd(e,[t,n]){return Math.min(n,Math.max(t,e))}var Hd=e.createContext(void 0);const Fd=["top","right","bottom","left"],jd=Math.min,Vd=Math.max,Wd=Math.round,Yd=Math.floor,Xd=e=>({x:e,y:e}),Kd={left:"right",right:"left",bottom:"top",top:"bottom"},Ud={start:"end",end:"start"};function qd(e,t,n){return Vd(e,jd(t,n))}function Zd(e,t){return"function"==typeof e?e(t):e}function Gd(e){return e.split("-")[0]}function Qd(e){return e.split("-")[1]}function Jd(e){return"x"===e?"y":"x"}function ef(e){return"y"===e?"height":"width"}const tf=new Set(["top","bottom"]);function nf(e){return tf.has(Gd(e))?"y":"x"}function of(e){return Jd(nf(e))}function rf(e){return e.replace(/start|end/g,e=>Ud[e])}const af=["left","right"],sf=["right","left"],lf=["top","bottom"],cf=["bottom","top"];function uf(e,t,n,o){const r=Qd(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?sf:af:t?af:sf;case"left":case"right":return t?lf:cf;default:return[]}}(Gd(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(rf)))),a}function df(e){return e.replace(/left|right|bottom|top/g,e=>Kd[e])}function ff(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function pf(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function hf(e,t,n){let{reference:o,floating:r}=e;const a=nf(t),i=of(t),s=ef(i),l=Gd(t),c="y"===a,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Qd(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function mf(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Zd(t,e),h=ff(p),m=s[f?"floating"===d?"reference":"floating":d],g=pf(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=pf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function gf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yf(e){return Fd.some(t=>e[t]>=0)}const vf=new Set(["left","top"]);function bf(){return"undefined"!=typeof window}function wf(e){return Sf(e)?(e.nodeName||"").toLowerCase():"#document"}function xf(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ef(e){var t;return null==(t=(Sf(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sf(e){return!!bf()&&(e instanceof Node||e instanceof xf(e).Node)}function _f(e){return!!bf()&&(e instanceof Element||e instanceof xf(e).Element)}function Nf(e){return!!bf()&&(e instanceof HTMLElement||e instanceof xf(e).HTMLElement)}function Cf(e){return!(!bf()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof xf(e).ShadowRoot)}const kf=new Set(["inline","contents"]);function Mf(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Hf(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!kf.has(r)}const Of=new Set(["table","td","th"]);function Pf(e){return Of.has(wf(e))}const Rf=[":popover-open",":modal"];function Af(e){return Rf.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Df=["transform","translate","scale","rotate","perspective"],Tf=["transform","translate","scale","rotate","perspective","filter"],If=["paint","layout","strict","content"];function zf(e){const t=Lf(),n=_f(e)?Hf(e):e;return Df.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Tf.some(e=>(n.willChange||"").includes(e))||If.some(e=>(n.contain||"").includes(e))}function Lf(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const $f=new Set(["html","body","#document"]);function Bf(e){return $f.has(wf(e))}function Hf(e){return xf(e).getComputedStyle(e)}function Ff(e){return _f(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jf(e){if("html"===wf(e))return e;const t=e.assignedSlot||e.parentNode||Cf(e)&&e.host||Ef(e);return Cf(t)?t.host:t}function Vf(e){const t=jf(e);return Bf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nf(t)&&Mf(t)?t:Vf(t)}function Wf(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Vf(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=xf(r);if(a){const e=Yf(i);return t.concat(i,i.visualViewport||[],Mf(r)?r:[],e&&n?Wf(e):[])}return t.concat(r,Wf(r,[],n))}function Yf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xf(e){const t=Hf(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Nf(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=Wd(n)!==a||Wd(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Kf(e){return _f(e)?e:e.contextElement}function Uf(e){const t=Kf(e);if(!Nf(t))return Xd(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=Xf(t);let i=(a?Wd(n.width):n.width)/o,s=(a?Wd(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const qf=Xd(0);function Zf(e){const t=xf(e);return Lf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:qf}function Gf(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Kf(e);let i=Xd(1);t&&(o?_f(o)&&(i=Uf(o)):i=Uf(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==xf(e))&&t}(a,n,o)?Zf(a):Xd(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(a){const e=xf(a),t=o&&_f(o)?xf(o):o;let n=e,r=Yf(n);for(;r&&o&&t!==n;){const e=Uf(r),t=r.getBoundingClientRect(),o=Hf(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=xf(r),r=Yf(n)}}return pf({width:u,height:d,x:l,y:c})}function Qf(e,t){const n=Ff(e).scrollLeft;return t?t.left+n:Gf(Ef(e)).left+n}function Jf(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qf(e,n),y:n.top+t.scrollTop}}const ep=new Set(["absolute","fixed"]);function tp(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=xf(e),o=Ef(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){a=r.width,i=r.height;const e=Lf();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=Qf(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=Ef(e),n=Ff(e),o=e.ownerDocument.body,r=Vd(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Vd(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Qf(e);const s=-n.scrollTop;return"rtl"===Hf(o).direction&&(i+=Vd(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(Ef(e));else if(_f(t))o=function(e,t){const n=Gf(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Nf(e)?Uf(e):Xd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:r*a.x,y:o*a.y}}(t,n);else{const n=Zf(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pf(o)}function np(e,t){const n=jf(e);return!(n===t||!_f(n)||Bf(n))&&("fixed"===Hf(n).position||np(n,t))}function op(e,t,n){const o=Nf(t),r=Ef(t),a="fixed"===n,i=Gf(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Xd(0);function c(){l.x=Qf(r)}if(o||!o&&!a)if(("body"!==wf(t)||Mf(r))&&(s=Ff(t)),o){const e=Gf(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();a&&!o&&r&&c();const u=!r||o||a?Xd(0):Jf(r,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function rp(e){return"static"===Hf(e).position}function ap(e,t){if(!Nf(e)||"fixed"===Hf(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ef(e)===n&&(n=n.ownerDocument.body),n}function ip(e,t){const n=xf(e);if(Af(e))return n;if(!Nf(e)){let t=jf(e);for(;t&&!Bf(t);){if(_f(t)&&!rp(t))return t;t=jf(t)}return n}let o=ap(e,t);for(;o&&Pf(o)&&rp(o);)o=ap(o,t);return o&&Bf(o)&&rp(o)&&!zf(o)?n:o||function(e){let t=jf(e);for(;Nf(t)&&!Bf(t);){if(zf(t))return t;if(Af(t))return null;t=jf(t)}return null}(e)||n}const sp={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=Ef(o),s=!!t&&Af(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Xd(1);const u=Xd(0),d=Nf(o);if((d||!d&&!a)&&(("body"!==wf(o)||Mf(i))&&(l=Ff(o)),Nf(o))){const e=Gf(o);c=Uf(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!i||d||a?Xd(0):Jf(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Ef,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a="clippingAncestors"===n?Af(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Wf(e,[],!1).filter(e=>_f(e)&&"body"!==wf(e)),r=null;const a="fixed"===Hf(e).position;let i=a?jf(e):e;for(;_f(i)&&!Bf(i);){const t=Hf(i),n=zf(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&ep.has(r.position)||Mf(i)&&!n&&np(e,i))?o=o.filter(e=>e!==i):r=t,i=jf(i)}return t.set(e,o),o}(t,this._c):[].concat(n),i=[...a,o],s=i[0],l=i.reduce((e,n)=>{const o=tp(t,n,r);return e.top=Vd(o.top,e.top),e.right=jd(o.right,e.right),e.bottom=jd(o.bottom,e.bottom),e.left=Vd(o.left,e.left),e},tp(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ip,getElementRects:async function(e){const t=this.getOffsetParent||ip,n=this.getDimensions,o=await n(e.floating);return{reference:op(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Xf(e);return{width:t,height:n}},getScale:Uf,isElement:_f,isRTL:function(e){return"rtl"===Hf(e).direction}};function lp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cp(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Kf(e),u=r||a?[...c?Wf(c):[],...Wf(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,o=null;const r=Ef(e);function a(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Yd(d)+"px "+-Yd(r.clientWidth-(u+f))+"px "+-Yd(r.clientHeight-(d+p))+"px "+-Yd(u)+"px",threshold:Vd(0,jd(1,l))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!m)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||lp(c,e.getBoundingClientRect())||i(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Gf(e):null;return l&&function t(){const o=Gf(e);m&&!lp(m,o)&&n();m=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const up=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,a=await(null==o.isRTL?void 0:o.isRTL(r.floating)),i=Gd(n),s=Qd(n),l="y"===nf(n),c=vf.has(i)?-1:1,u=a&&l?-1:1,d=Zd(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},dp=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Zd(e,t),c={x:n,y:o},u=await mf(t,l),d=nf(Gd(r)),f=Jd(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=qd(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=qd(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:a,[d]:i}}}}}},fp=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Zd(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=Gd(r),v=nf(s),b=Gd(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[df(s)]:function(e){const t=df(e);return[rf(e),t,rf(t)]}(s)),E="none"!==h;!f&&E&&x.push(...uf(s,m,h,w));const S=[s,...x],_=await mf(t,g),N=[];let C=(null==(o=a.flip)?void 0:o.overflows)||[];if(u&&N.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Qd(e),r=of(e),a=ef(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=df(i)),[i,df(i)]}(r,i,w);N.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:r,overflows:N}],!N.every(e=>e<=0)){var k,M;const e=((null==(k=a.flip)?void 0:k.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==nf(t))||C.every(e=>nf(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(M=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=C.filter(e=>{if(E){const t=nf(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},pp=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Zd(e,t),u=await mf(t,c),d=Gd(r),f=Qd(r),p="y"===nf(r),{width:h,height:m}=a.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=jd(m-u[g],v),x=jd(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(S=v),E&&!f){const e=Vd(u.left,0),t=Vd(u.right,0),n=Vd(u.top,0),o=Vd(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:Vd(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:Vd(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const N=await i.getDimensions(s.floating);return h!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}},hp=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Zd(e,t);switch(o){case"referenceHidden":{const e=gf(await mf(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yf(e)}}}case"escaped":{const e=gf(await mf(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yf(e)}}}default:return{}}}}},mp=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Zd(e,t)||{};if(null==c)return{};const d=ff(u),f={x:n,y:o},p=of(r),h=ef(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,N=S/2-m[h]/2-1,C=jd(d[y],N),k=jd(d[v],N),M=C,O=S-m[h]-k,P=S/2-m[h]/2+_,R=qd(M,P,O),A=!l.arrow&&null!=Qd(r)&&P!==R&&a.reference[h]/2-(P<M?C:k)-m[h]/2<0,D=A?P<M?P-M:P-O:0;return{[p]:f[p]+D,data:{[p]:R,centerOffset:P-R-D,...A&&{alignmentOffset:D}},reset:A}}}),gp=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Zd(e,t),u={x:n,y:o},d=nf(r),f=Jd(d);let p=u[f],h=u[d];const m=Zd(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=vf.has(Gd(r)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),o=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[f]:p,[d]:h}}}},yp=(e,t,n)=>{const o=new Map,r={platform:sp,...n},a={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=hf(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[a]:{...p[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:u,y:d}=hf(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:a})};var vp="undefined"!=typeof document?f:function(){};function bp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!bp(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!bp(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function wp(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xp(e,t){const n=wp(e);return Math.round(t*n)/n}function Ep(t){const n=e.useRef(t);return vp(()=>{n.current=t}),n}const Sp=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?mp({element:n.current,padding:o}).fn(t):{}:n?mp({element:n,padding:o}).fn(t):{};var r}}),_p=(e,t)=>({...up(e),options:[e,t]}),Np=(e,t)=>({...dp(e),options:[e,t]}),Cp=(e,t)=>({...gp(e),options:[e,t]}),kp=(e,t)=>({...fp(e),options:[e,t]}),Mp=(e,t)=>({...pp(e),options:[e,t]}),Op=(e,t)=>({...hp(e),options:[e,t]}),Pp=(e,t)=>({...Sp(e),options:[e,t]});var Rp=e.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return m(Sc.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m("polygon",{points:"0,0 30,0 15,10"})})});Rp.displayName="Arrow";var Ap=Rp;function Dp(t){const[n,o]=e.useState(void 0);return pc(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=t.offsetWidth,a=t.offsetHeight;o({width:r,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),n}var Tp="Popper",[Ip,zp]=dc(Tp),[Lp,$p]=Ip(Tp),Bp=t=>{const{__scopePopper:n,children:o}=t,[r,a]=e.useState(null);return m(Lp,{scope:n,anchor:r,onAnchorChange:a,children:o})};Bp.displayName=Tp;var Hp="PopperAnchor",Fp=e.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:r,...a}=t,i=$p(Hp,o),s=e.useRef(null),l=uc(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=r?.current||s.current,e!==c.current&&i.onAnchorChange(c.current)}),r?null:m(Sc.div,{...a,ref:l})});Fp.displayName=Hp;var jp="PopperContent",[Vp,Wp]=Ip(jp),Yp=e.forwardRef((t,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=$p(jp,o),[w,x]=e.useState(null),E=uc(n,e=>x(e)),[S,_]=e.useState(null),N=Dp(S),C=N?.width??0,k=N?.height??0,M=r+("center"!==i?"-"+i:""),O="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],R=P.length>0,A={padding:O,boundary:P.filter(qp),altBoundary:R},{refs:D,floatingStyles:T,placement:I,isPositioned:z,middlewareData:L}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(r);bp(h,r)||m(r);const[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=e.useCallback(e=>{e!==N.current&&(N.current=e,b(e))},[]),E=i||g,S=s||v,_=e.useRef(null),N=e.useRef(null),C=e.useRef(d),k=null!=c,M=Ep(c),O=Ep(a),P=Ep(u),R=e.useCallback(()=>{if(!_.current||!N.current)return;const e={placement:n,strategy:o,middleware:h};O.current&&(e.platform=O.current),yp(_.current,N.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};A.current&&!bp(C.current,t)&&(C.current=t,p.flushSync(()=>{f(t)}))})},[h,n,o,O,P]);vp(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const A=e.useRef(!1);vp(()=>(A.current=!0,()=>{A.current=!1}),[]),vp(()=>{if(E&&(_.current=E),S&&(N.current=S),E&&S){if(M.current)return M.current(E,S,R);R()}},[E,S,R,M,k]);const D=e.useMemo(()=>({reference:_,floating:N,setReference:w,setFloating:x}),[w,x]),T=e.useMemo(()=>({reference:E,floating:S}),[E,S]),I=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!T.floating)return e;const t=xp(T.floating,d.x),n=xp(T.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...wp(T.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,T.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:R,refs:D,elements:T,floatingStyles:I}),[d,R,D,T,I])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>cp(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[_p({mainAxis:a+k,alignmentAxis:s}),c&&Np({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Cp():void 0,...A}),c&&kp({...A}),Mp({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&Pp({element:S,padding:l}),Zp({arrowWidth:C,arrowHeight:k}),h&&Op({strategy:"referenceHidden",...A})]}),[$,B]=Gp(I),H=_c(y);pc(()=>{z&&H?.()},[z,H]);const F=L.arrow?.x,j=L.arrow?.y,V=0!==L.arrow?.centerOffset,[W,Y]=e.useState();return pc(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),m("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m(Vp,{scope:o,placedSide:$,onArrowChange:_,arrowX:F,arrowY:j,shouldHideArrow:V,children:m(Sc.div,{"data-side":$,"data-align":B,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});Yp.displayName=jp;var Xp="PopperArrow",Kp={top:"bottom",right:"left",bottom:"top",left:"right"},Up=e.forwardRef(function(e,t){const{__scopePopper:n,...o}=e,r=Wp(Xp,n),a=Kp[r.placedSide];return m("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:m(Ap,{...o,ref:t,style:{...o.style,display:"block"}})})});function qp(e){return null!==e}Up.displayName=Xp;var Zp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Gp(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(r.arrow?.x??0)+i/2,f=(r.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${o.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${o.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function Gp(e){const[t,n="center"]=e.split("-");return[t,n]}var Qp=Bp,Jp=Fp,eh=Yp,th=Up;function nh(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}var oh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});e.forwardRef((e,t)=>m(Sc.span,{...e,ref:t,style:{...oh,...e.style}})).displayName="VisuallyHidden";var rh=[" ","Enter","ArrowUp","ArrowDown"],ah=[" ","Enter"],ih="Select",[sh,lh,ch]=function(e){const n=e+"CollectionProvider",[o,r]=dc(n),[a,i]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:o}=e,r=t.useRef(null),i=t.useRef(new Map).current;return m(a,{scope:n,itemMap:i,collectionRef:r,children:o})};s.displayName=n;const l=e+"CollectionSlot",c=bc(l),u=t.forwardRef((e,t)=>{const{scope:n,children:o}=e,r=uc(t,i(l,n).collectionRef);return m(c,{ref:r,children:o})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=bc(d),h=t.forwardRef((e,n)=>{const{scope:o,children:r,...a}=e,s=t.useRef(null),l=uc(n,s),c=i(d,o);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),m(p,{[f]:"",ref:l,children:r})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const o=i(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},r]}(ih),[uh,dh]=dc(ih,[ch,zp]),fh=zp(),[ph,hh]=uh(ih),[mh,gh]=uh(ih),yh=t=>{const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:y}=t,v=fh(n),[b,w]=e.useState(null),[x,E]=e.useState(null),[S,_]=e.useState(!1),N=function(t){const n=e.useContext(Hd);return t||n||"ltr"}(u),[C,k]=vc({prop:r,defaultProp:a??!1,onChange:i,caller:ih}),[M,O]=vc({prop:s,defaultProp:l,onChange:c,caller:ih}),P=e.useRef(null),R=!b||(y||!!b.closest("form")),[A,D]=e.useState(new Set),T=Array.from(A).map(e=>e.props.value).join(";");return m(Qp,{...v,children:g(ph,{required:h,scope:n,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:E,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:gc(),value:M,onValueChange:O,open:C,onOpenChange:k,dir:N,triggerPointerDownPosRef:P,disabled:p,children:[m(sh.Provider,{scope:n,children:m(mh,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{D(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{D(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),R?g(om,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:e=>O(e.target.value),disabled:p,form:y,children:[void 0===M?m("option",{value:""}):null,Array.from(A)]},T):null]})})};yh.displayName=ih;var vh="SelectTrigger",bh=e.forwardRef((t,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=t,i=fh(o),s=hh(vh,o),l=s.disabled||r,c=uc(n,s.onTriggerChange),u=lh(o),d=e.useRef("touch"),[f,p,h]=am(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=im(t,e,n);void 0!==o&&s.onValueChange(o.value)}),g=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m(Jp,{asChild:!0,...i,children:m(Sc.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":rm(s.value)?"":void 0,...a,ref:c,onClick:sc(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&g(e)}),onPointerDown:sc(a.onPointerDown,e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:sc(a.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||rh.includes(e.key)&&(g(),e.preventDefault())})})})});bh.displayName=vh;var wh="SelectValue",xh=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:a,placeholder:i="",...s}=e,l=hh(wh,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==a,d=uc(t,l.onValueNodeChange);return pc(()=>{c(u)},[c,u]),m(Sc.span,{...s,ref:d,style:{pointerEvents:"none"},children:rm(l.value)?m(y,{children:i}):a})});xh.displayName=wh;var Eh=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return m(Sc.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Eh.displayName="SelectIcon";var Sh=e=>m(Vc,{asChild:!0,...e});Sh.displayName="SelectPortal";var _h="SelectContent",Nh=e.forwardRef((t,n)=>{const o=hh(_h,t.__scopeSelect),[r,a]=e.useState();if(pc(()=>{a(new DocumentFragment)},[]),!o.open){const e=r;return e?p.createPortal(m(kh,{scope:t.__scopeSelect,children:m(sh.Slot,{scope:t.__scopeSelect,children:m("div",{children:t.children})})}),e):null}return m(Ph,{...t,ref:n})});Nh.displayName=_h;var Ch=10,[kh,Mh]=uh(_h),Oh=bc("SelectContent.RemoveScroll"),Ph=e.forwardRef((t,n)=>{const{__scopeSelect:o,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=hh(_h,o),[x,E]=e.useState(null),[S,_]=e.useState(null),N=uc(n,e=>E(e)),[C,k]=e.useState(null),[M,O]=e.useState(null),P=lh(o),[R,A]=e.useState(!1),D=e.useRef(!1);e.useEffect(()=>{if(x)return Fu(x)},[x]),Kc();const T=e.useCallback(e=>{const[t,...n]=P().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===o&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==r)return}},[P,S]),I=e.useCallback(()=>T([C,x]),[T,C,x]);e.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:z,triggerPointerDownPosRef:L}=w;e.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,z,L]),e.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[$,B]=am(e=>{const t=P().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=im(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),H=e.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&(k(e),o&&(D.current=!0))},[w.value]),F=e.useCallback(()=>x?.focus(),[x]),j=e.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&O(e)},[w.value]),V="popper"===r?Ah:Rh,W=V===Ah?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return m(kh,{scope:o,content:x,viewport:S,onViewportChange:_,itemRefCallback:H,selectedItem:C,onItemLeave:F,itemTextRefCallback:j,focusSelectedItem:I,selectedItemText:M,position:r,isPositioned:R,searchRef:$,children:m(Tu,{as:Oh,allowPinchZoom:!0,children:m(zc,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:sc(a,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m(Pc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...W,onPlaced:()=>A(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:sc(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});Ph.displayName="SelectContentImpl";var Rh=e.forwardRef((t,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=t,i=hh(_h,o),s=Mh(_h,o),[l,c]=e.useState(null),[u,d]=e.useState(null),f=uc(n,e=>d(e)),p=lh(o),h=e.useRef(!1),g=e.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=s,x=e.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&y&&v&&b){const e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==i.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-Ch,d=Bd(a,[Ch,Math.max(Ch,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-Ch,d=Bd(a,[Ch,Math.max(Ch,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const a=p(),s=window.innerHeight-2*Ch,c=y.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=f+m+c+parseInt(d.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),N=e.top+e.height/2-Ch,C=s-N,k=v.offsetHeight/2,M=f+m+(v.offsetTop+k),O=w-M;if(M<=N){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(C,k+(e?_:0)+t+g);l.style.height=n+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(N,f+y.offsetTop+(e?S:0)+k)+O;l.style.height=t+"px",y.scrollTop=M-N+y.offsetTop}l.style.margin=`${Ch}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,l,u,y,v,b,i.dir,r]);pc(()=>x(),[x]);const[E,S]=e.useState();pc(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const _=e.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return m(Dh,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:m("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m(Sc.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});Rh.displayName="SelectItemAlignedPosition";var Ah=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Ch,...a}=e,i=fh(n);return m(eh,{...i,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ah.displayName="SelectPopperPosition";var[Dh,Th]=uh(_h,{}),Ih="SelectViewport",zh=e.forwardRef((t,n)=>{const{__scopeSelect:o,nonce:r,...a}=t,i=Mh(Ih,o),s=Th(Ih,o),l=uc(n,i.onViewportChange),c=e.useRef(0);return g(y,{children:[m("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m(sh.Slot,{scope:o,children:m(Sc.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:sc(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=s;if(o?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Ch,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});zh.displayName=Ih;var Lh="SelectGroup",[$h,Bh]=uh(Lh);e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=gc();return m($h,{scope:n,id:r,children:m(Sc.div,{role:"group","aria-labelledby":r,...o,ref:t})})}).displayName=Lh;var Hh="SelectLabel",Fh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Bh(Hh,n);return m(Sc.div,{id:r.id,...o,ref:t})});Fh.displayName=Hh;var jh="SelectItem",[Vh,Wh]=uh(jh),Yh=e.forwardRef((t,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:i,...s}=t,l=hh(jh,o),c=Mh(jh,o),u=l.value===r,[d,f]=e.useState(i??""),[p,h]=e.useState(!1),g=uc(n,e=>c.itemRefCallback?.(e,r,a)),y=gc(),v=e.useRef("touch"),b=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m(Vh,{scope:o,value:r,disabled:a,textId:y,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:m(sh.ItemSlot,{scope:o,value:r,disabled:a,textValue:d,children:m(Sc.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:sc(s.onFocus,()=>h(!0)),onBlur:sc(s.onBlur,()=>h(!1)),onClick:sc(s.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:sc(s.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:sc(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:sc(s.onPointerMove,e=>{v.current=e.pointerType,a?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:sc(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:sc(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(ah.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Yh.displayName=jh;var Xh="SelectItemText",Kh=e.forwardRef((t,n)=>{const{__scopeSelect:o,className:r,style:a,...i}=t,s=hh(Xh,o),l=Mh(Xh,o),c=Wh(Xh,o),u=gh(Xh,o),[d,f]=e.useState(null),h=uc(n,e=>f(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),v=d?.textContent,b=e.useMemo(()=>m("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return pc(()=>(w(b),()=>x(b)),[w,x,b]),g(y,{children:[m(Sc.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?p.createPortal(i.children,s.valueNode):null]})});Kh.displayName=Xh;var Uh="SelectItemIndicator",qh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Wh(Uh,n).isSelected?m(Sc.span,{"aria-hidden":!0,...o,ref:t}):null});qh.displayName=Uh;var Zh="SelectScrollUpButton",Gh=e.forwardRef((t,n)=>{const o=Mh(Zh,t.__scopeSelect),r=Th(Zh,t.__scopeSelect),[a,i]=e.useState(!1),s=uc(n,r.onScrollButtonChange);return pc(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?m(em,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Gh.displayName=Zh;var Qh="SelectScrollDownButton",Jh=e.forwardRef((t,n)=>{const o=Mh(Qh,t.__scopeSelect),r=Th(Qh,t.__scopeSelect),[a,i]=e.useState(!1),s=uc(n,r.onScrollButtonChange);return pc(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;i(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?m(em,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Jh.displayName=Qh;var em=e.forwardRef((t,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=t,i=Mh("SelectScrollButton",o),s=e.useRef(null),l=lh(o),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),pc(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),m(Sc.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:sc(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(r,50))}),onPointerMove:sc(a.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(r,50))}),onPointerLeave:sc(a.onPointerLeave,()=>{c()})})}),tm=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return m(Sc.div,{"aria-hidden":!0,...o,ref:t})});tm.displayName="SelectSeparator";var nm="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=fh(n),a=hh(nm,n),i=Mh(nm,n);return a.open&&"popper"===i.position?m(th,{...r,...o,ref:t}):null}).displayName=nm;var om=e.forwardRef(({__scopeSelect:t,value:n,...o},r)=>{const a=e.useRef(null),i=uc(r,a),s=nh(n);return e.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&o){const t=new Event("change",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[s,n]),m(Sc.select,{...o,style:{...oh,...o.style},ref:i,defaultValue:n})});function rm(e){return""===e||void 0===e}function am(t){const n=_c(t),o=e.useRef(""),r=e.useRef(0),a=e.useCallback(e=>{const t=o.current+e;n(t),function e(t){o.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{o.current="",window.clearTimeout(r.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(r.current),[]),[o,a,i]}function im(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(r,0));1===o.length&&(a=a.filter(e=>e!==n));const i=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return i!==n?i:void 0}om.displayName="SelectBubbleInput";var sm=bh,lm=Eh,cm=Sh,um=Nh,dm=zh,fm=Fh,pm=Yh,hm=Kh,mm=qh,gm=Gh,ym=Jh,vm=tm;const bm=yh,wm=xh,xm=e.forwardRef((t,n)=>{var{className:o,children:r}=t,a=ql(t,["className","children"]);return e.createElement(sm,Object.assign({ref:n,className:Vl("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",o)},a),r,e.createElement(lm,{asChild:!0},e.createElement(Ms,{className:"h-4 w-4 opacity-50"})))});xm.displayName=sm.displayName;const Em=e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(gm,Object.assign({ref:n,className:Vl("flex cursor-default items-center justify-center py-1",o)},r),e.createElement(Ps,{className:"h-4 w-4"}))});Em.displayName=gm.displayName;const Sm=e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(ym,Object.assign({ref:n,className:Vl("flex cursor-default items-center justify-center py-1",o)},r),e.createElement(Ms,{className:"h-4 w-4"}))});Sm.displayName=ym.displayName;const _m=e.forwardRef((t,n)=>{var{className:o,children:r,position:a="popper"}=t,i=ql(t,["className","children","position"]);return e.createElement(cm,null,e.createElement(um,Object.assign({ref:n,className:Vl("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o),position:a},i),e.createElement(Em,null),e.createElement(dm,{className:Vl("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},r),e.createElement(Sm,null)))});_m.displayName=um.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(fm,Object.assign({ref:n,className:Vl("py-1.5 pl-8 pr-2 text-sm font-semibold",o)},r))}).displayName=fm.displayName;const Nm=e.forwardRef((t,n)=>{var{className:o,children:r}=t,a=ql(t,["className","children"]);return e.createElement(pm,Object.assign({ref:n,className:Vl("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o)},a),e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(mm,null,e.createElement(ks,{className:"h-4 w-4"}))),e.createElement(hm,null,r))});Nm.displayName=pm.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(vm,Object.assign({ref:n,className:Vl("-mx-1 my-1 h-px bg-muted",o)},r))}).displayName=vm.displayName;const Cm=({files:e,currentFile:n,onFileSelect:o,onRefresh:r,loading:a=!1,disabled:i=!1})=>t.createElement("div",{className:"flex items-center gap-2"},0!==e.length||a?t.createElement(bm,{value:n||"",onValueChange:o,disabled:i||a},t.createElement(xm,{className:Vl("w-fit shadcn-select transition-all duration-200",(i||a)&&"opacity-60 cursor-not-allowed")},t.createElement("div",{className:"flex items-center justify-between w-full gap-3 p-2"},t.createElement(wm,{placeholder:a?"Loading sessions...":0===e.length?"No sessions found":"Select an Agent Session..."}))),t.createElement(_m,null,0!==e.length||a?e.map(e=>t.createElement(Nm,{key:e.name,value:e.name},e.name)):t.createElement("div",{className:"px-2 py-3 text-center text-sm text-gray-500"},"No agent sessions available"))):t.createElement("div",{className:"text-sm text-gray-500 px-3 py-2"},"No agent sessions available"),e.length>0&&t.createElement("button",{onClick:e=>{e.stopPropagation(),r()},disabled:a||i,title:a?"Loading...":"Refresh files",className:Vl("file-selector-refresh-btn transition-all duration-200",(a||i)&&"opacity-50 cursor-not-allowed")},a?t.createElement(Rs,{className:"h-4 w-4 animate-spin text-gray-400"}):t.createElement(Ds,{className:"h-4 w-4"})));var km="Checkbox",[Mm,Om]=dc(km),[Pm,Rm]=Mm(km);function Am(t){const{__scopeCheckbox:n,checked:o,children:r,defaultChecked:a,disabled:i,form:s,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,h]=vc({prop:o,defaultProp:a??!1,onChange:c,caller:km}),[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useRef(!1),x=!g||(!!s||!!g.closest("form")),E={checked:p,disabled:i,setChecked:h,control:g,setControl:y,name:l,form:s,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:!Fm(a)&&a,isFormControl:x,bubbleInput:v,setBubbleInput:b};return m(Pm,{scope:n,...E,children:Hm(f)?f(E):r})}var Dm="CheckboxTrigger",Tm=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:o,...r},a)=>{const{control:i,value:s,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=Rm(Dm,t),y=uc(a,d),v=e.useRef(c);return e.useEffect(()=>{const e=i?.form;if(e){const t=()=>f(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,f]),m(Sc.button,{type:"button",role:"checkbox","aria-checked":Fm(c)?"mixed":c,"aria-required":u,"data-state":jm(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:y,onKeyDown:sc(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:sc(o,e=>{f(e=>!!Fm(e)||!e),g&&h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});Tm.displayName=Dm;var Im=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return m(Am,{__scopeCheckbox:n,checked:r,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:o,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>g(y,{children:[m(Tm,{...d,ref:t,__scopeCheckbox:n}),e&&m(Bm,{__scopeCheckbox:n})]})})});Im.displayName=km;var zm="CheckboxIndicator",Lm=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,a=Rm(zm,n);return m(Wc,{present:o||Fm(a.checked)||!0===a.checked,children:m(Sc.span,{"data-state":jm(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Lm.displayName=zm;var $m="CheckboxBubbleInput",Bm=e.forwardRef(({__scopeCheckbox:t,...n},o)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:s,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=Rm($m,t),g=uc(o,h),y=nh(i),v=Dp(r);e.useEffect(()=>{const e=p;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!a.current;if(y!==i&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Fm(i),n.call(e,!Fm(i)&&i),e.dispatchEvent(t)}},[p,y,i,a]);const b=e.useRef(!Fm(i)&&i);return m(Sc.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:u,value:d,form:f,...n,tabIndex:-1,ref:g,style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function Hm(e){return"function"==typeof e}function Fm(e){return"indeterminate"===e}function jm(e){return Fm(e)?"indeterminate":e?"checked":"unchecked"}Bm.displayName=$m;const Vm=e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(Im,Object.assign({ref:n,className:Vl("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o)},r),e.createElement(Lm,{className:Vl("flex items-center justify-center text-current")},e.createElement(ks,{className:"h-4 w-4"})))});Vm.displayName=Im.displayName;const Wm=t.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Ym=()=>{const e=t.useContext(Wm);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function Xm(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Km(){return qm(/^iPad/)||qm(/^Mac/)&&navigator.maxTouchPoints>1}function Um(){return qm(/^iPhone/)||Km()}function qm(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const Zm="undefined"!=typeof window?f:i;function Gm(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Qm="undefined"!=typeof document&&window.visualViewport;function Jm(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function eg(e){for(Jm(e)&&(e=e.parentElement);e&&!Jm(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const tg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ng,og=0;function rg(e={}){let{isDisabled:t}=e;Zm(()=>{if(!t)return og++,1===og&&Um()&&(ng=function(){let e,t=0,n=n=>{e=eg(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},o=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let o=n.changedTouches[0].pageY,r=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((r<=0&&o>t||r>=a&&o<t)&&n.preventDefault(),t=o)},r=e=>{let t=e.target;sg(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;sg(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Qm&&(Qm.height<window.innerHeight?requestAnimationFrame(()=>{ig(t)}):Qm.addEventListener("resize",()=>ig(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Gm(function(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=Gm(ag(document,"touchstart",n,{passive:!1,capture:!0}),ag(document,"touchmove",o,{passive:!1,capture:!0}),ag(document,"touchend",r,{passive:!1,capture:!0}),ag(document,"focus",a,!0),ag(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{og--,0===og&&(null==ng||ng())}},[t])}function ag(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function ig(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=eg(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,o=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=o-n)}e=t.parentElement}}function sg(e){return e instanceof HTMLInputElement&&!tg.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function lg(...t){return e.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...t),t)}const cg=new WeakMap;function ug(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let o={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(o[t]=e.style[t],e.style[t]=n)}),n||cg.set(e,o)}const dg=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function fg(e,t){if(!e)return null;const n=window.getComputedStyle(e),o=n.transform||n.webkitTransform||n.mozTransform;let r=o.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[dg(t)?13:12]):(r=o.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[dg(t)?5:4]):null)}function pg(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const hg={DURATION:.5,EASE:[.32,.72,0,1]},mg=16,gg="vaul-dragging";function yg(e){const n=t.useRef(e);return t.useEffect(()=>{n.current=e}),t.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function vg({prop:e,defaultProp:n,onChange:o=()=>{}}){const[r,a]=function({defaultProp:e,onChange:n}){const o=t.useState(e),[r]=o,a=t.useRef(r),i=yg(n);return t.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),o}({defaultProp:n,onChange:o}),i=void 0!==e,s=i?e:r,l=yg(o),c=t.useCallback(t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else a(t)},[i,e,a,l]);return[s,c]}let bg=null;function wg({open:e,onOpenChange:n,children:o,onDrag:r,onRelease:a,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:N=!1,repositionInputs:C=!0,onAnimationEnd:k,container:M,autoFocus:O=!1}){var P,R;const[A=!1,D]=vg({defaultProp:E,prop:e,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==k||k(e)},1e3*hg.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[T,I]=t.useState(!1),[z,L]=t.useState(!1),[$,B]=t.useState(!1),H=t.useRef(null),F=t.useRef(null),j=t.useRef(null),V=t.useRef(null),W=t.useRef(null),Y=t.useRef(!1),X=t.useRef(null),K=t.useRef(0),U=t.useRef(!1),q=t.useRef(!E),Z=t.useRef(0),G=t.useRef(null),Q=t.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().height)||0),J=t.useRef((null==(R=G.current)?void 0:R.getBoundingClientRect().width)||0),ee=t.useRef(0),te=t.useCallback(e=>{i&&e===ie.length-1&&(F.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:oe,setActiveSnapPoint:re,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:o,drawerRef:r,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=vg({prop:e,defaultProp:null==o?void 0:o[0],onChange:n}),[p,h]=t.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);t.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=t.useMemo(()=>d===(null==o?void 0:o[o.length-1])||null,[o,d]),g=t.useMemo(()=>{var e;return null!=(e=null==o?void 0:o.findIndex(e=>e===d))?e:null},[o,d]),y=o&&o.length>0&&(i||0===i)&&!Number.isNaN(i)&&o[i]===d||!o,v=t.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==o?void 0:o.map(t=>{const n="string"==typeof t;let o=0;if(n&&(o=parseInt(t,10)),dg(l)){const r=n?o:p?t*e.height:0;return p?"bottom"===l?e.height-r:-e.height+r:r}const r=n?o:p?t*e.width:0;return p?"right"===l?e.width-r:-e.width+r:r}))?t:[]},[o,p,c]),b=t.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=t.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),ug(r.current,{transition:`transform ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`,transform:dg(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?ug(a.current,{transition:`opacity ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`,opacity:"0"}):ug(a.current,{transition:`opacity ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`,opacity:"1"}),f(null==o?void 0:o[Math.max(n,0)])},[r.current,o,v,i,a,f]);return t.useEffect(()=>{if(d||e){var t;const n=null!=(t=null==o?void 0:o.findIndex(t=>t===e||t===d))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,e,o,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!o||"number"!=typeof g||!v||void 0===i)return null;const n=g===i-1;if(g>=i&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const r=n?g+1:g-1,a=n?v[r]-v[r-1]:v[r+1]-v[r],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:r}){if(void 0===i)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===i-1&&ug(a.current,{transition:`opacity ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`}),!u&&n>2&&!d)return void(r?t():w(v[0]));if(!u&&n>2&&d&&v&&o)return void w(v[o.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=dg(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&o)return void w(v[o.length-1]);if(c&&e<0&&r&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||ug(r.current,{transform:dg(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:H,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});rg({isDisabled:!A||z||!y||$||!T||!C||!S});const{restorePositionSetting:ue}=function({isOpen:e,modal:n,nested:o,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=t.useState(()=>"undefined"!=typeof window?window.location.href:""),c=t.useRef(0),u=t.useCallback(()=>{if(Xm()&&null===bg&&e&&!i){bg={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-c.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=-(c.current+e)+"px")}),300)}},[e]),d=t.useCallback(()=>{if(Xm()&&null!==bg&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,bg),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),bg=null}},[s]);return t.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),t.useEffect(()=>{!o&&r&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[e,r,s,n,o,u,d]),{restorePositionSetting:d}}({isOpen:A,modal:y,nested:null!=b&&b,hasBeenOpened:T,preventScrollRestoration:N,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let o=e;const r=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?fg(G.current,x):null,i=new Date;if("SELECT"===o.tagName)return!1;if(o.hasAttribute("data-vaul-no-drag")||o.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(F.current&&i.getTime()-F.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(r&&r.length>0)return!1;if(W.current&&i.getTime()-W.current.getTime()<u&&0===a)return W.current=i,!1;if(t)return W.current=i,!1;for(;o;){if(o.scrollHeight>o.clientHeight){if(0!==o.scrollTop)return W.current=new Date,!1;if("dialog"===o.getAttribute("role"))return!0}o=o.parentNode}return!0}function pe(e){!function(){if(!z||!G.current)return;G.current.classList.remove(gg),Y.current=!1,L(!1),V.current=new Date}(),null==v||v(),e||D(!1),setTimeout(()=>{i&&re(i[0])},1e3*hg.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=fg(G.current,x);ug(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`}),ug(H.current,{transition:`opacity ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&A&&ug(e,{borderRadius:"8px",overflow:"hidden",...dg(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${hg.DURATION}s`,transitionTimingFunction:`cubic-bezier(${hg.EASE.join(",")})`},!0)}return t.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),t.useEffect(()=>{var e;function t(){if(!G.current||!C)return;if(sg(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let o=n-t;const r=G.current.getBoundingClientRect().height||0,a=r>.8*n;ee.current||(ee.current=r);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-o)>60&&(U.current=!U.current),i&&i.length>0&&ie&&oe){o+=ie[oe]||0}if(Z.current=o,r>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),G.current.style.height=g?e-Math.max(o,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);i&&i.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(o,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[oe,i,ie]),t.useEffect(()=>(A&&(ug(document.documentElement,{scrollBehavior:"auto"}),F.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=cg.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[A]),t.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),t.createElement(xd,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?I(!0):pe(!0),D(e))},open:A},t.createElement(Wm.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:re,drawerRef:G,overlayRef:H,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,L(!0),j.current=new Date,Um()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=dg(x)?e.pageY:e.pageX))},onRelease:function(e){if(!z||!G.current)return;G.current.classList.remove(gg),Y.current=!1,L(!1),V.current=new Date;const t=fg(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===j.current)return;const n=V.current.getTime()-j.current.getTime(),o=K.current-(dg(x)?e.pageY:e.pageX),r=Math.abs(o)/n;if(r>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:o*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:r,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?o>0:o<0)return he(),void(null==a||a(e,!0));if(r>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&z){const n="bottom"===x||"right"===x?1:-1,o=(K.current-(dg(x)?e.pageY:e.pageX))*n,a=o>0,l=i&&!d&&!a;if(l&&0===oe)return;const c=Math.abs(o),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,a);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,a))return;if(G.current.classList.add(gg),Y.current=!0,ug(G.current,{transition:"none"}),ug(H.current,{transition:"none"}),i&&se({draggedDistance:o}),a&&!i){const e=(t=o,8*(Math.log(t+1)-2)),r=Math.min(-1*e,0)*n;return void ug(G.current,{transform:dg(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`})}const m=1-f;if((le||p&&oe===p-1)&&(null==r||r(e,f),ug(H.current,{opacity:`${m}`,transition:"none"},!0)),u&&H.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);ug(u,{borderRadius:`${t}px`,transform:dg(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;ug(G.current,{transform:dg(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:A,isDragging:z,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-mg)/window.innerWidth,o=n+t*(1-n),r=t*mg-16;ug(G.current,{transform:dg(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-mg)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),ug(G.current,{transition:`transform ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`,transform:dg(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=fg(G.current,x);ug(G.current,{transition:"none",transform:dg(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=dg(x)?window.innerHeight:window.innerWidth,o=t?(n-mg)/n:1,r=t?-16:0;t&&ug(G.current,{transition:`transform ${hg.DURATION}s cubic-bezier(${hg.EASE.join(",")})`,transform:dg(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ie,activeSnapPointIndex:oe,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:O}},o))}const xg=t.forwardRef(function({...e},n){const{overlayRef:o,snapPoints:r,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Ym(),u=lg(n,o),d=r&&r.length>0;if(!l)return null;const f=t.useCallback(e=>a(e),[a]);return t.createElement(_d,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});xg.displayName="Drawer.Overlay";const Eg=t.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:o,...a},i){const{drawerRef:s,onPress:l,onRelease:c,onDrag:u,keyboardIsOpen:d,snapPointsOffset:f,activeSnapPointIndex:p,modal:h,isOpen:m,direction:g,snapPoints:y,container:v,handleOnly:b,shouldAnimate:w,autoFocus:x}=Ym(),[E,S]=t.useState(!1),_=lg(i,s),N=t.useRef(null),C=t.useRef(null),k=t.useRef(!1),M=y&&y.length>0;!function(){const{direction:e,isOpen:n,shouldScaleBackground:o,setBackgroundColorOnScale:a,noBodyStyles:i}=Ym(),s=t.useRef(null),l=r(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-26)/window.innerWidth}t.useEffect(()=>{if(n&&o){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;a&&!i&&pg(document.body,{background:"black"}),pg(t,{transformOrigin:dg(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${hg.DURATION}s`,transitionTimingFunction:`cubic-bezier(${hg.EASE.join(",")})`});const n=pg(t,{borderRadius:"8px",overflow:"hidden",...dg(e)?{transform:`scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),s.current=window.setTimeout(()=>{l?document.body.style.background=l:document.body.style.removeProperty("background")},1e3*hg.DURATION)}}},[n,o,l])}();function O(e){N.current=null,k.current=!1,c(e)}return t.useEffect(()=>{M&&window.requestAnimationFrame(()=>{S(!0)})},[]),t.createElement(Nd,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":E?"true":"false","data-vaul-snap-points":m&&M?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":(null==w?void 0:w.current)?"true":"false",...a,ref:_,style:f&&f.length>0?{"--snap-point-height":`${f[null!=p?p:0]}px`,...n}:n,onPointerDown:e=>{b||(null==a.onPointerDown||a.onPointerDown.call(a,e),N.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{null==o||o(e),x||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),h&&!t.defaultPrevented?d.current&&(d.current=!1):t.preventDefault()},onFocusOutside:e=>{h||e.preventDefault()},onPointerMove:e=>{if(C.current=e,b)return;if(null==a.onPointerMove||a.onPointerMove.call(a,e),!N.current)return;const t=e.pageY-N.current.y,n=e.pageX-N.current.x,o="touch"===e.pointerType?10:2,r=((e,t,n=0)=>{if(k.current)return!0;const o=Math.abs(e.y),r=Math.abs(e.x),a=r>o,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&r>=0&&r<=n)return a}else if(!(e.y*i<0)&&o>=0&&o<=n)return!a;return k.current=!0,!0})({x:n,y:t},g,o);r?u(e):(Math.abs(n)>o||Math.abs(t)>o)&&(N.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),N.current=null,k.current=!1,c(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),O(C.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),C.current&&O(C.current)}})});Eg.displayName="Drawer.Content";const Sg=t.forwardRef(function({preventCycle:e=!1,children:n,...o},r){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Ym(),m=t.useRef(null),g=t.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return t.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||e||g.current)return void y();if(y(),!s||0===s.length)return void(u||a());if(l===s[s.length-1]&&u)return void a();const t=s.findIndex(e=>e===l);if(-1===t)return;const n=s[t+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...o},t.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});Sg.displayName="Drawer.Handle";const _g={Root:wg,NestedRoot:function({onDrag:e,onOpenChange:n,open:o,...r}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Ym();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return t.createElement(wg,{nested:!0,open:o,onClose:()=>{i(!1)},onDrag:(t,n)=>{a(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...r})},Content:Eg,Overlay:xg,Trigger:Ed,Portal:function(e){const n=Ym(),{container:o=n.container,...r}=e;return t.createElement(Sd,{container:o,...r})},Handle:Sg,Close:Md,Title:Cd,Description:kd},Ng=t=>{var{shouldScaleBackground:n=!0}=t,o=ql(t,["shouldScaleBackground"]);return e.createElement(_g.Root,Object.assign({shouldScaleBackground:n},o))};Ng.displayName="Drawer";const Cg=_g.Portal,kg=e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(_g.Overlay,Object.assign({ref:n,className:Vl("fixed inset-0 z-50 bg-black/80",o)},r))});kg.displayName=_g.Overlay.displayName;const Mg=e.forwardRef((t,n)=>{var{className:o,children:r}=t,a=ql(t,["className","children"]);return e.createElement(Cg,null,e.createElement(kg,null),e.createElement(_g.Content,Object.assign({ref:n,className:Vl("fixed inset-x-0 top-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",o)},a),e.createElement("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),r))});Mg.displayName="DrawerContent";e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(_g.Title,Object.assign({ref:n,className:Vl("text-lg font-semibold leading-none tracking-tight",o)},r))}).displayName=_g.Title.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=ql(t,["className"]);return e.createElement(_g.Description,Object.assign({ref:n,className:Vl("text-sm text-muted-foreground",o)},r))}).displayName=_g.Description.displayName;export{Ld as AgenticFlowVisualizer,ec as Badge,Vm as Checkbox,Ng as Drawer,Ts as Edge,Cm as FileSelector,oc as JsonTreeViewer,ac as Node,bm as Select,Od as Sheet,ic as Timeline,$d as Visualizer,Id as calculateAutoLayout,Vl as cn,Xl as formatCurrency,Kl as formatLatency,Wl as toTitleCase,Yl as truncateText};
54
+ */function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Is.apply(null,arguments)}var zs=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),$s="-ms-",Ls="-moz-",Bs="-webkit-",Hs="comm",Fs="rule",js="decl",Ws="@keyframes",Vs=Math.abs,Ys=String.fromCharCode,Xs=Object.assign;function Ks(e){return e.trim()}function Us(e,t,n){return e.replace(t,n)}function qs(e,t){return e.indexOf(t)}function Zs(e,t){return 0|e.charCodeAt(t)}function Gs(e,t,n){return e.slice(t,n)}function Qs(e){return e.length}function Js(e){return e.length}function el(e,t){return t.push(e),e}var tl=1,nl=1,ol=0,rl=0,al=0,il="";function sl(e,t,n,o,r,a,i){return{value:e,root:t,parent:n,type:o,props:r,children:a,line:tl,column:nl,length:i,return:""}}function ll(e,t){return Xs(sl("",null,null,"",null,null,0),e,{length:-e.length},t)}function cl(){return al=rl>0?Zs(il,--rl):0,nl--,10===al&&(nl=1,tl--),al}function ul(){return al=rl<ol?Zs(il,rl++):0,nl++,10===al&&(nl=1,tl++),al}function dl(){return Zs(il,rl)}function fl(){return rl}function pl(e,t){return Gs(il,e,t)}function hl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ml(e){return tl=nl=1,ol=Qs(il=e),rl=0,[]}function gl(e){return il="",e}function yl(e){return Ks(pl(rl-1,wl(91===e?e+2:40===e?e+1:e)))}function vl(e){for(;(al=dl())&&al<33;)ul();return hl(e)>2||hl(al)>3?"":" "}function bl(e,t){for(;--t&&ul()&&!(al<48||al>102||al>57&&al<65||al>70&&al<97););return pl(e,fl()+(t<6&&32==dl()&&32==ul()))}function wl(e){for(;ul();)switch(al){case e:return rl;case 34:case 39:34!==e&&39!==e&&wl(al);break;case 40:41===e&&wl(e);break;case 92:ul()}return rl}function xl(e,t){for(;ul()&&e+al!==57&&(e+al!==84||47!==dl()););return"/*"+pl(t,rl-1)+"*"+Ys(47===e?e:ul())}function El(e){for(;!hl(dl());)ul();return pl(e,rl)}function Sl(e){return gl(_l("",null,null,null,[""],e=ml(e),0,[0],e))}function _l(e,t,n,o,r,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=r,x=a,E=o,S=b;g;)switch(h=v,v=ul()){case 40:if(108!=h&&58==Zs(S,d-1)){-1!=qs(S+=Us(yl(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=yl(v);break;case 9:case 10:case 13:case 32:S+=vl(h);break;case 92:S+=bl(fl()-1,7);continue;case 47:switch(dl()){case 42:case 47:el(Cl(xl(ul(),fl()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=Qs(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=Us(S,/\f/g,"")),p>0&&Qs(S)-d&&el(p>32?Nl(S+";",o,n,d-1):Nl(Us(S," ","")+";",o,n,d-2),l);break;case 59:S+=";";default:if(el(E=kl(S,t,n,c,u,r,s,b,w=[],x=[],d),a),123===v)if(0===u)_l(S,t,E,E,w,a,d,s,x);else switch(99===f&&110===Zs(S,3)?100:f){case 100:case 108:case 109:case 115:_l(e,E,E,o&&el(kl(e,E,E,0,0,r,s,b,r,w=[],d),x),r,x,d,s,o?w:x);break;default:_l(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=i;break;case 58:d=1+Qs(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==cl())continue;switch(S+=Ys(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Qs(S)-1)*y,y=1;break;case 64:45===dl()&&(S+=yl(ul())),f=dl(),u=d=Qs(b=S+=El(fl())),v++;break;case 45:45===h&&2==Qs(S)&&(m=0)}}return a}function kl(e,t,n,o,r,a,i,s,l,c,u){for(var d=r-1,f=0===r?a:[""],p=Js(f),h=0,m=0,g=0;h<o;++h)for(var y=0,v=Gs(e,d+1,d=Vs(m=i[h])),b=e;y<p;++y)(b=Ks(m>0?f[y]+" "+v:Us(v,/&\f/g,f[y])))&&(l[g++]=b);return sl(e,t,n,0===r?Fs:s,l,c,u)}function Cl(e,t,n){return sl(e,t,n,Hs,Ys(al),Gs(e,2,-2),0)}function Nl(e,t,n,o){return sl(e,t,n,js,Gs(e,0,o),Gs(e,o+1,-1),o)}function Ml(e,t){for(var n="",o=Js(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function Ol(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case js:return e.return=e.return||e.value;case Hs:return"";case Ws:return e.return=e.value+"{"+Ml(e.children,o)+"}";case Fs:e.value=e.props.join(",")}return Qs(n=Ml(e.children,o))?e.return=e.value+"{"+n+"}":""}function Pl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Al=function(e,t,n){for(var o=0,r=0;o=r,r=dl(),38===o&&12===r&&(t[n]=1),!hl(r);)ul();return pl(e,rl)},Rl=function(e,t){return gl(function(e,t){var n=-1,o=44;do{switch(hl(o)){case 0:38===o&&12===dl()&&(t[n]=1),e[n]+=Al(rl-1,t,n);break;case 2:e[n]+=yl(o);break;case 4:if(44===o){e[++n]=58===dl()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Ys(o)}}while(o=ul());return e}(ml(e),t))},Dl=new WeakMap,Tl=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Dl.get(n))&&!o){Dl.set(e,!0);for(var r=[],a=Rl(t,r),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},Il=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function zl(e,t){switch(function(e,t){return 45^Zs(e,0)?(((t<<2^Zs(e,0))<<2^Zs(e,1))<<2^Zs(e,2))<<2^Zs(e,3):0}(e,t)){case 5103:return Bs+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Bs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Bs+e+Ls+e+$s+e+e;case 6828:case 4268:return Bs+e+$s+e+e;case 6165:return Bs+e+$s+"flex-"+e+e;case 5187:return Bs+e+Us(e,/(\w+).+(:[^]+)/,Bs+"box-$1$2"+$s+"flex-$1$2")+e;case 5443:return Bs+e+$s+"flex-item-"+Us(e,/flex-|-self/,"")+e;case 4675:return Bs+e+$s+"flex-line-pack"+Us(e,/align-content|flex-|-self/,"")+e;case 5548:return Bs+e+$s+Us(e,"shrink","negative")+e;case 5292:return Bs+e+$s+Us(e,"basis","preferred-size")+e;case 6060:return Bs+"box-"+Us(e,"-grow","")+Bs+e+$s+Us(e,"grow","positive")+e;case 4554:return Bs+Us(e,/([^-])(transform)/g,"$1"+Bs+"$2")+e;case 6187:return Us(Us(Us(e,/(zoom-|grab)/,Bs+"$1"),/(image-set)/,Bs+"$1"),e,"")+e;case 5495:case 3959:return Us(e,/(image-set\([^]*)/,Bs+"$1$`$1");case 4968:return Us(Us(e,/(.+:)(flex-)?(.*)/,Bs+"box-pack:$3"+$s+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Bs+e+e;case 4095:case 3583:case 4068:case 2532:return Us(e,/(.+)-inline(.+)/,Bs+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Qs(e)-1-t>6)switch(Zs(e,t+1)){case 109:if(45!==Zs(e,t+4))break;case 102:return Us(e,/(.+:)(.+)-([^]+)/,"$1"+Bs+"$2-$3$1"+Ls+(108==Zs(e,t+3)?"$3":"$2-$3"))+e;case 115:return~qs(e,"stretch")?zl(Us(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Zs(e,t+1))break;case 6444:switch(Zs(e,Qs(e)-3-(~qs(e,"!important")&&10))){case 107:return Us(e,":",":"+Bs)+e;case 101:return Us(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Bs+(45===Zs(e,14)?"inline-":"")+"box$3$1"+Bs+"$2$3$1"+$s+"$2box$3")+e}break;case 5936:switch(Zs(e,t+11)){case 114:return Bs+e+$s+Us(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Bs+e+$s+Us(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Bs+e+$s+Us(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Bs+e+$s+e+e}return e}var $l=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case js:e.return=zl(e.value,e.length);break;case Ws:return Ml([ll(e,{value:Us(e.value,"@","@"+Bs)})],o);case Fs:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ml([ll(e,{props:[Us(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return Ml([ll(e,{props:[Us(t,/:(plac\w+)/,":"+Bs+"input-$1")]}),ll(e,{props:[Us(t,/:(plac\w+)/,":-moz-$1")]}),ll(e,{props:[Us(t,/:(plac\w+)/,$s+"input-$1")]})],o)}return""})}}],Ll=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var o,r,a=e.stylisPlugins||$l,i={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u=[Ol,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Js(e);return function(n,o,r,a){for(var i="",s=0;s<t;s++)i+=e[s](n,o,r,a)||"";return i}}([Tl,Il].concat(a,u));r=function(e,t,n,o){l=n,Ml(Sl(e?e+"{"+t.styles+"}":t.styles),d),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new zs({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return f.sheet.hydrate(s),f};var Bl=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)};var Hl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Fl=/[A-Z]|^ms/g,jl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wl=function(e){return 45===e.charCodeAt(1)},Vl=function(e){return null!=e&&"boolean"!=typeof e},Yl=Pl(function(e){return Wl(e)?e:e.replace(Fl,"-$&").toLowerCase()}),Xl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(jl,function(e,t,n){return Ul={name:t,styles:n,next:Ul},t})}return 1===Hl[e]||Wl(e)||"number"!=typeof t||0===t?t:t+"px"};function Kl(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return Ul={name:r.name,styles:r.styles,next:Ul},r.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)Ul={name:i.name,styles:i.styles,next:Ul},i=i.next;return a.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=Kl(e,t,n[r])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?o+=a+"{"+t[s]+"}":Vl(s)&&(o+=Yl(a)+":"+Xl(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Kl(e,t,i);switch(a){case"animation":case"animationName":o+=Yl(a)+":"+l+";";break;default:o+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Vl(i[c])&&(o+=Yl(a)+":"+Xl(a,i[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=Ul,l=n(e);return Ul=s,Kl(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Ul,ql=/label:\s*([^\s;{]+)\s*(;|$)/g;var Zl=!!e.useInsertionEffect&&e.useInsertionEffect||function(e){return e()},Gl=e.createContext("undefined"!=typeof HTMLElement?Ll({key:"css"}):null);Gl.Provider;var Ql=e.createContext({}),Jl=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,ec=Pl(function(e){return Jl.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),tc=function(e){return"theme"!==e},nc=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?ec:tc},oc=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},rc=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Bl(t,n,o),Zl(function(){return function(e,t,n){Bl(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}),null},ac=function t(n,o){var r,i,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==o&&(r=o.label,i=o.target);var u=oc(n,o,s),d=u||nc(l),f=!d("as");return function(){var p=arguments,h=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==r&&h.push("label:"+r+";"),null==p[0]||void 0===p[0].raw)h.push.apply(h,p);else{var m=p[0];h.push(m[0]);for(var g=p.length,y=1;y<g;y++)h.push(p[y],m[y])}var v,b=(v=function(t,n,o){var r,a,s,c,p=f&&t.as||l,m="",g=[],y=t;if(null==t.theme){for(var v in y={},t)y[v]=t[v];y.theme=e.useContext(Ql)}"string"==typeof t.className?(r=n.registered,a=g,s=t.className,c="",s.split(" ").forEach(function(e){void 0!==r[e]?a.push(r[e]+";"):e&&(c+=e+" ")}),m=c):null!=t.className&&(m=t.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";Ul=void 0;var a=e[0];null==a||void 0===a.raw?(o=!1,r+=Kl(n,t,a)):r+=a[0];for(var i=1;i<e.length;i++)r+=Kl(n,t,e[i]),o&&(r+=a[i]);ql.lastIndex=0;for(var s,l="";null!==(s=ql.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Ul}}(h.concat(g),n.registered,y);m+=n.key+"-"+b.name,void 0!==i&&(m+=" "+i);var w=f&&void 0===u?nc(p):d,x={};for(var E in t)f&&"as"===E||w(E)&&(x[E]=t[E]);return x.className=m,o&&(x.ref=o),e.createElement(e.Fragment,null,e.createElement(rc,{cache:n,serialized:b,isStringTag:"string"==typeof p}),e.createElement(p,x))},a(function(e,t){var n=c(Gl);return v(e,n,t)}));return b.displayName=void 0!==r?r:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",b.defaultProps=n.defaultProps,b.__emotion_real=b,b.__emotion_base=l,b.__emotion_styles=h,b.__emotion_forwardProp=u,Object.defineProperty(b,"toString",{value:function(){return"."+i}}),b.withComponent=function(e,n){return t(e,Is({},o,n,{shouldForwardProp:oc(b,n,!0)})).apply(void 0,h)},b}}.bind(null);function ic(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=ic(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function sc(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ic(e))&&(o&&(o+=" "),o+=t);return o}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ac[e]=ac(e)});const lc=e=>{const t=fc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),cc(n,t)||dc(e)},getConflictingClassGroupIds:(e,t)=>{const r=n[e]||[];return t&&o[e]?[...r,...o[e]]:r}}},cc=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?cc(e.slice(1),o):void 0;if(r)return r;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},uc=/^\[(.+)\]$/,dc=e=>{if(uc.test(e)){const t=uc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fc=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const e in n)pc(n[e],o,e,t);return o},pc=(e,t,n,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:hc(t,e)).classGroupId=n)}if("function"==typeof e)return mc(e)?void pc(e(o),t,n,o):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,r])=>{pc(r,hc(t,e),n,o)})})},hc=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},mc=e=>e.isThemeGetter,gc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(r,a)=>{n.set(r,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(r(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):r(e,t)}}},yc=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=e=>{const t=[];let n,o=0,r=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===o&&0===r){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?o++:"]"===s?o--:"("===s?r++:")"===s&&r--}const i=0===t.length?e:e.substring(a),s=vc(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=o;o=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=o;o=t=>n({className:t,parseClassName:e})}return o},vc=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,bc=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...o.sort(),e),o=[]):o.push(e)}),n.push(...o.sort()),n}},wc=/\s+/;function xc(){let e,t,n=0,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Ec(e))&&(o&&(o+=" "),o+=t);return o}const Ec=e=>{if("string"==typeof e)return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Ec(e[o]))&&(n&&(n+=" "),n+=t);return n};function Sc(e,...t){let n,o,r,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:gc(e.cacheSize),parseClassName:yc(e),sortModifiers:bc(e),...lc(e)}))(l),o=n.cache.get,r=n.cache.set,a=i,i(s)};function i(e){const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a}=t,i=[],s=e.trim().split(wc);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=o(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=o(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=a(u).join(":"),y=d?g+"!":g,v=y+m;if(i.includes(v))continue;i.push(v);const b=r(m,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return r(e,a),a}return function(){return a(xc.apply(null,arguments))}}const _c=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},kc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nc=/^\d+\/\d+$/,Mc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ac=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dc=e=>Nc.test(e),Tc=e=>!!e&&!Number.isNaN(Number(e)),Ic=e=>!!e&&Number.isInteger(Number(e)),zc=e=>e.endsWith("%")&&Tc(e.slice(0,-1)),$c=e=>Mc.test(e),Lc=()=>!0,Bc=e=>Oc.test(e)&&!Pc.test(e),Hc=()=>!1,Fc=e=>Ac.test(e),jc=e=>Rc.test(e),Wc=e=>!Yc(e)&&!Gc(e),Vc=e=>ru(e,lu,Hc),Yc=e=>kc.test(e),Xc=e=>ru(e,cu,Bc),Kc=e=>ru(e,uu,Tc),Uc=e=>ru(e,iu,Hc),qc=e=>ru(e,su,jc),Zc=e=>ru(e,fu,Fc),Gc=e=>Cc.test(e),Qc=e=>au(e,cu),Jc=e=>au(e,du),eu=e=>au(e,iu),tu=e=>au(e,lu),nu=e=>au(e,su),ou=e=>au(e,fu,!0),ru=(e,t,n)=>{const o=kc.exec(e);return!!o&&(o[1]?t(o[1]):n(o[2]))},au=(e,t,n=!1)=>{const o=Cc.exec(e);return!!o&&(o[1]?t(o[1]):n)},iu=e=>"position"===e||"percentage"===e,su=e=>"image"===e||"url"===e,lu=e=>"length"===e||"size"===e||"bg-size"===e,cu=e=>"length"===e,uu=e=>"number"===e,du=e=>"family-name"===e,fu=e=>"shadow"===e,pu=Sc(()=>{const e=_c("color"),t=_c("font"),n=_c("text"),o=_c("font-weight"),r=_c("tracking"),a=_c("leading"),i=_c("breakpoint"),s=_c("container"),l=_c("spacing"),c=_c("radius"),u=_c("shadow"),d=_c("inset-shadow"),f=_c("text-shadow"),p=_c("drop-shadow"),h=_c("blur"),m=_c("perspective"),g=_c("aspect"),y=_c("ease"),v=_c("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Gc,Yc],w=()=>[Gc,Yc,l],x=()=>[Dc,"full","auto",...w()],E=()=>[Ic,"none","subgrid",Gc,Yc],S=()=>["auto",{span:["full",Ic,Gc,Yc]},Ic,Gc,Yc],_=()=>[Ic,"auto",Gc,Yc],k=()=>["auto","min","max","fr",Gc,Yc],C=()=>["auto",...w()],N=()=>[Dc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,Gc,Yc],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",eu,Uc,{position:[Gc,Yc]}],P=()=>["auto","cover","contain",tu,Vc,{size:[Gc,Yc]}],A=()=>[zc,Qc,Xc],R=()=>["","none","full",c,Gc,Yc],D=()=>["",Tc,Qc,Xc],T=()=>[Tc,zc,eu,Uc],I=()=>["","none",h,Gc,Yc],z=()=>["none",Tc,Gc,Yc],$=()=>["none",Tc,Gc,Yc],L=()=>[Tc,Gc,Yc],B=()=>[Dc,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$c],breakpoint:[$c],color:[Lc],container:[$c],"drop-shadow":[$c],ease:["in","out","in-out"],font:[Wc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$c],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$c],shadow:[$c],spacing:["px",Tc],text:[$c],"text-shadow":[$c],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dc,Yc,Gc,g]}],container:["container"],columns:[{columns:[Tc,Yc,Gc,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Ic,"auto",Gc,Yc]}],basis:[{basis:[Dc,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Tc,Dc,"auto","initial","none",Yc]}],grow:[{grow:["",Tc,Gc,Yc]}],shrink:[{shrink:["",Tc,Gc,Yc]}],order:[{order:[Ic,"first","last","none",Gc,Yc]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",n,Qc,Xc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Gc,Kc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zc,Yc]}],"font-family":[{font:[Jc,Yc,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Gc,Yc]}],"line-clamp":[{"line-clamp":[Tc,"none",Gc,Kc]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Gc,Yc]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Gc,Yc]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Tc,"from-font","auto",Gc,Xc]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Tc,"auto",Gc,Yc]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Gc,Yc]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Gc,Yc]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ic,Gc,Yc],radial:["",Gc,Yc],conic:[Ic,Gc,Yc]},nu,qc]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Tc,Gc,Yc]}],"outline-w":[{outline:["",Tc,Qc,Xc]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,ou,Zc]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,ou,Zc]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Tc,Xc]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,ou,Zc]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Tc,Gc,Yc]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Tc]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Gc,Yc]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Tc]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Gc,Yc]}],filter:[{filter:["","none",Gc,Yc]}],blur:[{blur:I()}],brightness:[{brightness:[Tc,Gc,Yc]}],contrast:[{contrast:[Tc,Gc,Yc]}],"drop-shadow":[{"drop-shadow":["","none",p,ou,Zc]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Tc,Gc,Yc]}],"hue-rotate":[{"hue-rotate":[Tc,Gc,Yc]}],invert:[{invert:["",Tc,Gc,Yc]}],saturate:[{saturate:[Tc,Gc,Yc]}],sepia:[{sepia:["",Tc,Gc,Yc]}],"backdrop-filter":[{"backdrop-filter":["","none",Gc,Yc]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Tc,Gc,Yc]}],"backdrop-contrast":[{"backdrop-contrast":[Tc,Gc,Yc]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Tc,Gc,Yc]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Tc,Gc,Yc]}],"backdrop-invert":[{"backdrop-invert":["",Tc,Gc,Yc]}],"backdrop-opacity":[{"backdrop-opacity":[Tc,Gc,Yc]}],"backdrop-saturate":[{"backdrop-saturate":[Tc,Gc,Yc]}],"backdrop-sepia":[{"backdrop-sepia":["",Tc,Gc,Yc]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Gc,Yc]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Tc,"initial",Gc,Yc]}],ease:[{ease:["linear","initial",y,Gc,Yc]}],delay:[{delay:[Tc,Gc,Yc]}],animate:[{animate:["none",v,Gc,Yc]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Gc,Yc]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Gc,Yc,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Gc,Yc]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Gc,Yc]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Tc,Qc,Xc,Kc]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function hu(...e){return pu(sc(e))}function mu(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function gu(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function yu(e){if(null==e)return"$0.00";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}function vu(e){if(null==e)return"0ms";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0ms":`${Math.round(t)}ms`}var bu=function(){return bu=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},bu.apply(this,arguments)};function wu(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const xu=ac.div`
55
+ display: inline-flex;
56
+ align-items: center;
57
+ border-radius: 9999px;
58
+ border: 1px solid transparent;
59
+ padding: 0.125rem 0.625rem;
60
+ font-size: 0.75rem;
61
+ font-weight: 600;
62
+ transition: colors 0.2s ease-in-out;
63
+ outline: none;
64
+
65
+ &:focus {
66
+ outline: none;
67
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
68
+ }
69
+
70
+ ${({variant:e})=>{switch(e){case"default":default:return"\n background-color: #6366f1;\n color: white;\n &:hover {\n background-color: #5855eb;\n }\n ";case"secondary":return"\n background-color: #f3f4f6;\n color: #374151;\n &:hover {\n background-color: #e5e7eb;\n }\n ";case"destructive":return"\n background-color: #ef4444;\n color: white;\n &:hover {\n background-color: #dc2626;\n }\n ";case"outline":return"\n background-color: transparent;\n color: #374151;\n border-color: #d1d5db;\n ";case"cost":case"gray":return"\n background-color: #f3f4f6;\n color: #1f2937;\n &:hover {\n background-color: #e5e7eb;\n }\n ";case"latency":return"\n background-color: #dbeafe;\n color: #1e40af;\n &:hover {\n background-color: #bfdbfe;\n }\n ";case"latencyLow":return"\n background-color: #dcfce7;\n color: #166534;\n &:hover {\n background-color: #bbf7d0;\n }\n ";case"latencyMedium":return"\n background-color: #fed7aa;\n color: #c2410c;\n &:hover {\n background-color: #fdba74;\n }\n ";case"latencyHigh":return"\n background-color: #fecaca;\n color: #dc2626;\n &:hover {\n background-color: #fca5a5;\n }\n "}}}
71
+ `;function Eu(t){var{className:n,variant:o="default"}=t,r=wu(t,["className","variant"]);return e.createElement(xu,Object.assign({variant:o,className:n},r))}const Su=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const o=t.indexOf(e),r=t.indexOf(n);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:e.localeCompare(n)}),_u=({data:e,label:n,depth:o,maxDepth:r,path:a,priorityKeys:i})=>{const[s,l]=u(!1),c=null!==e&&"object"==typeof e&&!Array.isArray(e),d=Array.isArray(e),f=(c||d)&&o<r,p=f&&Object.keys(e).length>0;return t.createElement("div",{className:"select-none"},t.createElement("div",{className:"flex items-center gap-1 py-1 px-2 hover:bg-gray-50 rounded cursor-pointer transition-colors duration-150 "+(f?"hover:bg-gray-50":""),onClick:()=>{f&&l(!s)},style:{paddingLeft:12*o+8+"px"}},f&&p?s?t.createElement(Ms,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):t.createElement(Os,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):t.createElement("div",{className:"w-3 h-3 flex-shrink-0"}),t.createElement("span",{className:"font-medium text-gray-800 text-xs"},n,":"),!f&&t.createElement("span",{className:"text-xs "+(h=e,null==h?"text-gray-500":"string"==typeof h?"text-green-600":"number"==typeof h?"text-blue-600":"boolean"==typeof h?"text-purple-600":"text-gray-700")},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(e)),f&&!p&&t.createElement("span",{className:"text-xs text-gray-500"},d?"[]":"{}"),f&&p&&!s&&t.createElement("span",{className:"text-xs text-gray-500"},d?`[${Object.keys(e).length} items]`:`{${Object.keys(e).length} keys}`)),s&&p&&t.createElement("div",{className:"border-l border-gray-200 ml-3"},Su(e,i).map(([e,n])=>t.createElement(_u,{key:`${a}.${e}`,data:n,label:e,depth:o+1,maxDepth:r,path:`${a}.${e}`,priorityKeys:i}))));var h},ku=({data:e,maxDepth:n=4,initialExpanded:o=!1,className:r="",priorityKeys:a=["input","output"]})=>null==e?t.createElement("div",{className:`text-xs text-gray-500 italic ${r}`},"No data available"):"object"!=typeof e?t.createElement("div",{className:`text-xs ${r}`},t.createElement("span",{className:"font-medium text-gray-800"},"Value:")," ",t.createElement("span",{className:"text-gray-600"},String(e))):0===Object.keys(e).length?t.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 p-4 text-center ${r}`},t.createElement("div",{className:"text-xs text-gray-500 italic"},Array.isArray(e)?"Empty array":"Empty object")):t.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 overflow-hidden ${r}`},t.createElement("div",{className:"w-full max-h-64 overflow-y-auto"},Su(e,a).map(([e,o])=>t.createElement(_u,{key:e,data:o,label:e,depth:0,maxDepth:n,path:e,priorityKeys:a})))),Cu=({className:e="w-6 h-6"})=>t.createElement("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24",role:"img",xmlns:"http://www.w3.org/2000/svg"},t.createElement("title",null,"OpenAI icon"),t.createElement("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})),Nu=({className:e="w-6 h-6"})=>t.createElement("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",height:"24",width:"24"},t.createElement("path",{fill:"currentColor",d:"m13.788825 3.932 6.43325 16.136075h3.5279L17.316725 3.932H13.788825Z",strokeWidth:"0.25"}),t.createElement("path",{fill:"currentColor",d:"m6.325375 13.682775 2.20125 -5.67065 2.201275 5.67065H6.325375ZM6.68225 3.932 0.25 20.068075h3.596525l1.3155 -3.3886h6.729425l1.315275 3.3886h3.59655L10.371 3.932H6.68225Z",strokeWidth:"0.25"})),Mu=({className:e="w-6 h-6"})=>t.createElement("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},t.createElement("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),t.createElement("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),t.createElement("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),t.createElement("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"}),t.createElement("path",{d:"M1 1h22v22H1z",fill:"none"})),Ou=({label:e,content:n,isExpanded:o,onToggle:r})=>{const a=o?n:(null==n?void 0:n.slice(0,100))+((null==n?void 0:n.length)>100?"...":"");return t.createElement(Lu,null,t.createElement(Bu,{onClick:r},t.createElement(Hu,null,e),t.createElement(ju,null,o?t.createElement(Ms,{style:{width:"12px",height:"12px",color:"#6b7280"}}):t.createElement(Os,{style:{width:"12px",height:"12px",color:"#6b7280"}}))),t.createElement(Fu,{value:a||"",readOnly:!0,rows:o?Math.max(3,Math.max((null==n?void 0:n.split("\n").length)||0,Math.ceil(((null==n?void 0:n.length)||0)/60))):2}))},Pu=({data:e,id:n})=>{var o,r,a,i,s,l,c,d,f,p,h,m,g,y,v,b,w,x,E,S,_,k,C,N,M,O,P,A,R,D;$a();const[T,I]=u(!1),[z,$]=u(!1),L=(null===(o=e.edges)||void 0===o?void 0:o.some(e=>e.source===n))||!1,B=(null===(r=e.edges)||void 0===r?void 0:r.some(e=>e.target===n))||!1,H=e.nodeType||"Agent",F=e.label||mu(H)||"Agent",j=null===(l=null===(s=null===(i=null===(a=e.details)||void 0===a?void 0:a.internals)||void 0===i?void 0:i.llm_details)||void 0===s?void 0:s[0])||void 0===l?void 0:l.model_provider,W=((e,n)=>{if("tool"===e)return"🔧";if("coordinator"===e)return"🎯";if("agent"===e){if("OpenAI"===n)return t.createElement(Cu,null);if("Anthropic"===n)return t.createElement(Nu,null);if("Google"===n||"Vertex_AI"===n)return t.createElement(Mu,null)}return"🤖"})(H.toLowerCase(),j),V=(null===(p=null===(f=null===(d=null===(c=e.details)||void 0===c?void 0:c.internals)||void 0===d?void 0:d.llm_details)||void 0===f?void 0:f[0])||void 0===p?void 0:p.model_name)||"Unknown",Y=yu(null===(y=null===(g=null===(m=null===(h=e.details)||void 0===h?void 0:h.internals)||void 0===m?void 0:m.llm_details)||void 0===g?void 0:g[0])||void 0===y?void 0:y.total_cost),X=(null===(S=null===(E=null===(x=null===(w=null===(b=null===(v=e.details)||void 0===v?void 0:v.internals)||void 0===b?void 0:b.llm_details)||void 0===w?void 0:w[0])||void 0===x?void 0:x.input)||void 0===E?void 0:E[0])||void 0===S?void 0:S.content)||"",K=(null===(O=null===(M=null===(N=null===(C=null===(k=null===(_=e.details)||void 0===_?void 0:_.internals)||void 0===k?void 0:k.llm_details)||void 0===C?void 0:C[0])||void 0===N?void 0:N.input)||void 0===M?void 0:M[1])||void 0===O?void 0:O.content)||"",U=null===(R=null===(A=null===(P=e.details)||void 0===P?void 0:P.internals)||void 0===A?void 0:A.latency)||void 0===R?void 0:R.total_time;return t.createElement(Au,{onClick:()=>{console.log("Node clicked:",{label:e.label,nodeType:e.nodeType,details:e.details})}},B&&t.createElement(Jr,{type:"target",position:hr.Top,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:"white",cursor:"default"},isConnectable:!1}),t.createElement(Ru,null,t.createElement(Du,null,t.createElement(Tu,null,W),t.createElement(Iu,null,F)),"Agent"===H&&t.createElement(zu,null,t.createElement(Eu,{variant:"gray"},V),t.createElement(Eu,{variant:"cost"},Y)),"Tool"===H&&U&&t.createElement(zu,null,t.createElement(Eu,{variant:"latency"},vu(U))),"Coordinator"===H&&t.createElement(zu,null,t.createElement(Eu,{variant:"gray"},"Coordinator"))),t.createElement($u,null,"Agent"===H?t.createElement(t.Fragment,null,t.createElement(Ou,{label:"System Message",content:X,isExpanded:T,onToggle:()=>I(!T)}),t.createElement(Ou,{label:"User Message",content:K,isExpanded:z,onToggle:()=>$(!z)})):"Tool"===H?t.createElement(ku,{data:(()=>{var t,n,o,r,a,i;const s=(null===(t=e.details)||void 0===t?void 0:t.internals)||{};return e.edgeDetails&&e.edgeDetails.length>0?Object.assign(Object.assign({},s),{input:{args:null===(n=e.edgeDetails[0])||void 0===n?void 0:n.input_args,kwargs:null===(o=e.edgeDetails[0])||void 0===o?void 0:o.input_kwargs},output:null===(r=e.edgeDetails[0])||void 0===r?void 0:r.output,state:null===(a=e.edgeDetails[0])||void 0===a?void 0:a.state,status:null===(i=e.edgeDetails[0])||void 0===i?void 0:i.status}):s})()}):"Coordinator"===H?t.createElement(ku,{data:(null===(D=e.details)||void 0===D?void 0:D.internals)||{}}):null),L&&t.createElement(Jr,{type:"source",position:hr.Bottom,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:"white",cursor:"default"},isConnectable:!1}))},Au=ac.div`
72
+ font-family: ui-sans-serif, system-ui, sans-serif;
73
+ border-radius: 0.5rem;
74
+ background-color: white;
75
+ border: 2px solid #e5e7eb;
76
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
77
+ min-width: 300px;
78
+ max-width: 500px;
79
+ transition: all 0.2s ease-in-out;
80
+ position: relative;
81
+ cursor: pointer;
82
+
83
+ &:hover {
84
+ border-color: #6366f1;
85
+ box-shadow:
86
+ 0 4px 6px -1px rgba(0, 0, 0, 0.1),
87
+ 0 2px 4px -1px rgba(0, 0, 0, 0.06);
88
+ }
89
+ `,Ru=ac.div`
90
+ display: flex;
91
+ justify-content: space-between;
92
+ align-items: center;
93
+ gap: 0.5rem;
94
+ padding: 0.75rem;
95
+ border-bottom: 1px solid #e5e7eb;
96
+ `,Du=ac.div`
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 0.5rem;
100
+ `,Tu=ac.div`
101
+ font-size: 1.25rem;
102
+ display: flex;
103
+ align-items: center;
104
+ justify-content: center;
105
+ `,Iu=ac.div`
106
+ font-weight: 600;
107
+ color: #1f2937;
108
+ font-size: 0.875rem;
109
+ word-break: break-words;
110
+ `,zu=ac.div`
111
+ display: flex;
112
+ gap: 0.5rem;
113
+ justify-content: flex-end;
114
+ align-items: center;
115
+ `,$u=ac.div`
116
+ padding: 0.75rem;
117
+ display: flex;
118
+ flex-direction: column;
119
+ align-items: flex-start;
120
+ justify-content: center;
121
+ gap: 0.5rem;
122
+ `,Lu=ac.div`
123
+ width: 100%;
124
+ `,Bu=ac.div`
125
+ display: flex;
126
+ justify-content: space-between;
127
+ align-items: center;
128
+ padding: 0.25rem 0;
129
+ cursor: pointer;
130
+ user-select: none;
131
+ border-radius: 0.25rem;
132
+ padding-left: 0.25rem;
133
+ padding-right: 0.25rem;
134
+
135
+ &:hover {
136
+ background-color: #f9fafb;
137
+ }
138
+ `,Hu=ac.span`
139
+ font-weight: 600;
140
+ color: #374151;
141
+ font-size: 0.75rem;
142
+ `,Fu=ac.textarea`
143
+ width: 100%;
144
+ border: 1px solid #d1d5db;
145
+ border-radius: 0.25rem;
146
+ padding: 0.5rem;
147
+ font-size: 0.75rem;
148
+ background-color: #f9fafb;
149
+ resize: none;
150
+ min-height: 40px;
151
+ font-family: inherit;
152
+
153
+ &:focus {
154
+ outline: none;
155
+ border-color: #6366f1;
156
+ box-shadow: 0 0 0 1px #6366f1;
157
+ }
158
+
159
+ transition: all 0.2s ease-in-out;
160
+ `,ju=ac.div`
161
+ transition: transform 0.2s ease-in-out;
162
+ `,Wu=({stamps:e,currentStep:n,onStepChange:o,onToggle:r})=>{const a=e.length>0?Math.max(...e.map(e=>e.step)):0,i=e.length>0?Math.min(...e.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return t.createElement("div",{className:"w-full h-full bg-white flex flex-col overflow-hidden"},t.createElement("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex justify-between items-start"},t.createElement("div",null,t.createElement("h3",{className:"m-0 text-base font-semibold text-gray-800"},"Timeline")),r&&t.createElement("button",{onClick:r,className:"border-none bg-transparent cursor-pointer text-gray-500 p-1 flex items-center justify-center transition-colors duration-200 hover:text-gray-700",title:"Collapse Panel"},t.createElement(Rs,{size:16}))),t.createElement("div",{className:"flex-1 overflow-y-auto py-2 pb-4"},Array.from({length:s},(r,a)=>{const s=i+a,c=s===n,u=s<n,d=e.some(e=>e.step===s),f=(t=>{const n=e.filter(e=>e.step===t);if(0===n.length)return null;const o=t-1,r=e.filter(e=>e.step===o);return 0===r.length?null:Math.min(...n.map(e=>e.time))-Math.max(...r.map(e=>e.time))})(s),p=(t=>{var n;const o=e.filter(e=>e.step===t);return 0===o.length?`Step ${t}`:(null===(n=o[0])||void 0===n?void 0:n.identifier)||`Step ${t}`})(s);return t.createElement("div",{key:s,onClick:()=>d&&o(s),className:`\n px-4 py-3 border-b border-gray-100 relative transition-all duration-200\n ${d?"cursor-pointer":"cursor-default"}\n ${c?"bg-blue-50 border-l-4 border-l-indigo-500":"border-l-4 border-l-transparent"}\n ${d&&!c?"hover:bg-gray-50":""}\n `},t.createElement("div",{className:"flex items-center gap-2 mb-1"},t.createElement("div",{className:`\n w-3 h-3 rounded-full border flex-shrink-0\n ${c?"bg-indigo-500 border-indigo-500":u?"bg-yellow-400 border-gray-300":d?"bg-gray-400 border-gray-300":"bg-gray-200 border-gray-300"}\n `}),t.createElement("span",{className:`\n text-sm font-medium\n ${c?"font-semibold text-gray-800":"text-gray-500"}\n `},"Step ",s),f&&t.createElement(Eu,{variant:l(f),className:"ml-auto"},vu(f))),t.createElement("div",{className:`\n text-sm leading-relaxed break-words\n ${d?"text-gray-800":"text-gray-400 italic"}\n `},d?p:"No activity"),c&&t.createElement("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-indigo-500 animate-pulse"}))})))};function Vu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Yu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Xu(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Yu(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():Yu(e[t],null)}}}}function Ku(...t){return e.useCallback(Xu(...t),t)}function Uu(t,n=[]){let o=[];const r=()=>{const n=o.map(t=>e.createContext(t));return function(o){const r=o?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...o,[t]:r}}),[o,r])}};return r.scopeName=t,[function(n,r){const a=e.createContext(r),i=o.length;o=[...o,r];const s=n=>{const{scope:o,children:r,...s}=n,l=o?.[t]?.[i]||a,c=e.useMemo(()=>s,Object.values(s));return m(l.Provider,{value:c,children:r})};return s.displayName=n+"Provider",[s,function(o,s){const l=s?.[t]?.[i]||a,c=e.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${o}\` must be used within \`${n}\``)}]},qu(r,...n)]}function qu(...t){const n=t[0];if(1===t.length)return n;const o=()=>{const o=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const r=o.reduce((e,{useScope:n,scopeName:o})=>({...e,...n(t)[`__scope${o}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:r}),[r])}};return o.scopeName=n.scopeName,o}var Zu=globalThis?.document?e.useLayoutEffect:()=>{},Gu=e[" useId ".trim().toString()]||(()=>{}),Qu=0;function Ju(t){const[n,o]=e.useState(Gu());return Zu(()=>{t||o(e=>e??String(Qu++))},[t]),t||(n?`radix-${n}`:"")}var ed=e[" useInsertionEffect ".trim().toString()]||Zu;function td({prop:t,defaultProp:n,onChange:o=()=>{},caller:r}){const[a,i,s]=function({defaultProp:t,onChange:n}){const[o,r]=e.useState(t),a=e.useRef(o),i=e.useRef(n);return ed(()=>{i.current=n},[n]),e.useEffect(()=>{a.current!==o&&(i.current?.(o),a.current=o)},[o,a]),[o,r,i]}({defaultProp:n,onChange:o}),l=void 0!==t,c=l?t:a;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=l},[l,r])}const u=e.useCallback(e=>{if(l){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else i(e)},[l,t,i,s]);return[c,u]}function nd(t){const n=od(t),o=e.forwardRef((t,o)=>{const{children:r,...a}=t,i=e.Children.toArray(r),s=i.find(ad);if(s){const t=s.props.children,r=i.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return m(n,{...a,ref:o,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return m(n,{...a,ref:o,children:r})});return o.displayName=`${t}.Slot`,o}function od(t){const n=e.forwardRef((t,n)=>{const{children:o,...r}=t;if(e.isValidElement(o)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(r,o.props);return o.type!==e.Fragment&&(a.ref=n?Xu(n,t):t),e.cloneElement(o,a)}return e.Children.count(o)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var rd=Symbol("radix.slottable");function ad(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===rd}var id=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=nd(`Primitive.${n}`),r=e.forwardRef((e,t)=>{const{asChild:r,...a}=e,i=r?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m(i,{...a,ref:t})});return r.displayName=`Primitive.${n}`,{...t,[n]:r}},{});function sd(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var ld,cd="dismissableLayer.update",ud="dismissableLayer.pointerDownOutside",dd="dismissableLayer.focusOutside",fd=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pd=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=t,u=e.useContext(fd),[d,f]=e.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=e.useState({}),g=Ku(n,e=>f(e)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(t,n=globalThis?.document){const o=sd(t),r=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let t=function(){gd(ud,o,r,{discrete:!0})};const r={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);r.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}},[n,o]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));E&&!n&&(a?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(t,n=globalThis?.document){const o=sd(t),r=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!r.current){gd(dd,o,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,o]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),s?.(e),e.defaultPrevented||l?.())},p);return function(t,n=globalThis?.document){const o=sd(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&o(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[o,n])}(e=>{w===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(ld=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),md(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=ld)}},[d,p,o,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),md())},[d,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(cd,e),()=>document.removeEventListener(cd,e)},[]),m(id.div,{...c,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:Vu(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Vu(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Vu(t.onPointerDownCapture,S.onPointerDownCapture)})});pd.displayName="DismissableLayer";var hd=e.forwardRef((t,n)=>{const o=e.useContext(fd),r=e.useRef(null),a=Ku(n,r);return e.useEffect(()=>{const e=r.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),m(id.div,{...t,ref:a})});function md(){const e=new CustomEvent(cd);document.dispatchEvent(e)}function gd(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}(r,a):r.dispatchEvent(a)}hd.displayName="DismissableLayerBranch";var yd="focusScope.autoFocusOnMount",vd="focusScope.autoFocusOnUnmount",bd={bubbles:!1,cancelable:!0},wd=e.forwardRef((t,n)=>{const{loop:o=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=sd(a),d=sd(i),f=e.useRef(null),p=Ku(n,e=>c(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(r){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:_d(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||_d(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&_d(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return l&&o.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[r,l,h.paused]),e.useEffect(()=>{if(l){kd.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(yd,bd);l.addEventListener(yd,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(_d(o,{select:t}),document.activeElement!==n)return}((e=xd(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&_d(l))}return()=>{l.removeEventListener(yd,u),setTimeout(()=>{const e=new CustomEvent(vd,bd);l.addEventListener(vd,d),l.dispatchEvent(e),e.defaultPrevented||_d(t??document.body,{select:!0}),l.removeEventListener(vd,d),kd.remove(h)},0)}}var e},[l,u,d,h]);const g=e.useCallback(e=>{if(!o&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=xd(e),n=Ed(t,e),o=Ed(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&_d(a,{select:!0})):(e.preventDefault(),o&&_d(r,{select:!0})):n===t&&e.preventDefault()}},[o,r,h.paused]);return m(id.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});function xd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ed(e,t){for(const n of e)if(!Sd(n,{upTo:t}))return n}function Sd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function _d(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}wd.displayName="FocusScope";var kd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Cd(e,t),e.unshift(t)},remove(t){e=Cd(e,t),e[0]?.resume()}}}();function Cd(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Nd=e.forwardRef((t,n)=>{const{container:o,...r}=t,[a,i]=e.useState(!1);Zu(()=>i(!0),[]);const s=o||a&&globalThis?.document?.body;return s?h.createPortal(m(id.div,{...r,ref:n}),s):null});Nd.displayName="Portal";var Md=t=>{const{present:n,children:o}=t,r=function(t){const[n,o]=e.useState(),r=e.useRef(null),a=e.useRef(t),i=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Od(r.current);i.current="mounted"===l?e:"none"},[l]),Zu(()=>{const e=r.current,n=a.current;if(n!==t){const o=i.current,r=Od(e);if(t)c("MOUNT");else if("none"===r||"none"===e?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,c]),Zu(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,o=o=>{const i=Od(r.current).includes(CSS.escape(o.animationName));if(o.target===n&&i&&(c("ANIMATION_END"),!a.current)){const o=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=o)})}},s=e=>{e.target===n&&(i.current=Od(r.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",o),n.addEventListener("animationend",o),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",o),n.removeEventListener("animationend",o)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{r.current=e?getComputedStyle(e):null,o(e)},[])}}(n),a="function"==typeof o?o({present:r.isPresent}):e.Children.only(o),i=Ku(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof o||r.isPresent?e.cloneElement(a,{ref:i}):null};function Od(e){return e?.animationName||"none"}Md.displayName="Presence";var Pd=0;function Ad(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Rd()),document.body.insertAdjacentElement("beforeend",e[1]??Rd()),Pd++,()=>{1===Pd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Pd--}},[])}function Rd(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Dd="right-scroll-bar-position",Td="width-before-scroll-bar";function Id(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var zd="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,$d=new WeakMap;function Ld(e,t){var n,o,r,a=(n=t||null,o=function(t){return e.forEach(function(e){return Id(e,t)})},(r=u(function(){return{value:n,callback:o,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0]).callback=o,r.facade);return zd(function(){var t=$d.get(a);if(t){var n=new Set(t),o=new Set(e),r=a.current;n.forEach(function(e){o.has(e)||Id(e,null)}),o.forEach(function(e){n.has(e)||Id(e,r)})}$d.set(a,e)},[e]),a}function Bd(e){return e}var Hd=function(t){var n=t.sideCar,o=wu(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=n.read();if(!r)throw new Error("Sidecar medium not found");return e.createElement(r,bu({},o))};Hd.isSideCarExport=!0;var Fd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Bd);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return r}(null);return t.options=bu({async:!0,ssr:!1},e),t}(),jd=function(){},Wd=e.forwardRef(function(t,n){var o=e.useRef(null),r=e.useState({onScrollCapture:jd,onWheelCapture:jd,onTouchMoveCapture:jd}),a=r[0],i=r[1],s=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,h=t.noRelative,m=t.noIsolation,g=t.inert,y=t.allowPinchZoom,v=t.as,b=void 0===v?"div":v,w=t.gapMode,x=wu(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=Ld([o,n]),_=bu(bu({},x),a);return e.createElement(e.Fragment,null,d&&e.createElement(E,{sideCar:Fd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:o,gapMode:w}),s?e.cloneElement(e.Children.only(l),bu(bu({},_),{ref:S})):e.createElement(b,bu({},_,{className:c,ref:S}),l))});Wd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wd.classNames={fullWidth:Td,zeroRight:Dd};function Vd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Yd=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=Vd())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xd=function(){var t,n=(t=Yd(),function(n,o){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&o])});return function(e){var t=e.styles,o=e.dynamic;return n(t,o),null}},Kd={left:0,top:0,right:0,gap:0},Ud=function(e){return parseInt(e||"",10)||0},qd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Kd;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[Ud(n),Ud(o),Ud(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Zd=Xd(),Gd="data-scroll-locked",Qd=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(Gd,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Dd," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Td," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Dd," .").concat(Dd," {\n right: 0 ").concat(o,";\n }\n \n .").concat(Td," .").concat(Td," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(Gd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Jd=function(){var e=parseInt(document.body.getAttribute(Gd)||"0",10);return isFinite(e)?e:0},ef=function(t){var n=t.noRelative,o=t.noImportant,r=t.gapMode,a=void 0===r?"margin":r;e.useEffect(function(){return document.body.setAttribute(Gd,(Jd()+1).toString()),function(){var e=Jd()-1;e<=0?document.body.removeAttribute(Gd):document.body.setAttribute(Gd,e.toString())}},[]);var i=e.useMemo(function(){return qd(a)},[a]);return e.createElement(Zd,{styles:Qd(i,!n,a,o?"":"!important")})},tf=!1;if("undefined"!=typeof window)try{var nf=Object.defineProperty({},"passive",{get:function(){return tf=!0,!0}});window.addEventListener("test",nf,nf),window.removeEventListener("test",nf,nf)}catch(e){tf=!1}var of=!!tf&&{passive:!1},rf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},af=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),sf(e,o)){var r=lf(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},sf=function(e,t){return"v"===e?function(e){return rf(e,"overflowY")}(t):function(e){return rf(e,"overflowX")}(t)},lf=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},cf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uf=function(e){return[e.deltaX,e.deltaY]},df=function(e){return e&&"current"in e?e.current:e},ff=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},pf=0,hf=[];function mf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var gf,yf=(gf=function(t){var n=e.useRef([]),o=e.useRef([0,0]),r=e.useRef(),a=e.useState(pf++)[0],i=e.useState(Xd)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(df),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,a=cf(e),i=o.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=af(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=af(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=n),!n)return!0;var p=r.current||n;return function(e,t,n,o,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*o,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=lf(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&sf(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(d)<1||!r&&i>d)||!u&&(r&&Math.abs(f)<1||!r&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(hf.length&&hf[hf.length-1]===i){var o="deltaY"in t?uf(t):cf(t),r=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,r=o,n[0]===r[0]&&n[1]===r[1]);var n,r})[0];if(r&&r.should)t.cancelable&&t.preventDefault();else if(!r){var a=(s.current.shards||[]).map(df).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?l(t,a[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,o,r){var a={name:e,delta:t,target:o,should:r,shadowParent:mf(o)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),d=e.useCallback(function(e){o.current=cf(e),r.current=void 0},[]),f=e.useCallback(function(e){u(e.type,uf(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,cf(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return hf.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,of),document.addEventListener("touchmove",c,of),document.addEventListener("touchstart",d,of),function(){hf=hf.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,of),document.removeEventListener("touchmove",c,of),document.removeEventListener("touchstart",d,of)}},[]);var h=t.removeScrollBar,m=t.inert;return e.createElement(e.Fragment,null,m?e.createElement(i,{styles:ff(a)}):null,h?e.createElement(ef,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Fd.useMedium(gf),Hd),vf=e.forwardRef(function(t,n){return e.createElement(Wd,bu({},t,{ref:n,sideCar:yf}))});vf.classNames=Wd.classNames;var bf=vf,wf=new WeakMap,xf=new WeakMap,Ef={},Sf=0,_f=function(e){return e&&(e.host||_f(e.parentNode))},kf=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=_f(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Ef[n]||(Ef[n]=new WeakMap);var a=Ef[n],i=[],s=new Set,l=new Set(r),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};r.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,l=(wf.get(e)||0)+1,c=(a.get(e)||0)+1;wf.set(e,l),a.set(e,c),i.push(e),1===l&&r&&xf.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Sf++,function(){i.forEach(function(e){var t=wf.get(e)-1,r=a.get(e)-1;wf.set(e,t),a.set(e,r),t||(xf.has(e)||e.removeAttribute(o),xf.delete(e)),r||e.removeAttribute(n)}),--Sf||(wf=new WeakMap,wf=new WeakMap,xf=new WeakMap,Ef={})}},Cf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),kf(o,r,n,"aria-hidden")):function(){return null}},Nf="Dialog",[Mf,Of]=Uu(Nf),[Pf,Af]=Mf(Nf),Rf=t=>{const{__scopeDialog:n,children:o,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u,d]=td({prop:r,defaultProp:a??!1,onChange:i,caller:Nf});return m(Pf,{scope:n,triggerRef:l,contentRef:c,contentId:Ju(),titleId:Ju(),descriptionId:Ju(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:o})};Rf.displayName=Nf;var Df="DialogTrigger",Tf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Af(Df,n),a=Ku(t,r.triggerRef);return m(id.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":ep(r.open),...o,ref:a,onClick:Vu(e.onClick,r.onOpenToggle)})});Tf.displayName=Df;var If="DialogPortal",[zf,$f]=Mf(If,{forceMount:void 0}),Lf=t=>{const{__scopeDialog:n,forceMount:o,children:r,container:a}=t,i=Af(If,n);return m(zf,{scope:n,forceMount:o,children:e.Children.map(r,e=>m(Md,{present:o||i.open,children:m(Nd,{asChild:!0,container:a,children:e})}))})};Lf.displayName=If;var Bf="DialogOverlay",Hf=e.forwardRef((e,t)=>{const n=$f(Bf,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=Af(Bf,e.__scopeDialog);return a.modal?m(Md,{present:o||a.open,children:m(jf,{...r,ref:t})}):null});Hf.displayName=Bf;var Ff=nd("DialogOverlay.RemoveScroll"),jf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Af(Bf,n);return m(bf,{as:Ff,allowPinchZoom:!0,shards:[r.contentRef],children:m(id.div,{"data-state":ep(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Wf="DialogContent",Vf=e.forwardRef((e,t)=>{const n=$f(Wf,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=Af(Wf,e.__scopeDialog);return m(Md,{present:o||a.open,children:a.modal?m(Yf,{...r,ref:t}):m(Xf,{...r,ref:t})})});Vf.displayName=Wf;var Yf=e.forwardRef((t,n)=>{const o=Af(Wf,t.__scopeDialog),r=e.useRef(null),a=Ku(n,o.contentRef,r);return e.useEffect(()=>{const e=r.current;if(e)return Cf(e)},[]),m(Kf,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vu(t.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Vu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Vu(t.onFocusOutside,e=>e.preventDefault())})}),Xf=e.forwardRef((t,n)=>{const o=Af(Wf,t.__scopeDialog),r=e.useRef(!1),a=e.useRef(!1);return m(Kf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(r.current||o.triggerRef.current?.focus(),e.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(r.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=o.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),Kf=e.forwardRef((t,n)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=Af(Wf,o),c=e.useRef(null),u=Ku(n,c);return Ad(),g(y,{children:[m(wd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:m(pd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":ep(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),g(y,{children:[m(rp,{titleId:l.titleId}),m(ap,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Uf="DialogTitle",qf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Af(Uf,n);return m(id.h2,{id:r.titleId,...o,ref:t})});qf.displayName=Uf;var Zf="DialogDescription",Gf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Af(Zf,n);return m(id.p,{id:r.descriptionId,...o,ref:t})});Gf.displayName=Zf;var Qf="DialogClose",Jf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Af(Qf,n);return m(id.button,{type:"button",...o,ref:t,onClick:Vu(e.onClick,()=>r.onOpenChange(!1))})});function ep(e){return e?"open":"closed"}Jf.displayName=Qf;var tp="DialogTitleWarning",[np,op]=function(t,n){const o=e.createContext(n),r=t=>{const{children:n,...r}=t,a=e.useMemo(()=>r,Object.values(r));return m(o.Provider,{value:a,children:n})};return r.displayName=t+"Provider",[r,function(r){const a=e.useContext(o);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]}(tp,{contentName:Wf,titleName:Uf,docsSlug:"dialog"}),rp=({titleId:t})=>{const n=op(tp),o=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(o)}},[o,t]),null},ap=({contentRef:t,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${op("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(o)}},[o,t,n]),null},ip=Rf,sp=Tf,lp=Lf,cp=Hf,up=Vf,dp=qf,fp=Gf,pp=Jf;const hp=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,mp=sc,gp=ip,yp=sp,vp=lp,bp=e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(cp,Object.assign({className:hu("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",o)},r,{ref:n}))});bp.displayName=cp.displayName;const wp=(xp="fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",Ep={variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}},e=>{var t;if(null==(null==Ep?void 0:Ep.variants))return mp(xp,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:n,defaultVariants:o}=Ep,r=Object.keys(n).map(t=>{const r=null==e?void 0:e[t],a=null==o?void 0:o[t];if(null===r)return null;const i=hp(r)||hp(a);return n[t][i]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,o]=t;return void 0===o||(e[n]=o),e},{}),i=null==Ep||null===(t=Ep.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...a}[t]):{...o,...a}[t]===n})?[...e,n,r]:e},[]);return mp(xp,r,i,null==e?void 0:e.class,null==e?void 0:e.className)});var xp,Ep;const Sp=e.forwardRef((t,n)=>{var{side:o="right",className:r,children:a}=t,i=wu(t,["side","className","children"]);return e.createElement(vp,null,e.createElement(bp,null),e.createElement(up,Object.assign({ref:n,className:hu(wp({side:o}),r)},i),a,e.createElement(pp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},e.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{className:"sr-only"},"Close"))))});Sp.displayName=up.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(dp,Object.assign({ref:n,className:hu("text-lg font-semibold text-foreground",o)},r))}).displayName=dp.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(fp,Object.assign({ref:n,className:hu("text-sm text-muted-foreground",o)},r))}).displayName=fp.displayName;const _p=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{var t;e.source&&e.target&&(null===(t=a.get(e.source))||void 0===t||t.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{var t;e.parent&&e.parent.identifier!==e.identifier&&(null===(t=a.get(e.parent.identifier))||void 0===t||t.push(e.identifier),i.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!i.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of a.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{var t;const n=null!==(t=l.get(e.identifier))&&void 0!==t?t:0;u[n]||(u[n]=[]),u[n].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,o+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of i){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=o,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),o=m.get(x[t]);if(Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2))<w){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const a=w/r,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,o.x+=i,o.y+=s}else n.x-=w/2,o.x+=w/2}}return m},kp={Agent:Pu,Tool:Pu,Coordinator:Pu},Cp=({flowData:e,width:n="100%",height:o="1000px",className:a="",defaultZoom:c=1,defaultPan:d={x:0,y:0},disableAutoFit:f=!0,showTimeline:p=!1,minNodeSpacing:h=200})=>{const m=e;if(!m)return t.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",background:"#f9fafb",position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:a},t.createElement("div",{style:{textAlign:"center"}},t.createElement("div",{style:{fontSize:"16px",color:"#6b7280",marginBottom:"8px"}},"No flow data available"),t.createElement("div",{style:{fontSize:"14px",color:"#9ca3af"}},"Please provide flowData prop")));const g=l(null),y=l(null),[v,b]=u({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[w,x]=u(0),[E,S]=u(!1),_=l(null),[k,C]=u(!1),N=r(()=>{const e=m.stamps||m.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[m.stamps,m.steps]);i(()=>(E?_.current=setInterval(()=>{x(e=>e>=N?(S(!1),e):e+1)},250):_.current&&(clearInterval(_.current),_.current=null),()=>{_.current&&clearInterval(_.current)}),[E,N]),i(()=>{const e=m.stamps||m.steps||[];e.length>0&&x(Math.max(...e.map(e=>e.step)))},[m.stamps,m.steps]),i(()=>{const e=()=>{if(g.current){const e=g.current.getBoundingClientRect();b({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&g.current){const t=new ResizeObserver(e);return t.observe(g.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const M=r(()=>{if(!m.nodes)return new Map;const e=Math.max(v.width||800,1200);return _p(m.nodes,m.edges||[],{minNodeSpacing:h,containerWidth:e})},[m.nodes,m.edges,v.width,h]),O=s(e=>m.nodes?m.nodes.filter(t=>t.stamp.step<=e):[],[m.nodes]),P=s(e=>(m.edges||[]).filter(t=>t.stamp.step<=e),[m.edges]),A=r(()=>{const e=O(w),t=P(w);return e.map(e=>{const n=M.get(e.identifier)||{x:0,y:0},o=e.stamp.step===w,r="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:o,id:e.identifier,edges:t,edgeDetails:r},style:{filter:o?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[M,w,O,P]),R=r(()=>P(w).filter(e=>e.source&&e.target).map(e=>{var t,n,o,r;const a=e.stamp.step===w;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:a,bidirectional:!0,style:{stroke:a?"#6366f1":"#9ca3af",strokeWidth:a?3:2},label:(null===(t=e.stamp)||void 0===t?void 0:t.identifier)?gu(String(e.stamp.identifier),50):void 0,data:{label:(null===(n=e.stamp)||void 0===n?void 0:n.identifier)?gu(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:null===(o=e.stamp)||void 0===o?void 0:o.step,time:null===(r=e.stamp)||void 0===r?void 0:r.time,details:e.details}}}),[w,P]),[D,T,I]=ds(A),[z,$,L]=fs(R);i(()=>{T(A)},[A,T]),i(()=>{$(R)},[R,$]);const B=s(e=>$(t=>Dr(e,t)),[$]),H=s(e=>{x(e),S(!1)},[]);s(()=>{S(e=>!e)},[]);const F=(e,t)=>{var n;if(!y.current)return{x:0,y:0};const o=y.current.createSVGPoint();o.x=e,o.y=t;const r=o.matrixTransform(null===(n=y.current.getScreenCTM())||void 0===n?void 0:n.inverse());return{x:r.x,y:r.y}},j=$a();return i(()=>{if(f||!j||0===A.length)return;const e=new Map;R.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const o=e.get(t.target)||0;e.set(t.target,o+1)});let t="",n=0;e.forEach((e,o)=>{e>n&&(n=e,t=o)}),!t&&A.length>0&&(t=A[0].id),t&&setTimeout(()=>{j.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:c,maxZoom:1})},500)},[A,R,j,f,c]),t.createElement("div",{ref:g,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px"},className:a},p&&t.createElement(gp,{open:k,onOpenChange:C},t.createElement(yp,{asChild:!0},t.createElement("button",{className:"absolute top-4 left-4 z-50 w-10 h-10 bg-white border border-gray-300 rounded-lg shadow-sm hover:bg-gray-50 flex items-center justify-center transition-colors duration-200",title:"Open Timeline"},t.createElement(Rs,{size:20,className:"text-gray-600"}))),t.createElement(vp,null,t.createElement(up,{className:"fixed inset-y-0 left-0 h-full w-[280px] z-50 bg-background border-r shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left p-0",onPointerDownOutside:e=>e.preventDefault()},t.createElement("div",{className:"flex flex-col h-full"},t.createElement("div",{className:"flex-1 overflow-y-auto"},t.createElement(Wu,{stamps:m.stamps||m.steps||[],currentStep:w,onStepChange:H}))),t.createElement(pp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},t.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),t.createElement("span",{className:"sr-only"},"Close"))))),t.createElement(cs,{nodes:D,edges:z,onNodesChange:I,onEdgesChange:L,onConnect:B,nodeTypes:kp,edgeTypes:{default:e=>t.createElement(Ts,Object.assign({},e,{clientToSvgCoords:F,svgRef:y}))},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:d.x,y:d.y,zoom:c},onInit:()=>{if(g.current){const e=g.current.querySelector("svg");e&&(y.current=e)}}},t.createElement(ws,{variant:ps.Lines,color:"#EEEEEE",gap:16})),t.createElement("style",null,"\n .react-flow__edge-label {\n font-size: 10px;\n background: white;\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid #e5e7eb;\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n "))},Np=e=>t.createElement(ts,null,t.createElement(Cp,Object.assign({},e)));function Mp(e,[t,n]){return Math.min(n,Math.max(t,e))}var Op=e.createContext(void 0);const Pp=["top","right","bottom","left"],Ap=Math.min,Rp=Math.max,Dp=Math.round,Tp=Math.floor,Ip=e=>({x:e,y:e}),zp={left:"right",right:"left",bottom:"top",top:"bottom"},$p={start:"end",end:"start"};function Lp(e,t,n){return Rp(e,Ap(t,n))}function Bp(e,t){return"function"==typeof e?e(t):e}function Hp(e){return e.split("-")[0]}function Fp(e){return e.split("-")[1]}function jp(e){return"x"===e?"y":"x"}function Wp(e){return"y"===e?"height":"width"}const Vp=new Set(["top","bottom"]);function Yp(e){return Vp.has(Hp(e))?"y":"x"}function Xp(e){return jp(Yp(e))}function Kp(e){return e.replace(/start|end/g,e=>$p[e])}const Up=["left","right"],qp=["right","left"],Zp=["top","bottom"],Gp=["bottom","top"];function Qp(e,t,n,o){const r=Fp(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?qp:Up:t?Up:qp;case"left":case"right":return t?Zp:Gp;default:return[]}}(Hp(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Kp)))),a}function Jp(e){return e.replace(/left|right|bottom|top/g,e=>zp[e])}function eh(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function th(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function nh(e,t,n){let{reference:o,floating:r}=e;const a=Yp(t),i=Xp(t),s=Wp(i),l=Hp(t),c="y"===a,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Fp(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function oh(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Bp(t,e),h=eh(p),m=s[f?"floating"===d?"reference":"floating":d],g=th(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=th(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function rh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ah(e){return Pp.some(t=>e[t]>=0)}const ih=new Set(["left","top"]);function sh(){return"undefined"!=typeof window}function lh(e){return dh(e)?(e.nodeName||"").toLowerCase():"#document"}function ch(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function uh(e){var t;return null==(t=(dh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function dh(e){return!!sh()&&(e instanceof Node||e instanceof ch(e).Node)}function fh(e){return!!sh()&&(e instanceof Element||e instanceof ch(e).Element)}function ph(e){return!!sh()&&(e instanceof HTMLElement||e instanceof ch(e).HTMLElement)}function hh(e){return!(!sh()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ch(e).ShadowRoot)}const mh=new Set(["inline","contents"]);function gh(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Mh(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!mh.has(r)}const yh=new Set(["table","td","th"]);function vh(e){return yh.has(lh(e))}const bh=[":popover-open",":modal"];function wh(e){return bh.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const xh=["transform","translate","scale","rotate","perspective"],Eh=["transform","translate","scale","rotate","perspective","filter"],Sh=["paint","layout","strict","content"];function _h(e){const t=kh(),n=fh(e)?Mh(e):e;return xh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Eh.some(e=>(n.willChange||"").includes(e))||Sh.some(e=>(n.contain||"").includes(e))}function kh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ch=new Set(["html","body","#document"]);function Nh(e){return Ch.has(lh(e))}function Mh(e){return ch(e).getComputedStyle(e)}function Oh(e){return fh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ph(e){if("html"===lh(e))return e;const t=e.assignedSlot||e.parentNode||hh(e)&&e.host||uh(e);return hh(t)?t.host:t}function Ah(e){const t=Ph(e);return Nh(t)?e.ownerDocument?e.ownerDocument.body:e.body:ph(t)&&gh(t)?t:Ah(t)}function Rh(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Ah(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=ch(r);if(a){const e=Dh(i);return t.concat(i,i.visualViewport||[],gh(r)?r:[],e&&n?Rh(e):[])}return t.concat(r,Rh(r,[],n))}function Dh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Th(e){const t=Mh(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ph(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=Dp(n)!==a||Dp(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Ih(e){return fh(e)?e:e.contextElement}function zh(e){const t=Ih(e);if(!ph(t))return Ip(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=Th(t);let i=(a?Dp(n.width):n.width)/o,s=(a?Dp(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const $h=Ip(0);function Lh(e){const t=ch(e);return kh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$h}function Bh(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Ih(e);let i=Ip(1);t&&(o?fh(o)&&(i=zh(o)):i=zh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ch(e))&&t}(a,n,o)?Lh(a):Ip(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(a){const e=ch(a),t=o&&fh(o)?ch(o):o;let n=e,r=Dh(n);for(;r&&o&&t!==n;){const e=zh(r),t=r.getBoundingClientRect(),o=Mh(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=ch(r),r=Dh(n)}}return th({width:u,height:d,x:l,y:c})}function Hh(e,t){const n=Oh(e).scrollLeft;return t?t.left+n:Bh(uh(e)).left+n}function Fh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Hh(e,n),y:n.top+t.scrollTop}}const jh=new Set(["absolute","fixed"]);function Wh(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=ch(e),o=uh(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){a=r.width,i=r.height;const e=kh();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=Hh(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=uh(e),n=Oh(e),o=e.ownerDocument.body,r=Rp(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Rp(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Hh(e);const s=-n.scrollTop;return"rtl"===Mh(o).direction&&(i+=Rp(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(uh(e));else if(fh(t))o=function(e,t){const n=Bh(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=ph(e)?zh(e):Ip(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:r*a.x,y:o*a.y}}(t,n);else{const n=Lh(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return th(o)}function Vh(e,t){const n=Ph(e);return!(n===t||!fh(n)||Nh(n))&&("fixed"===Mh(n).position||Vh(n,t))}function Yh(e,t,n){const o=ph(t),r=uh(t),a="fixed"===n,i=Bh(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Ip(0);function c(){l.x=Hh(r)}if(o||!o&&!a)if(("body"!==lh(t)||gh(r))&&(s=Oh(t)),o){const e=Bh(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();a&&!o&&r&&c();const u=!r||o||a?Ip(0):Fh(r,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Xh(e){return"static"===Mh(e).position}function Kh(e,t){if(!ph(e)||"fixed"===Mh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return uh(e)===n&&(n=n.ownerDocument.body),n}function Uh(e,t){const n=ch(e);if(wh(e))return n;if(!ph(e)){let t=Ph(e);for(;t&&!Nh(t);){if(fh(t)&&!Xh(t))return t;t=Ph(t)}return n}let o=Kh(e,t);for(;o&&vh(o)&&Xh(o);)o=Kh(o,t);return o&&Nh(o)&&Xh(o)&&!_h(o)?n:o||function(e){let t=Ph(e);for(;ph(t)&&!Nh(t);){if(_h(t))return t;if(wh(t))return null;t=Ph(t)}return null}(e)||n}const qh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=uh(o),s=!!t&&wh(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Ip(1);const u=Ip(0),d=ph(o);if((d||!d&&!a)&&(("body"!==lh(o)||gh(i))&&(l=Oh(o)),ph(o))){const e=Bh(o);c=zh(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!i||d||a?Ip(0):Fh(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:uh,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a="clippingAncestors"===n?wh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Rh(e,[],!1).filter(e=>fh(e)&&"body"!==lh(e)),r=null;const a="fixed"===Mh(e).position;let i=a?Ph(e):e;for(;fh(i)&&!Nh(i);){const t=Mh(i),n=_h(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&jh.has(r.position)||gh(i)&&!n&&Vh(e,i))?o=o.filter(e=>e!==i):r=t,i=Ph(i)}return t.set(e,o),o}(t,this._c):[].concat(n),i=[...a,o],s=i[0],l=i.reduce((e,n)=>{const o=Wh(t,n,r);return e.top=Rp(o.top,e.top),e.right=Ap(o.right,e.right),e.bottom=Ap(o.bottom,e.bottom),e.left=Rp(o.left,e.left),e},Wh(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Uh,getElementRects:async function(e){const t=this.getOffsetParent||Uh,n=this.getDimensions,o=await n(e.floating);return{reference:Yh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Th(e);return{width:t,height:n}},getScale:zh,isElement:fh,isRTL:function(e){return"rtl"===Mh(e).direction}};function Zh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gh(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Ih(e),u=r||a?[...c?Rh(c):[],...Rh(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,o=null;const r=uh(e);function a(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Tp(d)+"px "+-Tp(r.clientWidth-(u+f))+"px "+-Tp(r.clientHeight-(d+p))+"px "+-Tp(u)+"px",threshold:Rp(0,Ap(1,l))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!m)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Zh(c,e.getBoundingClientRect())||i(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Bh(e):null;return l&&function t(){const o=Bh(e);m&&!Zh(m,o)&&n();m=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Qh=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,a=await(null==o.isRTL?void 0:o.isRTL(r.floating)),i=Hp(n),s=Fp(n),l="y"===Yp(n),c=ih.has(i)?-1:1,u=a&&l?-1:1,d=Bp(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},Jh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bp(e,t),c={x:n,y:o},u=await oh(t,l),d=Yp(Hp(r)),f=jp(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=Lp(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=Lp(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:a,[d]:i}}}}}},em=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Bp(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=Hp(r),v=Yp(s),b=Hp(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Jp(s)]:function(e){const t=Jp(e);return[Kp(e),t,Kp(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Qp(s,m,h,w));const S=[s,...x],_=await oh(t,g),k=[];let C=(null==(o=a.flip)?void 0:o.overflows)||[];if(u&&k.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Fp(e),r=Xp(e),a=Wp(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Jp(i)),[i,Jp(i)]}(r,i,w);k.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:r,overflows:k}],!k.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==Yp(t))||C.every(e=>Yp(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(M=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=C.filter(e=>{if(E){const t=Yp(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},tm=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Bp(e,t),u=await oh(t,c),d=Hp(r),f=Fp(r),p="y"===Yp(r),{width:h,height:m}=a.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=Ap(m-u[g],v),x=Ap(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(S=v),E&&!f){const e=Rp(u.left,0),t=Rp(u.right,0),n=Rp(u.top,0),o=Rp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:Rp(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:Rp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const k=await i.getDimensions(s.floating);return h!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}},nm=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Bp(e,t);switch(o){case"referenceHidden":{const e=rh(await oh(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ah(e)}}}case"escaped":{const e=rh(await oh(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ah(e)}}}default:return{}}}}},om=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Bp(e,t)||{};if(null==c)return{};const d=eh(u),f={x:n,y:o},p=Xp(r),h=Wp(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,k=S/2-m[h]/2-1,C=Ap(d[y],k),N=Ap(d[v],k),M=C,O=S-m[h]-N,P=S/2-m[h]/2+_,A=Lp(M,P,O),R=!l.arrow&&null!=Fp(r)&&P!==A&&a.reference[h]/2-(P<M?C:N)-m[h]/2<0,D=R?P<M?P-M:P-O:0;return{[p]:f[p]+D,data:{[p]:A,centerOffset:P-A-D,...R&&{alignmentOffset:D}},reset:R}}}),rm=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Bp(e,t),u={x:n,y:o},d=Yp(r),f=jp(d);let p=u[f],h=u[d];const m=Bp(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=ih.has(Hp(r)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),o=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[f]:p,[d]:h}}}},am=(e,t,n)=>{const o=new Map,r={platform:qh,...n},a={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=nh(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[a]:{...p[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:u,y:d}=nh(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:a})};var im="undefined"!=typeof document?f:function(){};function sm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!sm(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!sm(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function lm(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cm(e,t){const n=lm(e);return Math.round(t*n)/n}function um(t){const n=e.useRef(t);return im(()=>{n.current=t}),n}const dm=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?om({element:n.current,padding:o}).fn(t):{}:n?om({element:n,padding:o}).fn(t):{};var r}}),fm=(e,t)=>({...Qh(e),options:[e,t]}),pm=(e,t)=>({...Jh(e),options:[e,t]}),hm=(e,t)=>({...rm(e),options:[e,t]}),mm=(e,t)=>({...em(e),options:[e,t]}),gm=(e,t)=>({...tm(e),options:[e,t]}),ym=(e,t)=>({...nm(e),options:[e,t]}),vm=(e,t)=>({...dm(e),options:[e,t]});var bm=e.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return m(id.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m("polygon",{points:"0,0 30,0 15,10"})})});bm.displayName="Arrow";var wm=bm;function xm(t){const[n,o]=e.useState(void 0);return Zu(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=t.offsetWidth,a=t.offsetHeight;o({width:r,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),n}var Em="Popper",[Sm,_m]=Uu(Em),[km,Cm]=Sm(Em),Nm=t=>{const{__scopePopper:n,children:o}=t,[r,a]=e.useState(null);return m(km,{scope:n,anchor:r,onAnchorChange:a,children:o})};Nm.displayName=Em;var Mm="PopperAnchor",Om=e.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:r,...a}=t,i=Cm(Mm,o),s=e.useRef(null),l=Ku(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=r?.current||s.current,e!==c.current&&i.onAnchorChange(c.current)}),r?null:m(id.div,{...a,ref:l})});Om.displayName=Mm;var Pm="PopperContent",[Am,Rm]=Sm(Pm),Dm=e.forwardRef((t,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=Cm(Pm,o),[w,x]=e.useState(null),E=Ku(n,e=>x(e)),[S,_]=e.useState(null),k=xm(S),C=k?.width??0,N=k?.height??0,M=r+("center"!==i?"-"+i:""),O="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],A=P.length>0,R={padding:O,boundary:P.filter($m),altBoundary:A},{refs:D,floatingStyles:T,placement:I,isPositioned:z,middlewareData:$}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(r);sm(h,r)||m(r);const[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=e.useCallback(e=>{e!==k.current&&(k.current=e,b(e))},[]),E=i||g,S=s||v,_=e.useRef(null),k=e.useRef(null),C=e.useRef(d),N=null!=c,M=um(c),O=um(a),P=um(u),A=e.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:n,strategy:o,middleware:h};O.current&&(e.platform=O.current),am(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!sm(C.current,t)&&(C.current=t,p.flushSync(()=>{f(t)}))})},[h,n,o,O,P]);im(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=e.useRef(!1);im(()=>(R.current=!0,()=>{R.current=!1}),[]),im(()=>{if(E&&(_.current=E),S&&(k.current=S),E&&S){if(M.current)return M.current(E,S,A);A()}},[E,S,A,M,N]);const D=e.useMemo(()=>({reference:_,floating:k,setReference:w,setFloating:x}),[w,x]),T=e.useMemo(()=>({reference:E,floating:S}),[E,S]),I=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!T.floating)return e;const t=cm(T.floating,d.x),n=cm(T.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...lm(T.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,T.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:A,refs:D,elements:T,floatingStyles:I}),[d,A,D,T,I])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Gh(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[fm({mainAxis:a+N,alignmentAxis:s}),c&&pm({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?hm():void 0,...R}),c&&mm({...R}),gm({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&vm({element:S,padding:l}),Lm({arrowWidth:C,arrowHeight:N}),h&&ym({strategy:"referenceHidden",...R})]}),[L,B]=Bm(I),H=sd(y);Zu(()=>{z&&H?.()},[z,H]);const F=$.arrow?.x,j=$.arrow?.y,W=0!==$.arrow?.centerOffset,[V,Y]=e.useState();return Zu(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),m("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m(Am,{scope:o,placedSide:L,onArrowChange:_,arrowX:F,arrowY:j,shouldHideArrow:W,children:m(id.div,{"data-side":L,"data-align":B,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});Dm.displayName=Pm;var Tm="PopperArrow",Im={top:"bottom",right:"left",bottom:"top",left:"right"},zm=e.forwardRef(function(e,t){const{__scopePopper:n,...o}=e,r=Rm(Tm,n),a=Im[r.placedSide];return m("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:m(wm,{...o,ref:t,style:{...o.style,display:"block"}})})});function $m(e){return null!==e}zm.displayName=Tm;var Lm=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Bm(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(r.arrow?.x??0)+i/2,f=(r.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${o.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${o.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function Bm(e){const[t,n="center"]=e.split("-");return[t,n]}var Hm=Nm,Fm=Om,jm=Dm,Wm=zm;function Vm(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}var Ym=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});e.forwardRef((e,t)=>m(id.span,{...e,ref:t,style:{...Ym,...e.style}})).displayName="VisuallyHidden";var Xm=[" ","Enter","ArrowUp","ArrowDown"],Km=[" ","Enter"],Um="Select",[qm,Zm,Gm]=function(e){const n=e+"CollectionProvider",[o,r]=Uu(n),[a,i]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:o}=e,r=t.useRef(null),i=t.useRef(new Map).current;return m(a,{scope:n,itemMap:i,collectionRef:r,children:o})};s.displayName=n;const l=e+"CollectionSlot",c=nd(l),u=t.forwardRef((e,t)=>{const{scope:n,children:o}=e,r=Ku(t,i(l,n).collectionRef);return m(c,{ref:r,children:o})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=nd(d),h=t.forwardRef((e,n)=>{const{scope:o,children:r,...a}=e,s=t.useRef(null),l=Ku(n,s),c=i(d,o);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),m(p,{[f]:"",ref:l,children:r})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const o=i(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},r]}(Um),[Qm,Jm]=Uu(Um,[Gm,_m]),eg=_m(),[tg,ng]=Qm(Um),[og,rg]=Qm(Um),ag=t=>{const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:y}=t,v=eg(n),[b,w]=e.useState(null),[x,E]=e.useState(null),[S,_]=e.useState(!1),k=function(t){const n=e.useContext(Op);return t||n||"ltr"}(u),[C,N]=td({prop:r,defaultProp:a??!1,onChange:i,caller:Um}),[M,O]=td({prop:s,defaultProp:l,onChange:c,caller:Um}),P=e.useRef(null),A=!b||(y||!!b.closest("form")),[R,D]=e.useState(new Set),T=Array.from(R).map(e=>e.props.value).join(";");return m(Hm,{...v,children:g(tg,{required:h,scope:n,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:E,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:Ju(),value:M,onValueChange:O,open:C,onOpenChange:N,dir:k,triggerPointerDownPosRef:P,disabled:p,children:[m(qm.Provider,{scope:n,children:m(og,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{D(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{D(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),A?g(Yg,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:e=>O(e.target.value),disabled:p,form:y,children:[void 0===M?m("option",{value:""}):null,Array.from(R)]},T):null]})})};ag.displayName=Um;var ig="SelectTrigger",sg=e.forwardRef((t,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=t,i=eg(o),s=ng(ig,o),l=s.disabled||r,c=Ku(n,s.onTriggerChange),u=Zm(o),d=e.useRef("touch"),[f,p,h]=Kg(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=Ug(t,e,n);void 0!==o&&s.onValueChange(o.value)}),g=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m(Fm,{asChild:!0,...i,children:m(id.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Xg(s.value)?"":void 0,...a,ref:c,onClick:Vu(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&g(e)}),onPointerDown:Vu(a.onPointerDown,e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Vu(a.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Xm.includes(e.key)&&(g(),e.preventDefault())})})})});sg.displayName=ig;var lg="SelectValue",cg=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:a,placeholder:i="",...s}=e,l=ng(lg,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==a,d=Ku(t,l.onValueNodeChange);return Zu(()=>{c(u)},[c,u]),m(id.span,{...s,ref:d,style:{pointerEvents:"none"},children:Xg(l.value)?m(y,{children:i}):a})});cg.displayName=lg;var ug=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return m(id.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});ug.displayName="SelectIcon";var dg=e=>m(Nd,{asChild:!0,...e});dg.displayName="SelectPortal";var fg="SelectContent",pg=e.forwardRef((t,n)=>{const o=ng(fg,t.__scopeSelect),[r,a]=e.useState();if(Zu(()=>{a(new DocumentFragment)},[]),!o.open){const e=r;return e?p.createPortal(m(mg,{scope:t.__scopeSelect,children:m(qm.Slot,{scope:t.__scopeSelect,children:m("div",{children:t.children})})}),e):null}return m(vg,{...t,ref:n})});pg.displayName=fg;var hg=10,[mg,gg]=Qm(fg),yg=nd("SelectContent.RemoveScroll"),vg=e.forwardRef((t,n)=>{const{__scopeSelect:o,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=ng(fg,o),[x,E]=e.useState(null),[S,_]=e.useState(null),k=Ku(n,e=>E(e)),[C,N]=e.useState(null),[M,O]=e.useState(null),P=Zm(o),[A,R]=e.useState(!1),D=e.useRef(!1);e.useEffect(()=>{if(x)return Cf(x)},[x]),Ad();const T=e.useCallback(e=>{const[t,...n]=P().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===o&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==r)return}},[P,S]),I=e.useCallback(()=>T([C,x]),[T,C,x]);e.useEffect(()=>{A&&I()},[A,I]);const{onOpenChange:z,triggerPointerDownPosRef:$}=w;e.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-($.current?.x??0)),y:Math.abs(Math.round(t.pageY)-($.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),$.current=null};return null!==$.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,z,$]),e.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[L,B]=Kg(e=>{const t=P().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Ug(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),H=e.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&(N(e),o&&(D.current=!0))},[w.value]),F=e.useCallback(()=>x?.focus(),[x]),j=e.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&O(e)},[w.value]),W="popper"===r?wg:bg,V=W===wg?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return m(mg,{scope:o,content:x,viewport:S,onViewportChange:_,itemRefCallback:H,selectedItem:C,onItemLeave:F,itemTextRefCallback:j,focusSelectedItem:I,selectedItemText:M,position:r,isPositioned:A,searchRef:L,children:m(bf,{as:yg,allowPinchZoom:!0,children:m(wd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Vu(a,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m(pd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>R(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Vu(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});vg.displayName="SelectContentImpl";var bg=e.forwardRef((t,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=t,i=ng(fg,o),s=gg(fg,o),[l,c]=e.useState(null),[u,d]=e.useState(null),f=Ku(n,e=>d(e)),p=Zm(o),h=e.useRef(!1),g=e.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=s,x=e.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&y&&v&&b){const e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==i.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-hg,d=Mp(a,[hg,Math.max(hg,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-hg,d=Mp(a,[hg,Math.max(hg,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const a=p(),s=window.innerHeight-2*hg,c=y.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=f+m+c+parseInt(d.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),k=e.top+e.height/2-hg,C=s-k,N=v.offsetHeight/2,M=f+m+(v.offsetTop+N),O=w-M;if(M<=k){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(C,N+(e?_:0)+t+g);l.style.height=n+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(k,f+y.offsetTop+(e?S:0)+N)+O;l.style.height=t+"px",y.scrollTop=M-k+y.offsetTop}l.style.margin=`${hg}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,l,u,y,v,b,i.dir,r]);Zu(()=>x(),[x]);const[E,S]=e.useState();Zu(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const _=e.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return m(xg,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:m("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m(id.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});bg.displayName="SelectItemAlignedPosition";var wg=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=hg,...a}=e,i=eg(n);return m(jm,{...i,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});wg.displayName="SelectPopperPosition";var[xg,Eg]=Qm(fg,{}),Sg="SelectViewport",_g=e.forwardRef((t,n)=>{const{__scopeSelect:o,nonce:r,...a}=t,i=gg(Sg,o),s=Eg(Sg,o),l=Ku(n,i.onViewportChange),c=e.useRef(0);return g(y,{children:[m("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m(qm.Slot,{scope:o,children:m(id.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Vu(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=s;if(o?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*hg,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});_g.displayName=Sg;var kg="SelectGroup",[Cg,Ng]=Qm(kg);e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ju();return m(Cg,{scope:n,id:r,children:m(id.div,{role:"group","aria-labelledby":r,...o,ref:t})})}).displayName=kg;var Mg="SelectLabel",Og=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ng(Mg,n);return m(id.div,{id:r.id,...o,ref:t})});Og.displayName=Mg;var Pg="SelectItem",[Ag,Rg]=Qm(Pg),Dg=e.forwardRef((t,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:i,...s}=t,l=ng(Pg,o),c=gg(Pg,o),u=l.value===r,[d,f]=e.useState(i??""),[p,h]=e.useState(!1),g=Ku(n,e=>c.itemRefCallback?.(e,r,a)),y=Ju(),v=e.useRef("touch"),b=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m(Ag,{scope:o,value:r,disabled:a,textId:y,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:m(qm.ItemSlot,{scope:o,value:r,disabled:a,textValue:d,children:m(id.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:Vu(s.onFocus,()=>h(!0)),onBlur:Vu(s.onBlur,()=>h(!1)),onClick:Vu(s.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Vu(s.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Vu(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Vu(s.onPointerMove,e=>{v.current=e.pointerType,a?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Vu(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Vu(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(Km.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Dg.displayName=Pg;var Tg="SelectItemText",Ig=e.forwardRef((t,n)=>{const{__scopeSelect:o,className:r,style:a,...i}=t,s=ng(Tg,o),l=gg(Tg,o),c=Rg(Tg,o),u=rg(Tg,o),[d,f]=e.useState(null),h=Ku(n,e=>f(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),v=d?.textContent,b=e.useMemo(()=>m("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return Zu(()=>(w(b),()=>x(b)),[w,x,b]),g(y,{children:[m(id.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?p.createPortal(i.children,s.valueNode):null]})});Ig.displayName=Tg;var zg="SelectItemIndicator",$g=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Rg(zg,n).isSelected?m(id.span,{"aria-hidden":!0,...o,ref:t}):null});$g.displayName=zg;var Lg="SelectScrollUpButton",Bg=e.forwardRef((t,n)=>{const o=gg(Lg,t.__scopeSelect),r=Eg(Lg,t.__scopeSelect),[a,i]=e.useState(!1),s=Ku(n,r.onScrollButtonChange);return Zu(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?m(jg,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Bg.displayName=Lg;var Hg="SelectScrollDownButton",Fg=e.forwardRef((t,n)=>{const o=gg(Hg,t.__scopeSelect),r=Eg(Hg,t.__scopeSelect),[a,i]=e.useState(!1),s=Ku(n,r.onScrollButtonChange);return Zu(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;i(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?m(jg,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Fg.displayName=Hg;var jg=e.forwardRef((t,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=t,i=gg("SelectScrollButton",o),s=e.useRef(null),l=Zm(o),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),Zu(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),m(id.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:Vu(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(r,50))}),onPointerMove:Vu(a.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(r,50))}),onPointerLeave:Vu(a.onPointerLeave,()=>{c()})})}),Wg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return m(id.div,{"aria-hidden":!0,...o,ref:t})});Wg.displayName="SelectSeparator";var Vg="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=eg(n),a=ng(Vg,n),i=gg(Vg,n);return a.open&&"popper"===i.position?m(Wm,{...r,...o,ref:t}):null}).displayName=Vg;var Yg=e.forwardRef(({__scopeSelect:t,value:n,...o},r)=>{const a=e.useRef(null),i=Ku(r,a),s=Vm(n);return e.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&o){const t=new Event("change",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[s,n]),m(id.select,{...o,style:{...Ym,...o.style},ref:i,defaultValue:n})});function Xg(e){return""===e||void 0===e}function Kg(t){const n=sd(t),o=e.useRef(""),r=e.useRef(0),a=e.useCallback(e=>{const t=o.current+e;n(t),function e(t){o.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{o.current="",window.clearTimeout(r.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(r.current),[]),[o,a,i]}function Ug(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(a,0));1===r.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}Yg.displayName="SelectBubbleInput";var qg=sg,Zg=ug,Gg=dg,Qg=pg,Jg=_g,ey=Og,ty=Dg,ny=Ig,oy=$g,ry=Bg,ay=Fg,iy=Wg;const sy=ag,ly=cg,cy=e.forwardRef((t,n)=>{var{className:o,children:r}=t,a=wu(t,["className","children"]);return e.createElement(qg,Object.assign({ref:n,className:hu("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",o)},a),r,e.createElement(Zg,{asChild:!0},e.createElement(Ms,{className:"h-4 w-4 opacity-50"})))});cy.displayName=qg.displayName;const uy=e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(ry,Object.assign({ref:n,className:hu("flex cursor-default items-center justify-center py-1",o)},r),e.createElement(Ps,{className:"h-4 w-4"}))});uy.displayName=ry.displayName;const dy=e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(ay,Object.assign({ref:n,className:hu("flex cursor-default items-center justify-center py-1",o)},r),e.createElement(Ms,{className:"h-4 w-4"}))});dy.displayName=ay.displayName;const fy=e.forwardRef((t,n)=>{var{className:o,children:r,position:a="popper"}=t,i=wu(t,["className","children","position"]);return e.createElement(Gg,null,e.createElement(Qg,Object.assign({ref:n,className:hu("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o),position:a},i),e.createElement(uy,null),e.createElement(Jg,{className:hu("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},r),e.createElement(dy,null)))});fy.displayName=Qg.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(ey,Object.assign({ref:n,className:hu("py-1.5 pl-8 pr-2 text-sm font-semibold",o)},r))}).displayName=ey.displayName;const py=e.forwardRef((t,n)=>{var{className:o,children:r}=t,a=wu(t,["className","children"]);return e.createElement(ty,Object.assign({ref:n,className:hu("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o)},a),e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(oy,null,e.createElement(Ns,{className:"h-4 w-4"}))),e.createElement(ny,null,r))});py.displayName=ty.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(iy,Object.assign({ref:n,className:hu("-mx-1 my-1 h-px bg-muted",o)},r))}).displayName=iy.displayName;const hy=({files:e,currentFile:n,onFileSelect:o,onRefresh:r,loading:a=!1,disabled:i=!1})=>t.createElement("div",{className:"flex items-center gap-2"},0!==e.length||a?t.createElement(sy,{value:n||"",onValueChange:o,disabled:i||a},t.createElement(cy,{className:hu("w-fit shadcn-select transition-all duration-200",(i||a)&&"opacity-60 cursor-not-allowed")},t.createElement("div",{className:"flex items-center justify-between w-full gap-3 p-2"},t.createElement(ly,{placeholder:a?"Loading sessions...":0===e.length?"No sessions found":"Select an Agent Session..."}))),t.createElement(fy,null,0!==e.length||a?e.map(e=>t.createElement(py,{key:e.name,value:e.name},e.name)):t.createElement("div",{className:"px-2 py-3 text-center text-sm text-gray-500"},"No agent sessions available"))):t.createElement("div",{className:"text-sm text-gray-500 px-3 py-2"},"No agent sessions available"),e.length>0&&t.createElement("button",{onClick:e=>{e.stopPropagation(),r()},disabled:a||i,title:a?"Loading...":"Refresh files",className:hu("file-selector-refresh-btn transition-all duration-200",(a||i)&&"opacity-50 cursor-not-allowed")},a?t.createElement(As,{className:"h-4 w-4 animate-spin text-gray-400"}):t.createElement(Ds,{className:"h-4 w-4"})));var my="Checkbox",[gy,yy]=Uu(my),[vy,by]=gy(my);function wy(t){const{__scopeCheckbox:n,checked:o,children:r,defaultChecked:a,disabled:i,form:s,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,h]=td({prop:o,defaultProp:a??!1,onChange:c,caller:my}),[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useRef(!1),x=!g||(!!s||!!g.closest("form")),E={checked:p,disabled:i,setChecked:h,control:g,setControl:y,name:l,form:s,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:!Oy(a)&&a,isFormControl:x,bubbleInput:v,setBubbleInput:b};return m(vy,{scope:n,...E,children:My(f)?f(E):r})}var xy="CheckboxTrigger",Ey=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:o,...r},a)=>{const{control:i,value:s,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=by(xy,t),y=Ku(a,d),v=e.useRef(c);return e.useEffect(()=>{const e=i?.form;if(e){const t=()=>f(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,f]),m(id.button,{type:"button",role:"checkbox","aria-checked":Oy(c)?"mixed":c,"aria-required":u,"data-state":Py(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:y,onKeyDown:Vu(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Vu(o,e=>{f(e=>!!Oy(e)||!e),g&&h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});Ey.displayName=xy;var Sy=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return m(wy,{__scopeCheckbox:n,checked:r,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:o,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>g(y,{children:[m(Ey,{...d,ref:t,__scopeCheckbox:n}),e&&m(Ny,{__scopeCheckbox:n})]})})});Sy.displayName=my;var _y="CheckboxIndicator",ky=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,a=by(_y,n);return m(Md,{present:o||Oy(a.checked)||!0===a.checked,children:m(id.span,{"data-state":Py(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});ky.displayName=_y;var Cy="CheckboxBubbleInput",Ny=e.forwardRef(({__scopeCheckbox:t,...n},o)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:s,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=by(Cy,t),g=Ku(o,h),y=Vm(i),v=xm(r);e.useEffect(()=>{const e=p;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!a.current;if(y!==i&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Oy(i),n.call(e,!Oy(i)&&i),e.dispatchEvent(t)}},[p,y,i,a]);const b=e.useRef(!Oy(i)&&i);return m(id.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:u,value:d,form:f,...n,tabIndex:-1,ref:g,style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function My(e){return"function"==typeof e}function Oy(e){return"indeterminate"===e}function Py(e){return Oy(e)?"indeterminate":e?"checked":"unchecked"}Ny.displayName=Cy;const Ay=e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(Sy,Object.assign({ref:n,className:hu("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o)},r),e.createElement(ky,{className:hu("flex items-center justify-center text-current")},e.createElement(Ns,{className:"h-4 w-4"})))});Ay.displayName=Sy.displayName;const Ry=t.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Dy=()=>{const e=t.useContext(Ry);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function Ty(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Iy(){return $y(/^iPad/)||$y(/^Mac/)&&navigator.maxTouchPoints>1}function zy(){return $y(/^iPhone/)||Iy()}function $y(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const Ly="undefined"!=typeof window?f:i;function By(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Hy="undefined"!=typeof document&&window.visualViewport;function Fy(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function jy(e){for(Fy(e)&&(e=e.parentElement);e&&!Fy(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Wy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Vy,Yy=0;function Xy(e={}){let{isDisabled:t}=e;Ly(()=>{if(!t)return Yy++,1===Yy&&zy()&&(Vy=function(){let e,t=0,n=n=>{e=jy(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},o=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let o=n.changedTouches[0].pageY,r=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((r<=0&&o>t||r>=a&&o<t)&&n.preventDefault(),t=o)},r=e=>{let t=e.target;qy(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;qy(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Hy&&(Hy.height<window.innerHeight?requestAnimationFrame(()=>{Uy(t)}):Hy.addEventListener("resize",()=>Uy(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=By(function(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=By(Ky(document,"touchstart",n,{passive:!1,capture:!0}),Ky(document,"touchmove",o,{passive:!1,capture:!0}),Ky(document,"touchend",r,{passive:!1,capture:!0}),Ky(document,"focus",a,!0),Ky(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Yy--,0===Yy&&(null==Vy||Vy())}},[t])}function Ky(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function Uy(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=jy(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,o=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=o-n)}e=t.parentElement}}function qy(e){return e instanceof HTMLInputElement&&!Wy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Zy(...t){return e.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...t),t)}const Gy=new WeakMap;function Qy(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let o={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(o[t]=e.style[t],e.style[t]=n)}),n||Gy.set(e,o)}const Jy=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ev(e,t){if(!e)return null;const n=window.getComputedStyle(e),o=n.transform||n.webkitTransform||n.mozTransform;let r=o.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[Jy(t)?13:12]):(r=o.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[Jy(t)?5:4]):null)}function tv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const nv={DURATION:.5,EASE:[.32,.72,0,1]},ov=16,rv="vaul-dragging";function av(e){const n=t.useRef(e);return t.useEffect(()=>{n.current=e}),t.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function iv({prop:e,defaultProp:n,onChange:o=()=>{}}){const[r,a]=function({defaultProp:e,onChange:n}){const o=t.useState(e),[r]=o,a=t.useRef(r),i=av(n);return t.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),o}({defaultProp:n,onChange:o}),i=void 0!==e,s=i?e:r,l=av(o),c=t.useCallback(t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else a(t)},[i,e,a,l]);return[s,c]}let sv=null;function lv({open:e,onOpenChange:n,children:o,onDrag:r,onRelease:a,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:k=!1,repositionInputs:C=!0,onAnimationEnd:N,container:M,autoFocus:O=!1}){var P,A;const[R=!1,D]=iv({defaultProp:E,prop:e,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*nv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[T,I]=t.useState(!1),[z,$]=t.useState(!1),[L,B]=t.useState(!1),H=t.useRef(null),F=t.useRef(null),j=t.useRef(null),W=t.useRef(null),V=t.useRef(null),Y=t.useRef(!1),X=t.useRef(null),K=t.useRef(0),U=t.useRef(!1),q=t.useRef(!E),Z=t.useRef(0),G=t.useRef(null),Q=t.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().height)||0),J=t.useRef((null==(A=G.current)?void 0:A.getBoundingClientRect().width)||0),ee=t.useRef(0),te=t.useCallback(e=>{i&&e===ie.length-1&&(F.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:oe,setActiveSnapPoint:re,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:o,drawerRef:r,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=iv({prop:e,defaultProp:null==o?void 0:o[0],onChange:n}),[p,h]=t.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);t.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=t.useMemo(()=>d===(null==o?void 0:o[o.length-1])||null,[o,d]),g=t.useMemo(()=>{var e;return null!=(e=null==o?void 0:o.findIndex(e=>e===d))?e:null},[o,d]),y=o&&o.length>0&&(i||0===i)&&!Number.isNaN(i)&&o[i]===d||!o,v=t.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==o?void 0:o.map(t=>{const n="string"==typeof t;let o=0;if(n&&(o=parseInt(t,10)),Jy(l)){const r=n?o:p?t*e.height:0;return p?"bottom"===l?e.height-r:-e.height+r:r}const r=n?o:p?t*e.width:0;return p?"right"===l?e.width-r:-e.width+r:r}))?t:[]},[o,p,c]),b=t.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=t.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),Qy(r.current,{transition:`transform ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`,transform:Jy(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?Qy(a.current,{transition:`opacity ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`,opacity:"0"}):Qy(a.current,{transition:`opacity ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`,opacity:"1"}),f(null==o?void 0:o[Math.max(n,0)])},[r.current,o,v,i,a,f]);return t.useEffect(()=>{if(d||e){var t;const n=null!=(t=null==o?void 0:o.findIndex(t=>t===e||t===d))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,e,o,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!o||"number"!=typeof g||!v||void 0===i)return null;const n=g===i-1;if(g>=i&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const r=n?g+1:g-1,a=n?v[r]-v[r-1]:v[r+1]-v[r],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:r}){if(void 0===i)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===i-1&&Qy(a.current,{transition:`opacity ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`}),!u&&n>2&&!d)return void(r?t():w(v[0]));if(!u&&n>2&&d&&v&&o)return void w(v[o.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=Jy(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&o)return void w(v[o.length-1]);if(c&&e<0&&r&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||Qy(r.current,{transform:Jy(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:H,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Xy({isDisabled:!R||z||!y||L||!T||!C||!S});const{restorePositionSetting:ue}=function({isOpen:e,modal:n,nested:o,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=t.useState(()=>"undefined"!=typeof window?window.location.href:""),c=t.useRef(0),u=t.useCallback(()=>{if(Ty()&&null===sv&&e&&!i){sv={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-c.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=-(c.current+e)+"px")}),300)}},[e]),d=t.useCallback(()=>{if(Ty()&&null!==sv&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,sv),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),sv=null}},[s]);return t.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),t.useEffect(()=>{!o&&r&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[e,r,s,n,o,u,d]),{restorePositionSetting:d}}({isOpen:R,modal:y,nested:null!=b&&b,hasBeenOpened:T,preventScrollRestoration:k,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let o=e;const r=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?ev(G.current,x):null,i=new Date;if("SELECT"===o.tagName)return!1;if(o.hasAttribute("data-vaul-no-drag")||o.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(F.current&&i.getTime()-F.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(r&&r.length>0)return!1;if(V.current&&i.getTime()-V.current.getTime()<u&&0===a)return V.current=i,!1;if(t)return V.current=i,!1;for(;o;){if(o.scrollHeight>o.clientHeight){if(0!==o.scrollTop)return V.current=new Date,!1;if("dialog"===o.getAttribute("role"))return!0}o=o.parentNode}return!0}function pe(e){!function(){if(!z||!G.current)return;G.current.classList.remove(rv),Y.current=!1,$(!1),W.current=new Date}(),null==v||v(),e||D(!1),setTimeout(()=>{i&&re(i[0])},1e3*nv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=ev(G.current,x);Qy(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`}),Qy(H.current,{transition:`opacity ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&R&&Qy(e,{borderRadius:"8px",overflow:"hidden",...Jy(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${nv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${nv.EASE.join(",")})`},!0)}return t.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),t.useEffect(()=>{var e;function t(){if(!G.current||!C)return;if(qy(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let o=n-t;const r=G.current.getBoundingClientRect().height||0,a=r>.8*n;ee.current||(ee.current=r);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-o)>60&&(U.current=!U.current),i&&i.length>0&&ie&&oe){o+=ie[oe]||0}if(Z.current=o,r>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),G.current.style.height=g?e-Math.max(o,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);i&&i.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(o,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[oe,i,ie]),t.useEffect(()=>(R&&(Qy(document.documentElement,{scrollBehavior:"auto"}),F.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Gy.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[R]),t.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),t.createElement(ip,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?I(!0):pe(!0),D(e))},open:R},t.createElement(Ry.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:re,drawerRef:G,overlayRef:H,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,$(!0),j.current=new Date,zy()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=Jy(x)?e.pageY:e.pageX))},onRelease:function(e){if(!z||!G.current)return;G.current.classList.remove(rv),Y.current=!1,$(!1),W.current=new Date;const t=ev(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===j.current)return;const n=W.current.getTime()-j.current.getTime(),o=K.current-(Jy(x)?e.pageY:e.pageX),r=Math.abs(o)/n;if(r>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:o*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:r,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?o>0:o<0)return he(),void(null==a||a(e,!0));if(r>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&z){const n="bottom"===x||"right"===x?1:-1,o=(K.current-(Jy(x)?e.pageY:e.pageX))*n,a=o>0,l=i&&!d&&!a;if(l&&0===oe)return;const c=Math.abs(o),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,a);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,a))return;if(G.current.classList.add(rv),Y.current=!0,Qy(G.current,{transition:"none"}),Qy(H.current,{transition:"none"}),i&&se({draggedDistance:o}),a&&!i){const e=(t=o,8*(Math.log(t+1)-2)),r=Math.min(-1*e,0)*n;return void Qy(G.current,{transform:Jy(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`})}const m=1-f;if((le||p&&oe===p-1)&&(null==r||r(e,f),Qy(H.current,{opacity:`${m}`,transition:"none"},!0)),u&&H.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);Qy(u,{borderRadius:`${t}px`,transform:Jy(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;Qy(G.current,{transform:Jy(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:R,isDragging:z,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-ov)/window.innerWidth,o=n+t*(1-n),r=t*ov-16;Qy(G.current,{transform:Jy(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-ov)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Qy(G.current,{transition:`transform ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`,transform:Jy(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=ev(G.current,x);Qy(G.current,{transition:"none",transform:Jy(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=Jy(x)?window.innerHeight:window.innerWidth,o=t?(n-ov)/n:1,r=t?-16:0;t&&Qy(G.current,{transition:`transform ${nv.DURATION}s cubic-bezier(${nv.EASE.join(",")})`,transform:Jy(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ie,activeSnapPointIndex:oe,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:O}},o))}const cv=t.forwardRef(function({...e},n){const{overlayRef:o,snapPoints:r,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Dy(),u=Zy(n,o),d=r&&r.length>0;if(!l)return null;const f=t.useCallback(e=>a(e),[a]);return t.createElement(cp,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});cv.displayName="Drawer.Overlay";const uv=t.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:o,...a},i){const{drawerRef:s,onPress:l,onRelease:c,onDrag:u,keyboardIsOpen:d,snapPointsOffset:f,activeSnapPointIndex:p,modal:h,isOpen:m,direction:g,snapPoints:y,container:v,handleOnly:b,shouldAnimate:w,autoFocus:x}=Dy(),[E,S]=t.useState(!1),_=Zy(i,s),k=t.useRef(null),C=t.useRef(null),N=t.useRef(!1),M=y&&y.length>0;!function(){const{direction:e,isOpen:n,shouldScaleBackground:o,setBackgroundColorOnScale:a,noBodyStyles:i}=Dy(),s=t.useRef(null),l=r(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-26)/window.innerWidth}t.useEffect(()=>{if(n&&o){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;a&&!i&&tv(document.body,{background:"black"}),tv(t,{transformOrigin:Jy(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${nv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${nv.EASE.join(",")})`});const n=tv(t,{borderRadius:"8px",overflow:"hidden",...Jy(e)?{transform:`scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),s.current=window.setTimeout(()=>{l?document.body.style.background=l:document.body.style.removeProperty("background")},1e3*nv.DURATION)}}},[n,o,l])}();function O(e){k.current=null,N.current=!1,c(e)}return t.useEffect(()=>{M&&window.requestAnimationFrame(()=>{S(!0)})},[]),t.createElement(up,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":E?"true":"false","data-vaul-snap-points":m&&M?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":(null==w?void 0:w.current)?"true":"false",...a,ref:_,style:f&&f.length>0?{"--snap-point-height":`${f[null!=p?p:0]}px`,...n}:n,onPointerDown:e=>{b||(null==a.onPointerDown||a.onPointerDown.call(a,e),k.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{null==o||o(e),x||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),h&&!t.defaultPrevented?d.current&&(d.current=!1):t.preventDefault()},onFocusOutside:e=>{h||e.preventDefault()},onPointerMove:e=>{if(C.current=e,b)return;if(null==a.onPointerMove||a.onPointerMove.call(a,e),!k.current)return;const t=e.pageY-k.current.y,n=e.pageX-k.current.x,o="touch"===e.pointerType?10:2,r=((e,t,n=0)=>{if(N.current)return!0;const o=Math.abs(e.y),r=Math.abs(e.x),a=r>o,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&r>=0&&r<=n)return a}else if(!(e.y*i<0)&&o>=0&&o<=n)return!a;return N.current=!0,!0})({x:n,y:t},g,o);r?u(e):(Math.abs(n)>o||Math.abs(t)>o)&&(k.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),k.current=null,N.current=!1,c(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),O(C.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),C.current&&O(C.current)}})});uv.displayName="Drawer.Content";const dv=t.forwardRef(function({preventCycle:e=!1,children:n,...o},r){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Dy(),m=t.useRef(null),g=t.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return t.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||e||g.current)return void y();if(y(),!s||0===s.length)return void(u||a());if(l===s[s.length-1]&&u)return void a();const t=s.findIndex(e=>e===l);if(-1===t)return;const n=s[t+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...o},t.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});dv.displayName="Drawer.Handle";const fv={Root:lv,NestedRoot:function({onDrag:e,onOpenChange:n,open:o,...r}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Dy();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return t.createElement(lv,{nested:!0,open:o,onClose:()=>{i(!1)},onDrag:(t,n)=>{a(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...r})},Content:uv,Overlay:cv,Trigger:sp,Portal:function(e){const n=Dy(),{container:o=n.container,...r}=e;return t.createElement(lp,{container:o,...r})},Handle:dv,Close:pp,Title:dp,Description:fp},pv=t=>{var{shouldScaleBackground:n=!0}=t,o=wu(t,["shouldScaleBackground"]);return e.createElement(fv.Root,Object.assign({shouldScaleBackground:n},o))};pv.displayName="Drawer";const hv=fv.Portal,mv=e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(fv.Overlay,Object.assign({ref:n,className:hu("fixed inset-0 z-50 bg-black/80",o)},r))});mv.displayName=fv.Overlay.displayName;const gv=e.forwardRef((t,n)=>{var{className:o,children:r}=t,a=wu(t,["className","children"]);return e.createElement(hv,null,e.createElement(mv,null),e.createElement(fv.Content,Object.assign({ref:n,className:hu("fixed inset-x-0 top-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",o)},a),e.createElement("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),r))});gv.displayName="DrawerContent";e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(fv.Title,Object.assign({ref:n,className:hu("text-lg font-semibold leading-none tracking-tight",o)},r))}).displayName=fv.Title.displayName;e.forwardRef((t,n)=>{var{className:o}=t,r=wu(t,["className"]);return e.createElement(fv.Description,Object.assign({ref:n,className:hu("text-sm text-muted-foreground",o)},r))}).displayName=fv.Description.displayName;export{Cp as AgenticFlowVisualizer,Nu as AnthropicIcon,Eu as Badge,Ay as Checkbox,pv as Drawer,Ts as Edge,hy as FileSelector,Mu as GoogleIcon,ku as JsonTreeViewer,Pu as Node,Cu as OpenAIIcon,sy as Select,gp as Sheet,Wu as Timeline,Np as Visualizer,_p as calculateAutoLayout,hu as cn,yu as formatCurrency,vu as formatLatency,mu as toTitleCase,gu as truncateText};
55
163
  //# sourceMappingURL=index.js.map