@railtownai/railtracks-visualizer 0.0.19 → 0.0.21
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/README.md +0 -9
- package/dist/cjs/index.js +410 -303
- package/dist/esm/index.js +410 -303
- package/dist/types/components/AgenticFlowVisualizer.d.ts +1 -0
- package/dist/types/components/Node.d.ts +3 -4
- package/dist/types/components/Visualizer.d.ts +1 -1
- package/dist/types/components/nodes/AgentNode.d.ts +22 -0
- package/dist/types/components/nodes/CoordinatorNode.d.ts +22 -0
- package/dist/types/components/nodes/ExpandableTextarea.d.ts +9 -0
- package/dist/types/components/nodes/NodeDetailsPopover.d.ts +23 -0
- package/dist/types/components/nodes/ToolNode.d.ts +22 -0
- package/dist/types/components/nodes/index.d.ts +5 -0
- package/dist/types/components/ui/badge.d.ts +7 -4
- package/dist/types/components/ui/tooltip.d.ts +9 -0
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/SafeThemeProvider.d.ts +19 -0
- package/dist/types/lib/ThemeProvider.d.ts +1 -0
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/lib/safeStyled.d.ts +41 -0
- package/dist/types/lib/utils.d.ts +32 -2
- package/package.json +3 -2
- package/dist/types/hooks/useTheme.d.ts +0 -7
package/dist/esm/index.js
CHANGED
|
@@ -1,18 +1,53 @@
|
|
|
1
|
-
import*as e from"react";import t,{createContext as n,memo as r,useMemo as o,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,r=0;r<e.length;r++)""!==(n=v(e[r]))&&(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:{}},S={},E={exports:{}},_={};var C,k,N,M={};function P(){return k||(k=1,"production"===process.env.NODE_ENV?E.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},r=e.useState,o=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}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=r({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]),o(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,_}():E.exports=(C||(C=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(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,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=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();r(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=o({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)),E.exports}var O,A={};"production"===process.env.NODE_ENV?x.exports=function(){if(N)return S;N=1;var e=t,n=P(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return S.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,o=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,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,a=n)}var o,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=o(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},S}():x.exports=(O||(O=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=P(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=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,o=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,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,a=n)}var o,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=o(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 T=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,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(r,o,a);return a},{useDebugValue:D}=t,{useSyncExternalStoreWithSelector:$}=R,I=e=>e;function z(e,t=I,n){const r=$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return D(r),r}const L=(e,t)=>{const n=(e=>e?T(e):T)(e),r=(e,r=t)=>z(n,e,r);return Object.assign(r,n),r};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,r]of e)if(!Object.is(r,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 r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var F={value:()=>{}};function H(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new W(r)}function W(e){this._=e}function V(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function j(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=F,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}W.prototype=H.prototype={constructor:W,on:function(e,t){var n,r,o=this._,a=(r=o,(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&&!r.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)o[n]=j(o[n],e.name,t);else if(null==t)for(n in o)o[n]=j(o[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=V(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new W(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].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 re(e){return function(t){return t.matches(e)}}var oe=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,r,o,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new ce(e,a[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function de(e,t,n,r,o,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)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(r[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&&(o[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 Se(e){return function(){this.style.removeProperty(e)}}function Ee(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _e(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ce(e,t){return e.style.getPropertyValue(t)||xe(e).getComputedStyle(e,null).getPropertyValue(t)}function ke(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 Pe(e){return e.trim().split(/^|\s+/)}function Oe(e){return e.classList||new Ae(e)}function Ae(e){this._node=e,this._names=Pe(e.getAttribute("class")||"")}function Re(e,t){for(var n=Oe(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Te(e,t){for(var n=Oe(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function De(e){return function(){Re(this,e)}}function $e(e){return function(){Te(this,e)}}function Ie(e,t){return function(){(t.apply(this,arguments)?Re:Te)(this,e)}}function ze(){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 Fe(){this.innerHTML=""}function He(e){return function(){this.innerHTML=e}}function We(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ve(){this.nextSibling&&this.parentNode.appendChild(this)}function je(){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,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Ze(e,t,n){return function(){var r,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var i=0,s=o.length;i<s;++i)if((r=o[i]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t);this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function Ge(e,t,n){var r=xe(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}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 rt(e){return"string"==typeof e?new tt([[document.querySelector(e)]],[document.documentElement]):new tt([[e]],et)}function ot(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 r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.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,r=new Array(n),o=0;o<n;++o)for(var a,i,s=t[o],l=s.length,c=r[o]=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(r,this._parents)},selectAll:function(e){e="function"==typeof e?te(e):ee(e);for(var t=this._groups,n=t.length,r=[],o=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),o.push(i));return new tt(r,o)},selectChild:function(e){return this.select(null==e?ae:function(e){return function(){return oe.call(this.children,e)}}("function"==typeof e?e:re(e)))},selectChildren:function(e){return this.selectAll(null==e?se:function(e){return function(){return ie.call(this.children,e)}}("function"==typeof e?e:re(e)))},filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new tt(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,fe);var n,r=t?de:ue,o=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=o[u],f=a[u],p=f.length,h=pe(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(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,o))._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 r=this.enter(),o=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,i=Math.min(o,a),s=new Array(o),l=0;l<i;++l)for(var c,u=n[l],d=r[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<o;++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 r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);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,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new tt(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];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,r=t.length;n<r;++n)for(var o,a=t[n],i=0,s=a.length;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=K(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.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?Se:"function"==typeof t?_e:Ee)(e,t,null==n?"":n)):Ce(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?ke:"function"==typeof t?Me:Ne)(e,t)):this.node()[e]},classed:function(e,t){var n=Pe(e+"");if(arguments.length<2){for(var r=Oe(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Ie:t?De:$e)(n,t))},text:function(e){return arguments.length?this.each(null==e?ze:("function"==typeof e?Be:Le)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Fe:("function"==typeof e?We:He)(e)):this.node().innerHTML},raise:function(){return this.each(Ve)},lower:function(){return this.each(je)},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),r=null==t?Ye:"function"==typeof t?t:Q(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.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 r,o,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,r=0;r<i;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((o=a[r]).type===l.type&&o.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 r,o=e[t],a=0,i=o.length;a<i;++a)(r=o[a])&&(yield r)}};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=rt(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,r=rt(e).on("dragstart.drag",null);t&&(r.on("click.drag",lt,it),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var dt=e=>()=>e;function ft(e,{sourceEvent:t,subject:n,target:r,identifier:o,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:r,enumerable:!0,configurable:!0},identifier:{value:o,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 r in t)n[r]=t[r];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,St="\\s*([+-]?\\d+)\\s*",Et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ct=/^#([0-9a-f]{3,8})$/,kt=new RegExp(`^rgb\\(${St},${St},${St}\\)$`),Nt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),Mt=new RegExp(`^rgba\\(${St},${St},${St},${Et}\\)$`),Pt=new RegExp(`^rgba\\(${_t},${_t},${_t},${Et}\\)$`),Ot=new RegExp(`^hsl\\(${Et},${_t},${_t}\\)$`),At=new RegExp(`^hsla\\(${Et},${_t},${_t},${Et}\\)$`),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 Tt(){return this.rgb().formatHex()}function Dt(){return this.rgb().formatRgb()}function $t(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ct.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?It(t):3===n?new Bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zt(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=kt.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))?zt(t[1],t[2],t[3],t[4]):(t=Pt.exec(e))?zt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ot.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)?It(Rt[e]):"transparent"===e?new Bt(NaN,NaN,NaN,0):null}function It(e){return new Bt(e>>16&255,e>>8&255,255&e,1)}function zt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Bt(e,t,n,r)}function Lt(e,t,n,r){return 1===arguments.length?((o=e)instanceof bt||(o=$t(o)),o?new Bt((o=o.rgb()).r,o.g,o.b,o.opacity):new Bt):new Bt(e,t,n,null==r?1:r);var o}function Bt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ft(){return`#${jt(this.r)}${jt(this.g)}${jt(this.b)}`}function Ht(){const e=Wt(this.opacity);return`${1===e?"rgb(":"rgba("}${Vt(this.r)}, ${Vt(this.g)}, ${Vt(this.b)}${1===e?")":`, ${e})`}`}function Wt(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 jt(e){return((e=Vt(e))<16?"0":"")+e.toString(16)}function Yt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kt(e,t,n,r)}function Xt(e){if(e instanceof Kt)return new Kt(e.h,e.s,e.l,e.opacity);if(e instanceof bt||(e=$t(e)),!e)return new Kt;if(e instanceof Kt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,s=a-o,l=(a+o)/2;return s?(i=t===a?(n-r)/s+6*(n<r):n===a?(r-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new Kt(i,s,l,e.opacity)}function Kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}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,$t,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tt,formatHex:Tt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xt(this).formatHsl()},formatRgb:Dt,toString:Dt}),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(Vt(this.r),Vt(this.g),Vt(this.b),Wt(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:Ft,formatHex:Ft,formatHex8:function(){return`#${jt(this.r)}${jt(this.g)}${jt(this.b)}${jt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ht,toString:Ht})),yt(Kt,function(e,t,n,r){return 1===arguments.length?Xt(e):new Kt(e,t,n,null==r?1:r)},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,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Bt(Zt(e>=240?e-240:e+120,o,r),Zt(e,o,r),Zt(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Kt(Ut(this.h),qt(this.s),qt(this.l),Wt(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=Wt(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(r){return Math.pow(e+r*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 r(e,t){var r=n((e=Lt(e)).r,(t=Lt(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=Jt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(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,rn=new RegExp(nn.source,"g");function on(e,t){var n,r,o,a=nn.lastIndex=rn.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=nn.exec(e))&&(r=rn.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i:i,x:tn(n,r)})),a=rn.lastIndex;return a<t.length&&(o=t.slice(a),s[i]?s[i]+=o:s[++i]=o),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,r=0;r<t;++r)s[(n=l[r]).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,r,o,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*sn,skewX:Math.atan(l)*sn,scaleX:i,scaleY:s}}function un(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,r,o,a,i,s){if(e!==o||r!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:tn(e,o)},{i:l-2,x:tn(r,a)})}else(o||a)&&i.push("translate("+o+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(o(n)+"rotate(",null,r)-2,x:tn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,r)-2,x:tn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(a.skewX,i.skewX,s,l),function(e,t,n,r,a,i){if(e!==n||t!==r){var s=a.push(o(a)+"scale(",null,",",null,")");i.push({i:s-4,x:tn(e,n)},{i:s-2,x:tn(t,r)})}else 1===n&&1===r||a.push(o(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,r=l.length;++n<r;)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,r){function o(e,o){var a,i,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[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+r*m)/(2*c*n*g),v=(f*f-c*c-r*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 r,o=e*i,a=pn(b),u=c/(n*g)*(a*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/pn(t*o+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),yn=0,vn=0,bn=0,wn=0,xn=0,Sn=0,En="object"==typeof performance&&performance.now?performance:Date,_n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cn(){return xn||(_n(kn),xn=En.now()+Sn)}function kn(){xn=0}function Nn(){this._call=this._time=this._next=null}function Mn(e,t,n){var r=new Nn;return r.restart(e,t,n),r}function Pn(){xn=(wn=En.now())+Sn,yn=vn=0;try{!function(){Cn(),++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,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hn=t);mn=e,An(r)}(),xn=0}}function On(){var e=En.now(),t=e-wn;t>1e3&&(Sn-=t,wn=e)}function An(e){yn||(vn&&(vn=clearTimeout(vn)),e-xn>24?(e<1/0&&(vn=setTimeout(Pn,e-En.now()-Sn)),bn&&(bn=clearInterval(bn))):(bn||(wn=En.now(),bn=setInterval(On,1e3)),yn=1,_n(Pn)))}function Rn(e,t,n){var r=new Nn;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}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?Cn():+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 Tn=H("start","end","cancel","interrupt"),Dn=[];function $n(e,t,n,r,o,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,o=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 o)if((f=o[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 o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[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,r=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))&&(r[++u]=f);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=r.length;++a<i;)r[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Mn(a,0,n.time)}(e,n,{name:t,index:r,group:o,on:Tn,tween:Dn,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function In(e,t){var n=Ln(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function zn(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,r,o,a=e.__transition,i=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):i=!1;i&&delete e.__transition}}function Fn(e,t){var n,r;return function(){var o=zn(this,e),a=o.tween;if(a!==n)for(var i=0,s=(r=n=a).length;i<s;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}o.tween=r}}function Hn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var a=zn(this,e),i=a.tween;if(i!==r){o=(r=i).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function Wn(e,t,n){var r=e._id;return e.each(function(){var e=zn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Ln(e,r).value[t]}}function Vn(e,t){var n;return("number"==typeof t?tn:t instanceof $t?en:(n=$t(t))?(t=n,en):on)(e,t)}function jn(e){return function(){this.removeAttribute(e)}}function Yn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xn(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===r?o:o=t(r=i,n)}}function Kn(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?o:o=t(r=i,n)}}function Un(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttribute(e)}}function qn(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttributeNS(e.space,e.local)}}function Zn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Gn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Qn(e,t){return function(){In(this,e).delay=+t.apply(this,arguments)}}function Jn(e,t){return t=+t,function(){In(this,e).delay=t}}function er(e,t){return function(){zn(this,e).duration=+t.apply(this,arguments)}}function tr(e,t){return t=+t,function(){zn(this,e).duration=t}}var nr=nt.prototype.constructor;function rr(e){return function(){this.style.removeProperty(e)}}var or=0;function ar(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ir(){return++or}var sr=nt.prototype;ar.prototype={constructor:ar,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Q(e));for(var r=this._groups,o=r.length,a=new Array(o),i=0;i<o;++i)for(var s,l,c=r[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,$n(d[f],t,n,f,d,Ln(s,n)));return new ar(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ee(e));for(var r=this._groups,o=r.length,a=[],i=[],s=0;s<o;++s)for(var l,c=r[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])&&$n(f,t,n,m,p,h);a.push(p),i.push(l)}return new ar(a,i,t,n)},selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new ar(r,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,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),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<r;++s)i[s]=t[s];return new ar(i,this._parents,this._name,this._id)},selection:function(){return new nr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=ir(),r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=Ln(i,t);$n(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ar(r,this._parents,e,n)},call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.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 r,o,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)?In:zn;return function(){var i=a(this,e),s=i.on;s!==r&&(o=(r=s).copy()).on(t,n),i.on=o}}(n,e,t))},attr:function(e,t){var n=K(e),r="transform"===n?fn:Vn;return this.attrTween(e,"function"==typeof t?(n.local?qn:Un)(n,r,Wn(this,"attr."+e,t)):null==t?(n.local?Yn:jn)(n):(n.local?Kn:Xn)(n,r,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 r=K(e);return this.tween(n,(r.local?Zn:Gn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?dn:Vn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var a=Ce(this,e),i=(this.style.removeProperty(e),Ce(this,e));return a===i?null:a===n&&i===r?o:o=t(n=a,r=i)}}(e,r)).on("end.style."+e,rr(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,a;return function(){var i=Ce(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Ce(this,e)),i===l?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}(e,r,Wn(this,"style."+e,t))).each(function(e,t){var n,r,o,a,i="style."+t,s="end."+i;return function(){var l=zn(this,e),c=l.on,u=null==l.value[i]?a||(a=rr(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,a=n+"";return function(){var i=Ce(this,e);return i===a?null:i===r?o:o=t(r=i,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function a(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}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}}(Wn(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 r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(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 r,o=Ln(this.node(),n).tween,a=0,i=o.length;a<i;++a)if((r=o[a]).name===e)return r.value;return null}return this.each((null==t?Fn:Hn)(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?er:tr)(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(){zn(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;zn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--o&&a()}};n.each(function(){var n=zn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&a()})},[Symbol.iterator]:sr[Symbol.iterator]};var lr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function cr(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 ar?(t=e._id,e=e._name):(t=ir(),(n=lr).time=Cn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)(i=s[c])&&$n(i,e,t,c,s,n||cr(i,t));return new ar(r,this._parents,e,t)};var ur=e=>()=>e;function dr(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:r,enumerable:!0,configurable:!0},_:{value:o}})}function fr(e,t,n){this.k=e,this.x=t,this.y=n}fr.prototype={constructor:fr,scale:function(e){return 1===e?this:new fr(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new fr(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 pr=new fr(1,0,0);function hr(e){e.stopImmediatePropagation()}function mr(e){e.preventDefault(),e.stopImmediatePropagation()}function gr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function yr(){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 vr(){return this.__zoom||pr}function br(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wr(){return navigator.maxTouchPoints||"ontouchstart"in this}function xr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=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(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}fr.prototype;const Sr=n(null),Er=Sr.Provider,_r=()=>"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.",Cr=e=>`Node type "${e}" not found. Using fallback type "default".`,kr=()=>"The React Flow parent container needs a width and a height to render the graph.",Nr=()=>"Only child nodes can use a parent extent.",Mr=()=>"Can't create edge. An edge needs a source and a target.",Pr=e=>`Marker type "${e}" doesn't exist.`,Or=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Ar=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Rr=e=>`Edge type "${e}" not found. Using fallback type "default".`,Tr=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.`,Dr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function $r(e,t){const n=c(Sr);if(null===n)throw new Error(Dr);return z(n,e,t)}const Ir=()=>{const e=c(Sr);if(null===e)throw new Error(Dr);return o(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},zr=e=>e.userSelectionActive?"none":"all";function Lr({position:e,children:n,className:r,style:o,...a}){const i=$r(zr),s=`${e}`.split("-");return t.createElement("div",{className:v(["react-flow__panel",r,...s]),style:{...o,pointerEvents:i},...a},n)}function Br({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(Lr,{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 Fr=r(({x:e,y:n,label:r,labelStyle:o={},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})}},[r]),void 0!==r&&r?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:o},r),f):null});const Hr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vr=(e={x:0,y:0},t)=>({x:Wr(e.x,t[0][0],t[1][0]),y:Wr(e.y,t[0][1],t[1][1])}),jr=(e,t,n)=>e<t?Wr(Math.abs(e-t),1,50)/50:e>n?-Wr(Math.abs(e-n),1,50)/50:0,Yr=(e,t)=>[20*jr(e.x,35,t.width-35),20*jr(e.y,35,t.height-35)],Xr=e=>e.getRootNode?.()||window?.document,Kr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ur=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),qr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Zr=e=>!isNaN(e)&&isFinite(e),Gr=Symbol.for("internals"),Qr=["Enter"," ","Escape"],Jr=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function eo(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 to=e=>"clientX"in e,no=(e,t)=>{const n=to(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},ro=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,oo=({id:e,path:n,labelX:r,labelY:o,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&&Zr(r)&&Zr(o)?t.createElement(Fr,{x:r,y:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function ao(e,t,n){return void 0===n?n:r=>{const o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function io({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,i=Math.abs(r-t)/2;return[a,r<t?r+i:r-i,o,i]}function so({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*o+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var lo,co,uo,fo,po,ho;function mo({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ho.Left||e===ho.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function go({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:a=ho.Top}){const[i,s]=mo({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=mo({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=so({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${r},${o}`,u,d,f,p]}oo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(lo||(lo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(co||(co={})),function(e){e.Partial="partial",e.Full="full"}(uo||(uo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(fo||(fo={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(po||(po={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(ho||(ho={}));const yo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:a=ho.Bottom,targetPosition:i=ho.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]=go({sourceX:e,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i});return t.createElement(oo,{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})});yo.displayName="SimpleBezierEdge";const vo={[ho.Left]:{x:-1,y:0},[ho.Right]:{x:1,y:0},[ho.Top]:{x:0,y:-1},[ho.Bottom]:{x:0,y:1}},bo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wo({source:e,sourcePosition:t=ho.Bottom,target:n,targetPosition:r=ho.Top,center:o,offset:a}){const i=vo[t],s=vo[r],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=ho.Bottom,target:n})=>t===ho.Left||t===ho.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]=io({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=o.x??v,h=o.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 o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:o:i.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=a){const r=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===i[d]&&(!t&&n||t&&r)||1!==i[d]&&(!t&&r||t&&n))&&(m="x"===d?o: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 xo({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:a=ho.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=wo({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(bo(e,t)/2,bo(t,n)/2,r),{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+o*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+o*(e.y<n.y?-1:1)}Q ${a},${i} ${a+o*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r},"");return[m,d,f,p,h]}const So=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=ho.Bottom,targetPosition:p=ho.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=xo({sourceX:e,sourceY:n,sourcePosition:f,targetX:r,targetY:o,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return t.createElement(oo,{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})});So.displayName="SmoothStepEdge";const Eo=r(e=>t.createElement(So,{...e,pathOptions:o(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Eo.displayName="StepEdge";const _o=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,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:r}){const[o,a,i,s]=io({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,s]}({sourceX:e,sourceY:n,targetX:r,targetY:o});return t.createElement(oo,{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 Co(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ko({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case ho.Left:return[t-Co(t-r,a),n];case ho.Right:return[t+Co(r-t,a),n];case ho.Top:return[t,n-Co(n-o,a)];case ho.Bottom:return[t,n+Co(o-n,a)]}}function No({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:a=ho.Top,curvature:i=.25}){const[s,l]=ko({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=ko({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,h]=so({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,h]}_o.displayName="StraightEdge";const Mo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:a=ho.Bottom,targetPosition:i=ho.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]=No({sourceX:e,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i,curvature:g?.curvature});return t.createElement(oo,{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})});Mo.displayName="BezierEdge";const Po=n(null),Oo=Po.Provider;Po.Consumer;const Ao=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ro=(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("&")}`},To=(e,t)=>{if(!e.source||!e.target)return Jr("006",Mr()),t;let n;var r;return n="id"in(r=e)&&"source"in r&&"target"in r?{...e}:{...e,id:Ao(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)},Do=({x:e,y:t},[n,r,o],a,[i,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},$o=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Io=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},zo=(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:r,y:o}=Io(n,t).positionAbsolute;return a=e,i=Kr({x:r,y:o,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:r})=>({x:e,y:t,width:n-e,height:r-t}))(n)},Lo=(e,t,[n,r,o]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(i&&!r||o)return!1;const{positionAbsolute:u}=Io(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=qr(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},Bo=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Fo=(e,t,n,r,o,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Wr(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Ho=(e,t=0)=>e.transition().duration(t);function Wo(e,t,n,r){return(t[n]||[]).reduce((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t),[])}const Vo={source:null,target:null,sourceHandle:null,targetHandle:null},jo=()=>({handleDomNode:null,isValid:!1,connection:Vo,endHandle:null});function Yo(e,t,n,r,o,a,i){const s="target"===o,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...jo(),handleDomNode:l};if(l){const e=Xo(void 0,l),o=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?o:n,sourceHandle:s?i:r,target:s?n:o,targetHandle:s?r:i};c.connection=f;u&&d&&(t===lo.Strict?s&&"source"===e||!s&&"target"===e:o!==n||i!==r)&&(c.endHandle={nodeId:o,handleId:i,type:e},c.isValid=a(f))}return c}function Xo(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ko(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Uo(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function qo({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Xr(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:S}=no(e),E=u?.elementFromPoint(x,S),_=Xo(l,E),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=no(e,C),M=!1,P=null,O=!1,A=null;const R=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[Gr]){const{handleBounds:a}=o[Gr];let i=[],s=[];a&&(i=Wo(o,a,"source",`${t}-${n}-${r}`),s=Wo(o,a,"target",`${t}-${n}-${r}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),T=()=>{if(!p)return;const[e,t]=Yr(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function D(e){const{transform:r}=a();N=no(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,a){const{x:i,y:s}=no(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=Xo(void 0,l),r=l.getAttribute("data-handleid"),i=a({nodeId:e,id:r,type:t});if(i){const a=o.find(n=>n.nodeId===e&&n.type===t&&n.id===r);return{handle:{id:r,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(o.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){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:jo()};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,Do(N,r,!1,[1,1]),h,R,e=>Yo(e,d,n,t,o?"target":"source",s,u));if(b=l,M||(T(),M=!0),A=c.handleDomNode,P=c.connection,O=c.isValid,i({connectionPosition:b&&O?$o({x:b.x,y:b.y},r):N,connectionStatus:Uo(!!b,O),connectionEndHandle:c.endHandle}),!b&&!O&&!A)return Ko(k);P.source!==P.target&&A&&(Ko(k),k=A,A.classList.add("connecting","react-flow__handle-connecting"),A.classList.toggle("valid",O),A.classList.toggle("react-flow__handle-valid",O))}function $(e){(b||A)&&P&&O&&r?.(P),a().onConnectEnd?.(e),l&&c?.(e),Ko(k),v(),cancelAnimationFrame(w),M=!1,O=!1,P=null,A=null,u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",$),u.removeEventListener("touchmove",D),u.removeEventListener("touchend",$)}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",D),u.addEventListener("mouseup",$),u.addEventListener("touchmove",D),u.addEventListener("touchend",$)}const Zo=()=>!0,Go=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Qo=a(({type:e="source",position:n=ho.Top,isValidConnection:r,isConnectable:o=!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=Ir(),w=c(Po),{connectOnClick:x,noPanClassName:S}=$r(Go,B),{connecting:E,clickConnecting:_}=$r(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:a,connectionClickStartHandle:i}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.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",Ar());const C=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=b.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=b.getState();t(To(o,e))}n?.(o),l?.(o)},k=e=>{if(!w)return;const t=to(e);a&&(t&&0===e.button||!t)&&qo({event:e,handleId:g,nodeId:w,onConnect:C,isTarget:y,getState:b.getState,setState:b.setState,isValidConnection:r||b.getState().isValidConnection||Zo}),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",S,d,{source:!y,target:y,connectable:o,connectablestart:a,connectableend:i,connecting:_,connectionindicator:o&&(a&&!E||i&&E)}]),onMouseDown:k,onTouchStart:k,onClick:x?t=>{const{onClickConnectStart:n,onClickConnectEnd:o,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=Xr(t.target),u=r||l||Zo,{connection:d,isValid:f}=Yo({nodeId:w,id:g,type:e},s,i.nodeId,i.handleId||null,i.type,u,c);f&&C(d),o?.(t),b.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Qo.displayName="Handle";var Jo=r(Qo);const ea=({data:e,isConnectable:n,targetPosition:r=ho.Top,sourcePosition:o=ho.Bottom})=>t.createElement(t.Fragment,null,t.createElement(Jo,{type:"target",position:r,isConnectable:n}),e?.label,t.createElement(Jo,{type:"source",position:o,isConnectable:n}));ea.displayName="DefaultNode";var ta=r(ea);const na=({data:e,isConnectable:n,sourcePosition:r=ho.Bottom})=>t.createElement(t.Fragment,null,e?.label,t.createElement(Jo,{type:"source",position:r,isConnectable:n}));na.displayName="InputNode";var ra=r(na);const oa=({data:e,isConnectable:n,targetPosition:r=ho.Top})=>t.createElement(t.Fragment,null,t.createElement(Jo,{type:"target",position:r,isConnectable:n}),e?.label);oa.displayName="OutputNode";var aa=r(oa);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=r(({onSelectionChange:e})=>{const t=Ir(),{selectedNodes:n,selectedEdges:r}=$r(sa,ca);return i(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(e=>e(o))},[n,r,e]),null});ua.displayName="SelectionListener";const da=e=>!!e.onSelectionChange;function fa({onSelectionChange:e}){const n=$r(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:r,onConnect:o,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:S,snapGrid:E,snapToGrid:_,translateExtent:C,connectOnClick:k,defaultEdgeOptions:N,fitView:M,fitViewOptions:P,onNodesDelete:O,onEdgesDelete:A,onNodeDrag:R,onNodeDragStart:T,onNodeDragStop:D,onSelectionDrag:$,onSelectionDragStart:I,onSelectionDragStop:z,noPanClassName:L,nodeOrigin:F,rfId:H,autoPanOnConnect:W,autoPanOnNodeDrag:V,onError:j,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=$r(pa,B),ne=Ir();return i(()=>{const e=r?.map(e=>({...e,...N}));return Z(n,e),()=>{te()}},[]),ma("defaultEdgeOptions",N,ne.setState),ma("connectionMode",S,ne.setState),ma("onConnect",o,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",E,ne.setState),ma("onNodesChange",b,ne.setState),ma("onEdgesChange",w,ne.setState),ma("connectOnClick",k,ne.setState),ma("fitViewOnInit",M,ne.setState),ma("fitViewOnInitOptions",P,ne.setState),ma("onNodesDelete",O,ne.setState),ma("onEdgesDelete",A,ne.setState),ma("onNodeDrag",R,ne.setState),ma("onNodeDragStart",T,ne.setState),ma("onNodeDragStop",D,ne.setState),ma("onSelectionDrag",$,ne.setState),ma("onSelectionDragStart",I,ne.setState),ma("onSelectionDragStop",z,ne.setState),ma("noPanClassName",L,ne.setState),ma("nodeOrigin",F,ne.setState),ma("rfId",H,ne.setState),ma("autoPanOnConnect",W,ne.setState),ma("autoPanOnNodeDrag",V,ne.setState),ma("onError",j,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(C,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 Sa({rfId:e}){const n=$r(xa);return t.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:va},n)}function Ea({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(Sa,{rfId:e}))}var _a=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=u(!1),a=l(!1),s=l(new Set([])),[c,d]=o(()=>{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,o=t?.target||n;if(null!==e){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!t.actInsideInputWithModifier)&&eo(e))return!1;const n=ka(e.code,d);s.current.add(e[n]),Ca(c,s.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&eo(e))return!1;const n=ka(e.code,d);Ca(c,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(e[n]),"Meta"===e.key&&s.current.clear(),a.current=!1},i=()=>{s.current.clear(),r(!1)};return o?.addEventListener("keydown",e),o?.addEventListener("keyup",n),window.addEventListener("blur",i),()=>{o?.removeEventListener("keydown",e),o?.removeEventListener("keyup",n),window.removeEventListener("blur",i)}}},[e,r]),n};function Ca(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ka(e,t){return t.includes(e)?"code":"key"}function Na(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const a=t.get(o),i=Io(a,r);return Na(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Gr]?.z??0)>(n.z??0)?a[Gr]?.z??0:n.z??0},r)}function Ma(e,t,n){e.forEach(r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:a,z:i}=Na(r,e,{...r.position,z:r[Gr]?.z??0},t);r.positionAbsolute={x:o,y:a},r[Gr].z=i,n?.[r.id]&&(r[Gr].isParent=!0)}})}function Pa(e,t,n,r){const o=new Map,a={},i=r?1e3:0;return e.forEach(e=>{const n=(Zr(e.zIndex)?e.zIndex:0)+(e.selected?i:0),r=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=r?.type&&r?.type!==e.type;Object.defineProperty(s,Gr,{enumerable:!1,value:{handleBounds:c?void 0:r?.[Gr]?.handleBounds,z:n}}),o.set(e.id,s)}),Ma(o,n,a),o}function Oa(e,t={}){const{getNodes:n,width:r,height:o,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=zo(e,d),{x:c,y:u,zoom:f}=Fo(n,r,o,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=pr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Ho(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,[Gr]:n[Gr],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 Ta({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:Aa(e,o)}),i?.(e)),t?.length&&(c&&r({edges:Ra(t,a)}),s?.(t))}const Da=()=>{},$a={zoomIn:Da,zoomOut:Da,zoomTo:Da,getZoom:()=>1,setViewport:Da,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Da,fitBounds:Da,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Ia=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function za(){const e=(()=>{const e=Ir(),{d3Zoom:t,d3Selection:n}=$r(Ia,B),r=o(()=>n&&t?{zoomIn:e=>t.scaleBy(Ho(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(Ho(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(Ho(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[a,i,s]=e.getState().transform,l=pr.translate(r.x??a,r.y??i).scale(r.zoom??s);t.transform(Ho(n,o?.duration),l)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>Oa(e.getState,t),setCenter:(r,o,a)=>{const{width:i,height:s,maxZoom:l}=e.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-r*c,d=s/2-o*c,f=pr.translate(u,d).scale(c);t.transform(Ho(n,a?.duration),f)},fitBounds:(r,o)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=e.getState(),{x:c,y:u,zoom:d}=Fo(r,a,i,s,l,o?.padding??.1),f=pr.translate(c,u).scale(d);t.transform(Ho(n,o?.duration),f)},project:t=>{const{transform:n,snapToGrid:r,snapGrid:o}=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"),Do(t,n,r,o)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:r,snapGrid:o,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 Do(l,n,r,o)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:a}=r.getBoundingClientRect(),i=$o(t,n);return{x:i.x+o,y:i.y+a}},viewportInitialized:!0}:$a,[t,n]);return r})(),t=Ir(),n=s(()=>t.getState().getNodes().map(e=>({...e})),[]),r=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:r,hasDefaultNodes:o,onNodesChange:a}=t.getState(),i=n(),s="function"==typeof e?e(i):e;if(o)r(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:r,hasDefaultEdges:o,onEdgesChange:a}=t.getState(),i="function"==typeof e?e(n):e;if(o)r(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:r,setNodes:o,hasDefaultNodes:a,onNodesChange:i}=t.getState();if(a){o([...r(),...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:r=[],setEdges:o,hasDefaultEdges:a,onEdgesChange:i}=t.getState();if(a)o([...r,...n]);else if(i){i(n.map(e=>({item:e,type:"add"})))}},[]),f=s(()=>{const{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,a,i]=r;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},[]),p=s(({nodes:e,edges:n})=>{const{nodeInternals:r,getNodes:o,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=o().reduce((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&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=Bo(h,m),n=[...g,...e],o=n.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&t.setState({edges:a.filter(e=>!o.includes(e.id))}),i&&(h.forEach(e=>{r.delete(e.id)}),t.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(n),d&&d(o.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=Zr((r=e).width)&&Zr(r.height)&&Zr(r.x)&&Zr(r.y);var r;const o=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!o)return[null,null,n];return[n?e:Ur(o),o,n]},[]),m=s((e,n=!0,r)=>{const[o,a,i]=h(e);return o?(r||t.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const t=Ur(e),r=qr(t,o);return n&&r>0||r>=o.width*o.height}):[]},[]),g=s((e,t,n=!0)=>{const[r]=h(e);if(!r)return!1;const o=qr(r,t);return n&&o>0||o>=r.width*r.height},[]);return o(()=>({...e,getNodes:n,getNode:r,getEdges:a,getEdge:i,setNodes:l,setEdges:c,addNodes:u,addEdges:d,toObject:f,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:g}),[e,n,r,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},Fa=e=>({x:e.x,y:e.y,zoom:e.k}),Ha=(e,t)=>e.target.closest(`.${t}`),Wa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Va=e=>{const t=e.ctrlKey&&ro()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},ja=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ya=({onMove:e,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:a=!0,zoomOnPinch:s=!0,panOnScroll:c=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=co.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:S,noPanClassName:E})=>{const _=l(),C=Ir(),k=l(!1),N=l(!1),M=l(null),P=l({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:A,d3ZoomHandler:R,userSelectionActive:T}=$r(ja,B),D=_a(b),$=l(0),I=l(!1),z=l();return function(e){const t=Ir();i(()=>{let n;const r=()=>{if(!e.current)return;const n=Hr(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",kr()),t.setState({width:n.width||500,height:n.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}(M),i(()=>{if(M.current){const e=M.current.getBoundingClientRect(),t=function(){var e,t,n,r=gr,o=yr,a=xr,i=br,s=wr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=gn,f=H("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",vr).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",k).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 fr(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new fr(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(r),s=o.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 fr(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=o.apply(e,t),this.taps=0}function S(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,i.apply(this,arguments)))),u=ot(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Bn(this),n.start()}mr(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=w(this,t,!0).event(e),s=rt(e.view).on("mousemove.zoom",function(e){if(mr(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]=ot(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ut(e.view,i.moved),mr(e),i.event(e).end()},!0),l=ot(e,o),u=e.clientX,d=e.clientY;ct(e.view),hr(e),i.mouse=[l,this.__zoom.invert(l)],Bn(this),i.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=ot(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),o.apply(this,t),c);mr(e),u>0?rt(this).transition().duration(u).call(b,d,i,e):rt(this).call(m.transform,d,i,e)}}function C(n,...o){if(r.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(hr(n),i=0;i<u;++i)l=[l=ot(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 k(e,...t){if(this.__zooming){var n,r,o,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(mr(e),n=0;n<u;++n)o=ot(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=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;r=g(r,Math.sqrt(m/v)),o=[(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;o=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(r,o,i),s.extent,c))}}function N(e,...r){if(this.__zooming){var o,a,i=w(this,r).event(e),s=e.changedTouches,l=s.length;for(hr(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)a=s[o],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=ot(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=rt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",vr),e!==o?b(e,t,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(r,l),i,s),e,c)},n,r)},m.translateBy=function(e,t,n,r){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),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,i){m.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,s=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return a(pr.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)},r,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=rt(this.that).datum();f.call(e,this.that,new dr(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:ur(+e),m):i},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:ur(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:ur(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:ur([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},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=rt(M.current).call(t),r=pr.translate(m.x,m.y).scale(Wr(m.zoom,y,v)),o=[[0,0],[e.width,e.height]],a=t.constrain()(r,o,g);t.transform(n,a),t.wheelDelta(Va),C.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&&O&&(!c||D||T?void 0!==R&&A.on("wheel.zoom",function(e,t){if(!w&&"wheel"===e.type&&!e.ctrlKey||Ha(e,S))return null;e.preventDefault(),R.call(this,e,t)},{passive:!1}):A.on("wheel.zoom",t=>{if(Ha(t,S))return!1;t.preventDefault(),t.stopImmediatePropagation();const o=A.property("__zoom").k||1;if(t.ctrlKey&&s){const e=ot(t),n=Va(t),r=o*Math.pow(2,n);return void O.scaleTo(A,r,e,t)}const a=1===t.deltaMode?20:1;let i=d===co.Vertical?0:t.deltaX*a,l=d===co.Horizontal?0:t.deltaY*a;!ro()&&t.shiftKey&&d!==co.Vertical&&(i=t.deltaY*a,l=0),O.translateBy(A,-i/o*u,-l/o*u,{internal:!0});const c=Fa(A.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=C.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(t,c),f?.(c)),I.current&&(e?.(t,c),p?.(c),z.current=setTimeout(()=>{r?.(t,c),h?.(c),I.current=!1},150))},{passive:!1}))},[T,c,d,A,O,R,D,s,w,S,n,e,r]),i(()=>{O&&O.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;$.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=C.getState(),r=Fa(e.transform);k.current=!0,P.current=r,"mousedown"===e.sourceEvent?.type&&C.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)})},[O,n]),i(()=>{O&&(T&&!k.current?O.on("zoom",null):T||O.on("zoom",t=>{const{onViewportChange:n}=C.getState();if(C.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),N.current=!(!o||!Wa(h,$.current??0)),(e||n)&&!t.sourceEvent?.internal){const r=Fa(t.transform);n?.(r),e?.(t.sourceEvent,r)}}))},[T,O,e,h,o]),i(()=>{O&&O.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=C.getState();if(k.current=!1,C.setState({paneDragging:!1}),o&&Wa(h,$.current??0)&&!N.current&&o(e.sourceEvent),N.current=!1,(r||t)&&(n=P.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Fa(e.transform);P.current=n,clearTimeout(_.current),_.current=setTimeout(()=>{t?.(n),r?.(e.sourceEvent,n)},c?150:0)}var n,a})},[O,c,h,r,o]),i(()=>{O&&O.filter(e=>{const t=D||a,n=s&&e.ctrlKey;if((!0===h||Array.isArray(h)&&h.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ha(e,"react-flow__node")||Ha(e,"react-flow__edge")))return!0;if(!(h||t||c||f||s))return!1;if(T)return!1;if(!f&&"dblclick"===e.type)return!1;if(Ha(e,S)&&"wheel"===e.type)return!1;if(Ha(e,E)&&("wheel"!==e.type||c&&"wheel"===e.type&&!D))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 r=Array.isArray(h)&&h.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[T,O,a,s,c,f,h,p,D]),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}=$r(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,r=e.find(e=>e.id===n);if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.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 r=e.filter(e=>e.id===n.id);if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&Ua(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&Ua(t,o);break;case"remove":return t}return t.push(o),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 r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(Ga(n.id,!0))):n.selected&&!r&&(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=r(({isSelecting:e,selectionMode:n=uo.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:a,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=l(null),m=Ir(),g=l(0),y=l(0),b=l(),{userSelectionActive:w,elementsSelectable:x,dragging:S}=$r(ei,B),E=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},_=e=>{i?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=c?e=>c(e):void 0,k=x&&(e||w);return t.createElement("div",{className:v(["react-flow__pane",{dragging:S,selection:e}]),onClick:k?void 0:Ja(_,h),onContextMenu:Ja(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():s?.(e)},h),onWheel:Ja(C,h),onMouseEnter:k?void 0:u,onMouseDown:k?t=>{const{resetSelectedElements:n,domNode:r}=m.getState();if(b.current=r?.getBoundingClientRect(),!x||!e||0!==t.button||t.target!==h.current||!b.current)return;const{x:a,y:i}=no(t,b.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),o?.(t)}:void 0,onMouseMove:k?t=>{const{userSelectionRect:r,nodeInternals:o,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!b.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=no(t,b.current),f=r.startX??0,p=r.startY??0,h={...r,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=Lo(o,h,i,n===uo.Partial,!0,c),x=Bo(w,a).map(e=>e.id),S=w.map(e=>e.id);if(g.current!==S.length){g.current=S.length;const e=Qa(v,S);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:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!w&&t&&e.target===h.current&&_?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:k?e=>{w&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}: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 r=t.get(n);return!!r&&(!!r.selected||ni(r,t))}function ri(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function oi(e,t,n,r){return Array.from(e.values()).filter(n=>(n.selected||n.id===r)&&(!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,r,o=[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||r);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:r,y:a}=Io(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+a],[e.extent[1][0]+r,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:a}=Io(t,o).positionAbsolute;s=t&&Zr(r)&&Zr(a)&&Zr(t.width)&&Zr(t.height)?[[r+e.width*o[0],a+e.height*o[1]],[r+t.width-e.width+e.width*o[0],a+t.height-e.height+e.height*o[1]]]:s}else a?.("005",Nr()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=Io(e,o).positionAbsolute}const u=s&&"parent"!==s?Vr(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 r=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?r.find(t=>t.id===e):r[0],r]}ti.displayName="Pane";const si=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const a=Array.from(o),i=t.getBoundingClientRect(),s=i.width*r[0],l=i.height*r[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,...Hr(e)}})};function li(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function ci({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,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(()=>r?.current?.blur())):o([e])):l?.("012",Tr(e))}function ui(e){return(t,n,r)=>e?.(t,r)}function di({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:a,selectNodesOnDrag:c}){const d=Ir(),[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),S=l(!1),E=function(){const e=Ir(),t=s(({sourceEvent:t})=>{const{transform:n,snapGrid:r,snapToGrid:o}=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:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}},[]);return t}();return i(()=>{if(e?.current){const i=rt(e.current),s=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,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=zo(h.current,u);y=Kr(e)}if(h.current=h.current.map(r=>{const o={x:e-r.distance.x,y:t-r.distance.y};c&&(o.x=l[0]*Math.round(o.x/l[0]),o.y=l[1]*Math.round(o.y/l[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];h.current.length>1&&s&&!r.extent&&(a[0][0]=r.positionAbsolute.x-y.x+s[0][0],a[1][0]=r.positionAbsolute.x+(r.width??0)-y.x2+s[1][0],a[0][1]=r.positionAbsolute.y-y.y+s[0][1],a[1][1]=r.positionAbsolute.y+(r.height??0)-y.y2+s[1][1]);const i=ai(r,o,n,a,u,f);return g=g||r.position.x!==i.position.x||r.position.y!==i.position.y,r.position=i.position,r.positionAbsolute=i.positionAbsolute,r}),!g)return;i(h.current,!0,!0),p(!0);const v=o?r:ui(a);if(v&&b.current){const[e,t]=ii({nodeId:o,dragItems:h.current,nodeInternals:n});v(b.current,e,t)}},l=()=>{if(!y.current)return;const[e,t]=Yr(v.current,y.current);if(0!==e||0!==t){const{transform:n,panBy:r}=d.getState();m.current.x=(m.current.x??0)-e/n[2],m.current.y=(m.current.y??0)-t/n[2],r({x:e,y:t})&&s(m.current)}g.current=requestAnimationFrame(l)},u=t=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:i,unselectNodesAndEdges:s,onNodeDragStart:l,onSelectionDragStart:u}=d.getState();x.current=!0;const f=o?l:ui(u);c&&a||r||!o||n.get(o)?.selected||s(),o&&a&&c&&ci({id:o,store:d,nodeRef:e});const p=E(t);if(m.current=p,h.current=oi(n,i,p,o),f&&h.current){const[e,r]=ii({nodeId:o,dragItems:h.current,nodeInternals:n});f(t.sourceEvent,e,r)}};if(!t){const t=function(){var e,t,n,r,o=pt,a=ht,i=mt,s=gt,l={},c=H("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(!r&&o.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(rt(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(r){if(lt(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}l.mouse("drag",r)}function m(e){rt(e.view).on("mousemove.drag mouseup.drag",null),ut(e.view,n),lt(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(r=b(this,s,e,t,i[n].identifier,i[n]))&&(st(e),r("start",e,i[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(lt(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,a=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<a;++t)(n=l[o[t].identifier])&&(st(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var s,d,p,h=c.copy(),m=ot(a||n,t);if(null!=(p=i.call(e,new ft("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))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[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=ot(c||i,t),g=u}h.call(a,e,new ft(a,{sourceEvent:i,subject:p,target:f,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:dt(!!e),f):o},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),S.current=!1;const r=E(e);m.current=r,y.current=t?.getBoundingClientRect()||null,v.current=no(e.sourceEvent,y.current)}).on("drag",e=>{const t=E(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=d.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(S.current=!0),!S.current){if(!w.current&&x.current&&n&&(w.current=!0,l()),!x.current){const n=t.xSnapped-(m?.current?.x??0),o=t.ySnapped-(m?.current?.y??0);Math.sqrt(n*n+o*o)>r&&u(e)}(m.current.x!==t.xSnapped||m.current.y!==t.ySnapped)&&h.current&&x.current&&(b.current=e.sourceEvent,v.current=no(e.sourceEvent,y.current),s(t))}}).on("end",e=>{if(x.current&&!S.current&&(p(!1),w.current=!1,x.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:a}=d.getState(),i=o?r:ui(a);if(t(h.current,!1,!1),i){const[t,r]=ii({nodeId:o,dragItems:h.current,nodeInternals:n});i(e.sourceEvent,t,r)}}}).filter(t=>{const o=t.target;return!t.button&&(!n||!ri(o,`.${n}`,e))&&(!r||ri(o,r,e))});return i.call(t),()=>{i.on(".drag",null)}}i.on(".drag",null)}},[e,t,n,r,a,d,o,c,E]),f}function fi(){const e=Ir(),t=s(t=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,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:o,position:a}=ai(e,t,n,r,void 0,l);e.position=a,e.positionAbsolute=o}return e});o(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:r,data:o,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:S,isConnectable:E,isFocusable:_,selectNodesOnDrag:C,sourcePosition:k,targetPosition:N,hidden:M,resizeObserver:P,dragHandle:O,zIndex:A,isParent:R,noDragClassName:T,noPanClassName:D,initialized:$,disableKeyboardA11y:I,ariaLabel:z,rfId:L,hasHandleBounds:B})=>{const F=Ir(),H=l(null),W=l(null),V=l(k),j=l(N),Y=l(r),X=S||x||f||p||h||m,K=fi(),U=li(n,F.getState,p),q=li(n,F.getState,h),Z=li(n,F.getState,m),G=li(n,F.getState,g),Q=li(n,F.getState,y);i(()=>()=>{W.current&&(P?.unobserve(W.current),W.current=null)},[]),i(()=>{if(H.current&&!M){const e=H.current;$&&B&&W.current===e||(W.current&&P?.unobserve(W.current),P?.observe(e),W.current=e)}},[M,$,B]),i(()=>{const e=Y.current!==r,t=V.current!==k,o=j.current!==N;H.current&&(e||t||o)&&(e&&(Y.current=r),t&&(V.current=k),o&&(j.current=N),F.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,k,N]);const J=di({nodeRef:H,disabled:M||!x,noDragClassName:T,handleSelector:O,nodeId:n,isSelectable:S,selectNodesOnDrag:C});return M?null:t.createElement("div",{className:v(["react-flow__node",`react-flow__node-${r}`,{[D]:x},w,{selected:d,selectable:S,parent:R,dragging:J}]),ref:H,style:{zIndex:A,transform:`translate(${c}px,${u}px)`,pointerEvents:X?"all":"none",visibility:$?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:U,onMouseMove:q,onMouseLeave:Z,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:t}=F.getState();if(S&&(!C||!x||t>0)&&ci({id:n,store:F,nodeRef:H}),f){const t=F.getState().nodeInternals.get(n);t&&f(e,{...t})}},onDoubleClick:Q,onKeyDown:_?e=>{if(!eo(e)&&!I)if(Qr.includes(e.key)&&S){const t="Escape"===e.key;ci({id:n,store:F,unselect:t,nodeRef:H})}else x&&d&&Object.prototype.hasOwnProperty.call(pi,e.key)&&(F.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":I?void 0:`${ba}-${L}`,"aria-label":z},t.createElement(Oo,{value:n},t.createElement(e,{id:n,data:o,type:r,xPos:a,yPos:s,selected:d,isConnectable:E,sourcePosition:k,targetPosition:N,dragging:J,dragHandle:O,zIndex:A})))};return n.displayName="NodeWrapper",r(n)};const mi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...zo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var gi=r(function({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const o=Ir(),{width:a,height:s,x:c,y:u,transformString:d,userSelectionActive:f}=$r(mi,B),p=fi(),h=l(null);if(i(()=>{r||h.current?.focus({preventScroll:!0})},[r]),di({nodeRef:h}),f||!a||!s)return null;const m=e?t=>{const n=o.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:r?void 0:-1,onKeyDown:r?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:r,onPaneMouseMove:o,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:S,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:M,defaultViewport:P,translateExtent:O,minZoom:A,maxZoom:R,preventScrolling:T,onSelectionContextMenu:D,noWheelClassName:$,noPanClassName:I,disableKeyboardA11y:z})=>{const L=$r(yi),B=_a(p),F=_a(b),H=F||M,W=F||_,V=B||h&&!0!==H;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ir(),{deleteElements:r}=za(),o=_a(e,La),a=_a(t);i(()=>{if(o){const{edges:e,getNodes:t}=n.getState(),o=t().filter(e=>e.selected),a=e.filter(e=>e.selected);r({nodes:o,edges:a}),n.setState({nodesSelectionActive:!1})}},[o]),i(()=>{n.setState({multiSelectionActive:a})},[a])})({deleteKeyCode:c,multiSelectionKeyCode:v}),t.createElement(Ya,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:S,zoomOnPinch:E,panOnScroll:W,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:!B&&H,defaultViewport:P,translateExtent:O,minZoom:A,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:T,noWheelClassName:$,noPanClassName:I},t.createElement(ti,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:H,isSelecting:!!V,selectionMode:m},e,L&&t.createElement(gi,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:z})))};vi.displayName="FlowRenderer";var bi=r(vi);function wi(e){return{...{input:hi(e.input||ra),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}),Si=e=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:a,elementsSelectable:c,updateNodeDimensions:u,onError:d}=$r(xi,B),f=(p=e.onlyRenderVisibleElements,$r(s(e=>p?Lo(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[p])));var p;const h=l(),m=o(()=>{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(o=>{let i=o.type||"default";e.nodeTypes[i]||(d?.("003",Cr(i)),i="default");const s=e.nodeTypes[i]||e.nodeTypes.default,l=!!(o.draggable||n&&void 0===o.draggable),u=!!(o.selectable||c&&void 0===o.selectable),f=!!(o.connectable||r&&void 0===o.connectable),p=!!(o.focusable||a&&void 0===o.focusable),h=e.nodeExtent?Vr(o.positionAbsolute,e.nodeExtent):o.positionAbsolute,g=h?.x??0,y=h?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:o.width??0,height:o.height??0,origin:e.nodeOrigin});return t.createElement(s,{key:o.id,id:o.id,className:o.className,style:o.style,type:i,data:o.data,sourcePosition:o.sourcePosition||ho.Bottom,targetPosition:o.targetPosition||ho.Top,hidden:o.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:!!o.selected,isDraggable:l,isSelectable:u,isConnectable:f,isFocusable:p,resizeObserver:m,dragHandle:o.dragHandle,zIndex:o[Gr]?.z??0,isParent:!!o[Gr]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!o.width&&!!o.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:o.ariaLabel,hasHandleBounds:!!o[Gr]?.handleBounds})}))};Si.displayName="NodeRenderer";var Ei=r(Si);const _i=(e,t,n)=>n===ho.Left?e-t:n===ho.Right?e+t:e,Ci=(e,t,n)=>n===ho.Top?e-t:n===ho.Bottom?e+t:e,ki="react-flow__edgeupdater",Ni=({position:e,centerX:n,centerY:r,radius:o=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:l})=>t.createElement("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:v([ki,`${ki}-${l}`]),cx:_i(n,o,e),cy:Ci(r,o,e),r:o,stroke:"transparent",fill:"transparent"}),Mi=()=>!0;var Pi=e=>{const n=({id:n,className:r,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:S,sourceX:E,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,elementsSelectable:P,hidden:O,sourceHandleId:A,targetHandleId:R,onContextMenu:T,onMouseEnter:D,onMouseMove:$,onMouseLeave:I,reconnectRadius:z,onReconnect:L,onReconnectStart:B,onReconnectEnd:F,markerEnd:H,markerStart:W,rfId:V,ariaLabel:j,isFocusable:Y,isReconnectable:X,pathOptions:K,interactionWidth:U,disableKeyboardA11y:q})=>{const Z=l(null),[G,Q]=u(!1),[J,ee]=u(!1),te=Ir(),ne=o(()=>`url('#${Ro(W,V)}')`,[W,V]),re=o(()=>`url('#${Ro(H,V)}')`,[H,V]);if(O)return null;const oe=ao(n,te.getState,c),ae=ao(n,te.getState,T),ie=ao(n,te.getState,D),se=ao(n,te.getState,$),le=ao(n,te.getState,I),ce=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=te.getState(),a=t?S:x,i=(t?R:A)||null,s=t?"target":"source",l=o||Mi,c=t,u=r.find(e=>e.id===n);ee(!0),B?.(e,u,s);qo({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),F?.(e,u,s)}})},ue=()=>Q(!0),de=()=>Q(!1),fe=!P&&!s;return t.createElement("g",{className:v(["react-flow__edge",`react-flow__edge-${a}`,r,{selected:d,animated:f,inactive:fe,updating:G}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=te.getState(),i=t.find(e=>e.id===n);i&&(P&&(te.setState({nodesSelectionActive:!1}),i.selected&&a?(o({nodes:[],edges:[i]}),Z.current?.blur()):r([n])),s&&s(e,i))},onDoubleClick:oe,onContextMenu:ae,onMouseEnter:ie,onMouseMove:se,onMouseLeave:le,onKeyDown:Y?e=>{if(!q&&Qr.includes(e.key)&&P){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=te.getState();"Escape"===e.key?(Z.current?.blur(),t({edges:[o.find(e=>e.id===n)]})):r([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===j?void 0:j||`Edge from ${x} to ${S}`,"aria-describedby":Y?`${wa}-${V}`:void 0,ref:Z},!J&&t.createElement(e,{id:n,source:x,target:S,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,data:i,style:w,sourceX:E,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,sourceHandleId:A,targetHandleId:R,markerStart:ne,markerEnd:re,pathOptions:K,interactionWidth:U}),X&&t.createElement(t.Fragment,null,("source"===X||!0===X)&&t.createElement(Ni,{position:N,centerX:E,centerY:_,radius:z,onMouseDown:e=>ce(e,!0),onMouseEnter:ue,onMouseOut:de,type:"source"}),("target"===X||!0===X)&&t.createElement(Ni,{position:M,centerX:C,centerY:k,radius:z,onMouseDown:e=>ce(e,!1),onMouseEnter:ue,onMouseOut:de,type:"target"})))};return n.displayName="EdgeWrapper",r(n)};function Oi(e){return{...{default:Pi(e.default||Mo),straight:Pi(e.bezier||_o),step:Pi(e.step||Eo),smoothstep:Pi(e.step||So),simplebezier:Pi(e.simplebezier||yo)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=Pi(e[n]||Mo),t),{})}}function Ai(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case ho.Top:return{x:r+a/2,y:o};case ho.Right:return{x:r+a,y:o+i/2};case ho.Bottom:return{x:r+a/2,y:o+i};case ho.Left:return{x:r,y:o+i/2}}}function Ri(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function Ti(e){const t=e?.[Gr]?.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 Di=[{level:0,isMaxLevel:!0,edges:[]}];function $i(e,t,n){return function(e,t,n=!1){let r=-1;const o=e.reduce((e,o)=>{const a=Zr(o.zIndex);let i=a?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[Gr]?.z||0,e?.[Gr]?.z||0,1e3);i=(a?o.zIndex:0)+(r?s:0)}return e[i]?e[i].push(o):e[i]=[o],r=i>r?i:r,e},{}),a=Object.entries(o).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}});return 0===a.length?Di:a}($r(s(n=>e?n.edges.filter(e=>{const r=t.get(e.source),o=t.get(e.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,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+o),y2:Math.max(e.y+r,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Kr({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:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:n.width,height:n.height,transform:n.transform})}):n.edges,[e,t])),t,n)}const Ii={[po.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"}),[po.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 zi=({id:e,type:n,color:r,width:a=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=Ir();return o(()=>Object.prototype.hasOwnProperty.call(Ii,e)?Ii[e]:(t.getState().onError?.("009",Pr(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:r,strokeWidth:l})):null},Li=({defaultColor:e,rfId:n})=>{const r=$r(s((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((n,o)=>([o.markerStart,o.markerEnd].forEach(o=>{if(o&&"object"==typeof o){const a=Ro(o,t);r.includes(a)||(n.push({id:a,color:o.color||e,...o}),r.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,r.map(e=>t.createElement(zi,{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=r(Li);const Fi=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}),Hi=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,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:S,width:E,height:_,connectionMode:C,nodeInternals:k,onError:N}=$r(Fi,B),M=$i(n,k,r);return E?t.createElement(t.Fragment,null,M.map(({level:n,edges:r,isMaxLevel:y})=>t.createElement("svg",{key:n,style:{zIndex:n},width:E,height:_,className:"react-flow__edges react-flow__container"},y&&t.createElement(Bi,{defaultColor:e,rfId:o}),t.createElement("g",null,r.map(e=>{const[n,r,y]=Ti(k.get(e.source)),[E,_,M]=Ti(k.get(e.target));if(!y||!M)return null;let P=e.type||"default";a[P]||(N?.("011",Rr(P)),P="default");const O=a[P]||a.default,A=C===lo.Strict?_.target:(_.target??[]).concat(_.source??[]),R=Ri(r.source,e.sourceHandle),T=Ri(A,e.targetHandle),D=R?.position||ho.Bottom,$=T?.position||ho.Top,I=!!(e.focusable||w&&void 0===e.focusable),z=e.reconnectable||e.updatable,L=void 0!==p&&(z||x&&void 0===z);if(!R||!T)return N?.("008",Or(R,e)),null;const{sourceX:B,sourceY:F,targetX:H,targetY:W}=((e,t,n,r,o,a)=>{const i=Ai(n,e,t),s=Ai(a,r,o);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,R,D,E,T,$);return t.createElement(O,{key:e.id,id:e.id,className:v([e.className,i]),type:P,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:F,targetX:H,targetY:W,sourcePosition:D,targetPosition:$,elementsSelectable:S,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:o,ariaLabel:e.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:b})})))),y):null};Hi.displayName="EdgeRenderer";var Wi=r(Hi);const Vi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ji({children:e}){const n=$r(Vi);return t.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}const Yi={[ho.Left]:ho.Right,[ho.Right]:ho.Left,[ho.Top]:ho.Bottom,[ho.Bottom]:ho.Top},Xi=({nodeId:e,handleType:n,style:r,type:o=fo.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:l,handleId:c,toX:u,toY:d,connectionMode:f}=$r(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?.[Gr]?.handleBounds;let h=p?.[n];if(f===lo.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:o,connectionLineStyle:r,fromNode:l,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:i});let S="";const E={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return o===fo.Bezier?[S]=No(E):o===fo.Step?[S]=xo({...E,borderRadius:0}):o===fo.SmoothStep?[S]=xo(E):o===fo.SimpleBezier?[S]=go(E):S=`M${v},${b} ${u},${d}`,t.createElement("path",{d:S,fill:"none",className:"react-flow__connection-path",style:r})};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:r,component:o}){const{nodeId:a,handleType:i,nodesConnectable:s,width:l,height:c,connectionStatus:u}=$r(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:r,CustomComponent:o,connectionStatus:u}))):null}function qi(e,t){const n=l(null),r=Ir();return o(()=>{if("development"===process.env.NODE_ENV){const t=Object.keys(e);B(n.current,t)&&r.getState().onError?.("002",_r()),n.current=t}return t(e)},[e])}const Zi=({nodeTypes:e,edgeTypes:n,onMove:r,onMoveStart:o,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:S,connectionLineContainerStyle:E,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:P,deleteKeyCode:O,onlyRenderVisibleElements:A,elementsSelectable:R,selectNodesOnDrag:T,defaultViewport:D,translateExtent:$,minZoom:I,maxZoom:z,preventScrolling:L,defaultMarkerColor:B,zoomOnScroll:F,zoomOnPinch:H,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:j,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:re,onReconnectStart:oe,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,Oi);return function(e){const t=za(),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:O,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:P,elementsSelectable:R,onMove:r,onMoveStart:o,onMoveEnd:a,zoomOnScroll:F,zoomOnPinch:H,zoomOnDoubleClick:Y,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:j,panOnDrag:X,defaultViewport:D,translateExtent:$,minZoom:I,maxZoom:z,onSelectionContextMenu:y,preventScrolling:L,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,disableKeyboardA11y:de},t.createElement(ji,null,t.createElement(Wi,{edgeTypes:ge,onEdgeClick:u,onEdgeDoubleClick:f,onlyRenderVisibleElements:A,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:re,onReconnectStart:oe,onReconnectEnd:ae,reconnectRadius:ie,defaultMarkerColor:B,noPanClassName:ce,elevateEdgesOnSelect:!!ue,disableKeyboardA11y:de,rfId:he},t.createElement(Ui,{style:x,type:w,component:S,containerStyle:E})),t.createElement("div",{className:"react-flow__edgelabel-renderer"}),t.createElement(Ei,{nodeTypes:me,onNodeClick:c,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,selectNodesOnDrag:T,onlyRenderVisibleElements:A,noPanClassName:ce,noDragClassName:se,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})))};Zi.displayName="GraphView";var Gi=r(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:lo.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:Jr,isValidConnection:void 0},es=()=>{return e=(e,t)=>({...Ji,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:a}=t();e({nodeInternals:Pa(n,r,o,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(e=>({...r,...e}))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,a=void 0!==r,i=o?Pa(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?r:[],hasDefaultNodes:o,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,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=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[Gr]:{...n[Gr],handleBounds:void 0}});else if(n){const r=Hr(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[Gr]:{...n[Gr],handleBounds:{source:si(".source",t.nodeElement,f,c),target:si(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);Ma(o,c);const h=i||a&&!i&&Oa(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),a=e.map(e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=Pa(Za(n,s()),o,i,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:a}=t();let i,s=null;r?i=n.map(e=>Ga(e,!0)):(i=Qa(a(),n),s=Qa(o,[])),Ta({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:a}=t();let i,s=null;r?i=n.map(e=>Ga(e,!0)):(i=Qa(o,n),s=Qa(a(),[])),Ta({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:a}=t(),i=r||o;Ta({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:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Ta({changedNodes:r().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:r}=t();r.forEach(e=>{e.positionAbsolute=Vr(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=pr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],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(Er,{value:n.current},e)};ts.displayName="ReactFlowProvider";const ns=({children:e})=>c(Sr)?t.createElement(t.Fragment,null,e):t.createElement(ts,null,e);ns.displayName="ReactFlowWrapper";const rs={input:ra,default:ta,output:aa,group:ia},os={default:Mo,straight:_o,step:Eo,smoothstep:So,simplebezier:yo},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:r,defaultEdges:o,className:a,nodeTypes:i=rs,edgeTypes:s=os,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:S,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:P,onSelectionChange:O,onSelectionDragStart:A,onSelectionDrag:R,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,connectionMode:z=lo.Strict,connectionLineType:L=fo.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,deleteKeyCode:W="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:j=!1,selectionMode:Y=uo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(ro()?"Meta":"Control"),zoomActivationKeyCode:U=(ro()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=is,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=as,edgesFocusable:re,edgesUpdatable:oe,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=co.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Se,onPaneMouseLeave:Ee,onPaneScroll:_e,onPaneContextMenu:Ce,children:ke,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Pe,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ae,onEdgeUpdate:Re,onEdgeUpdateStart:Te,onEdgeUpdateEnd:De,onReconnect:$e,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:He,noDragClassName:We="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:je="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:rt,onError:ot,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:S,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:j,selectionMode:Y,deleteKeyCode:W,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:Se,onPaneMouseLeave:Ee,onPaneScroll:_e,onPaneContextMenu:Ce,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Pe,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ae,onReconnect:$e??Re,onReconnectStart:Ie??Te,onReconnectEnd:ze??De,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:We,noWheelClassName:Ve,noPanClassName:je,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),t.createElement(ga,{nodes:e,edges:n,defaultNodes:r,defaultEdges:o,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Fe,onEdgesChange:He,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:P,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:R,onSelectionDragStart:A,onSelectionDragStop:T,noPanClassName:je,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),t.createElement(fa,{onSelectionChange:O}),ke,t.createElement(Br,{proOptions:qe,position:Ue}),t.createElement(Ea,{rfId:ut,disableKeyboardA11y:Je})))});function us(e){return t=>{const[n,r]=u(t),o=s(t=>r(n=>e(t,n)),[]);return[n,r,o]}}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:r}){return t.createElement("path",{stroke:e,strokeWidth:r,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:r=20,size:o,lineWidth:a=1,offset:i=2,color:s,style:c,className:u}){const d=l(null),{transform:f,patternId:p}=$r(vs,B),h=s||gs[n],m=o||ys[n],g=n===ps.Dots,y=n===ps.Cross,b=Array.isArray(r)?r:[r,r],w=[b[0]*f[2]||1,b[1]*f[2]||1],x=m*f[2],S=y?[x,x]:w,E=g?[x/i,x/i]:[S[0]/i,S[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(-${E[0]},-${E[1]})`},g?t.createElement(ms,{color:h,radius:x/i}):t.createElement(hs,{dimensions:S,color:h,lineWidth:a})),t.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}bs.displayName="Background";var ws=r(bs);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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:-webkit-grab;cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;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;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation: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;-webkit-animation:dashdraw .5s linear infinite;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:-webkit-grab;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:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:-webkit-grab;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}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@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%}");
|
|
1
|
+
import*as e from"react";import t,{createContext as n,memo as r,useMemo as o,forwardRef as i,useEffect as a,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,{createPortal as m}from"react-dom";import g from"react-countup";import{jsx as y,jsxs as v,Fragment as b}from"react/jsx-runtime";function w(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=w(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E,S={exports:{}},_={},C={exports:{}},k={};var N,M,A,O={};function P(){return M||(M=1,"production"===process.env.NODE_ENV?C.exports=function(){if(E)return k;E=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},r=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}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=r({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return i(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),o(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),a(n),n};return k.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,k}():C.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!r(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,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,i=n.useEffect,a=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();r(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=o({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return a(function(){p.value=d,p.getSnapshot=u,e(p)&&h({inst:p})},[t,d,u]),i(function(){return e(p)&&h({inst:p}),t(function(){e(p)&&h({inst:p})})},[t]),s(d),d};O.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())}()),O)),C.exports}var R,T={};"production"===process.env.NODE_ENV?S.exports=function(){if(A)return _;A=1;var e=t,n=P(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return _.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(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(!a){if(a=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!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=o(e,d[0],d[1]);return a(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},_}():S.exports=(R||(R=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=P(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;T.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(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(!a){if(a=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!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=o(e,d[0],d[1]);return a(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())}()),T);var $=x(S.exports);const D=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,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()}},a=t=e(r,o,i);return i},{useDebugValue:I}=t,{useSyncExternalStoreWithSelector:z}=$,L=e=>e;function B(e,t=L,n){const r=z(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return I(r),r}const F=(e,t)=>{const n=(e=>e?D(e):D)(e),r=(e,r=t)=>B(n,e,r);return Object.assign(r,n),r};function H(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,r]of e)if(!Object.is(r,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 r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var W={value:()=>{}};function V(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new j(r)}function j(e){this._=e}function Y(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function X(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=W,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}j.prototype=V.prototype={constructor:j,on:function(e,t){var n,r,o=this._,i=(r=o,(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&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=i[a]).type)o[n]=X(o[n],e.name,t);else if(null==t)for(n in o)o[n]=X(o[n],e.name,null);return this}for(;++a<s;)if((n=(e=i[a]).type)&&(n=Y(o[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,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var K="http://www.w3.org/1999/xhtml",U={svg:"http://www.w3.org/2000/svg",xhtml:K,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function q(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),U.hasOwnProperty(t)?{space:U[t],local:e}:e}function Z(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===K&&t.documentElement.namespaceURI===K?t.createElement(e):t.createElementNS(n,e)}}function G(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Q(e){var t=q(e);return(t.local?G:Z)(t)}function J(){}function ee(e){return null==e?J:function(){return this.querySelector(e)}}function te(){return[]}function ne(e){return null==e?te:function(){return this.querySelectorAll(e)}}function re(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function oe(e){return function(){return this.matches(e)}}function ie(e){return function(t){return t.matches(e)}}var ae=Array.prototype.find;function se(){return this.firstElementChild}var le=Array.prototype.filter;function ce(){return Array.from(this.children)}function ue(e){return new Array(e.length)}function de(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function fe(e,t,n,r,o,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new de(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function pe(e,t,n,r,o,i,a){var s,l,c,u=new Map,d=t.length,f=i.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(r[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new de(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function he(e){return e.__data__}function me(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ge(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ye(e){return function(){this.removeAttribute(e)}}function ve(e){return function(){this.removeAttributeNS(e.space,e.local)}}function be(e,t){return function(){this.setAttribute(e,t)}}function we(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xe(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Ee(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 Se(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _e(e){return function(){this.style.removeProperty(e)}}function Ce(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ke(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ne(e,t){return e.style.getPropertyValue(t)||Se(e).getComputedStyle(e,null).getPropertyValue(t)}function Me(e){return function(){delete this[e]}}function Ae(e,t){return function(){this[e]=t}}function Oe(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Pe(e){return e.trim().split(/^|\s+/)}function Re(e){return e.classList||new Te(e)}function Te(e){this._node=e,this._names=Pe(e.getAttribute("class")||"")}function $e(e,t){for(var n=Re(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function De(e,t){for(var n=Re(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Ie(e){return function(){$e(this,e)}}function ze(e){return function(){De(this,e)}}function Le(e,t){return function(){(t.apply(this,arguments)?$e:De)(this,e)}}function Be(){this.textContent=""}function Fe(e){return function(){this.textContent=e}}function He(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function We(){this.innerHTML=""}function Ve(e){return function(){this.innerHTML=e}}function je(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ye(){this.nextSibling&&this.parentNode.appendChild(this)}function Xe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ke(){return null}function Ue(){var e=this.parentNode;e&&e.removeChild(this)}function qe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ze(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ge(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Qe(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Je(e,t,n){var r=Se(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function et(e,t){return function(){return Je(this,e,t)}}function tt(e,t){return function(){return Je(this,e,t.apply(this,arguments))}}de.prototype={constructor:de,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)}},Te.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 nt=[null];function rt(e,t){this._groups=e,this._parents=t}function ot(){return new rt([[document.documentElement]],nt)}function it(e){return"string"==typeof e?new rt([[document.querySelector(e)]],[document.documentElement]):new rt([[e]],nt)}function at(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 r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}rt.prototype=ot.prototype={constructor:rt,select:function(e){"function"!=typeof e&&(e=ee(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new rt(r,this._parents)},selectAll:function(e){e="function"==typeof e?re(e):ne(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(e.call(a,a.__data__,c,s)),o.push(a));return new rt(r,o)},selectChild:function(e){return this.select(null==e?se:function(e){return function(){return ae.call(this.children,e)}}("function"==typeof e?e:ie(e)))},selectChildren:function(e){return this.selectAll(null==e?ce:function(e){return function(){return le.call(this.children,e)}}("function"==typeof e?e:ie(e)))},filter:function(e){"function"!=typeof e&&(e=oe(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new rt(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,he);var n,r=t?pe:fe,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],f=i[u],p=f.length,h=me(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(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 rt(s,o))._enter=l,s._exit=c,s},enter:function(){return new rt(this._enter||this._groups.map(ue),this._parents)},exit:function(){return new rt(this._exit||this._groups.map(ue),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var c,u=n[l],d=r[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<o;++l)s[l]=n[l];return new rt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=ge);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],l=s.length,c=o[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new rt(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=q(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?ve:ye:"function"==typeof t?n.local?Ee:xe:n.local?we:be)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?_e:"function"==typeof t?ke:Ce)(e,t,null==n?"":n)):Ne(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Me:"function"==typeof t?Oe:Ae)(e,t)):this.node()[e]},classed:function(e,t){var n=Pe(e+"");if(arguments.length<2){for(var r=Re(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Le:t?Ie:ze)(n,t))},text:function(e){return arguments.length?this.each(null==e?Be:("function"==typeof e?He:Fe)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?We:("function"==typeof e?je:Ve)(e)):this.node().innerHTML},raise:function(){return this.each(Ye)},lower:function(){return this.each(Xe)},append:function(e){var t="function"==typeof e?e:Q(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Q(e),r=null==t?Ke:"function"==typeof t?t:ee(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Ue)},clone:function(e){return this.select(e?Ze:qe)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=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+""),a=i.length;if(!(arguments.length<2)){for(s=t?Qe:Ge,r=0;r<a;++r)this.each(s(i[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?tt:et)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const st={passive:!1},lt={capture:!0,passive:!1};function ct(e){e.stopImmediatePropagation()}function ut(e){e.preventDefault(),e.stopImmediatePropagation()}function dt(e){var t=e.document.documentElement,n=it(e).on("dragstart.drag",ut,lt);"onselectstart"in t?n.on("selectstart.drag",ut,lt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ft(e,t){var n=e.document.documentElement,r=it(e).on("dragstart.drag",null);t&&(r.on("click.drag",ut,lt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var pt=e=>()=>e;function ht(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,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:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function mt(e){return!e.ctrlKey&&!e.button}function gt(){return this.parentNode}function yt(e,t){return null==t?{x:e.x,y:e.y}:t}function vt(){return navigator.maxTouchPoints||"ontouchstart"in this}function bt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xt(){}ht.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Et=.7,St=1/Et,_t="\\s*([+-]?\\d+)\\s*",Ct="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nt=/^#([0-9a-f]{3,8})$/,Mt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),At=new RegExp(`^rgb\\(${kt},${kt},${kt}\\)$`),Ot=new RegExp(`^rgba\\(${_t},${_t},${_t},${Ct}\\)$`),Pt=new RegExp(`^rgba\\(${kt},${kt},${kt},${Ct}\\)$`),Rt=new RegExp(`^hsl\\(${Ct},${kt},${kt}\\)$`),Tt=new RegExp(`^hsla\\(${Ct},${kt},${kt},${Ct}\\)$`),$t={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 It(){return this.rgb().formatRgb()}function zt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Nt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Lt(t):3===n?new Ht(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Bt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Bt(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=Mt.exec(e))?new Ht(t[1],t[2],t[3],1):(t=At.exec(e))?new Ht(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ot.exec(e))?Bt(t[1],t[2],t[3],t[4]):(t=Pt.exec(e))?Bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Rt.exec(e))?Kt(t[1],t[2]/100,t[3]/100,1):(t=Tt.exec(e))?Kt(t[1],t[2]/100,t[3]/100,t[4]):$t.hasOwnProperty(e)?Lt($t[e]):"transparent"===e?new Ht(NaN,NaN,NaN,0):null}function Lt(e){return new Ht(e>>16&255,e>>8&255,255&e,1)}function Bt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ht(e,t,n,r)}function Ft(e,t,n,r){return 1===arguments.length?((o=e)instanceof xt||(o=zt(o)),o?new Ht((o=o.rgb()).r,o.g,o.b,o.opacity):new Ht):new Ht(e,t,n,null==r?1:r);var o}function Ht(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Wt(){return`#${Xt(this.r)}${Xt(this.g)}${Xt(this.b)}`}function Vt(){const e=jt(this.opacity);return`${1===e?"rgb(":"rgba("}${Yt(this.r)}, ${Yt(this.g)}, ${Yt(this.b)}${1===e?")":`, ${e})`}`}function jt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xt(e){return((e=Yt(e))<16?"0":"")+e.toString(16)}function Kt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qt(e,t,n,r)}function Ut(e){if(e instanceof qt)return new qt(e.h,e.s,e.l,e.opacity);if(e instanceof xt||(e=zt(e)),!e)return new qt;if(e instanceof qt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(n-r)/s+6*(n<r):n===i?(r-t)/s+2:(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new qt(a,s,l,e.opacity)}function qt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Zt(e){return(e=(e||0)%360)<0?e+360:e}function Gt(e){return Math.max(0,Math.min(1,e||0))}function Qt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}bt(xt,zt,{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 Ut(this).formatHsl()},formatRgb:It,toString:It}),bt(Ht,Ft,wt(xt,{brighter(e){return e=null==e?St:Math.pow(St,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Et:Math.pow(Et,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ht(Yt(this.r),Yt(this.g),Yt(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:Wt,formatHex:Wt,formatHex8:function(){return`#${Xt(this.r)}${Xt(this.g)}${Xt(this.b)}${Xt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Vt,toString:Vt})),bt(qt,function(e,t,n,r){return 1===arguments.length?Ut(e):new qt(e,t,n,null==r?1:r)},wt(xt,{brighter(e){return e=null==e?St:Math.pow(St,e),new qt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Et:Math.pow(Et,e),new qt(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,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Ht(Qt(e>=240?e-240:e+120,o,r),Qt(e,o,r),Qt(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new qt(Zt(this.h),Gt(this.s),Gt(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("}${Zt(this.h)}, ${100*Gt(this.s)}%, ${100*Gt(this.l)}%${1===e?")":`, ${e})`}`}}));var Jt=e=>()=>e;function en(e){return 1===(e=+e)?tn: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Jt(isNaN(t)?n:t)}}function tn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Jt(isNaN(e)?t:e)}var nn=function e(t){var n=en(t);function r(e,t){var r=n((e=Ft(e)).r,(t=Ft(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=tn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function rn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var on=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,an=new RegExp(on.source,"g");function sn(e,t){var n,r,o,i=on.lastIndex=an.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=on.exec(e))&&(r=an.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:rn(n,r)})),i=an.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),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,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}var ln,cn=180/Math.PI,un={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dn(e,t,n,r,o,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*cn,skewX:Math.atan(l)*cn,scaleX:a,scaleY:s}}function fn(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,r,o,i,a,s){if(e!==o||r!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:rn(e,o)},{i:l-2,x:rn(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:rn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:rn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,s,l),function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:rn(e,n)},{i:s-2,x:rn(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var pn=fn(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?un:dn(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),hn=fn(function(e){return null==e?un:(ln||(ln=document.createElementNS("http://www.w3.org/2000/svg","g")),ln.setAttribute("transform",e),(e=ln.transform.baseVal.consolidate())?dn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):un)},", ",")",")");function mn(e){return((e=Math.exp(e))+1/e)/2}var gn,yn,vn=function e(t,n,r){function o(e,o){var i,a,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)a=Math.log(f/c)/t,i=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),v=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-b)/t,i=function(e){var r,o=e*a,i=mn(b),u=c/(n*g)*(i*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*i/mn(t*o+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),bn=0,wn=0,xn=0,En=0,Sn=0,_n=0,Cn="object"==typeof performance&&performance.now?performance:Date,kn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nn(){return Sn||(kn(Mn),Sn=Cn.now()+_n)}function Mn(){Sn=0}function An(){this._call=this._time=this._next=null}function On(e,t,n){var r=new An;return r.restart(e,t,n),r}function Pn(){Sn=(En=Cn.now())+_n,bn=wn=0;try{!function(){Nn(),++bn;for(var e,t=gn;t;)(e=Sn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--bn}()}finally{bn=0,function(){var e,t,n=gn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:gn=t);yn=e,Tn(r)}(),Sn=0}}function Rn(){var e=Cn.now(),t=e-En;t>1e3&&(_n-=t,En=e)}function Tn(e){bn||(wn&&(wn=clearTimeout(wn)),e-Sn>24?(e<1/0&&(wn=setTimeout(Pn,e-Cn.now()-_n)),xn&&(xn=clearInterval(xn))):(xn||(En=Cn.now(),xn=setInterval(Rn,1e3)),bn=1,kn(Pn)))}function $n(e,t,n){var r=new An;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}An.prototype=On.prototype={constructor:An,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||yn===this||(yn?yn._next=this:gn=this,yn=this),this._call=e,this._time=n,Tn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tn())}};var Dn=V("start","end","cancel","interrupt"),In=[];function zn(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return $n(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if($n(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=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))&&(r[++u]=f);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=On(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:Dn,tween:In,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Ln(e,t){var n=Fn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Bn(e,t){var n=Fn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Fn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Hn(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function Wn(e,t){var n,r;return function(){var o=Bn(this,e),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function Vn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Bn(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}i.tween=o}}function jn(e,t,n){var r=e._id;return e.each(function(){var e=Bn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Fn(e,r).value[t]}}function Yn(e,t){var n;return("number"==typeof t?rn:t instanceof zt?nn:(n=zt(t))?(t=n,nn):sn)(e,t)}function Xn(e){return function(){this.removeAttribute(e)}}function Kn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Un(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function qn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function Zn(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttribute(e)}}function Gn(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttributeNS(e.space,e.local)}}function Qn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Jn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function er(e,t){return function(){Ln(this,e).delay=+t.apply(this,arguments)}}function tr(e,t){return t=+t,function(){Ln(this,e).delay=t}}function nr(e,t){return function(){Bn(this,e).duration=+t.apply(this,arguments)}}function rr(e,t){return t=+t,function(){Bn(this,e).duration=t}}var or=ot.prototype.constructor;function ir(e){return function(){this.style.removeProperty(e)}}var ar=0;function sr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function lr(){return++ar}var cr=ot.prototype;sr.prototype={constructor:sr,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ee(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,l,c=r[a],u=c.length,d=i[a]=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,zn(d[f],t,n,f,d,Fn(s,n)));return new sr(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ne(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l,c=r[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=Fn(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&zn(f,t,n,m,p,h);i.push(p),a.push(l)}return new sr(i,a,t,n)},selectChild:cr.selectChild,selectChildren:cr.selectChildren,filter:function(e){"function"!=typeof e&&(e=oe(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new sr(r,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,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,f=a[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<r;++s)a[s]=t[s];return new sr(a,this._parents,this._name,this._id)},selection:function(){return new or(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=lr(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=Fn(a,t);zn(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new sr(r,this._parents,e,n)},call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:function(e,t){var n=this._id;return arguments.length<2?Fn(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=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)?Ln:Bn;return function(){var a=i(this,e),s=a.on;s!==r&&(o=(r=s).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=q(e),r="transform"===n?hn:Yn;return this.attrTween(e,"function"==typeof t?(n.local?Gn:Zn)(n,r,jn(this,"attr."+e,t)):null==t?(n.local?Kn:Xn)(n):(n.local?qn:Un)(n,r,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 r=q(e);return this.tween(n,(r.local?Qn:Jn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?pn:Yn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=Ne(this,e),a=(this.style.removeProperty(e),Ne(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,ir(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=Ne(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Ne(this,e)),a===l?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}(e,r,jn(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,s="end."+a;return function(){var l=Bn(this,e),c=l.on,u=null==l.value[a]?i||(i=ir(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=Ne(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(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 r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(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 r,o=Fn(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?Wn:Vn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?er:tr)(t,e)):Fn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?nr:rr)(t,e)):Fn(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(){Bn(this,e).ease=t}}(t,e)):Fn(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;Bn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var s={value:a},l={value:function(){0===--o&&i()}};n.each(function(){var n=Bn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&i()})},[Symbol.iterator]:cr[Symbol.iterator]};var ur={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function dr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}ot.prototype.interrupt=function(e){return this.each(function(){Hn(this,e)})},ot.prototype.transition=function(e){var t,n;e instanceof sr?(t=e._id,e=e._name):(t=lr(),(n=ur).time=Nn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)(a=s[c])&&zn(a,e,t,c,s,n||dr(a,t));return new sr(r,this._parents,e,t)};var fr=e=>()=>e;function pr(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:r,enumerable:!0,configurable:!0},_:{value:o}})}function hr(e,t,n){this.k=e,this.x=t,this.y=n}hr.prototype={constructor:hr,scale:function(e){return 1===e?this:new hr(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new hr(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 mr=new hr(1,0,0);function gr(e){e.stopImmediatePropagation()}function yr(e){e.preventDefault(),e.stopImmediatePropagation()}function vr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function br(){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 wr(){return this.__zoom||mr}function xr(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Er(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}hr.prototype;const _r=n(null),Cr=_r.Provider,kr=()=>"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.",Nr=e=>`Node type "${e}" not found. Using fallback type "default".`,Mr=()=>"The React Flow parent container needs a width and a height to render the graph.",Ar=()=>"Only child nodes can use a parent extent.",Or=()=>"Can't create edge. An edge needs a source and a target.",Pr=e=>`Marker type "${e}" doesn't exist.`,Rr=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Tr=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",$r=e=>`Edge type "${e}" not found. Using fallback type "default".`,Dr=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.`,Ir=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function zr(e,t){const n=c(_r);if(null===n)throw new Error(Ir);return B(n,e,t)}const Lr=()=>{const e=c(_r);if(null===e)throw new Error(Ir);return o(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Br=e=>e.userSelectionActive?"none":"all";function Fr({position:e,children:n,className:r,style:o,...i}){const a=zr(Br),s=`${e}`.split("-");return t.createElement("div",{className:w(["react-flow__panel",r,...s]),style:{...o,pointerEvents:a},...i},n)}function Hr({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(Fr,{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 Wr=r(({x:e,y:n,label:r,labelStyle:o={},labelShowBg:i=!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}),v=w(["react-flow__edge-textwrapper",p]);return a(()=>{if(m.current){const e=m.current.getBBox();y({x:e.x,y:e.y,width:e.width,height:e.height})}},[r]),void 0!==r&&r?t.createElement("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...h},i&&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:o},r),f):null});const Vr=e=>({width:e.offsetWidth,height:e.offsetHeight}),jr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Yr=(e={x:0,y:0},t)=>({x:jr(e.x,t[0][0],t[1][0]),y:jr(e.y,t[0][1],t[1][1])}),Xr=(e,t,n)=>e<t?jr(Math.abs(e-t),1,50)/50:e>n?-jr(Math.abs(e-n),1,50)/50:0,Kr=(e,t)=>[20*Xr(e.x,35,t.width-35),20*Xr(e.y,35,t.height-35)],Ur=e=>e.getRootNode?.()||window?.document,qr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Zr=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Gr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Qr=e=>!isNaN(e)&&isFinite(e),Jr=Symbol.for("internals"),eo=["Enter"," ","Escape"],to=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function no(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 ro=e=>"clientX"in e,oo=(e,t)=>{const n=ro(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},io=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,ao=({id:e,path:n,labelX:r,labelY:o,label:i,labelStyle:a,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"}),i&&Qr(r)&&Qr(o)?t.createElement(Wr,{x:r,y:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function so(e,t,n){return void 0===n?n:r=>{const o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function lo({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function co({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var uo,fo,po,ho,mo,go;function yo({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===go.Left||e===go.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function vo({sourceX:e,sourceY:t,sourcePosition:n=go.Bottom,targetX:r,targetY:o,targetPosition:i=go.Top}){const[a,s]=yo({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=yo({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=co({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${r},${o}`,u,d,f,p]}ao.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(uo||(uo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(fo||(fo={})),function(e){e.Partial="partial",e.Full="full"}(po||(po={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(ho||(ho={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(mo||(mo={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(go||(go={}));const bo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:i=go.Bottom,targetPosition:a=go.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]=vo({sourceX:e,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a});return t.createElement(ao,{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})});bo.displayName="SimpleBezierEdge";const wo={[go.Left]:{x:-1,y:0},[go.Right]:{x:1,y:0},[go.Top]:{x:0,y:-1},[go.Bottom]:{x:0,y:1}},xo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Eo({source:e,sourcePosition:t=go.Bottom,target:n,targetPosition:r=go.Top,center:o,offset:i}){const a=wo[t],s=wo[r],l={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+s.x*i,y:n.y+s.y*i},u=(({source:e,sourcePosition:t=go.Bottom,target:n})=>t===go.Left||t===go.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]=lo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){p=o.x??v,h=o.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=a[d]===f?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?a.x===f?u:o:a.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=i){const r=Math.min(i-1,i-t);a[d]===f?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=a[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===a[d]&&(!t&&n||t&&r)||1!==a[d]&&(!t&&r||t&&n))&&(m="x"===d?o: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 So({sourceX:e,sourceY:t,sourcePosition:n=go.Bottom,targetX:r,targetY:o,targetPosition:i=go.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=Eo({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(xo(e,t)/2,xo(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*s},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r},"");return[m,d,f,p,h]}const _o=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=go.Bottom,targetPosition:p=go.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=So({sourceX:e,sourceY:n,sourcePosition:f,targetX:r,targetY:o,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return t.createElement(ao,{path:v,labelX:b,labelY:w,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});_o.displayName="SmoothStepEdge";const Co=r(e=>t.createElement(_o,{...e,pathOptions:o(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Co.displayName="StepEdge";const ko=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,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:r}){const[o,i,a,s]=lo({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}({sourceX:e,sourceY:n,targetX:r,targetY:o});return t.createElement(ao,{path:m,labelX:g,labelY:y,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function No(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Mo({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case go.Left:return[t-No(t-r,i),n];case go.Right:return[t+No(r-t,i),n];case go.Top:return[t,n-No(n-o,i)];case go.Bottom:return[t,n+No(o-n,i)]}}function Ao({sourceX:e,sourceY:t,sourcePosition:n=go.Bottom,targetX:r,targetY:o,targetPosition:i=go.Top,curvature:a=.25}){const[s,l]=Mo({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=Mo({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,h]=co({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,h]}ko.displayName="StraightEdge";const Oo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:i=go.Bottom,targetPosition:a=go.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]=Ao({sourceX:e,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a,curvature:g?.curvature});return t.createElement(ao,{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})});Oo.displayName="BezierEdge";const Po=n(null),Ro=Po.Provider;Po.Consumer;const To=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,$o=(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("&")}`},Do=(e,t)=>{if(!e.source||!e.target)return to("006",Or()),t;let n;var r;return n="id"in(r=e)&&"source"in r&&"target"in r?{...e}:{...e,id:To(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)},Io=({x:e,y:t},[n,r,o],i,[a,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},zo=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Lo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Bo=(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:r,y:o}=Lo(n,t).positionAbsolute;return i=e,a=qr({x:r,y:o,width:n.width||0,height:n.height||0}),{x:Math.min(i.x,a.x),y:Math.min(i.y,a.y),x2:Math.max(i.x2,a.x2),y2:Math.max(i.y2,a.y2)};var i,a},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}))(n)},Fo=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;const{positionAbsolute:u}=Lo(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=Gr(l,d);(void 0===t||void 0===n||null===t||null===n||i&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},Ho=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Wo=(e,t,n,r,o,i=.1)=>{const a=t/(e.width*(1+i)),s=n/(e.height*(1+i)),l=Math.min(a,s),c=jr(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Vo=(e,t=0)=>e.transition().duration(t);function jo(e,t,n,r){return(t[n]||[]).reduce((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t),[])}const Yo={source:null,target:null,sourceHandle:null,targetHandle:null},Xo=()=>({handleDomNode:null,isValid:!1,connection:Yo,endHandle:null});function Ko(e,t,n,r,o,i,a){const s="target"===o,l=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Xo(),handleDomNode:l};if(l){const e=Uo(void 0,l),o=l.getAttribute("data-nodeid"),a=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?o:n,sourceHandle:s?a:r,target:s?n:o,targetHandle:s?r:a};c.connection=f;u&&d&&(t===uo.Strict?s&&"source"===e||!s&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(f))}return c}function Uo(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function qo(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Zo(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Go({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Ur(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=i();let b,w=0;const{x:x,y:E}=oo(e),S=u?.elementFromPoint(x,E),_=Uo(l,S),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=oo(e,C),M=!1,A=null,O=!1,P=null;const R=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[Jr]){const{handleBounds:i}=o[Jr];let a=[],s=[];i&&(a=jo(o,i,"source",`${t}-${n}-${r}`),s=jo(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),T=()=>{if(!p)return;const[e,t]=Kr(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function $(e){const{transform:r}=i();N=oo(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,i){const{x:a,y:s}=oo(e),l=t.elementsFromPoint(a,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Uo(void 0,l),r=l.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){const i=o.find(n=>n.nodeId===e&&n.type===t&&n.id===r);return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let c=[],u=1/0;if(o.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=i(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:Xo()};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,Io(N,r,!1,[1,1]),h,R,e=>Ko(e,d,n,t,o?"target":"source",s,u));if(b=l,M||(T(),M=!0),P=c.handleDomNode,A=c.connection,O=c.isValid,a({connectionPosition:b&&O?zo({x:b.x,y:b.y},r):N,connectionStatus:Zo(!!b,O),connectionEndHandle:c.endHandle}),!b&&!O&&!P)return qo(k);A.source!==A.target&&P&&(qo(k),k=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",O),P.classList.toggle("react-flow__handle-valid",O))}function D(e){(b||P)&&A&&O&&r?.(A),i().onConnectEnd?.(e),l&&c?.(e),qo(k),v(),cancelAnimationFrame(w),M=!1,O=!1,A=null,P=null,u.removeEventListener("mousemove",$),u.removeEventListener("mouseup",D),u.removeEventListener("touchmove",$),u.removeEventListener("touchend",D)}a({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",$),u.addEventListener("mouseup",D),u.addEventListener("touchmove",$),u.addEventListener("touchend",D)}const Qo=()=>!0,Jo=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),ei=i(({type:e="source",position:n=go.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=s||null,y="target"===e,v=Lr(),b=c(Po),{connectOnClick:x,noPanClassName:E}=zr(Jo,H),{connecting:S,clickConnecting:_}=zr(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:a?.nodeId===e&&a?.handleId===t&&a?.type===n}})(b,g,e),H);b||v.getState().onError?.("010",Tr());const C=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=v.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=v.getState();t(Do(o,e))}n?.(o),l?.(o)},k=e=>{if(!b)return;const t=ro(e);i&&(t&&0===e.button||!t)&&Go({event:e,handleId:g,nodeId:b,onConnect:C,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:r||v.getState().isValidConnection||Qo}),t?f?.(e):p?.(e)};return t.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${g}-${e}`,className:w(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,d,{source:!y,target:y,connectable:o,connectablestart:i,connectableend:a,connecting:_,connectionindicator:o&&(i&&!S||a&&S)}]),onMouseDown:k,onTouchStart:k,onClick:x?t=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l}=v.getState();if(!b||!a&&!i)return;if(!a)return n?.(t,{nodeId:b,handleId:g,handleType:e}),void v.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:g}});const c=Ur(t.target),u=r||l||Qo,{connection:d,isValid:f}=Ko({nodeId:b,id:g,type:e},s,a.nodeId,a.handleId||null,a.type,u,c);f&&C(d),o?.(t),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});ei.displayName="Handle";var ti=r(ei);const ni=({data:e,isConnectable:n,targetPosition:r=go.Top,sourcePosition:o=go.Bottom})=>t.createElement(t.Fragment,null,t.createElement(ti,{type:"target",position:r,isConnectable:n}),e?.label,t.createElement(ti,{type:"source",position:o,isConnectable:n}));ni.displayName="DefaultNode";var ri=r(ni);const oi=({data:e,isConnectable:n,sourcePosition:r=go.Bottom})=>t.createElement(t.Fragment,null,e?.label,t.createElement(ti,{type:"source",position:r,isConnectable:n}));oi.displayName="InputNode";var ii=r(oi);const ai=({data:e,isConnectable:n,targetPosition:r=go.Top})=>t.createElement(t.Fragment,null,t.createElement(ti,{type:"target",position:r,isConnectable:n}),e?.label);ai.displayName="OutputNode";var si=r(ai);const li=()=>null;li.displayName="GroupNode";const ci=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),ui=e=>e.id;function di(e,t){return H(e.selectedNodes.map(ui),t.selectedNodes.map(ui))&&H(e.selectedEdges.map(ui),t.selectedEdges.map(ui))}const fi=r(({onSelectionChange:e})=>{const t=Lr(),{selectedNodes:n,selectedEdges:r}=zr(ci,di);return a(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(e=>e(o))},[n,r,e]),null});fi.displayName="SelectionListener";const pi=e=>!!e.onSelectionChange;function hi({onSelectionChange:e}){const n=zr(pi);return e||n?t.createElement(fi,{onSelectionChange:e}):null}const mi=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 gi(e,t){a(()=>{void 0!==e&&t(e)},[e])}function yi(e,t,n){a(()=>{void 0!==t&&n({[e]:t})},[t])}const vi=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,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:C,connectOnClick:k,defaultEdgeOptions:N,fitView:M,fitViewOptions:A,onNodesDelete:O,onEdgesDelete:P,onNodeDrag:R,onNodeDragStart:T,onNodeDragStop:$,onSelectionDrag:D,onSelectionDragStart:I,onSelectionDragStop:z,noPanClassName:L,nodeOrigin:B,rfId:F,autoPanOnConnect:W,autoPanOnNodeDrag:V,onError:j,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=zr(mi,H),ne=Lr();return a(()=>{const e=r?.map(e=>({...e,...N}));return Z(n,e),()=>{te()}},[]),yi("defaultEdgeOptions",N,ne.setState),yi("connectionMode",E,ne.setState),yi("onConnect",o,ne.setState),yi("onConnectStart",i,ne.setState),yi("onConnectEnd",s,ne.setState),yi("onClickConnectStart",l,ne.setState),yi("onClickConnectEnd",c,ne.setState),yi("nodesDraggable",u,ne.setState),yi("nodesConnectable",d,ne.setState),yi("nodesFocusable",f,ne.setState),yi("edgesFocusable",p,ne.setState),yi("edgesUpdatable",h,ne.setState),yi("elementsSelectable",x,ne.setState),yi("elevateNodesOnSelect",m,ne.setState),yi("snapToGrid",_,ne.setState),yi("snapGrid",S,ne.setState),yi("onNodesChange",b,ne.setState),yi("onEdgesChange",w,ne.setState),yi("connectOnClick",k,ne.setState),yi("fitViewOnInit",M,ne.setState),yi("fitViewOnInitOptions",A,ne.setState),yi("onNodesDelete",O,ne.setState),yi("onEdgesDelete",P,ne.setState),yi("onNodeDrag",R,ne.setState),yi("onNodeDragStart",T,ne.setState),yi("onNodeDragStop",$,ne.setState),yi("onSelectionDrag",D,ne.setState),yi("onSelectionDragStart",I,ne.setState),yi("onSelectionDragStop",z,ne.setState),yi("noPanClassName",L,ne.setState),yi("nodeOrigin",B,ne.setState),yi("rfId",F,ne.setState),yi("autoPanOnConnect",W,ne.setState),yi("autoPanOnNodeDrag",V,ne.setState),yi("onError",j,ne.setState),yi("connectionRadius",Y,ne.setState),yi("isValidConnection",X,ne.setState),yi("nodeDragThreshold",K,ne.setState),gi(e,U),gi(t,q),gi(g,G),gi(y,Q),gi(C,J),gi(v,ee),null},bi={display:"none"},wi={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xi="react-flow__node-desc",Ei="react-flow__edge-desc",Si=e=>e.ariaLiveMessage;function _i({rfId:e}){const n=zr(Si);return t.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:wi},n)}function Ci({rfId:e,disableKeyboardA11y:n}){return t.createElement(t.Fragment,null,t.createElement("div",{id:`${xi}-${e}`,style:bi},"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:`${Ei}-${e}`,style:bi},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&t.createElement(_i,{rfId:e}))}var ki=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=u(!1),i=l(!1),s=l(new Set([])),[c,d]=o(()=>{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 a(()=>{const n="undefined"!=typeof document?document:null,o=t?.target||n;if(null!==e){const e=e=>{i.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!i.current||i.current&&!t.actInsideInputWithModifier)&&no(e))return!1;const n=Mi(e.code,d);s.current.add(e[n]),Ni(c,s.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&no(e))return!1;const n=Mi(e.code,d);Ni(c,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(e[n]),"Meta"===e.key&&s.current.clear(),i.current=!1},a=()=>{s.current.clear(),r(!1)};return o?.addEventListener("keydown",e),o?.addEventListener("keyup",n),window.addEventListener("blur",a),()=>{o?.removeEventListener("keydown",e),o?.removeEventListener("keyup",n),window.removeEventListener("blur",a)}}},[e,r]),n};function Ni(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Mi(e,t){return t.includes(e)?"code":"key"}function Ai(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),a=Lo(i,r);return Ai(i,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[Jr]?.z??0)>(n.z??0)?i[Jr]?.z??0:n.z??0},r)}function Oi(e,t,n){e.forEach(r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:i,z:a}=Ai(r,e,{...r.position,z:r[Jr]?.z??0},t);r.positionAbsolute={x:o,y:i},r[Jr].z=a,n?.[r.id]&&(r[Jr].isParent=!0)}})}function Pi(e,t,n,r){const o=new Map,i={},a=r?1e3:0;return e.forEach(e=>{const n=(Qr(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(i[l]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(s,Jr,{enumerable:!1,value:{handleBounds:c?void 0:r?.[Jr]?.handleBounds,z:n}}),o.set(e.id,s)}),Oi(o,n,i),o}function Ri(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,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=Bo(e,d),{x:c,y:u,zoom:f}=Wo(n,r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),p=mr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Vo(l,t.duration),p):s.transform(l,p),!0}}return!1}function Ti(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Jr]:n[Jr],selected:e.selected})}),new Map(t)}function $i(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function Di({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:Ti(e,o)}),a?.(e)),t?.length&&(c&&r({edges:$i(t,i)}),s?.(t))}const Ii=()=>{},zi={zoomIn:Ii,zoomOut:Ii,zoomTo:Ii,getZoom:()=>1,setViewport:Ii,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ii,fitBounds:Ii,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Li=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Bi(){const e=(()=>{const e=Lr(),{d3Zoom:t,d3Selection:n}=zr(Li,H),r=o(()=>n&&t?{zoomIn:e=>t.scaleBy(Vo(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(Vo(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(Vo(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[i,a,s]=e.getState().transform,l=mr.translate(r.x??i,r.y??a).scale(r.zoom??s);t.transform(Vo(n,o?.duration),l)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>Ri(e.getState,t),setCenter:(r,o,i)=>{const{width:a,height:s,maxZoom:l}=e.getState(),c=void 0!==i?.zoom?i.zoom:l,u=a/2-r*c,d=s/2-o*c,f=mr.translate(u,d).scale(c);t.transform(Vo(n,i?.duration),f)},fitBounds:(r,o)=>{const{width:i,height:a,minZoom:s,maxZoom:l}=e.getState(),{x:c,y:u,zoom:d}=Wo(r,i,a,s,l,o?.padding??.1),f=mr.translate(c,u).scale(d);t.transform(Vo(n,o?.duration),f)},project:t=>{const{transform:n,snapToGrid:r,snapGrid:o}=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"),Io(t,n,r,o)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:a,y:s}=i.getBoundingClientRect(),l={x:t.x-a,y:t.y-s};return Io(l,n,r,o)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),a=zo(t,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:zi,[t,n]);return r})(),t=Lr(),n=s(()=>t.getState().getNodes().map(e=>({...e})),[]),r=s(e=>t.getState().nodeInternals.get(e),[]),i=s(()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},[]),a=s(e=>{const{edges:n=[]}=t.getState();return n.find(t=>t.id===e)},[]),l=s(e=>{const{getNodes:n,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=t.getState(),a=n(),s="function"==typeof e?e(a):e;if(o)r(s);else if(i){const e=0===s.length?a.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));i(e)}},[]),c=s(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=t.getState(),a="function"==typeof e?e(n):e;if(o)r(a);else if(i){i(0===a.length?n.map(e=>({type:"remove",id:e.id})):a.map(e=>({item:e,type:"reset"})))}},[]),u=s(e=>{const n=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=t.getState();if(i){o([...r(),...n])}else if(a){const e=n.map(e=>({item:e,type:"add"}));a(e)}},[]),d=s(e=>{const n=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=t.getState();if(i)o([...r,...n]);else if(a){a(n.map(e=>({item:e,type:"add"})))}},[]),f=s(()=>{const{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,i,a]=r;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:i,zoom:a}}},[]),p=s(({nodes:e,edges:n})=>{const{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,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=o().reduce((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e},[]),m=i.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Ho(h,m),n=[...g,...e],o=n.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||a)&&(s&&t.setState({edges:i.filter(e=>!o.includes(e.id))}),a&&(h.forEach(e=>{r.delete(e.id)}),t.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(n),d&&d(o.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=Qr((r=e).width)&&Qr(r.height)&&Qr(r.x)&&Qr(r.y);var r;const o=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!o)return[null,null,n];return[n?e:Zr(o),o,n]},[]),m=s((e,n=!0,r)=>{const[o,i,a]=h(e);return o?(r||t.getState().getNodes()).filter(e=>{if(!(a||e.id!==i.id&&e.positionAbsolute))return!1;const t=Zr(e),r=Gr(t,o);return n&&r>0||r>=o.width*o.height}):[]},[]),g=s((e,t,n=!0)=>{const[r]=h(e);if(!r)return!1;const o=Gr(r,t);return n&&o>0||o>=r.width*r.height},[]);return o(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:a,setNodes:l,setEdges:c,addNodes:u,addEdges:d,toObject:f,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:g}),[e,n,r,i,a,l,c,u,d,f,p,m,g])}const Fi={actInsideInputWithModifier:!1};const Hi={position:"absolute",width:"100%",height:"100%",top:0,left:0},Wi=e=>({x:e.x,y:e.y,zoom:e.k}),Vi=(e,t)=>e.target.closest(`.${t}`),ji=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Yi=e=>{const t=e.ctrlKey&&io()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Xi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ki=({onMove:e,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:i=!0,zoomOnPinch:s=!0,panOnScroll:c=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=fo.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(),C=Lr(),k=l(!1),N=l(!1),M=l(null),A=l({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:P,d3ZoomHandler:R,userSelectionActive:T}=zr(Xi,H),$=ki(b),D=l(0),I=l(!1),z=l();return function(e){const t=Lr();a(()=>{let n;const r=()=>{if(!e.current)return;const n=Vr(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",Mr()),t.setState({width:n.width||500,height:n.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}(M),a(()=>{if(M.current){const e=M.current.getBoundingClientRect(),t=function(){var e,t,n,r=vr,o=br,i=Sr,a=xr,s=Er,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=vn,f=V("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",wr).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",k).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 hr(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new hr(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,i=arguments,a=w(e,i).event(r),s=o.apply(e,i),l=null==n?v(s):"function"==typeof n?n.apply(e,i):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,i):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 hr(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.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=o.apply(e,t),this.taps=0}function E(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=at(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Hn(this),n.start()}yr(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=w(this,t,!0).event(e),s=it(e.view).on("mousemove.zoom",function(e){if(yr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=at(e,o),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ft(e.view,a.moved),yr(e),a.event(e).end()},!0),l=at(e,o),u=e.clientX,d=e.clientY;dt(e.view),gr(e),a.mouse=[l,this.__zoom.invert(l)],Hn(this),a.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=at(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(y(g(n,l),a,s),o.apply(this,t),c);yr(e),u>0?it(this).transition().duration(u).call(b,d,a,e):it(this).call(m.transform,d,a,e)}}function C(n,...o){if(r.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(gr(n),a=0;a<u;++a)l=[l=at(s=c[a],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,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Hn(this),d.start())}}function k(e,...t){if(this.__zooming){var n,r,o,a,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(yr(e),n=0;n<u;++n)o=at(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=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;r=g(r,Math.sqrt(m/v)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],a=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(y(r,o,a),s.extent,c))}}function N(e,...r){if(this.__zooming){var o,i,a=w(this,r).event(e),s=e.changedTouches,l=s.length;for(gr(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=at(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=it(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",wr),e!==o?b(e,t,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,l),a,s),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return i(mr.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,a)},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=it(this.that).datum();f.call(e,this.that,new pr(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:fr(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:fr(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:fr(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:fr([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},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?(i=e,m):i},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=it(M.current).call(t),r=mr.translate(m.x,m.y).scale(jr(m.zoom,y,v)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,g);t.transform(n,i),t.wheelDelta(Yi),C.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:M.current.closest(".react-flow")})}},[]),a(()=>{P&&O&&(!c||$||T?void 0!==R&&P.on("wheel.zoom",function(e,t){if(!w&&"wheel"===e.type&&!e.ctrlKey||Vi(e,E))return null;e.preventDefault(),R.call(this,e,t)},{passive:!1}):P.on("wheel.zoom",t=>{if(Vi(t,E))return!1;t.preventDefault(),t.stopImmediatePropagation();const o=P.property("__zoom").k||1;if(t.ctrlKey&&s){const e=at(t),n=Yi(t),r=o*Math.pow(2,n);return void O.scaleTo(P,r,e,t)}const i=1===t.deltaMode?20:1;let a=d===fo.Vertical?0:t.deltaX*i,l=d===fo.Horizontal?0:t.deltaY*i;!io()&&t.shiftKey&&d!==fo.Vertical&&(a=t.deltaY*i,l=0),O.translateBy(P,-a/o*u,-l/o*u,{internal:!0});const c=Wi(P.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=C.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(t,c),f?.(c)),I.current&&(e?.(t,c),p?.(c),z.current=setTimeout(()=>{r?.(t,c),h?.(c),I.current=!1},150))},{passive:!1}))},[T,c,d,P,O,R,$,s,w,E,n,e,r]),a(()=>{O&&O.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;D.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=C.getState(),r=Wi(e.transform);k.current=!0,A.current=r,"mousedown"===e.sourceEvent?.type&&C.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)})},[O,n]),a(()=>{O&&(T&&!k.current?O.on("zoom",null):T||O.on("zoom",t=>{const{onViewportChange:n}=C.getState();if(C.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),N.current=!(!o||!ji(h,D.current??0)),(e||n)&&!t.sourceEvent?.internal){const r=Wi(t.transform);n?.(r),e?.(t.sourceEvent,r)}}))},[T,O,e,h,o]),a(()=>{O&&O.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=C.getState();if(k.current=!1,C.setState({paneDragging:!1}),o&&ji(h,D.current??0)&&!N.current&&o(e.sourceEvent),N.current=!1,(r||t)&&(n=A.current,i=e.transform,n.x!==i.x||n.y!==i.y||n.zoom!==i.k)){const n=Wi(e.transform);A.current=n,clearTimeout(_.current),_.current=setTimeout(()=>{t?.(n),r?.(e.sourceEvent,n)},c?150:0)}var n,i})},[O,c,h,r,o]),a(()=>{O&&O.filter(e=>{const t=$||i,n=s&&e.ctrlKey;if((!0===h||Array.isArray(h)&&h.includes(1))&&1===e.button&&"mousedown"===e.type&&(Vi(e,"react-flow__node")||Vi(e,"react-flow__edge")))return!0;if(!(h||t||c||f||s))return!1;if(T)return!1;if(!f&&"dblclick"===e.type)return!1;if(Vi(e,E)&&"wheel"===e.type)return!1;if(Vi(e,S)&&("wheel"!==e.type||c&&"wheel"===e.type&&!$))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 r=Array.isArray(h)&&h.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[T,O,i,s,c,f,h,p,$]),t.createElement("div",{className:"react-flow__renderer",ref:M,style:Hi},x)},Ui=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qi(){const{userSelectionActive:e,userSelectionRect:n}=zr(Ui,H);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 Zi(e,t){const n=t.parentNode||t.parentId,r=e.find(e=>e.id===n);if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function Gi(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 r=e.filter(e=>e.id===n.id);if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&Zi(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&Zi(t,o);break;case"remove":return t}return t.push(o),t},n)}function Qi(e,t){return Gi(e,t)}const Ji=(e,t)=>({id:e,type:"select",selected:t});function ea(e,t){return e.reduce((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(Ji(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(Ji(n.id,!1))),e},[])}const ta=(e,t)=>n=>{n.target===t.current&&e?.(n)},na=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ra=r(({isSelecting:e,selectionMode:n=po.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:i,onPaneClick:a,onPaneContextMenu:s,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=l(null),m=Lr(),g=l(0),y=l(0),v=l(),{userSelectionActive:b,elementsSelectable:x,dragging:E}=zr(na,H),S=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},_=e=>{a?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=c?e=>c(e):void 0,k=x&&(e||b);return t.createElement("div",{className:w(["react-flow__pane",{dragging:E,selection:e}]),onClick:k?void 0:ta(_,h),onContextMenu:ta(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():s?.(e)},h),onWheel:ta(C,h),onMouseEnter:k?void 0:u,onMouseDown:k?t=>{const{resetSelectedElements:n,domNode:r}=m.getState();if(v.current=r?.getBoundingClientRect(),!x||!e||0!==t.button||t.target!==h.current||!v.current)return;const{x:i,y:a}=oo(t,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),o?.(t)}:void 0,onMouseMove:k?t=>{const{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!v.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=oo(t,v.current),f=r.startX??0,p=r.startY??0,h={...r,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)},b=u(),w=Fo(o,h,a,n===po.Partial,!0,c),x=Ho(w,i).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=ea(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=ea(i,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&_?.(e),m.setState({nodesSelectionActive:g.current>0}),S(),i?.(e)}:void 0,onMouseLeave:k?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),i?.(e)),S()}:f,ref:h,style:Hi},p,t.createElement(qi,null))});function oa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||oa(r,t))}function ia(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function aa(e,t,n,r){return Array.from(e.values()).filter(n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!oa(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 sa(e,t,n,r,o=[0,0],i){const a=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||r);let s=a;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:r,y:i}=Lo(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+i],[e.extent[1][0]+r,e.extent[1][1]+i]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:i}=Lo(t,o).positionAbsolute;s=t&&Qr(r)&&Qr(i)&&Qr(t.width)&&Qr(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:s}else i?.("005",Ar()),s=a;let c={x:0,y:0};if(l){const e=n.get(l);c=Lo(e,o).positionAbsolute}const u=s&&"parent"!==s?Yr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function la({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?r.find(t=>t.id===e):r[0],r]}ra.displayName="Pane";const ca=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),a=t.getBoundingClientRect(),s=a.width*r[0],l=a.height*r[1];return i.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-s)/n,y:(t.top-a.top-l)/n,...Vr(e)}})};function ua(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function da({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):l?.("012",Dr(e))}function fa(e){return(t,n,r)=>e?.(t,r)}function pa({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:c}){const d=Lr(),[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=Lr(),t=s(({sourceEvent:t})=>{const{transform:n,snapGrid:r,snapToGrid:o}=e.getState(),i=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,s={x:(i-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}},[]);return t}();return a(()=>{if(e?.current){const a=it(e.current),s=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:i,updateNodePositions:a,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=Bo(h.current,u);y=qr(e)}if(h.current=h.current.map(r=>{const o={x:e-r.distance.x,y:t-r.distance.y};c&&(o.x=l[0]*Math.round(o.x/l[0]),o.y=l[1]*Math.round(o.y/l[1]));const i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];h.current.length>1&&s&&!r.extent&&(i[0][0]=r.positionAbsolute.x-y.x+s[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-y.x2+s[1][0],i[0][1]=r.positionAbsolute.y-y.y+s[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-y.y2+s[1][1]);const a=sa(r,o,n,i,u,f);return g=g||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r}),!g)return;a(h.current,!0,!0),p(!0);const v=o?r:fa(i);if(v&&b.current){const[e,t]=la({nodeId:o,dragItems:h.current,nodeInternals:n});v(b.current,e,t)}},l=()=>{if(!y.current)return;const[e,t]=Kr(v.current,y.current);if(0!==e||0!==t){const{transform:n,panBy:r}=d.getState();m.current.x=(m.current.x??0)-e/n[2],m.current.y=(m.current.y??0)-t/n[2],r({x:e,y:t})&&s(m.current)}g.current=requestAnimationFrame(l)},u=t=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:a,unselectNodesAndEdges:s,onNodeDragStart:l,onSelectionDragStart:u}=d.getState();x.current=!0;const f=o?l:fa(u);c&&i||r||!o||n.get(o)?.selected||s(),o&&i&&c&&da({id:o,store:d,nodeRef:e});const p=S(t);if(m.current=p,h.current=aa(n,a,p,o),f&&h.current){const[e,r]=la({nodeId:o,dragItems:h.current,nodeInternals:n});f(t.sourceEvent,e,r)}};if(!t){const t=function(){var e,t,n,r,o=mt,i=gt,a=yt,s=vt,l={},c=V("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,st).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&o.call(this,a,s)){var l=b(this,i.call(this,a,s),a,s,"mouse");l&&(it(a.view).on("mousemove.drag",h,lt).on("mouseup.drag",m,lt),dt(a.view),ct(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function h(r){if(ut(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}l.mouse("drag",r)}function m(e){it(e.view).on("mousemove.drag mouseup.drag",null),ft(e.view,n),ut(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(r=b(this,s,e,t,a[n].identifier,a[n]))&&(ct(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(ut(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=l[o[t].identifier])&&(ct(e),n("end",e,o[t]))}function b(e,t,n,r,o,i){var s,d,p,h=c.copy(),m=at(i||n,t);if(null!=(p=a.call(e,new ht("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(i,a,c){var g,y=m;switch(i){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=at(c||a,t),g=u}h.call(i,e,new ht(i,{sourceEvent:a,subject:p,target:f,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:pt(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:pt(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:pt(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:pt(!!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 r=S(e);m.current=r,y.current=t?.getBoundingClientRect()||null,v.current=oo(e.sourceEvent,y.current)}).on("drag",e=>{const t=S(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=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),o=t.ySnapped-(m?.current?.y??0);Math.sqrt(n*n+o*o)>r&&u(e)}(m.current.x!==t.xSnapped||m.current.y!==t.ySnapped)&&h.current&&x.current&&(b.current=e.sourceEvent,v.current=oo(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:r,onSelectionDragStop:i}=d.getState(),a=o?r:fa(i);if(t(h.current,!1,!1),a){const[t,r]=la({nodeId:o,dragItems:h.current,nodeInternals:n});a(e.sourceEvent,t,r)}}}).filter(t=>{const o=t.target;return!t.button&&(!n||!ia(o,`.${n}`,e))&&(!r||ia(o,r,e))});return a.call(t),()=>{a.on(".drag",null)}}a.on(".drag",null)}},[e,t,n,r,i,d,o,c,S]),f}function ha(){const e=Lr(),t=s(t=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:s,onError:l,nodesDraggable:c}=e.getState(),u=i().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=a?s[0]:5,f=a?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};a&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:o,position:i}=sa(e,t,n,r,void 0,l);e.position=i,e.positionAbsolute=o}return e});o(g,!0,!1)},[]);return t}const ma={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ga=e=>{const n=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:c,yPosOrigin:u,selected:d,onClick:f,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:g,onDoubleClick:y,style:v,className:b,isDraggable:x,isSelectable:E,isConnectable:S,isFocusable:_,selectNodesOnDrag:C,sourcePosition:k,targetPosition:N,hidden:M,resizeObserver:A,dragHandle:O,zIndex:P,isParent:R,noDragClassName:T,noPanClassName:$,initialized:D,disableKeyboardA11y:I,ariaLabel:z,rfId:L,hasHandleBounds:B})=>{const F=Lr(),H=l(null),W=l(null),V=l(k),j=l(N),Y=l(r),X=E||x||f||p||h||m,K=ha(),U=ua(n,F.getState,p),q=ua(n,F.getState,h),Z=ua(n,F.getState,m),G=ua(n,F.getState,g),Q=ua(n,F.getState,y);a(()=>()=>{W.current&&(A?.unobserve(W.current),W.current=null)},[]),a(()=>{if(H.current&&!M){const e=H.current;D&&B&&W.current===e||(W.current&&A?.unobserve(W.current),A?.observe(e),W.current=e)}},[M,D,B]),a(()=>{const e=Y.current!==r,t=V.current!==k,o=j.current!==N;H.current&&(e||t||o)&&(e&&(Y.current=r),t&&(V.current=k),o&&(j.current=N),F.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,k,N]);const J=pa({nodeRef:H,disabled:M||!x,noDragClassName:T,handleSelector:O,nodeId:n,isSelectable:E,selectNodesOnDrag:C});return M?null:t.createElement("div",{className:w(["react-flow__node",`react-flow__node-${r}`,{[$]:x},b,{selected:d,selectable:E,parent:R,dragging:J}]),ref:H,style:{zIndex:P,transform:`translate(${c}px,${u}px)`,pointerEvents:X?"all":"none",visibility:D?"visible":"hidden",...v},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:U,onMouseMove:q,onMouseLeave:Z,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:t}=F.getState();if(E&&(!C||!x||t>0)&&da({id:n,store:F,nodeRef:H}),f){const t=F.getState().nodeInternals.get(n);t&&f(e,{...t})}},onDoubleClick:Q,onKeyDown:_?e=>{if(!no(e)&&!I)if(eo.includes(e.key)&&E){const t="Escape"===e.key;da({id:n,store:F,unselect:t,nodeRef:H})}else x&&d&&Object.prototype.hasOwnProperty.call(ma,e.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),K({x:ma[e.key].x,y:ma[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":I?void 0:`${xi}-${L}`,"aria-label":z},t.createElement(Ro,{value:n},t.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:d,isConnectable:S,sourcePosition:k,targetPosition:N,dragging:J,dragHandle:O,zIndex:P})))};return n.displayName="NodeWrapper",r(n)};const ya=e=>{const t=e.getNodes().filter(e=>e.selected);return{...Bo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var va=r(function({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const o=Lr(),{width:i,height:s,x:c,y:u,transformString:d,userSelectionActive:f}=zr(ya,H),p=ha(),h=l(null);if(a(()=>{r||h.current?.focus({preventScroll:!0})},[r]),pa({nodeRef:h}),f||!i||!s)return null;const m=e?t=>{const n=o.getState().getNodes().filter(e=>e.selected);e(t,n)}:void 0;return t.createElement("div",{className:w(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},t.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(ma,e.key)&&p({x:ma[e.key].x,y:ma[e.key].y,isShiftPressed:e.shiftKey})},style:{width:i,height:s,top:u,left:c}}))});const ba=e=>e.nodesSelectionActive,wa=({children:e,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,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:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:M,defaultViewport:A,translateExtent:O,minZoom:P,maxZoom:R,preventScrolling:T,onSelectionContextMenu:$,noWheelClassName:D,noPanClassName:I,disableKeyboardA11y:z})=>{const L=zr(ba),B=ki(p),F=ki(b),H=F||M,W=F||_,V=B||h&&!0!==H;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Lr(),{deleteElements:r}=Bi(),o=ki(e,Fi),i=ki(t);a(()=>{if(o){const{edges:e,getNodes:t}=n.getState(),o=t().filter(e=>e.selected),i=e.filter(e=>e.selected);r({nodes:o,edges:i}),n.setState({nodesSelectionActive:!1})}},[o]),a(()=>{n.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:c,multiSelectionKeyCode:v}),t.createElement(Ki,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:W,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:!B&&H,defaultViewport:A,translateExtent:O,minZoom:P,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:T,noWheelClassName:D,noPanClassName:I},t.createElement(ra,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:H,isSelecting:!!V,selectionMode:m},e,L&&t.createElement(va,{onSelectionContextMenu:$,noPanClassName:I,disableKeyboardA11y:z})))};wa.displayName="FlowRenderer";var xa=r(wa);function Ea(e){return{...{input:ga(e.input||ii),default:ga(e.default||ri),output:ga(e.output||si),group:ga(e.group||li)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ga(e[n]||ri),t),{})}}const Sa=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),_a=e=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:i,elementsSelectable:c,updateNodeDimensions:u,onError:d}=zr(Sa,H),f=(p=e.onlyRenderVisibleElements,zr(s(e=>p?Fo(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[p])));var p;const h=l(),m=o(()=>{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 a(()=>()=>{h?.current?.disconnect()},[]),t.createElement("div",{className:"react-flow__nodes",style:Hi},f.map(o=>{let a=o.type||"default";e.nodeTypes[a]||(d?.("003",Nr(a)),a="default");const s=e.nodeTypes[a]||e.nodeTypes.default,l=!!(o.draggable||n&&void 0===o.draggable),u=!!(o.selectable||c&&void 0===o.selectable),f=!!(o.connectable||r&&void 0===o.connectable),p=!!(o.focusable||i&&void 0===o.focusable),h=e.nodeExtent?Yr(o.positionAbsolute,e.nodeExtent):o.positionAbsolute,g=h?.x??0,y=h?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:o.width??0,height:o.height??0,origin:e.nodeOrigin});return t.createElement(s,{key:o.id,id:o.id,className:o.className,style:o.style,type:a,data:o.data,sourcePosition:o.sourcePosition||go.Bottom,targetPosition:o.targetPosition||go.Top,hidden:o.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:!!o.selected,isDraggable:l,isSelectable:u,isConnectable:f,isFocusable:p,resizeObserver:m,dragHandle:o.dragHandle,zIndex:o[Jr]?.z??0,isParent:!!o[Jr]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!o.width&&!!o.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:o.ariaLabel,hasHandleBounds:!!o[Jr]?.handleBounds})}))};_a.displayName="NodeRenderer";var Ca=r(_a);const ka=(e,t,n)=>n===go.Left?e-t:n===go.Right?e+t:e,Na=(e,t,n)=>n===go.Top?e-t:n===go.Bottom?e+t:e,Ma="react-flow__edgeupdater",Aa=({position:e,centerX:n,centerY:r,radius:o=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l})=>t.createElement("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:w([Ma,`${Ma}-${l}`]),cx:ka(n,o,e),cy:Na(r,o,e),r:o,stroke:"transparent",fill:"transparent"}),Oa=()=>!0;var Pa=e=>{const n=({id:n,className:r,type:i,data:a,onClick:s,onEdgeDoubleClick:c,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:b,source:x,target:E,sourceX:S,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,elementsSelectable:A,hidden:O,sourceHandleId:P,targetHandleId:R,onContextMenu:T,onMouseEnter:$,onMouseMove:D,onMouseLeave:I,reconnectRadius:z,onReconnect:L,onReconnectStart:B,onReconnectEnd:F,markerEnd:H,markerStart:W,rfId:V,ariaLabel:j,isFocusable:Y,isReconnectable:X,pathOptions:K,interactionWidth:U,disableKeyboardA11y:q})=>{const Z=l(null),[G,Q]=u(!1),[J,ee]=u(!1),te=Lr(),ne=o(()=>`url('#${$o(W,V)}')`,[W,V]),re=o(()=>`url('#${$o(H,V)}')`,[H,V]);if(O)return null;const oe=so(n,te.getState,c),ie=so(n,te.getState,T),ae=so(n,te.getState,$),se=so(n,te.getState,D),le=so(n,te.getState,I),ce=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=te.getState(),i=t?E:x,a=(t?R:P)||null,s=t?"target":"source",l=o||Oa,c=t,u=r.find(e=>e.id===n);ee(!0),B?.(e,u,s);Go({event:e,handleId:a,nodeId:i,onConnect:e=>L?.(u,e),isTarget:c,getState:te.getState,setState:te.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{ee(!1),F?.(e,u,s)}})},ue=()=>Q(!0),de=()=>Q(!1),fe=!A&&!s;return t.createElement("g",{className:w(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:d,animated:f,inactive:fe,updating:G}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:i}=te.getState(),a=t.find(e=>e.id===n);a&&(A&&(te.setState({nodesSelectionActive:!1}),a.selected&&i?(o({nodes:[],edges:[a]}),Z.current?.blur()):r([n])),s&&s(e,a))},onDoubleClick:oe,onContextMenu:ie,onMouseEnter:ae,onMouseMove:se,onMouseLeave:le,onKeyDown:Y?e=>{if(!q&&eo.includes(e.key)&&A){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=te.getState();"Escape"===e.key?(Z.current?.blur(),t({edges:[o.find(e=>e.id===n)]})):r([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===j?void 0:j||`Edge from ${x} to ${E}`,"aria-describedby":Y?`${Ei}-${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:v,data:a,style:b,sourceX:S,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,sourceHandleId:P,targetHandleId:R,markerStart:ne,markerEnd:re,pathOptions:K,interactionWidth:U}),X&&t.createElement(t.Fragment,null,("source"===X||!0===X)&&t.createElement(Aa,{position:N,centerX:S,centerY:_,radius:z,onMouseDown:e=>ce(e,!0),onMouseEnter:ue,onMouseOut:de,type:"source"}),("target"===X||!0===X)&&t.createElement(Aa,{position:M,centerX:C,centerY:k,radius:z,onMouseDown:e=>ce(e,!1),onMouseEnter:ue,onMouseOut:de,type:"target"})))};return n.displayName="EdgeWrapper",r(n)};function Ra(e){return{...{default:Pa(e.default||Oo),straight:Pa(e.bezier||ko),step:Pa(e.step||Co),smoothstep:Pa(e.step||_o),simplebezier:Pa(e.simplebezier||bo)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=Pa(e[n]||Oo),t),{})}}function Ta(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case go.Top:return{x:r+i/2,y:o};case go.Right:return{x:r+i,y:o+a/2};case go.Bottom:return{x:r+i/2,y:o+a};case go.Left:return{x:r,y:o+a/2}}}function $a(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function Da(e){const t=e?.[Jr]?.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 Ia=[{level:0,isMaxLevel:!0,edges:[]}];function za(e,t,n){return function(e,t,n=!1){let r=-1;const o=e.reduce((e,o)=>{const i=Qr(o.zIndex);let a=i?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[Jr]?.z||0,e?.[Jr]?.z||0,1e3);a=(i?o.zIndex:0)+(r?s:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e},{}),i=Object.entries(o).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}});return 0===i.length?Ia:i}(zr(s(n=>e?n.edges.filter(e=>{const r=t.get(e.source),o=t.get(e.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,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+o),y2:Math.max(e.y+r,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=qr({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/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:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:n.width,height:n.height,transform:n.transform})}):n.edges,[e,t])),t,n)}const La={[mo.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"}),[mo.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 Ba=({id:e,type:n,color:r,width:i=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=Lr();return o(()=>Object.prototype.hasOwnProperty.call(La,e)?La[e]:(t.getState().onError?.("009",Pr(e)),null),[e])}(n);return u?t.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0"},t.createElement(u,{color:r,strokeWidth:l})):null},Fa=({defaultColor:e,rfId:n})=>{const r=zr(s((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((n,o)=>([o.markerStart,o.markerEnd].forEach(o=>{if(o&&"object"==typeof o){const i=$o(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}}),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,r.map(e=>t.createElement(Ba,{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})))};Fa.displayName="MarkerDefinitions";var Ha=r(Fa);const Wa=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}),Va=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:i,noPanClassName:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:v})=>{const{edgesFocusable:b,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:C,nodeInternals:k,onError:N}=zr(Wa,H),M=za(n,k,r);return S?t.createElement(t.Fragment,null,M.map(({level:n,edges:r,isMaxLevel:y})=>t.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},y&&t.createElement(Ha,{defaultColor:e,rfId:o}),t.createElement("g",null,r.map(e=>{const[n,r,y]=Da(k.get(e.source)),[S,_,M]=Da(k.get(e.target));if(!y||!M)return null;let A=e.type||"default";i[A]||(N?.("011",$r(A)),A="default");const O=i[A]||i.default,P=C===uo.Strict?_.target:(_.target??[]).concat(_.source??[]),R=$a(r.source,e.sourceHandle),T=$a(P,e.targetHandle),$=R?.position||go.Bottom,D=T?.position||go.Top,I=!!(e.focusable||b&&void 0===e.focusable),z=e.reconnectable||e.updatable,L=void 0!==p&&(z||x&&void 0===z);if(!R||!T)return N?.("008",Rr(R,e)),null;const{sourceX:B,sourceY:F,targetX:H,targetY:W}=((e,t,n,r,o,i)=>{const a=Ta(n,e,t),s=Ta(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}})(n,R,$,S,T,D);return t.createElement(O,{key:e.id,id:e.id,className:w([e.className,a]),type:A,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:F,targetX:H,targetY:W,sourcePosition:$,targetPosition:D,elementsSelectable:E,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:o,ariaLabel:e.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:v})})))),y):null};Va.displayName="EdgeRenderer";var ja=r(Va);const Ya=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Xa({children:e}){const n=zr(Ya);return t.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}const Ka={[go.Left]:go.Right,[go.Right]:go.Left,[go.Top]:go.Bottom,[go.Bottom]:go.Top},Ua=({nodeId:e,handleType:n,style:r,type:o=ho.Bezier,CustomComponent:i,connectionStatus:a})=>{const{fromNode:l,handleId:c,toX:u,toY:d,connectionMode:f}=zr(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]),H),p=l?.[Jr]?.handleBounds;let h=p?.[n];if(f===uo.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?Ka[w]:null;if(!w||!x)return null;if(i)return t.createElement(i,{connectionLineType:o,connectionLineStyle:r,fromNode:l,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:a});let E="";const S={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return o===ho.Bezier?[E]=Ao(S):o===ho.Step?[E]=So({...S,borderRadius:0}):o===ho.SmoothStep?[E]=So(S):o===ho.SimpleBezier?[E]=vo(S):E=`M${v},${b} ${u},${d}`,t.createElement("path",{d:E,fill:"none",className:"react-flow__connection-path",style:r})};Ua.displayName="ConnectionLine";const qa=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Za({containerStyle:e,style:n,type:r,component:o}){const{nodeId:i,handleType:a,nodesConnectable:s,width:l,height:c,connectionStatus:u}=zr(qa,H);return!!(i&&a&&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:w(["react-flow__connection",u])},t.createElement(Ua,{nodeId:i,handleType:a,style:n,type:r,CustomComponent:o,connectionStatus:u}))):null}function Ga(e,t){const n=l(null),r=Lr();return o(()=>{if("development"===process.env.NODE_ENV){const t=Object.keys(e);H(n.current,t)&&r.getState().onError?.("002",kr()),n.current=t}return t(e)},[e])}const Qa=({nodeTypes:e,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:i,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:C,selectionMode:k,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:A,deleteKeyCode:O,onlyRenderVisibleElements:P,elementsSelectable:R,selectNodesOnDrag:T,defaultViewport:$,translateExtent:D,minZoom:I,maxZoom:z,preventScrolling:L,defaultMarkerColor:B,zoomOnScroll:F,zoomOnPinch:H,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:j,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:re,onReconnectStart:oe,onReconnectEnd:ie,reconnectRadius:ae,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,elevateEdgesOnSelect:ue,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})=>{const me=Ga(e,Ea),ge=Ga(n,Ra);return function(e){const t=Bi(),n=l(!1);a(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(s),t.createElement(xa,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:O,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:A,elementsSelectable:R,onMove:r,onMoveStart:o,onMoveEnd:i,zoomOnScroll:F,zoomOnPinch:H,zoomOnDoubleClick:Y,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:j,panOnDrag:X,defaultViewport:$,translateExtent:D,minZoom:I,maxZoom:z,onSelectionContextMenu:y,preventScrolling:L,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,disableKeyboardA11y:de},t.createElement(Xa,null,t.createElement(ja,{edgeTypes:ge,onEdgeClick:u,onEdgeDoubleClick:f,onlyRenderVisibleElements:P,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:re,onReconnectStart:oe,onReconnectEnd:ie,reconnectRadius:ae,defaultMarkerColor:B,noPanClassName:ce,elevateEdgesOnSelect:!!ue,disableKeyboardA11y:de,rfId:he},t.createElement(Za,{style:x,type:w,component:E,containerStyle:S})),t.createElement("div",{className:"react-flow__edgelabel-renderer"}),t.createElement(Ca,{nodeTypes:me,onNodeClick:c,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,selectNodesOnDrag:T,onlyRenderVisibleElements:P,noPanClassName:ce,noDragClassName:se,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})))};Qa.displayName="GraphView";var Ja=r(Qa);const es=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ts={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:es,nodeExtent:es,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:uo.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:to,isValidConnection:void 0},ns=()=>{return e=(e,t)=>({...ts,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Pi(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(e=>({...r,...e}))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,i=void 0!==r,a=o?Pi(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,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=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[Jr]:{...n[Jr],handleBounds:void 0}});else if(n){const r=Vr(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[Jr]:{...n[Jr],handleBounds:{source:ca(".source",t.nodeElement,f,c),target:ca(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);Oi(o,c);const h=a||i&&!a&&Ri(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=e.map(e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});o(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(i){const t=Pi(Qi(n,s()),o,a,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map(e=>Ji(e,!0)):(a=ea(i(),n),s=ea(o,[])),Di({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map(e=>Ji(e,!0)):(a=ea(o,n),s=ea(i(),[])),Di({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),a=r||o;Di({changedNodes:(n||i()).map(e=>(e.selected=!1,Ji(e.id,!1))),changedEdges:a.map(e=>Ji(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Di({changedNodes:r().filter(e=>e.selected).map(e=>Ji(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ji(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(e=>{e.positionAbsolute=Yr(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:s}=t();if(!i||!a||!e.x&&!e.y)return!1;const l=mr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=i?.constrain()(l,c,s);return i.transform(a,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:ts.connectionNodeId,connectionHandleId:ts.connectionHandleId,connectionHandleType:ts.connectionHandleType,connectionStatus:ts.connectionStatus,connectionStartHandle:ts.connectionStartHandle,connectionEndHandle:ts.connectionEndHandle}),reset:()=>e({...ts})}),t=Object.is,e?F(e,t):F;var e,t},rs=({children:e})=>{const n=l(null);return n.current||(n.current=ns()),t.createElement(Cr,{value:n.current},e)};rs.displayName="ReactFlowProvider";const os=({children:e})=>c(_r)?t.createElement(t.Fragment,null,e):t.createElement(rs,null,e);os.displayName="ReactFlowWrapper";const is={input:ii,default:ri,output:si,group:li},as={default:Oo,straight:ko,step:Co,smoothstep:_o,simplebezier:bo},ss=[0,0],ls=[15,15],cs={x:0,y:0,zoom:1},us={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ds=i(({nodes:e,edges:n,defaultNodes:r,defaultEdges:o,className:i,nodeTypes:a=is,edgeTypes:s=as,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:A,onSelectionChange:O,onSelectionDragStart:P,onSelectionDrag:R,onSelectionDragStop:T,onSelectionContextMenu:$,onSelectionStart:D,onSelectionEnd:I,connectionMode:z=uo.Strict,connectionLineType:L=ho.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,deleteKeyCode:W="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:j=!1,selectionMode:Y=po.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(io()?"Meta":"Control"),zoomActivationKeyCode:U=(io()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=ls,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=ss,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,defaultViewport:ae=cs,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=es,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=fo.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,children:ke,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Ae,onEdgeMouseMove:Oe,onEdgeMouseLeave:Pe,onEdgeUpdate:Re,onEdgeUpdateStart:Te,onEdgeUpdateEnd:$e,onReconnect:De,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:He,noDragClassName:We="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:je="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:rt,onError:ot,style:it,id:at,nodeDragThreshold:st,...lt},ct)=>{const ut=at||"1";return t.createElement("div",{...lt,style:{...it,...us},ref:ct,className:w(["react-flow",i]),"data-testid":"rf__wrapper",id:at},t.createElement(os,null,t.createElement(Ja,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:a,edgeTypes:s,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:j,selectionMode:Y,deleteKeyCode:W,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ae,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:Ce,onSelectionContextMenu:$,onSelectionStart:D,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Ae,onEdgeMouseMove:Oe,onEdgeMouseLeave:Pe,onReconnect:De??Re,onReconnectStart:Ie??Te,onReconnectEnd:ze??$e,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:We,noWheelClassName:Ve,noPanClassName:je,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),t.createElement(vi,{nodes:e,edges:n,defaultNodes:r,defaultEdges:o,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Fe,onEdgesChange:He,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:A,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:R,onSelectionDragStart:P,onSelectionDragStop:T,noPanClassName:je,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),t.createElement(hi,{onSelectionChange:O}),ke,t.createElement(Hr,{proOptions:qe,position:Ue}),t.createElement(Ci,{rfId:ut,disableKeyboardA11y:Je})))});function fs(e){return t=>{const[n,r]=u(t),o=s(t=>r(n=>e(t,n)),[]);return[n,r,o]}}ds.displayName="ReactFlow";const ps=fs(Qi),hs=fs(function(e,t){return Gi(e,t)});var ms;function gs({color:e,dimensions:n,lineWidth:r}){return t.createElement("path",{stroke:e,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function ys({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"}(ms||(ms={}));const vs={[ms.Dots]:"#91919a",[ms.Lines]:"#eee",[ms.Cross]:"#e2e2e2"},bs={[ms.Dots]:1,[ms.Lines]:1,[ms.Cross]:6},ws=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function xs({id:e,variant:n=ms.Dots,gap:r=20,size:o,lineWidth:i=1,offset:a=2,color:s,style:c,className:u}){const d=l(null),{transform:f,patternId:p}=zr(ws,H),h=s||vs[n],m=o||bs[n],g=n===ms.Dots,y=n===ms.Cross,v=Array.isArray(r)?r:[r,r],b=[v[0]*f[2]||1,v[1]*f[2]||1],x=m*f[2],E=y?[x,x]:b,S=g?[x/a,x/a]:[E[0]/a,E[1]/a];return t.createElement("svg",{className:w(["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]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`},g?t.createElement(ys,{color:h,radius:x/a}):t.createElement(gs,{dimensions:E,color:h,lineWidth:i})),t.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}xs.displayName="Background";var Es=r(xs);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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:-webkit-grab;cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;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;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation: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;-webkit-animation:dashdraw .5s linear infinite;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:-webkit-grab;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:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:-webkit-grab;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}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@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%}");
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.525.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const Ss=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},_s=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Cs=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v0.525.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Cs=a(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},l)=>d("svg",{ref:l,..._s,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Ss("lucide",o),...!a&&!Es(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>d(e,t)),...Array.isArray(a)?a:[a]])),ks=(e,t)=>{const n=a(({className:n,...r},o)=>{return d(Cs,{ref:o,iconNode:t,className:Ss(`lucide-${a=xs(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var a});return n.displayName=xs(e),n},Ns=ks("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ms=ks("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ps=ks("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Os=ks("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),As=ks("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Rs=ks("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ts=ks("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"}]]);var Ds=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-",Is="-moz-",zs="-webkit-",Ls="comm",Bs="rule",Fs="decl",Hs="@keyframes",Ws=Math.abs,Vs=String.fromCharCode,js=Object.assign;function Ys(e){return e.trim()}function Xs(e,t,n){return e.replace(t,n)}function Ks(e,t){return e.indexOf(t)}function Us(e,t){return 0|e.charCodeAt(t)}function qs(e,t,n){return e.slice(t,n)}function Zs(e){return e.length}function Gs(e){return e.length}function Qs(e,t){return t.push(e),e}var Js=1,el=1,tl=0,nl=0,rl=0,ol="";function al(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:Js,column:el,length:i,return:""}}function il(e,t){return js(al("",null,null,"",null,null,0),e,{length:-e.length},t)}function sl(){return rl=nl>0?Us(ol,--nl):0,el--,10===rl&&(el=1,Js--),rl}function ll(){return rl=nl<tl?Us(ol,nl++):0,el++,10===rl&&(el=1,Js++),rl}function cl(){return Us(ol,nl)}function ul(){return nl}function dl(e,t){return qs(ol,e,t)}function fl(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 pl(e){return Js=el=1,tl=Zs(ol=e),nl=0,[]}function hl(e){return ol="",e}function ml(e){return Ys(dl(nl-1,vl(91===e?e+2:40===e?e+1:e)))}function gl(e){for(;(rl=cl())&&rl<33;)ll();return fl(e)>2||fl(rl)>3?"":" "}function yl(e,t){for(;--t&&ll()&&!(rl<48||rl>102||rl>57&&rl<65||rl>70&&rl<97););return dl(e,ul()+(t<6&&32==cl()&&32==ll()))}function vl(e){for(;ll();)switch(rl){case e:return nl;case 34:case 39:34!==e&&39!==e&&vl(rl);break;case 40:41===e&&vl(e);break;case 92:ll()}return nl}function bl(e,t){for(;ll()&&e+rl!==57&&(e+rl!==84||47!==cl()););return"/*"+dl(t,nl-1)+"*"+Vs(47===e?e:ll())}function wl(e){for(;!fl(cl());)ll();return dl(e,nl)}function xl(e){return hl(Sl("",null,null,null,[""],e=pl(e),0,[0],e))}function Sl(e,t,n,r,o,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=o,x=a,S=r,E=b;g;)switch(h=v,v=ll()){case 40:if(108!=h&&58==Us(E,d-1)){-1!=Ks(E+=Xs(ml(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:E+=ml(v);break;case 9:case 10:case 13:case 32:E+=gl(h);break;case 92:E+=yl(ul()-1,7);continue;case 47:switch(cl()){case 42:case 47:Qs(_l(bl(ll(),ul()),t,n),l);break;default:E+="/"}break;case 123*m:s[c++]=Zs(E)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(E=Xs(E,/\f/g,"")),p>0&&Zs(E)-d&&Qs(p>32?Cl(E+";",r,n,d-1):Cl(Xs(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(Qs(S=El(E,t,n,c,u,o,s,b,w=[],x=[],d),a),123===v)if(0===u)Sl(E,t,S,S,w,a,d,s,x);else switch(99===f&&110===Us(E,3)?100:f){case 100:case 108:case 109:case 115:Sl(e,S,S,r&&Qs(El(e,S,S,0,0,o,s,b,o,w=[],d),x),o,x,d,s,r?w:x);break;default:Sl(E,S,S,S,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=E="",d=i;break;case 58:d=1+Zs(E),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==sl())continue;switch(E+=Vs(v),v*m){case 38:y=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(Zs(E)-1)*y,y=1;break;case 64:45===cl()&&(E+=ml(ll())),f=cl(),u=d=Zs(b=E+=wl(ul())),v++;break;case 45:45===h&&2==Zs(E)&&(m=0)}}return a}function El(e,t,n,r,o,a,i,s,l,c,u){for(var d=o-1,f=0===o?a:[""],p=Gs(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=qs(e,d+1,d=Ws(m=i[h])),b=e;y<p;++y)(b=Ys(m>0?f[y]+" "+v:Xs(v,/&\f/g,f[y])))&&(l[g++]=b);return al(e,t,n,0===o?Bs:s,l,c,u)}function _l(e,t,n){return al(e,t,n,Ls,Vs(rl),qs(e,2,-2),0)}function Cl(e,t,n,r){return al(e,t,n,Fs,qs(e,0,r),qs(e,r+1,-1),r)}function kl(e,t){for(var n="",r=Gs(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Nl(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Fs:return e.return=e.return||e.value;case Ls:return"";case Hs:return e.return=e.value+"{"+kl(e.children,r)+"}";case Bs:e.value=e.props.join(",")}return Zs(n=kl(e.children,r))?e.return=e.value+"{"+n+"}":""}var Ml=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}};function Pl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Ol=function(e,t,n){for(var r=0,o=0;r=o,o=cl(),38===r&&12===o&&(t[n]=1),!fl(o);)ll();return dl(e,nl)},Al=function(e,t){return hl(function(e,t){var n=-1,r=44;do{switch(fl(r)){case 0:38===r&&12===cl()&&(t[n]=1),e[n]+=Ol(nl-1,t,n);break;case 2:e[n]+=ml(r);break;case 4:if(44===r){e[++n]=58===cl()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Vs(r)}}while(r=ll());return e}(pl(e),t))},Rl=new WeakMap,Tl=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=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)||Rl.get(n))&&!r){Rl.set(e,!0);for(var o=[],a=Al(t,o),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},Dl=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function $l(e,t){switch(function(e,t){return 45^Us(e,0)?(((t<<2^Us(e,0))<<2^Us(e,1))<<2^Us(e,2))<<2^Us(e,3):0}(e,t)){case 5103:return zs+"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 zs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return zs+e+Is+e+$s+e+e;case 6828:case 4268:return zs+e+$s+e+e;case 6165:return zs+e+$s+"flex-"+e+e;case 5187:return zs+e+Xs(e,/(\w+).+(:[^]+)/,zs+"box-$1$2"+$s+"flex-$1$2")+e;case 5443:return zs+e+$s+"flex-item-"+Xs(e,/flex-|-self/,"")+e;case 4675:return zs+e+$s+"flex-line-pack"+Xs(e,/align-content|flex-|-self/,"")+e;case 5548:return zs+e+$s+Xs(e,"shrink","negative")+e;case 5292:return zs+e+$s+Xs(e,"basis","preferred-size")+e;case 6060:return zs+"box-"+Xs(e,"-grow","")+zs+e+$s+Xs(e,"grow","positive")+e;case 4554:return zs+Xs(e,/([^-])(transform)/g,"$1"+zs+"$2")+e;case 6187:return Xs(Xs(Xs(e,/(zoom-|grab)/,zs+"$1"),/(image-set)/,zs+"$1"),e,"")+e;case 5495:case 3959:return Xs(e,/(image-set\([^]*)/,zs+"$1$`$1");case 4968:return Xs(Xs(e,/(.+:)(flex-)?(.*)/,zs+"box-pack:$3"+$s+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+zs+e+e;case 4095:case 3583:case 4068:case 2532:return Xs(e,/(.+)-inline(.+)/,zs+"$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(Zs(e)-1-t>6)switch(Us(e,t+1)){case 109:if(45!==Us(e,t+4))break;case 102:return Xs(e,/(.+:)(.+)-([^]+)/,"$1"+zs+"$2-$3$1"+Is+(108==Us(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ks(e,"stretch")?$l(Xs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Us(e,t+1))break;case 6444:switch(Us(e,Zs(e)-3-(~Ks(e,"!important")&&10))){case 107:return Xs(e,":",":"+zs)+e;case 101:return Xs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+zs+(45===Us(e,14)?"inline-":"")+"box$3$1"+zs+"$2$3$1"+$s+"$2box$3")+e}break;case 5936:switch(Us(e,t+11)){case 114:return zs+e+$s+Xs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return zs+e+$s+Xs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return zs+e+$s+Xs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return zs+e+$s+e+e}return e}var Il=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Fs:e.return=$l(e.value,e.length);break;case Hs:return kl([il(e,{value:Xs(e.value,"@","@"+zs)})],r);case Bs: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 kl([il(e,{props:[Xs(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return kl([il(e,{props:[Xs(t,/:(plac\w+)/,":"+zs+"input-$1")]}),il(e,{props:[Xs(t,/:(plac\w+)/,":-moz-$1")]}),il(e,{props:[Xs(t,/:(plac\w+)/,$s+"input-$1")]})],r)}return""})}}],zl=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 r,o,a=e.stylisPlugins||Il,i={},s=[];r=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=[Nl,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Gs(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}([Tl,Dl].concat(a,u));o=function(e,t,n,r){l=n,kl(xl(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Ds({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:o};return f.sheet.hydrate(s),f};function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ll.apply(null,arguments)}var Bl,Fl={exports:{}},Hl={};var Wl,Vl={};"production"===process.env.NODE_ENV?Fl.exports=function(){if(Bl)return Hl;Bl=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case l:case c:case r:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case u:case h:case p:case i:return e;default:return f}}case n:return f}}}function w(e){return b(e)===c}return Hl.AsyncMode=l,Hl.ConcurrentMode=c,Hl.ContextConsumer=s,Hl.ContextProvider=i,Hl.Element=t,Hl.ForwardRef=u,Hl.Fragment=r,Hl.Lazy=h,Hl.Memo=p,Hl.Portal=n,Hl.Profiler=a,Hl.StrictMode=o,Hl.Suspense=d,Hl.isAsyncMode=function(e){return w(e)||b(e)===l},Hl.isConcurrentMode=w,Hl.isContextConsumer=function(e){return b(e)===s},Hl.isContextProvider=function(e){return b(e)===i},Hl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Hl.isForwardRef=function(e){return b(e)===u},Hl.isFragment=function(e){return b(e)===r},Hl.isLazy=function(e){return b(e)===h},Hl.isMemo=function(e){return b(e)===p},Hl.isPortal=function(e){return b(e)===n},Hl.isProfiler=function(e){return b(e)===a},Hl.isStrictMode=function(e){return b(e)===o},Hl.isSuspense=function(e){return b(e)===d},Hl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Hl.typeOf=b,Hl}():Fl.exports=(Wl||(Wl=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var m=e.type;switch(m){case l:case c:case r:case a:case o:case d:return m;default:var g=m&&m.$$typeof;switch(g){case s:case u:case h:case p:case i:return g;default:return f}}case n:return f}}}var w=l,x=c,S=s,E=i,_=t,C=u,k=r,N=h,M=p,P=n,O=a,A=o,R=d,T=!1;function D(e){return b(e)===c}Vl.AsyncMode=w,Vl.ConcurrentMode=x,Vl.ContextConsumer=S,Vl.ContextProvider=E,Vl.Element=_,Vl.ForwardRef=C,Vl.Fragment=k,Vl.Lazy=N,Vl.Memo=M,Vl.Portal=P,Vl.Profiler=O,Vl.StrictMode=A,Vl.Suspense=R,Vl.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||b(e)===l},Vl.isConcurrentMode=D,Vl.isContextConsumer=function(e){return b(e)===s},Vl.isContextProvider=function(e){return b(e)===i},Vl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Vl.isForwardRef=function(e){return b(e)===u},Vl.isFragment=function(e){return b(e)===r},Vl.isLazy=function(e){return b(e)===h},Vl.isMemo=function(e){return b(e)===p},Vl.isPortal=function(e){return b(e)===n},Vl.isProfiler=function(e){return b(e)===a},Vl.isStrictMode=function(e){return b(e)===o},Vl.isSuspense=function(e){return b(e)===d},Vl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Vl.typeOf=b}()),Vl);var jl=Fl.exports,Yl={};Yl[jl.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yl[jl.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function Xl(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var Kl=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Ul=function(e,t,n){Kl(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};var ql={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},Zl=/[A-Z]|^ms/g,Gl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ql=function(e){return 45===e.charCodeAt(1)},Jl=function(e){return null!=e&&"boolean"!=typeof e},ec=Pl(function(e){return Ql(e)?e:e.replace(Zl,"-$&").toLowerCase()}),tc=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Gl,function(e,t,n){return rc={name:t,styles:n,next:rc},t})}return 1===ql[e]||Ql(e)||"number"!=typeof t||0===t?t:t+"px"};function nc(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return rc={name:o.name,styles:o.styles,next:rc},o.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)rc={name:i.name,styles:i.styles,next:rc},i=i.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=nc(e,t,n[o])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":Jl(s)&&(r+=ec(a)+":"+tc(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=nc(e,t,i);switch(a){case"animation":case"animationName":r+=ec(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Jl(i[c])&&(r+=ec(a)+":"+tc(a,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=rc,l=n(e);return rc=s,nc(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var rc,oc=/label:\s*([^\s;{]+)\s*(;|$)/g;function ac(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";rc=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=nc(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++){if(o+=nc(n,t,e[i]),r)o+=a[i]}oc.lastIndex=0;for(var s,l="";null!==(s=oc.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:rc}}var ic=!!e.useInsertionEffect&&e.useInsertionEffect,sc=ic||function(e){return e()},lc=ic||e.useLayoutEffect,cc=e.createContext("undefined"!=typeof HTMLElement?zl({key:"css"}):null);cc.Provider;var uc,dc,fc=function(e){return a(function(t,n){var r=c(cc);return e(t,r,n)})},pc=e.createContext({}),hc=Ml(function(e){return Ml(function(t){return function(e,t){return"function"==typeof t?t(e):Ll({},e,t)}(e,t)})}),mc=function(t){var n=e.useContext(pc);return t.theme!==n&&(n=hc(n)(t.theme)),e.createElement(pc.Provider,{value:n},t.children)},gc={}.hasOwnProperty,yc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",vc=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Kl(t,n,r),sc(function(){return Ul(t,n,r)}),null},bc=fc(function(t,n,r){var o=t.css;"string"==typeof o&&void 0!==n.registered[o]&&(o=n.registered[o]);var a=t[yc],i=[o],s="";"string"==typeof t.className?s=Xl(n.registered,i,t.className):null!=t.className&&(s=t.className+" ");var l=ac(i,void 0,e.useContext(pc));s+=n.key+"-"+l.name;var c={};for(var u in t)gc.call(t,u)&&"css"!==u&&u!==yc&&(c[u]=t[u]);return c.className=s,r&&(c.ref=r),e.createElement(e.Fragment,null,e.createElement(vc,{cache:n,serialized:l,isStringTag:"string"==typeof a}),e.createElement(a,c))}),wc=bc,xc=function(t,n){var r=arguments;if(null==n||!gc.call(n,"css"))return e.createElement.apply(void 0,r);var o=r.length,a=new Array(o);a[0]=wc,a[1]=function(e,t){var n={};for(var r in t)gc.call(t,r)&&(n[r]=t[r]);return n[yc]=e,n}(t,n);for(var i=2;i<o;i++)a[i]=r[i];return e.createElement.apply(null,a)};uc=xc||(xc={}),dc||(dc=uc.JSX||(uc.JSX={}));var Sc=fc(function(t,n){var r=ac([t.styles],void 0,e.useContext(pc)),o=e.useRef();return lc(function(){var e=n.key+"-global",t=new n.sheet.constructor({key:e,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy}),a=!1,i=document.querySelector('style[data-emotion="'+e+" "+r.name+'"]');return n.sheet.tags.length&&(t.before=n.sheet.tags[0]),null!==i&&(a=!0,i.setAttribute("data-emotion",e),t.hydrate([i])),o.current=[t,a],function(){t.flush()}},[n]),lc(function(){var e=o.current,t=e[0];if(e[1])e[1]=!1;else{if(void 0!==r.next&&Ul(n,r.next,!0),t.tags.length){var a=t.tags[t.tags.length-1].nextElementSibling;t.before=a,t.flush()}n.insert("",r,t,!1)}},[n,r.name]),null});function Ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ac(t)}const _c={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},Cc={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",mutedBorder:"hsl(217.2 32.6% 5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:_c.spacing,borderRadius:_c.borderRadius,fontSize:_c.fontSize,fontWeight:_c.fontWeight,shadows:_c.shadows,transitions:_c.transitions},kc=_c,Nc=n(void 0),Mc=({children:e,theme:n})=>{const[r,o]=t.useState(()=>{if(n)return n;return"dark"===localStorage.getItem("theme")?Cc:_c});i(()=>{const e=()=>{const e=localStorage.getItem("theme");o("dark"===e?Cc:_c)};if(window.addEventListener("storage",e),!n){const e=localStorage.getItem("theme");o("dark"===e?Cc:_c)}return()=>{window.removeEventListener("storage",e)}},[n]),i(()=>{n&&o(n)},[n]);const a=t.useMemo(()=>({theme:r,setTheme:o}),[r]);return t.createElement(Nc.Provider,{value:a},t.createElement(mc,{theme:r},e))},Pc=()=>{const e=c(Nc);return void 0===e?{theme:kc,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")}}:e},Oc=()=>{const{theme:e}=Pc();return e},Ac=({id:e,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,style:c={},markerEnd:d,bidirectional:f=!1,data:p,clientToSvgCoords:h,svgRef:m})=>{u(!1);const{theme:g}=Pc(),[y,v,b]=o(()=>No({sourceX:n,sourceY:r,targetX:a,targetY:i}),[n,r,a,i]),w={...c,stroke:(()=>{const e=p?.details?.state;switch(e){case"Open":case"Completed":default:return g.colors.mutedForeground;case"Error":return g.colors.destructive}})(),strokeWidth:c.strokeWidth||2};return t.createElement(t.Fragment,null,t.createElement(oo,{path:y,style:w}))};var Rc=/^((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)-.*))$/,Tc=Pl(function(e){return Rc.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Dc=function(e){return"theme"!==e},$c=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Tc:Dc},Ic=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},zc=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Kl(t,n,r),sc(function(){return Ul(t,n,r)}),null},Lc=function t(n,r){var o,a,i=n.__emotion_real===n,s=i&&n.__emotion_base||n;void 0!==r&&(o=r.label,a=r.target);var l=Ic(n,r,i),c=l||$c(s),u=!c("as");return function(){var d=arguments,f=i&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==o&&f.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{var p=d[0];f.push(p[0]);for(var h=d.length,m=1;m<h;m++)f.push(d[m],p[m])}var g=fc(function(t,n,r){var o=u&&t.as||s,i="",d=[],p=t;if(null==t.theme){for(var h in p={},t)p[h]=t[h];p.theme=e.useContext(pc)}"string"==typeof t.className?i=Xl(n.registered,d,t.className):null!=t.className&&(i=t.className+" ");var m=ac(f.concat(d),n.registered,p);i+=n.key+"-"+m.name,void 0!==a&&(i+=" "+a);var g=u&&void 0===l?$c(o):c,y={};for(var v in t)u&&"as"===v||g(v)&&(y[v]=t[v]);return y.className=i,r&&(y.ref=r),e.createElement(e.Fragment,null,e.createElement(zc,{cache:n,serialized:m,isStringTag:"string"==typeof o}),e.createElement(o,y))});return g.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=n.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=f,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+a}}),g.withComponent=function(e,n){return t(e,Ll({},r,n,{shouldForwardProp:Ic(g,n,!0)})).apply(void 0,f)},g}}.bind(null);function Bc(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Bc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fc(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bc(e))&&(r&&(r+=" "),r+=t);return r}(e)}function Hc(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Wc(e){return null==e?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)}function Vc(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;return`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function jc(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function Yc(e,t,n=""){return e?t:n}function Xc(e,t){return e.spacing[t]||e.spacing.md}function Kc(e,t){return e.colors[t]||e.colors.foreground}["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){Lc[e]=Lc(e)});const Uc=Lc.div`
|
|
15
|
+
var ks={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ns=i(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>d("svg",{ref:l,...ks,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:_s("lucide",o),...!i&&!Cs(s)&&{"aria-hidden":"true"},...s},[...a.map(([e,t])=>d(e,t)),...Array.isArray(i)?i:[i]])),Ms=(e,t)=>{const n=i(({className:n,...r},o)=>{return d(Ns,{ref:o,iconNode:t,className:_s(`lucide-${i=Ss(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var i});return n.displayName=Ss(e),n},As=Ms("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Os=Ms("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ps=Ms("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Rs=Ms("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Ts=Ms("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),$s=Ms("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ds=Ms("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"}]]),Is=Ms("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);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}(),Ls="-ms-",Bs="-moz-",Fs="-webkit-",Hs="comm",Ws="rule",Vs="decl",js="@keyframes",Ys=Math.abs,Xs=String.fromCharCode,Ks=Object.assign;function Us(e){return e.trim()}function qs(e,t,n){return e.replace(t,n)}function Zs(e,t){return e.indexOf(t)}function Gs(e,t){return 0|e.charCodeAt(t)}function Qs(e,t,n){return e.slice(t,n)}function Js(e){return e.length}function el(e){return e.length}function tl(e,t){return t.push(e),e}var nl=1,rl=1,ol=0,il=0,al=0,sl="";function ll(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:nl,column:rl,length:a,return:""}}function cl(e,t){return Ks(ll("",null,null,"",null,null,0),e,{length:-e.length},t)}function ul(){return al=il>0?Gs(sl,--il):0,rl--,10===al&&(rl=1,nl--),al}function dl(){return al=il<ol?Gs(sl,il++):0,rl++,10===al&&(rl=1,nl++),al}function fl(){return Gs(sl,il)}function pl(){return il}function hl(e,t){return Qs(sl,e,t)}function ml(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 gl(e){return nl=rl=1,ol=Js(sl=e),il=0,[]}function yl(e){return sl="",e}function vl(e){return Us(hl(il-1,xl(91===e?e+2:40===e?e+1:e)))}function bl(e){for(;(al=fl())&&al<33;)dl();return ml(e)>2||ml(al)>3?"":" "}function wl(e,t){for(;--t&&dl()&&!(al<48||al>102||al>57&&al<65||al>70&&al<97););return hl(e,pl()+(t<6&&32==fl()&&32==dl()))}function xl(e){for(;dl();)switch(al){case e:return il;case 34:case 39:34!==e&&39!==e&&xl(al);break;case 40:41===e&&xl(e);break;case 92:dl()}return il}function El(e,t){for(;dl()&&e+al!==57&&(e+al!==84||47!==fl()););return"/*"+hl(t,il-1)+"*"+Xs(47===e?e:dl())}function Sl(e){for(;!ml(fl());)dl();return hl(e,il)}function _l(e){return yl(Cl("",null,null,null,[""],e=gl(e),0,[0],e))}function Cl(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=o,x=i,E=r,S=b;g;)switch(h=v,v=dl()){case 40:if(108!=h&&58==Gs(S,d-1)){-1!=Zs(S+=qs(vl(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=vl(v);break;case 9:case 10:case 13:case 32:S+=bl(h);break;case 92:S+=wl(pl()-1,7);continue;case 47:switch(fl()){case 42:case 47:tl(Nl(El(dl(),pl()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=Js(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=qs(S,/\f/g,"")),p>0&&Js(S)-d&&tl(p>32?Ml(S+";",r,n,d-1):Ml(qs(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(tl(E=kl(S,t,n,c,u,o,s,b,w=[],x=[],d),i),123===v)if(0===u)Cl(S,t,E,E,w,i,d,s,x);else switch(99===f&&110===Gs(S,3)?100:f){case 100:case 108:case 109:case 115:Cl(e,E,E,r&&tl(kl(e,E,E,0,0,o,s,b,o,w=[],d),x),o,x,d,s,r?w:x);break;default:Cl(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=a;break;case 58:d=1+Js(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==ul())continue;switch(S+=Xs(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Js(S)-1)*y,y=1;break;case 64:45===fl()&&(S+=vl(dl())),f=fl(),u=d=Js(b=S+=Sl(pl())),v++;break;case 45:45===h&&2==Js(S)&&(m=0)}}return i}function kl(e,t,n,r,o,i,a,s,l,c,u){for(var d=o-1,f=0===o?i:[""],p=el(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=Qs(e,d+1,d=Ys(m=a[h])),b=e;y<p;++y)(b=Us(m>0?f[y]+" "+v:qs(v,/&\f/g,f[y])))&&(l[g++]=b);return ll(e,t,n,0===o?Ws:s,l,c,u)}function Nl(e,t,n){return ll(e,t,n,Hs,Xs(al),Qs(e,2,-2),0)}function Ml(e,t,n,r){return ll(e,t,n,Vs,Qs(e,0,r),Qs(e,r+1,-1),r)}function Al(e,t){for(var n="",r=el(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Ol(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Vs:return e.return=e.return||e.value;case Hs:return"";case js:return e.return=e.value+"{"+Al(e.children,r)+"}";case Ws:e.value=e.props.join(",")}return Js(n=Al(e.children,r))?e.return=e.value+"{"+n+"}":""}var Pl=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}};function Rl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Tl=function(e,t,n){for(var r=0,o=0;r=o,o=fl(),38===r&&12===o&&(t[n]=1),!ml(o);)dl();return hl(e,il)},$l=function(e,t){return yl(function(e,t){var n=-1,r=44;do{switch(ml(r)){case 0:38===r&&12===fl()&&(t[n]=1),e[n]+=Tl(il-1,t,n);break;case 2:e[n]+=vl(r);break;case 4:if(44===r){e[++n]=58===fl()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Xs(r)}}while(r=dl());return e}(gl(e),t))},Dl=new WeakMap,Il=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=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))&&!r){Dl.set(e,!0);for(var o=[],i=$l(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},zl=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ll(e,t){switch(function(e,t){return 45^Gs(e,0)?(((t<<2^Gs(e,0))<<2^Gs(e,1))<<2^Gs(e,2))<<2^Gs(e,3):0}(e,t)){case 5103:return Fs+"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 Fs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Fs+e+Bs+e+Ls+e+e;case 6828:case 4268:return Fs+e+Ls+e+e;case 6165:return Fs+e+Ls+"flex-"+e+e;case 5187:return Fs+e+qs(e,/(\w+).+(:[^]+)/,Fs+"box-$1$2"+Ls+"flex-$1$2")+e;case 5443:return Fs+e+Ls+"flex-item-"+qs(e,/flex-|-self/,"")+e;case 4675:return Fs+e+Ls+"flex-line-pack"+qs(e,/align-content|flex-|-self/,"")+e;case 5548:return Fs+e+Ls+qs(e,"shrink","negative")+e;case 5292:return Fs+e+Ls+qs(e,"basis","preferred-size")+e;case 6060:return Fs+"box-"+qs(e,"-grow","")+Fs+e+Ls+qs(e,"grow","positive")+e;case 4554:return Fs+qs(e,/([^-])(transform)/g,"$1"+Fs+"$2")+e;case 6187:return qs(qs(qs(e,/(zoom-|grab)/,Fs+"$1"),/(image-set)/,Fs+"$1"),e,"")+e;case 5495:case 3959:return qs(e,/(image-set\([^]*)/,Fs+"$1$`$1");case 4968:return qs(qs(e,/(.+:)(flex-)?(.*)/,Fs+"box-pack:$3"+Ls+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Fs+e+e;case 4095:case 3583:case 4068:case 2532:return qs(e,/(.+)-inline(.+)/,Fs+"$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(Js(e)-1-t>6)switch(Gs(e,t+1)){case 109:if(45!==Gs(e,t+4))break;case 102:return qs(e,/(.+:)(.+)-([^]+)/,"$1"+Fs+"$2-$3$1"+Bs+(108==Gs(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Zs(e,"stretch")?Ll(qs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Gs(e,t+1))break;case 6444:switch(Gs(e,Js(e)-3-(~Zs(e,"!important")&&10))){case 107:return qs(e,":",":"+Fs)+e;case 101:return qs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Fs+(45===Gs(e,14)?"inline-":"")+"box$3$1"+Fs+"$2$3$1"+Ls+"$2box$3")+e}break;case 5936:switch(Gs(e,t+11)){case 114:return Fs+e+Ls+qs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Fs+e+Ls+qs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Fs+e+Ls+qs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Fs+e+Ls+e+e}return e}var Bl=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Vs:e.return=Ll(e.value,e.length);break;case js:return Al([cl(e,{value:qs(e.value,"@","@"+Fs)})],r);case Ws: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 Al([cl(e,{props:[qs(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Al([cl(e,{props:[qs(t,/:(plac\w+)/,":"+Fs+"input-$1")]}),cl(e,{props:[qs(t,/:(plac\w+)/,":-moz-$1")]}),cl(e,{props:[qs(t,/:(plac\w+)/,Ls+"input-$1")]})],r)}return""})}}],Fl=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 r,o,i=e.stylisPlugins||Bl,a={},s=[];r=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++)a[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=el(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}([Il,zl].concat(i,u));o=function(e,t,n,r){l=n,Al(_l(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new zs({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return f.sheet.hydrate(s),f};function Hl(){return Hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hl.apply(null,arguments)}var Wl=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)};var Vl={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},jl=/[A-Z]|^ms/g,Yl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Xl=function(e){return 45===e.charCodeAt(1)},Kl=function(e){return null!=e&&"boolean"!=typeof e},Ul=Rl(function(e){return Xl(e)?e:e.replace(jl,"-$&").toLowerCase()}),ql=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Yl,function(e,t,n){return Gl={name:t,styles:n,next:Gl},t})}return 1===Vl[e]||Xl(e)||"number"!=typeof t||0===t?t:t+"px"};function Zl(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return Gl={name:o.name,styles:o.styles,next:Gl},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Gl={name:a.name,styles:a.styles,next:Gl},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Zl(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":Kl(s)&&(r+=Ul(i)+":"+ql(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=Zl(e,t,a);switch(i){case"animation":case"animationName":r+=Ul(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var c=0;c<a.length;c++)Kl(a[c])&&(r+=Ul(i)+":"+ql(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Gl,l=n(e);return Gl=s,Zl(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Gl,Ql=/label:\s*([^\s;{]+)\s*(;|$)/g;var Jl=!!e.useInsertionEffect&&e.useInsertionEffect||function(e){return e()},ec=e.createContext("undefined"!=typeof HTMLElement?Fl({key:"css"}):null);ec.Provider;var tc=e.createContext({}),nc=Pl(function(e){return Pl(function(t){return function(e,t){return"function"==typeof t?t(e):Hl({},e,t)}(e,t)})}),rc=function(t){var n=e.useContext(tc);return t.theme!==n&&(n=nc(n)(t.theme)),e.createElement(tc.Provider,{value:n},t.children)};const oc={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},ic={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",mutedBorder:"hsl(217.2 32.6% 5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:oc.spacing,borderRadius:oc.borderRadius,fontSize:oc.fontSize,fontWeight:oc.fontWeight,shadows:oc.shadows,transitions:oc.transitions},ac=oc,sc=n(void 0),lc=({children:e,theme:n})=>{const[r,o]=t.useState(()=>{if(n)return n;return"dark"===localStorage.getItem("theme")?ic:oc});a(()=>{n&&o(n)},[n]),a(()=>{if(n)return;const e=()=>{const e=localStorage.getItem("theme");o("dark"===e?ic:oc)};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[n]);const i=t.useMemo(()=>({theme:r,setTheme:o}),[r]);return t.createElement(sc.Provider,{value:i},t.createElement(rc,{theme:r},e))},cc=()=>{const e=c(sc);return void 0===e?{theme:oc,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")}}:e},uc=()=>{const{theme:e}=cc();return e},dc=e=>{const{theme:t}=cc();return e||t},fc=({id:e,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:s,targetPosition:l,style:c={},markerEnd:d,bidirectional:f=!1,data:p,clientToSvgCoords:h,svgRef:m})=>{u(!1);const{theme:g}=cc(),y=g.colors,[v,b,w]=o(()=>Ao({sourceX:n,sourceY:r,targetX:i,targetY:a}),[n,r,i,a]),x={...c,stroke:(()=>{const e=p?.details?.state,t=p?.details?.status,n=p?.details?.output;return"Error"===e||"Error"===t||"string"==typeof n&&n.includes("ERROR:")?y.destructive:y.mutedForeground})(),strokeWidth:c.strokeWidth||2};return t.createElement(t.Fragment,null,t.createElement(ao,{path:v,style:x}))};var pc=/^((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)-.*))$/,hc=Rl(function(e){return pc.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),mc=function(e){return"theme"!==e},gc=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?hc:mc},yc=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},vc=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Wl(t,n,r),Jl(function(){return function(e,t,n){Wl(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)}),null},bc=function t(n,r){var o,a,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==r&&(o=r.label,a=r.target);var u=yc(n,r,s),d=u||gc(l),f=!d("as");return function(){var p=arguments,h=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==o&&h.push("label:"+o+";"),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,r){var o,i,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(tc)}"string"==typeof t.className?(o=n.registered,i=g,s=t.className,c="",s.split(" ").forEach(function(e){void 0!==o[e]?i.push(o[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 r=!0,o="";Gl=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Zl(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=Zl(n,t,e[a]),r&&(o+=i[a]);Ql.lastIndex=0;for(var s,l="";null!==(s=Ql.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:Gl}}(h.concat(g),n.registered,y);m+=n.key+"-"+b.name,void 0!==a&&(m+=" "+a);var w=f&&void 0===u?gc(p):d,x={};for(var E in t)f&&"as"===E||w(E)&&(x[E]=t[E]);return x.className=m,r&&(x.ref=r),e.createElement(e.Fragment,null,e.createElement(vc,{cache:n,serialized:b,isStringTag:"string"==typeof p}),e.createElement(p,x))},i(function(e,t){var n=c(ec);return v(e,n,t)}));return b.displayName=void 0!==o?o:"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"."+a}}),b.withComponent=function(e,n){return t(e,Hl({},r,n,{shouldForwardProp:yc(b,n,!0)})).apply(void 0,h)},b}}.bind(null);function wc(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=wc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xc(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wc(e))&&(r&&(r+=" "),r+=t);return r}(e)}function Ec(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Sc(e){if(null==e)return"$0.00";if(Math.abs(e)<.01&&0!==e){const t=e.toString().split(".")[1]?.length||0,n=Math.max(3,Math.min(t,2));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:Math.min(3,n),maximumFractionDigits:n}).format(e)}const t=e.toString().split(".")[1]?.length||0,n=Math.max(2,Math.min(t,2));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:n}).format(e)}function _c(e){if(e<1)return`${Math.round(1e3*e)}ms`;if(e<60)return`${e.toFixed(1)}s`;return`${Math.floor(e/60)}m ${Math.round(e%60/1e3)}s`}function Cc(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function kc(e,t,n=""){return e?t:n}function Nc(e,t){return e.spacing[t]||e.spacing.md}function Mc(e,t){return e.colors[t]||e.colors.foreground}function Ac(e,t,n="#000000"){return e?.colors?.[t]?e.colors[t]:(console.warn(`Theme color '${t}' not found, using fallback: ${n}`),n)}function Oc(e,t,n="1rem"){return e?.spacing?.[t]?e.spacing[t]:(console.warn(`Theme spacing '${t}' not found, using fallback: ${n}`),n)}function Pc(e,t,n){if(!e)return console.warn(`Theme is undefined, using fallback for path: ${t}`),n;const r=t.split(".");let o=e;for(const e of r){if(void 0===o?.[e])return console.warn(`Theme property '${t}' not found, using fallback`),n;o=o[e]}return o}function Rc(e){return e||(console.warn("Theme is undefined, using default light theme"),{colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}})}["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){bc[e]=bc(e)});const Tc=bc.div`
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
`,$c=bc.div`
|
|
19
|
+
position: absolute;
|
|
20
|
+
z-index: 1000;
|
|
21
|
+
padding: 8px 12px;
|
|
22
|
+
background-color: ${({themeColors:e})=>e.popover};
|
|
23
|
+
color: ${({themeColors:e})=>e.popoverForeground};
|
|
24
|
+
border: 1px solid ${({themeColors:e})=>e.border};
|
|
25
|
+
border-radius: 6px;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
line-height: 1.4;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
box-shadow:
|
|
30
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
31
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
32
|
+
opacity: ${({isVisible:e})=>e?1:0};
|
|
33
|
+
visibility: ${({isVisible:e})=>e?"visible":"hidden"};
|
|
34
|
+
transition:
|
|
35
|
+
opacity 0.15s ease-in-out,
|
|
36
|
+
visibility 0.15s ease-in-out;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
|
|
39
|
+
/* Arrow */
|
|
40
|
+
&::before {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
width: 0;
|
|
44
|
+
height: 0;
|
|
45
|
+
border: 4px solid transparent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Placement-specific positioning and arrow */
|
|
49
|
+
${({placement:e,themeColors:t})=>{switch(e){case"top":default:return`\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 8px;\n &::before {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-top-color: ${t.popover};\n }\n `;case"bottom":return`\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: 8px;\n &::before {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-bottom-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-bottom-color: ${t.popover};\n }\n `;case"left":return`\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: 8px;\n &::before {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-left-color: ${t.popover};\n }\n `;case"right":return`\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: 8px;\n &::before {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-right-color: ${t.popover};\n }\n `;case"topLeft":return`\n bottom: 100%;\n right: 0;\n margin-bottom: 8px;\n &::before {\n top: 100%;\n right: 8px;\n border-top-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n top: 100%;\n right: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-top-color: ${t.popover};\n }\n `;case"topRight":return`\n bottom: 100%;\n left: 0;\n margin-bottom: 8px;\n &::before {\n top: 100%;\n left: 8px;\n border-top-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n top: 100%;\n left: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-top-color: ${t.popover};\n }\n `;case"bottomLeft":return`\n top: 100%;\n right: 0;\n margin-top: 8px;\n &::before {\n bottom: 100%;\n right: 8px;\n border-bottom-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n bottom: 100%;\n right: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-bottom-color: ${t.popover};\n }\n `;case"bottomRight":return`\n top: 100%;\n left: 0;\n margin-top: 8px;\n &::before {\n bottom: 100%;\n left: 8px;\n border-bottom-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-bottom-color: ${t.popover};\n }\n `;case"leftTop":return`\n right: 100%;\n bottom: 0;\n margin-right: 8px;\n &::before {\n left: 100%;\n bottom: 8px;\n border-left-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n left: 100%;\n bottom: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-left-color: ${t.popover};\n }\n `;case"leftBottom":return`\n right: 100%;\n top: 0;\n margin-right: 8px;\n &::before {\n left: 100%;\n top: 8px;\n border-left-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n left: 100%;\n top: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-left-color: ${t.popover};\n }\n `;case"rightTop":return`\n left: 100%;\n bottom: 0;\n margin-left: 8px;\n &::before {\n right: 100%;\n bottom: 8px;\n border-right-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n right: 100%;\n bottom: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-right-color: ${t.popover};\n }\n `;case"rightBottom":return`\n left: 100%;\n top: 0;\n margin-left: 8px;\n &::before {\n right: 100%;\n top: 8px;\n border-right-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n right: 100%;\n top: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-right-color: ${t.popover};\n }\n `}}}
|
|
50
|
+
`,Dc=({children:t,content:n,placement:r="top",delay:o=300})=>{const{theme:i}=cc(),[a,s]=e.useState(!1),l=e.useRef(),c=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(!0)},o)},u=()=>{l.current&&clearTimeout(l.current),s(!1)};return e.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),e.createElement(Tc,{onMouseEnter:c,onMouseLeave:u,onFocus:c,onBlur:u},t,e.createElement($c,{isVisible:a,placement:r,themeColors:i.colors,role:"tooltip"},n))},Ic=bc.div`
|
|
16
51
|
display: inline-flex;
|
|
17
52
|
align-items: center;
|
|
18
53
|
border-radius: 9999px;
|
|
@@ -28,10 +63,47 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
28
63
|
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
|
|
29
64
|
}
|
|
30
65
|
|
|
31
|
-
${({variant:e,
|
|
32
|
-
|
|
66
|
+
${({variant:e,themeColors:t})=>{switch(e){case"default":default:return`\n background-color: ${t.primary};\n color: ${t.primaryForeground};\n &:hover {\n background-color: ${t.primary};\n opacity: 0.9;\n }\n `;case"secondary":case"cost":case"gray":case"latency":case"latencyLow":case"latencyMedium":return`\n background-color: ${t.secondary};\n color: ${t.secondaryForeground};\n &:hover {\n background-color: ${t.muted};\n }\n `;case"destructive":case"latencyHigh":return`\n background-color: ${t.destructive};\n color: ${t.destructiveForeground};\n &:hover {\n background-color: ${t.destructive};\n opacity: 0.9;\n }\n `;case"outline":return`\n background-color: transparent;\n color: ${t.cardForeground};\n border-color: ${t.border};\n `}}}
|
|
67
|
+
`,zc=({variant:t="default",children:n,title:r,placement:o="top"})=>{const{theme:i}=cc(),a=i.colors,s=e.createElement(Ic,{variant:t,themeColors:a},n);return r?e.createElement(Dc,{content:r,placement:o},s):s},Lc=({label:e,content:n,isExpanded:r,onToggle:o})=>{const{theme:i}=cc(),a=i?.colors||{muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",border:"hsl(214.3 31.8% 91.4%)",foreground:"hsl(222.2 84% 4.9%)"},s=r?n:n?.slice(0,100)+(n?.length>100?"...":"");return t.createElement(Bc,null,t.createElement(Fc,{onClick:o,onMouseEnter:e=>{e.currentTarget.style.backgroundColor=a.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},t.createElement(Hc,{style:{color:a.mutedForeground}},e),t.createElement(Vc,null,r?t.createElement(Os,{style:{width:"12px",height:"12px",color:a.mutedForeground}}):t.createElement(Ps,{style:{width:"12px",height:"12px",color:a.mutedForeground}}))),t.createElement(Wc,{value:s||"",readOnly:!0,rows:r?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2,style:{border:`1px solid ${a.border}`,backgroundColor:a.muted,color:a.foreground}}))},Bc=bc.div`
|
|
68
|
+
width: 100%;
|
|
69
|
+
`,Fc=bc.div`
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
align-items: center;
|
|
73
|
+
padding: 0.25rem 0;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
user-select: none;
|
|
76
|
+
border-radius: 0.25rem;
|
|
77
|
+
padding-left: 0.25rem;
|
|
78
|
+
padding-right: 0.25rem;
|
|
79
|
+
|
|
80
|
+
&:hover {
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
`,Hc=bc.span`
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
font-size: 0.75rem;
|
|
86
|
+
`,Wc=bc.textarea`
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
width: 100%;
|
|
89
|
+
border-radius: 0.25rem;
|
|
90
|
+
padding: 0.5rem;
|
|
91
|
+
resize: none;
|
|
92
|
+
min-height: 40px;
|
|
93
|
+
font-family: inherit;
|
|
94
|
+
|
|
95
|
+
&:focus {
|
|
96
|
+
outline: none;
|
|
97
|
+
border-color: ${e=>e.theme?.colors?.primary||"hsl(221.2 83.2% 53.3%)"};
|
|
98
|
+
box-shadow: 0 0 0 1px ${e=>e.theme?.colors?.primary||"hsl(221.2 83.2% 53.3%)"};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
transition: all 0.2s ease-in-out;
|
|
102
|
+
`,Vc=bc.div`
|
|
103
|
+
transition: transform 0.2s ease-in-out;
|
|
104
|
+
`,jc=bc.div`
|
|
33
105
|
user-select: none;
|
|
34
|
-
`,
|
|
106
|
+
`,Yc=bc.div`
|
|
35
107
|
display: flex;
|
|
36
108
|
align-items: center;
|
|
37
109
|
gap: 0.25rem;
|
|
@@ -41,180 +113,387 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
41
113
|
transition: background-color 0.15s ease-in-out;
|
|
42
114
|
|
|
43
115
|
&:hover {
|
|
44
|
-
background-color: ${e=>e.isExpandable?e.
|
|
116
|
+
background-color: ${e=>e.isExpandable?e.themeColors.muted:"transparent"};
|
|
45
117
|
}
|
|
46
|
-
`,
|
|
118
|
+
`,Xc=bc.div`
|
|
47
119
|
width: 0.5rem;
|
|
48
120
|
height: 0.5rem;
|
|
49
121
|
flex-shrink: 0;
|
|
50
122
|
display: flex;
|
|
51
123
|
align-items: center;
|
|
52
124
|
justify-content: center;
|
|
53
|
-
color: ${e=>e.
|
|
54
|
-
`,
|
|
125
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
126
|
+
`,Kc=bc.span`
|
|
55
127
|
font-weight: 500;
|
|
56
|
-
color: ${e=>e.
|
|
128
|
+
color: ${e=>e.themeColors.foreground};
|
|
57
129
|
font-size: 0.75rem;
|
|
58
|
-
`,
|
|
130
|
+
`,Uc=bc.span`
|
|
59
131
|
font-size: 0.75rem;
|
|
60
|
-
color: ${e=>e.
|
|
61
|
-
`,
|
|
132
|
+
color: ${e=>e.themeColors.primary};
|
|
133
|
+
`,qc=bc.span`
|
|
62
134
|
font-size: 0.75rem;
|
|
63
|
-
color: ${e=>e.
|
|
64
|
-
`,
|
|
65
|
-
border-left: 1px solid ${e=>e.
|
|
135
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
136
|
+
`,Zc=bc.div`
|
|
137
|
+
border-left: 1px solid ${e=>e.themeColors.border};
|
|
66
138
|
margin-left: 0.5rem;
|
|
67
|
-
`,
|
|
139
|
+
`,Gc=bc.div`
|
|
68
140
|
width: 100%;
|
|
69
|
-
background-color: ${e=>e.
|
|
141
|
+
background-color: ${e=>e.themeColors.muted};
|
|
70
142
|
border-radius: 0.5rem;
|
|
71
|
-
border: 1px solid ${e=>e.
|
|
143
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
72
144
|
overflow: hidden;
|
|
73
|
-
`,
|
|
145
|
+
`,Qc=bc.div`
|
|
74
146
|
width: 100%;
|
|
75
147
|
max-height: 16rem;
|
|
76
148
|
overflow-y: auto;
|
|
77
149
|
padding: 0.5rem;
|
|
78
|
-
`,
|
|
150
|
+
`,Jc=bc.div`
|
|
79
151
|
width: 100%;
|
|
80
152
|
padding: 1rem;
|
|
81
153
|
text-align: center;
|
|
82
|
-
color: ${e=>e.
|
|
154
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
83
155
|
font-size: 0.875rem;
|
|
84
|
-
background-color: ${e=>e.
|
|
156
|
+
background-color: ${e=>e.themeColors.muted};
|
|
85
157
|
border-radius: 0.5rem;
|
|
86
|
-
border: 1px solid ${e=>e.
|
|
87
|
-
`,
|
|
158
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
159
|
+
`,eu=bc.div`
|
|
88
160
|
width: 100%;
|
|
89
161
|
padding: 0.5rem;
|
|
90
|
-
background-color: ${e=>e.
|
|
162
|
+
background-color: ${e=>e.themeColors.muted};
|
|
91
163
|
border-radius: 0.5rem;
|
|
92
|
-
border: 1px solid ${e=>e.
|
|
93
|
-
|
|
164
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
165
|
+
font-size: 0.75rem;
|
|
166
|
+
color: ${e=>e.themeColors.foreground};
|
|
167
|
+
word-break: break-all;
|
|
168
|
+
`;bc.div`
|
|
169
|
+
width: 100%;
|
|
170
|
+
padding: 1rem;
|
|
171
|
+
text-align: center;
|
|
172
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
173
|
+
font-size: 0.875rem;
|
|
174
|
+
background-color: ${e=>e.themeColors.muted};
|
|
175
|
+
border-radius: 0.5rem;
|
|
176
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
177
|
+
margin-bottom: 0.5rem;
|
|
178
|
+
`;const tu=bc.span`
|
|
94
179
|
font-weight: 500;
|
|
95
|
-
color: ${e=>e.
|
|
180
|
+
color: ${e=>e.themeColors.cardForeground};
|
|
96
181
|
font-size: 0.875rem;
|
|
97
|
-
`,
|
|
98
|
-
color: ${e=>e.
|
|
182
|
+
`,nu=bc.span`
|
|
183
|
+
color: ${e=>e.themeColors.foreground};
|
|
99
184
|
font-size: 0.875rem;
|
|
100
|
-
`,
|
|
185
|
+
`,ru=bc.div`
|
|
101
186
|
width: 100%;
|
|
102
187
|
padding: 1rem;
|
|
103
188
|
text-align: center;
|
|
104
|
-
color: ${e=>e.
|
|
189
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
105
190
|
font-size: 0.875rem;
|
|
106
|
-
background-color: ${e=>e.
|
|
191
|
+
background-color: ${e=>e.themeColors.muted};
|
|
107
192
|
border-radius: 0.5rem;
|
|
108
|
-
border: 1px solid ${e=>e.
|
|
109
|
-
`,
|
|
110
|
-
color: ${e=>e.
|
|
111
|
-
`,
|
|
112
|
-
|
|
193
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
194
|
+
`,ou=bc.span`
|
|
195
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
196
|
+
`,iu=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const r=t.indexOf(e),o=t.indexOf(n);return-1!==r&&-1!==o?r-o:-1!==r?-1:-1!==o?1:e.localeCompare(n)}),au=({data:e,label:n,depth:r,maxDepth:o,path:i,priorityKeys:a})=>{const[s,l]=u(!1),{theme:c}=cc(),d=c.colors,f=null!==e&&"object"==typeof e&&!Array.isArray(e),p=Array.isArray(e),h=(f||p)&&r<o,m=h&&Object.keys(e).length>0;return t.createElement(jc,null,t.createElement(Yc,{isExpandable:h,themeColors:d,onClick:()=>{h&&l(!s)},style:{paddingLeft:12*r+8+"px"}},t.createElement(Xc,{themeColors:d},h&&m?s?t.createElement(Os,{size:12}):t.createElement(Ps,{size:12}):t.createElement("div",{style:{width:"12px",height:"12px"}})),t.createElement(Kc,{themeColors:d},n,":"),!h&&t.createElement(Uc,{valueType:(g=e,null===g?"null":void 0===g?"undefined":typeof g),themeColors:d},(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)),h&&!m&&t.createElement(qc,{themeColors:d},p?"[]":"{}"),h&&m&&!s&&t.createElement(qc,{themeColors:d},p?`[${Object.keys(e).length} items]`:`{${Object.keys(e).length} keys}`)),s&&m&&t.createElement(Zc,{themeColors:d},iu(e,a).map(([e,n])=>t.createElement(au,{key:`${i}.${e}`,data:n,label:e,depth:r+1,maxDepth:o,path:`${i}.${e}`,priorityKeys:a}))));var g},su=({data:e,maxDepth:n=4,initialExpanded:r=!1,className:o="",priorityKeys:i=["input","output"]})=>{const{theme:a}=cc(),s=a.colors;return null==e?t.createElement(Jc,{themeColors:s,className:o},"No data available"):"object"!=typeof e?t.createElement(eu,{themeColors:s,className:o},t.createElement(tu,{themeColors:s},"Value:")," ",t.createElement(nu,{themeColors:s},String(e))):0===Object.keys(e).length?t.createElement(ru,{themeColors:s,className:o},t.createElement(ou,{themeColors:s},Array.isArray(e)?"Empty array":"Empty object")):t.createElement(Gc,{themeColors:s,className:o},t.createElement(Qc,null,iu(e,i).map(([e,r])=>t.createElement(au,{key:e,data:r,label:e,depth:0,maxDepth:n,path:e,priorityKeys:i}))))},lu=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n,display:"block"},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"})),cu=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n},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"})),uu=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n},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"})),du=({isVisible:e,onClose:n,nodeData:r,triggerRef:o})=>{const{theme:i}=cc(),[s,l]=u({top:0,left:0,arrowPosition:"right"});if(a(()=>{if(e&&o.current){const e=o.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=400,i=600,a=12;if(e.width>0&&e.height>0&&e.top>=0&&e.left>=0){let o=e.right+a,s=e.top,c="right";o+r>t&&(o=e.left-r-a,c="left"),s<0?s=20:s+i>n&&(s=n-i-20),l({top:s,left:o,arrowPosition:c})}else{const e=Math.max(20,(t-r)/2),o=Math.max(20,(n-i)/2);l({top:o,left:e,arrowPosition:"none"})}}},[e,o]),a(()=>{const t=e=>{"Escape"===e.key&&n()};if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,n]),a(()=>{const t=t=>{e&&o.current&&!o.current.contains(t.target)&&!t.target.closest("[data-popover-content]")&&n()};if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e,n,o]),!e)return null;const c=r.details?.internals?.llm_details?.[0],d=r.details?.internals?.latency;console.log(r);const f=t.createElement(fu,{style:{top:s.top,left:s.left}},t.createElement(pu,{"data-popover-content":!0,$arrowPosition:s.arrowPosition},t.createElement(hu,null,t.createElement(mu,null,t.createElement(Nu,null,((e,n)=>{if("tool"===e)return"🔧";if("coordinator"===e)return"🎯";if("agent"===e){if("OpenAI"===n)return t.createElement(lu,null);if("Anthropic"===n)return t.createElement(uu,null);if("Google"===n||"Vertex_AI"===n)return t.createElement(cu,null)}return"🤖"})(r.nodeType||"Agent",c?.model_provider)),t.createElement("span",null,r.label||"Agent Node")),t.createElement(gu,{onClick:n},t.createElement(Is,{size:16}))),t.createElement(yu,null,t.createElement(vu,null,t.createElement(bu,null,"🔍 Node Information"),t.createElement(wu,null,t.createElement(xu,null,t.createElement(Eu,null,"Type:"),t.createElement(Su,null,r.nodeType)),t.createElement(xu,null,t.createElement(Eu,null,"ID:"),t.createElement(Su,null,r.id||"N/A")))),c&&t.createElement(vu,null,t.createElement(bu,null,"🤖 LLM Details"),t.createElement(wu,null,t.createElement(xu,null,t.createElement(Eu,null,"Model:"),t.createElement(Su,null,c.model_name)),t.createElement(xu,null,t.createElement(Eu,null,"Provider:"),t.createElement(Su,null,c.model_provider)),t.createElement(xu,null,t.createElement(Eu,null,"Input Tokens:"),t.createElement(Su,null,c.input_tokens?t.createElement(g,{end:c.input_tokens,duration:1.2,separator:",",useEasing:!0}):"N/A")),t.createElement(xu,null,t.createElement(Eu,null,"Output Tokens:"),t.createElement(Su,null,c.output_tokens?t.createElement(g,{end:c.output_tokens,duration:1.2,separator:",",useEasing:!0}):"N/A")),t.createElement(xu,null,t.createElement(Eu,null,"Total Cost:"),t.createElement(Su,null,Sc(c.total_cost))),c.system_fingerprint&&t.createElement(xu,null,t.createElement(Eu,null,"System Fingerprint:"),t.createElement(Su,null,c.system_fingerprint)))),d&&t.createElement(vu,null,t.createElement(bu,null,"🚀 Performance"),t.createElement(wu,null,t.createElement(xu,null,t.createElement(Eu,null,"Total Time:"),t.createElement(Su,null,_c(d.total_time))))),c?.input&&c.input.length>0&&t.createElement(vu,null,t.createElement(bu,null,"Input Messages"),c.input.map((e,n)=>t.createElement(_u,{key:n},t.createElement(Cu,null,"system"===e.role?"System Message":"User Message"),t.createElement(ku,null,"object"==typeof e.content?JSON.stringify(e.content,null,2):String(e.content))))),c?.output&&t.createElement(vu,null,t.createElement(bu,null,"Output"),t.createElement(ku,null,Array.isArray(c.output.content)?c.output.content.map((e,n)=>t.createElement("div",{key:n},"object"==typeof e?JSON.stringify(e,null,2):String(e))):"object"==typeof c.output.content?JSON.stringify(c.output.content,null,2):String(c.output.content))),t.createElement(vu,null,t.createElement(bu,null,"Raw Data"),t.createElement(su,{data:r.details||{}})))));return m(f,document.body)},fu=bc.div`
|
|
197
|
+
position: fixed;
|
|
198
|
+
z-index: 99999;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
`,pu=bc.div`
|
|
201
|
+
width: 400px;
|
|
202
|
+
max-height: 600px;
|
|
203
|
+
background-color: ${e=>e.theme?.colors?.background||"hsl(0 0% 100%)"};
|
|
204
|
+
border: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
113
205
|
border-radius: 0.5rem;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
206
|
+
box-shadow:
|
|
207
|
+
0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
208
|
+
0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
209
|
+
z-index: 99999;
|
|
210
|
+
pointer-events: auto;
|
|
211
|
+
animation: popoverSlideIn 200ms ease-out;
|
|
212
|
+
|
|
213
|
+
@keyframes popoverSlideIn {
|
|
214
|
+
from {
|
|
215
|
+
transform: translateX(-10px);
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
to {
|
|
219
|
+
transform: translateX(0);
|
|
220
|
+
opacity: 1;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Arrow pointing to the node - only show when not in fallback mode */
|
|
225
|
+
${e=>"none"!==e.$arrowPosition&&`\n &::before {\n content: "";\n position: absolute;\n top: 20px;\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n ${"right"===e.$arrowPosition?`\n left: -6px;\n border-right: 6px solid ${e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};\n `:`\n right: -6px;\n border-left: 6px solid ${e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};\n `}\n }\n\n &::after {\n content: "";\n position: absolute;\n top: 20px;\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n ${"right"===e.$arrowPosition?`\n left: -5px;\n border-right: 6px solid ${e.theme?.colors?.background||"hsl(0 0% 100%)"};\n `:`\n right: -5px;\n border-left: 6px solid ${e.theme?.colors?.background||"hsl(0 0% 100%)"};\n `}\n }\n `}
|
|
226
|
+
|
|
227
|
+
@media (max-width: 768px) {
|
|
228
|
+
width: 300px;
|
|
229
|
+
}
|
|
230
|
+
`,hu=bc.div`
|
|
231
|
+
display: flex;
|
|
232
|
+
justify-content: space-between;
|
|
233
|
+
align-items: center;
|
|
234
|
+
padding: 0.75rem 1rem;
|
|
235
|
+
border-bottom: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
236
|
+
background-color: ${e=>e.theme?.colors?.card||"hsl(0 0% 100%)"};
|
|
237
|
+
border-radius: 0.5rem 0.5rem 0 0;
|
|
238
|
+
`,mu=bc.div`
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: 0.5rem;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
font-size: 0.875rem;
|
|
244
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
245
|
+
`,gu=bc.button`
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
width: 24px;
|
|
250
|
+
height: 24px;
|
|
251
|
+
border: none;
|
|
252
|
+
border-radius: 0.25rem;
|
|
253
|
+
background-color: transparent;
|
|
254
|
+
color: ${e=>e.theme?.colors?.mutedForeground||"hsl(215.4 16.3% 46.9%)"};
|
|
255
|
+
cursor: pointer;
|
|
256
|
+
transition: all 0.2s ease-in-out;
|
|
257
|
+
|
|
258
|
+
&:hover {
|
|
259
|
+
background-color: ${e=>e.theme?.colors?.muted||"hsl(210 40% 96%)"};
|
|
260
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&:focus {
|
|
264
|
+
outline: 2px solid ${e=>e.theme?.colors?.primary||"hsl(221.2 83.2% 53.3%)"};
|
|
265
|
+
outline-offset: 2px;
|
|
266
|
+
}
|
|
267
|
+
`,yu=bc.div`
|
|
268
|
+
max-height: 500px;
|
|
269
|
+
overflow-y: auto;
|
|
270
|
+
padding: 1rem;
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: column;
|
|
273
|
+
gap: 1rem;
|
|
274
|
+
`,vu=bc.div`
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-direction: column;
|
|
277
|
+
gap: 0.75rem;
|
|
278
|
+
`,bu=bc.h3`
|
|
279
|
+
font-size: 1rem;
|
|
280
|
+
font-weight: 600;
|
|
281
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
282
|
+
margin: 0;
|
|
283
|
+
padding-bottom: 0.5rem;
|
|
284
|
+
border-bottom: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
285
|
+
`,wu=bc.div`
|
|
286
|
+
display: grid;
|
|
287
|
+
grid-template-columns: 1fr 1fr;
|
|
288
|
+
gap: 0.75rem;
|
|
289
|
+
`,xu=bc.div`
|
|
290
|
+
display: flex;
|
|
291
|
+
flex-direction: column;
|
|
292
|
+
gap: 0.25rem;
|
|
293
|
+
`,Eu=bc.span`
|
|
294
|
+
font-size: 0.875rem;
|
|
295
|
+
font-weight: 500;
|
|
296
|
+
color: ${e=>e.theme?.colors?.mutedForeground||"hsl(215.4 16.3% 46.9%)"};
|
|
297
|
+
`,Su=bc.span`
|
|
298
|
+
font-size: 0.875rem;
|
|
299
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
300
|
+
word-break: break-word;
|
|
301
|
+
`,_u=bc.div`
|
|
302
|
+
display: flex;
|
|
303
|
+
flex-direction: column;
|
|
304
|
+
gap: 0.5rem;
|
|
305
|
+
padding: 0.75rem;
|
|
306
|
+
background-color: ${e=>e.theme?.colors?.muted||"hsl(210 40% 96%)"};
|
|
307
|
+
border-radius: 0.375rem;
|
|
308
|
+
border: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
309
|
+
`,Cu=bc.span`
|
|
310
|
+
font-size: 0.875rem;
|
|
311
|
+
font-weight: 600;
|
|
312
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
313
|
+
`,ku=bc.div`
|
|
314
|
+
font-size: 0.875rem;
|
|
315
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
316
|
+
line-height: 1.5;
|
|
317
|
+
white-space: pre-wrap;
|
|
318
|
+
word-break: break-word;
|
|
319
|
+
max-height: 200px;
|
|
320
|
+
overflow-y: auto;
|
|
321
|
+
`,Nu=bc.div`
|
|
322
|
+
font-size: 1.25rem;
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: center;
|
|
326
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
327
|
+
`,Mu=({data:e,id:n,onInspect:r})=>{const{theme:o}=cc(),i=o?.colors||{primary:"hsl(221.2 83.2% 53.3%)",background:"hsl(0 0% 100%)"},[a,s]=u(!1),[c,d]=u(!1),[f,p]=u(!1),h=l(null),m=e.edges?.some(e=>e.source===n)||!1,g=e.edges?.some(e=>e.target===n)||!1,y=e.label||Ec("Agent")||"Agent",v=e.details?.internals?.llm_details?.[0]?.model_provider,b=(e=>"OpenAI"===e?t.createElement(lu,null):"Anthropic"===e?t.createElement(uu,null):"Google"===e||"Vertex_AI"===e?t.createElement(cu,null):"🤖")(v),w=e.details?.internals?.llm_details?.[0]?.model_name||"Unknown",x=Sc(e.details?.internals?.llm_details?.[0]?.total_cost),E=e.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",S=e.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"";return t.createElement(t.Fragment,null,t.createElement(Au,{ref:h,onClick:()=>{p(!0),r&&r(e)}},g&&t.createElement(ti,{type:"target",position:go.Top,style:{width:"8px",height:"8px",border:`2px solid ${i.primary}`,backgroundColor:i.background,cursor:"default"},isConnectable:!1}),t.createElement(Ou,null,t.createElement(Pu,null,t.createElement(Ru,null,b),t.createElement(Tu,null,y)),t.createElement($u,null,t.createElement(zc,{variant:"gray",title:w},w),t.createElement(zc,{variant:"cost",title:e.details?.internals?.llm_details?.[0]?.total_cost?.toString()||""},x))),t.createElement(Du,null,t.createElement(Lc,{label:"System Message",content:E,isExpanded:a,onToggle:e=>{e?.stopPropagation(),s(!a)}}),t.createElement(Lc,{label:"User Message",content:S,isExpanded:c,onToggle:e=>{e?.stopPropagation(),d(!c)}})),m&&t.createElement(ti,{type:"source",position:go.Bottom,style:{width:"8px",height:"8px",border:`2px solid ${i.primary}`,backgroundColor:i.background,cursor:"default"},isConnectable:!1})),t.createElement(du,{isVisible:f,onClose:()=>{p(!1)},nodeData:{...e,id:n},triggerRef:h}))},Au=bc.div`
|
|
328
|
+
border-radius: 0.5rem;
|
|
329
|
+
background-color: ${e=>e.theme?.colors?.card||"hsl(0 0% 100%)"};
|
|
330
|
+
border: 2px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
331
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
117
332
|
min-width: 300px;
|
|
118
|
-
max-width: 500px;
|
|
119
333
|
transition: all 0.2s ease-in-out;
|
|
120
334
|
position: relative;
|
|
121
335
|
cursor: pointer;
|
|
122
336
|
|
|
123
337
|
&:hover {
|
|
124
|
-
border-color: ${e=>e.theme
|
|
125
|
-
box-shadow:
|
|
338
|
+
border-color: ${e=>e.theme?.colors?.primary||"hsl(221.2 83.2% 53.3%)"};
|
|
339
|
+
box-shadow:
|
|
340
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
341
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
126
342
|
}
|
|
127
|
-
`,
|
|
343
|
+
`,Ou=bc.div`
|
|
128
344
|
display: flex;
|
|
129
345
|
justify-content: space-between;
|
|
130
346
|
align-items: center;
|
|
131
347
|
gap: 0.5rem;
|
|
132
348
|
padding: 0.75rem;
|
|
133
|
-
border-bottom: 1px solid ${e=>e.theme
|
|
134
|
-
`,
|
|
349
|
+
border-bottom: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
350
|
+
`,Pu=bc.div`
|
|
135
351
|
display: flex;
|
|
136
352
|
align-items: center;
|
|
137
353
|
gap: 0.5rem;
|
|
138
|
-
`,
|
|
354
|
+
`,Ru=bc.div`
|
|
139
355
|
font-size: 1.25rem;
|
|
140
356
|
display: flex;
|
|
141
357
|
align-items: center;
|
|
142
358
|
justify-content: center;
|
|
143
|
-
|
|
359
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
360
|
+
`,Tu=bc.div`
|
|
144
361
|
font-weight: 600;
|
|
145
|
-
color: ${e=>e.theme
|
|
362
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
146
363
|
font-size: 0.875rem;
|
|
147
364
|
word-break: break-words;
|
|
148
|
-
|
|
365
|
+
`,$u=bc.div`
|
|
149
366
|
display: flex;
|
|
150
367
|
gap: 0.5rem;
|
|
151
368
|
justify-content: flex-end;
|
|
152
369
|
align-items: center;
|
|
153
|
-
`,
|
|
370
|
+
`,Du=bc.div`
|
|
154
371
|
padding: 0.75rem;
|
|
155
372
|
display: flex;
|
|
156
373
|
flex-direction: column;
|
|
157
374
|
align-items: flex-start;
|
|
158
375
|
justify-content: center;
|
|
159
376
|
gap: 0.5rem;
|
|
160
|
-
`,
|
|
161
|
-
|
|
162
|
-
|
|
377
|
+
`,Iu=({data:e,id:n,onInspect:r})=>{const{theme:o}=cc(),i=o?.colors||{primary:"hsl(221.2 83.2% 53.3%)",background:"hsl(0 0% 100%)"},a=e.edges?.some(e=>e.source===n)||!1,s=e.edges?.some(e=>e.target===n)||!1,l=e.label||Ec("Coordinator")||"Coordinator";return t.createElement(zu,{onClick:()=>{console.log("Coordinator node clicked:",{label:e.label,nodeType:e.nodeType,details:e.details})}},s&&t.createElement(ti,{type:"target",position:go.Top,style:{width:"8px",height:"8px",border:`2px solid ${i.primary}`,backgroundColor:i.background,cursor:"default"},isConnectable:!1}),t.createElement(Lu,null,t.createElement(Bu,null,t.createElement(Fu,null,"🎯"),t.createElement(Hu,null,l)),t.createElement(Wu,null,t.createElement(zc,{variant:"gray"},"Coordinator"))),t.createElement(Vu,null,t.createElement(su,{data:e.details?.internals||{}})),a&&t.createElement(ti,{type:"source",position:go.Bottom,style:{width:"8px",height:"8px",border:`2px solid ${i.primary}`,backgroundColor:i.background,cursor:"default"},isConnectable:!1}))},zu=bc.div`
|
|
378
|
+
border-radius: 0.5rem;
|
|
379
|
+
background-color: ${e=>e.theme?.colors?.card||"hsl(0 0% 100%)"};
|
|
380
|
+
border: 2px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
381
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
382
|
+
min-width: 300px;
|
|
383
|
+
transition: all 0.2s ease-in-out;
|
|
384
|
+
position: relative;
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
|
|
387
|
+
&:hover {
|
|
388
|
+
border-color: ${e=>e.theme?.colors?.primary||"hsl(221.2 83.2% 53.3%)"};
|
|
389
|
+
box-shadow:
|
|
390
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
391
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
392
|
+
}
|
|
393
|
+
`,Lu=bc.div`
|
|
163
394
|
display: flex;
|
|
164
395
|
justify-content: space-between;
|
|
165
396
|
align-items: center;
|
|
166
|
-
|
|
397
|
+
gap: 0.5rem;
|
|
398
|
+
padding: 0.75rem;
|
|
399
|
+
border-bottom: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
400
|
+
`,Bu=bc.div`
|
|
401
|
+
display: flex;
|
|
402
|
+
align-items: center;
|
|
403
|
+
gap: 0.5rem;
|
|
404
|
+
`,Fu=bc.div`
|
|
405
|
+
font-size: 1.25rem;
|
|
406
|
+
display: flex;
|
|
407
|
+
align-items: center;
|
|
408
|
+
justify-content: center;
|
|
409
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
410
|
+
`,Hu=bc.div`
|
|
411
|
+
font-weight: 600;
|
|
412
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
413
|
+
font-size: 0.875rem;
|
|
414
|
+
word-break: break-words;
|
|
415
|
+
`,Wu=bc.div`
|
|
416
|
+
display: flex;
|
|
417
|
+
gap: 0.5rem;
|
|
418
|
+
justify-content: flex-end;
|
|
419
|
+
align-items: center;
|
|
420
|
+
`,Vu=bc.div`
|
|
421
|
+
padding: 0.75rem;
|
|
422
|
+
display: flex;
|
|
423
|
+
flex-direction: column;
|
|
424
|
+
align-items: flex-start;
|
|
425
|
+
justify-content: center;
|
|
426
|
+
gap: 0.5rem;
|
|
427
|
+
`,ju=({data:e,id:n,onInspect:r})=>{const{theme:o}=cc(),i=o?.colors||{primary:"hsl(221.2 83.2% 53.3%)",background:"hsl(0 0% 100%)"},a=e.edges?.some(e=>e.source===n)||!1,s=e.edges?.some(e=>e.target===n)||!1,l=e.label||Ec("Tool")||"Tool",c=e.details?.internals?.latency?.total_time;return t.createElement(Yu,{onClick:()=>{console.log("Tool node clicked:",{label:e.label,nodeType:e.nodeType,details:e.details})}},s&&t.createElement(ti,{type:"target",position:go.Top,style:{width:"8px",height:"8px",border:`2px solid ${i.primary}`,backgroundColor:i.background,cursor:"default"},isConnectable:!1}),t.createElement(Xu,null,t.createElement(Ku,null,t.createElement(Uu,null,"🔧"),t.createElement(qu,null,l)),null!=c&&t.createElement(Zu,null,t.createElement(zc,{variant:"latency"},_c(c)))),t.createElement(Gu,null,t.createElement(su,{data:(()=>{const t=e.details?.internals||{};return e.edgeDetails&&e.edgeDetails.length>0?{...t,input:{args:e.edgeDetails[0]?.input_args,kwargs:e.edgeDetails[0]?.input_kwargs},output:e.edgeDetails[0]?.output,state:e.edgeDetails[0]?.state,status:e.edgeDetails[0]?.status}:t})()})),a&&t.createElement(ti,{type:"source",position:go.Bottom,style:{width:"8px",height:"8px",border:`2px solid ${i.primary}`,backgroundColor:i.background,cursor:"default"},isConnectable:!1}))},Yu=bc.div`
|
|
428
|
+
border-radius: 0.5rem;
|
|
429
|
+
background-color: ${e=>e.theme?.colors?.card||"hsl(0 0% 100%)"};
|
|
430
|
+
border: 2px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
431
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
432
|
+
min-width: 300px;
|
|
433
|
+
transition: all 0.2s ease-in-out;
|
|
434
|
+
position: relative;
|
|
167
435
|
cursor: pointer;
|
|
168
|
-
user-select: none;
|
|
169
|
-
border-radius: 0.25rem;
|
|
170
|
-
padding-left: 0.25rem;
|
|
171
|
-
padding-right: 0.25rem;
|
|
172
436
|
|
|
173
437
|
&:hover {
|
|
174
|
-
|
|
438
|
+
border-color: ${e=>e.theme?.colors?.primary||"hsl(221.2 83.2% 53.3%)"};
|
|
439
|
+
box-shadow:
|
|
440
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
441
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
175
442
|
}
|
|
176
|
-
`,
|
|
443
|
+
`,Xu=bc.div`
|
|
444
|
+
display: flex;
|
|
445
|
+
justify-content: space-between;
|
|
446
|
+
align-items: center;
|
|
447
|
+
gap: 0.5rem;
|
|
448
|
+
padding: 0.75rem;
|
|
449
|
+
border-bottom: 1px solid ${e=>e.theme?.colors?.border||"hsl(214.3 31.8% 91.4%)"};
|
|
450
|
+
`,Ku=bc.div`
|
|
451
|
+
display: flex;
|
|
452
|
+
align-items: center;
|
|
453
|
+
gap: 0.5rem;
|
|
454
|
+
`,Uu=bc.div`
|
|
455
|
+
font-size: 1.25rem;
|
|
456
|
+
display: flex;
|
|
457
|
+
align-items: center;
|
|
458
|
+
justify-content: center;
|
|
459
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
460
|
+
`,qu=bc.div`
|
|
177
461
|
font-weight: 600;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
transition: all 0.2s ease-in-out;
|
|
196
|
-
`,Ou=Lc.div`
|
|
197
|
-
transition: transform 0.2s ease-in-out;
|
|
198
|
-
`,Au=Lc.div`
|
|
462
|
+
color: ${e=>e.theme?.colors?.foreground||"hsl(222.2 84% 4.9%)"};
|
|
463
|
+
font-size: 0.875rem;
|
|
464
|
+
word-break: break-words;
|
|
465
|
+
`,Zu=bc.div`
|
|
466
|
+
display: flex;
|
|
467
|
+
gap: 0.5rem;
|
|
468
|
+
justify-content: flex-end;
|
|
469
|
+
align-items: center;
|
|
470
|
+
`,Gu=bc.div`
|
|
471
|
+
padding: 0.75rem;
|
|
472
|
+
display: flex;
|
|
473
|
+
flex-direction: column;
|
|
474
|
+
align-items: flex-start;
|
|
475
|
+
justify-content: center;
|
|
476
|
+
gap: 0.5rem;
|
|
477
|
+
`,Qu=({data:e,id:n})=>{const r=e.nodeType||"Agent",o=e.onInspect;switch(r){case"Agent":default:return t.createElement(Mu,{data:e,id:n,onInspect:o});case"Tool":return t.createElement(ju,{data:e,id:n,onInspect:o});case"Coordinator":return t.createElement(Iu,{data:e,id:n,onInspect:o})}},Ju=bc.div`
|
|
199
478
|
background-color: ${e=>e.theme.colors.card};
|
|
200
479
|
border: 1px solid ${e=>e.theme.colors.border};
|
|
201
480
|
border-radius: 0.5rem;
|
|
202
481
|
overflow: hidden;
|
|
203
482
|
width: 100%;
|
|
204
483
|
max-width: 400px;
|
|
205
|
-
`,
|
|
484
|
+
`,ed=bc.div`
|
|
206
485
|
display: flex;
|
|
207
486
|
justify-content: space-between;
|
|
208
487
|
align-items: center;
|
|
209
488
|
padding: 0.75rem;
|
|
210
489
|
border-bottom: 1px solid ${e=>e.theme.colors.border};
|
|
211
490
|
background-color: ${e=>e.theme.colors.muted};
|
|
212
|
-
`,
|
|
491
|
+
`,td=bc.h3`
|
|
213
492
|
margin: 0;
|
|
214
493
|
font-size: 0.875rem;
|
|
215
494
|
font-weight: 600;
|
|
216
495
|
color: ${e=>e.theme.colors.cardForeground};
|
|
217
|
-
`,
|
|
496
|
+
`,nd=bc.button`
|
|
218
497
|
display: flex;
|
|
219
498
|
align-items: center;
|
|
220
499
|
justify-content: center;
|
|
@@ -230,11 +509,11 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
230
509
|
background-color: ${e=>e.theme.colors.accent};
|
|
231
510
|
color: ${e=>e.theme.colors.accentForeground};
|
|
232
511
|
}
|
|
233
|
-
|
|
512
|
+
`,rd=bc.div`
|
|
234
513
|
padding: 0.75rem;
|
|
235
514
|
max-height: 400px;
|
|
236
515
|
overflow-y: auto;
|
|
237
|
-
`,
|
|
516
|
+
`,od=bc.div`
|
|
238
517
|
position: relative;
|
|
239
518
|
padding: 0.5rem;
|
|
240
519
|
border-radius: 0.375rem;
|
|
@@ -247,26 +526,26 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
247
526
|
&:hover {
|
|
248
527
|
background-color: ${e=>e.hasStep&&!e.isActive?e.theme.colors.accent:e.isActive?e.theme.colors.primary:"transparent"};
|
|
249
528
|
}
|
|
250
|
-
`,
|
|
529
|
+
`,id=bc.div`
|
|
251
530
|
display: flex;
|
|
252
531
|
align-items: center;
|
|
253
532
|
gap: 0.5rem;
|
|
254
533
|
margin-bottom: 0.25rem;
|
|
255
|
-
`,
|
|
534
|
+
`,ad=bc.div`
|
|
256
535
|
width: 0.5rem;
|
|
257
536
|
height: 0.5rem;
|
|
258
537
|
border-radius: 50%;
|
|
259
538
|
background-color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.isPast?e.theme.colors.primary:e.hasStep?e.theme.colors.mutedForeground:e.theme.colors.border};
|
|
260
539
|
flex-shrink: 0;
|
|
261
|
-
`,
|
|
540
|
+
`,sd=bc.span`
|
|
262
541
|
font-weight: 600;
|
|
263
542
|
font-size: 0.75rem;
|
|
264
543
|
color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.theme.colors.cardForeground};
|
|
265
|
-
`,
|
|
544
|
+
`,ld=bc.div`
|
|
266
545
|
font-size: 0.75rem;
|
|
267
546
|
color: ${e=>e.hasStep?e.theme.colors.cardForeground:e.theme.colors.mutedForeground};
|
|
268
547
|
font-style: ${e=>e.hasStep?"normal":"italic"};
|
|
269
|
-
`,
|
|
548
|
+
`,cd=bc.div`
|
|
270
549
|
position: absolute;
|
|
271
550
|
top: 0;
|
|
272
551
|
left: 0;
|
|
@@ -286,7 +565,7 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
286
565
|
opacity: 0.5;
|
|
287
566
|
}
|
|
288
567
|
}
|
|
289
|
-
`,Wu=({stamps:e,currentStep:n,onStepChange:r,onToggle:o})=>{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(Au,null,t.createElement(Ru,null,t.createElement(Tu,null,"Timeline"),o&&t.createElement(Du,{onClick:o,title:"Collapse Panel"},t.createElement(Rs,{size:16}))),t.createElement($u,null,Array.from({length:s},(o,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 r=t-1,o=e.filter(e=>e.step===r);return 0===o.length?null:Math.min(...n.map(e=>e.time))-Math.max(...o.map(e=>e.time))})(s),p=(t=>{const n=e.filter(e=>e.step===t);return 0===n.length?`Step ${t}`:n[0]?.identifier||`Step ${t}`})(s);return t.createElement(Iu,{key:s,isActive:c,isPast:u,hasStep:d,onClick:()=>d&&r(s)},t.createElement(zu,null,t.createElement(Lu,{isActive:c,isPast:u,hasStep:d}),t.createElement(Bu,{isActive:c},"Step ",s),f&&t.createElement(qc,{variant:l(f),style:{marginLeft:"auto"}},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(f))),t.createElement(Fu,{hasStep:d},d?p:"No activity"),c&&t.createElement(Hu,null))})))};function Vu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function ju(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Yu(...e){return t=>{let n=!1;const r=e.map(e=>{const r=ju(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():ju(e[t],null)}}}}function Xu(...t){return e.useCallback(Yu(...t),t)}function Ku(t,n=[]){let r=[];const o=()=>{const n=r.map(t=>e.createContext(t));return function(r){const o=r?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...r,[t]:o}}),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,l=r?.[t]?.[i]||a,c=e.useMemo(()=>s,Object.values(s));return m(l.Provider,{value:c,children:o})};return s.displayName=n+"Provider",[s,function(r,s){const l=s?.[t]?.[i]||a,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Uu(o,...n)]}function Uu(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}var qu=globalThis?.document?e.useLayoutEffect:()=>{},Zu=e[" useId ".trim().toString()]||(()=>{}),Gu=0;function Qu(t){const[n,r]=e.useState(Zu());return qu(()=>{t||r(e=>e??String(Gu++))},[t]),t||(n?`radix-${n}`:"")}var Ju=e[" useInsertionEffect ".trim().toString()]||qu;function ed({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[a,i,s]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),a=e.useRef(r),i=e.useRef(n);return Ju(()=>{i.current=n},[n]),e.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,o,i]}({defaultProp:n,onChange:r}),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(`${o} 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,o])}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 td(t){const n=nd(t),r=e.forwardRef((t,r)=>{const{children:o,...a}=t,i=e.Children.toArray(o),s=i.find(od);if(s){const t=s.props.children,o=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:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return m(n,{...a,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function nd(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){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}(r),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(a.ref=n?Yu(n,t):t),e.cloneElement(r,a)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var rd=Symbol("radix.slottable");function od(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===rd}var ad=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=td(`Primitive.${n}`),o=e.forwardRef((e,t)=>{const{asChild:o,...a}=e,i=o?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m(i,{...a,ref:t})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function id(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var sd,ld="dismissableLayer.update",cd="dismissableLayer.pointerDownOutside",ud="dismissableLayer.focusOutside",dd=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fd=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=t,u=e.useContext(dd),[d,f]=e.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=e.useState({}),g=Xu(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,S=w>=b,E=function(t,n=globalThis?.document){const r=id(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){md(cd,r,o,{discrete:!0})};const o={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);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));S&&!n&&(a?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(t,n=globalThis?.document){const r=id(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){md(ud,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.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 r=id(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{w===u.layers.size-1&&(o?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(sd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),hd(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=sd)}},[d,p,r,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),hd())},[d,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(ld,e),()=>document.removeEventListener(ld,e)},[]),m(ad.div,{...c,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:Vu(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Vu(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Vu(t.onPointerDownCapture,E.onPointerDownCapture)})});fd.displayName="DismissableLayer";var pd=e.forwardRef((t,n)=>{const r=e.useContext(dd),o=e.useRef(null),a=Xu(n,o);return e.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),m(ad.div,{...t,ref:a})});function hd(){const e=new CustomEvent(ld);document.dispatchEvent(e)}function md(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}pd.displayName="DismissableLayerBranch";var gd="focusScope.autoFocusOnMount",yd="focusScope.autoFocusOnUnmount",vd={bubbles:!1,cancelable:!0},bd=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=id(a),d=id(i),f=e.useRef(null),p=Xu(n,e=>c(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:Ed(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Ed(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ed(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,l,h.paused]),e.useEffect(()=>{if(l){_d.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(gd,vd);l.addEventListener(gd,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ed(r,{select:t}),document.activeElement!==n)return}((e=wd(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Ed(l))}return()=>{l.removeEventListener(gd,u),setTimeout(()=>{const e=new CustomEvent(yd,vd);l.addEventListener(yd,d),l.dispatchEvent(e),e.defaultPrevented||Ed(t??document.body,{select:!0}),l.removeEventListener(yd,d),_d.remove(h)},0)}}var e},[l,u,d,h]);const g=e.useCallback(e=>{if(!r&&!o)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,[o,a]=function(e){const t=wd(e),n=xd(t,e),r=xd(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&Ed(a,{select:!0})):(e.preventDefault(),r&&Ed(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return m(ad.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});function wd(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 xd(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 Ed(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()}}bd.displayName="FocusScope";var _d=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],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var kd=e.forwardRef((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);qu(()=>i(!0),[]);const s=r||a&&globalThis?.document?.body;return s?h.createPortal(m(ad.div,{...o,ref:n}),s):null});kd.displayName="Portal";var Nd=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=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=Md(o.current);i.current="mounted"===l?e:"none"},[l]),qu(()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=Md(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,c]),qu(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=Md(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(i.current=Md(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=Xu(o.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 r||o.isPresent?e.cloneElement(a,{ref:i}):null};function Md(e){return e?.animationName||"none"}Nd.displayName="Presence";var Pd=0;function Od(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ad()),document.body.insertAdjacentElement("beforeend",e[1]??Ad()),Pd++,()=>{1===Pd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Pd--}},[])}function Ad(){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 Rd=function(){return Rd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Rd.apply(this,arguments)};function Td(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Dd="right-scroll-bar-position",$d="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,Ld=new WeakMap;function Bd(e,t){var n,r,o,a=(n=t||null,r=function(t){return e.forEach(function(e){return Id(e,t)})},(o=u(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return zd(function(){var t=Ld.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach(function(e){r.has(e)||Id(e,null)}),r.forEach(function(e){n.has(e)||Id(e,o)})}Ld.set(a,e)},[e]),a}function Fd(e){return e}var Hd=function(t){var n=t.sideCar,r=Td(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,Rd({},r))};Hd.isSideCarExport=!0;var Wd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Fd);var n=[],r=!1,o={read:function(){if(r)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 o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.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 o}(null);return t.options=Rd({async:!0,ssr:!1},e),t}(),Vd=function(){},jd=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:Vd,onWheelCapture:Vd,onTouchMoveCapture:Vd}),a=o[0],i=o[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=Td(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=Bd([r,n]),_=Rd(Rd({},x),a);return e.createElement(e.Fragment,null,d&&e.createElement(S,{sideCar:Wd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?e.cloneElement(e.Children.only(l),Rd(Rd({},_),{ref:E})):e.createElement(b,Rd({},_,{className:c,ref:E}),l))});jd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},jd.classNames={fullWidth:$d,zeroRight:Dd};function Yd(){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 Xd=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=Yd())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kd=function(){var t,n=(t=Xd(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},Ud={left:0,top:0,right:0,gap:0},qd=function(e){return parseInt(e||"",10)||0},Zd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ud;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[qd(n),qd(r),qd(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Gd=Kd(),Qd="data-scroll-locked",Jd=function(e,t,n,r){var o=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(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(Qd,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"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(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Dd," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat($d," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Dd," .").concat(Dd," {\n right: 0 ").concat(r,";\n }\n \n .").concat($d," .").concat($d," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Qd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},ef=function(){var e=parseInt(document.body.getAttribute(Qd)||"0",10);return isFinite(e)?e:0},tf=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(Qd,(ef()+1).toString()),function(){var e=ef()-1;e<=0?document.body.removeAttribute(Qd):document.body.setAttribute(Qd,e.toString())}},[]);var i=e.useMemo(function(){return Zd(a)},[a]);return e.createElement(Gd,{styles:Jd(i,!n,a,r?"":"!important")})},nf=!1;if("undefined"!=typeof window)try{var rf=Object.defineProperty({},"passive",{get:function(){return nf=!0,!0}});window.addEventListener("test",rf,rf),window.removeEventListener("test",rf,rf)}catch(e){nf=!1}var of=!!nf&&{passive:!1},af=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])},sf=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),lf(e,r)){var o=cf(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lf=function(e,t){return"v"===e?function(e){return af(e,"overflowY")}(t):function(e){return af(e,"overflowX")}(t)},cf=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},uf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},df=function(e){return[e.deltaX,e.deltaY]},ff=function(e){return e&&"current"in e?e.current:e},pf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},hf=0,mf=[];function gf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var yf,vf=(yf=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(hf++)[0],i=e.useState(Kd)[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 r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(ff),!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=uf(e),i=r.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=sf(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=sf(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r,o){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=cf(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&lf(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&&(o&&Math.abs(d)<1||!o&&i>d)||!u&&(o&&Math.abs(f)<1||!o&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(mf.length&&mf[mf.length-1]===i){var r="deltaY"in t?df(t):uf(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(s.current.shards||[]).map(ff).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,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:gf(r)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),d=e.useCallback(function(e){r.current=uf(e),o.current=void 0},[]),f=e.useCallback(function(e){u(e.type,df(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,uf(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return mf.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(){mf=mf.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:pf(a)}):null,h?e.createElement(tf,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Wd.useMedium(yf),Hd),bf=e.forwardRef(function(t,n){return e.createElement(jd,Rd({},t,{ref:n,sideCar:vf}))});bf.classNames=jd.classNames;var wf=bf,xf=new WeakMap,Sf=new WeakMap,Ef={},_f=0,Cf=function(e){return e&&(e.host||Cf(e.parentNode))},kf=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Cf(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(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.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(r),o=null!==t&&"false"!==t,l=(xf.get(e)||0)+1,c=(a.get(e)||0)+1;xf.set(e,l),a.set(e,c),i.push(e),1===l&&o&&Sf.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),_f++,function(){i.forEach(function(e){var t=xf.get(e)-1,o=a.get(e)-1;xf.set(e,t),a.set(e,o),t||(Sf.has(e)||e.removeAttribute(r),Sf.delete(e)),o||e.removeAttribute(n)}),--_f||(xf=new WeakMap,xf=new WeakMap,Sf=new WeakMap,Ef={})}},Nf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),kf(r,o,n,"aria-hidden")):function(){return null}},Mf="Dialog",[Pf,Of]=Ku(Mf),[Af,Rf]=Pf(Mf),Tf=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u,d]=ed({prop:o,defaultProp:a??!1,onChange:i,caller:Mf});return m(Af,{scope:n,triggerRef:l,contentRef:c,contentId:Qu(),titleId:Qu(),descriptionId:Qu(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};Tf.displayName=Mf;var Df="DialogTrigger",$f=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rf(Df,n),a=Xu(t,o.triggerRef);return m(ad.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tp(o.open),...r,ref:a,onClick:Vu(e.onClick,o.onOpenToggle)})});$f.displayName=Df;var If="DialogPortal",[zf,Lf]=Pf(If,{forceMount:void 0}),Bf=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=Rf(If,n);return m(zf,{scope:n,forceMount:r,children:e.Children.map(o,e=>m(Nd,{present:r||i.open,children:m(kd,{asChild:!0,container:a,children:e})}))})};Bf.displayName=If;var Ff="DialogOverlay",Hf=e.forwardRef((e,t)=>{const n=Lf(Ff,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Rf(Ff,e.__scopeDialog);return a.modal?m(Nd,{present:r||a.open,children:m(Vf,{...o,ref:t})}):null});Hf.displayName=Ff;var Wf=td("DialogOverlay.RemoveScroll"),Vf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rf(Ff,n);return m(wf,{as:Wf,allowPinchZoom:!0,shards:[o.contentRef],children:m(ad.div,{"data-state":tp(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jf="DialogContent",Yf=e.forwardRef((e,t)=>{const n=Lf(jf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Rf(jf,e.__scopeDialog);return m(Nd,{present:r||a.open,children:a.modal?m(Xf,{...o,ref:t}):m(Kf,{...o,ref:t})})});Yf.displayName=jf;var Xf=e.forwardRef((t,n)=>{const r=Rf(jf,t.__scopeDialog),o=e.useRef(null),a=Xu(n,r.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return Nf(e)},[]),m(Uf,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vu(t.onCloseAutoFocus,e=>{e.preventDefault(),r.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())})}),Kf=e.forwardRef((t,n)=>{const r=Rf(jf,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return m(Uf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=r.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),Uf=e.forwardRef((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=Rf(jf,r),c=e.useRef(null),u=Xu(n,c);return Od(),g(y,{children:[m(bd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:m(fd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":tp(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),g(y,{children:[m(ap,{titleId:l.titleId}),m(ip,{contentRef:c,descriptionId:l.descriptionId})]})]})}),qf="DialogTitle",Zf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rf(qf,n);return m(ad.h2,{id:o.titleId,...r,ref:t})});Zf.displayName=qf;var Gf="DialogDescription",Qf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rf(Gf,n);return m(ad.p,{id:o.descriptionId,...r,ref:t})});Qf.displayName=Gf;var Jf="DialogClose",ep=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rf(Jf,n);return m(ad.button,{type:"button",...r,ref:t,onClick:Vu(e.onClick,()=>o.onOpenChange(!1))})});function tp(e){return e?"open":"closed"}ep.displayName=Jf;var np="DialogTitleWarning",[rp,op]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,a=e.useMemo(()=>o,Object.values(o));return m(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(o){const a=e.useContext(r);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(np,{contentName:jf,titleName:qf,docsSlug:"dialog"}),ap=({titleId:t})=>{const n=op(np),r=`\`${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(r)}},[r,t]),null},ip=({contentRef:t,descriptionId:n})=>{const r=`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(r)}},[r,t,n]),null},sp=Tf,lp=$f,cp=Bf,up=Hf,dp=Yf,fp=Zf,pp=Qf,hp=ep;const mp=sp,gp=lp,yp=cp,vp=e.forwardRef(({className:t,...n},r)=>e.createElement(up,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:t,...n,ref:r}));vp.displayName=up.displayName;const bp=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},wp=e.forwardRef(({side:t="right",className:n,children:r,...o},a)=>e.createElement(yp,null,e.createElement(vp,null),e.createElement(dp,{ref:a,style:bp(t),className:n,...o},r,e.createElement(hp,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},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",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));wp.displayName=dp.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(fp,{ref:r,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:t,...n})).displayName=fp.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(pp,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=pp.displayName;const xp=(e,t,n={})=>{const{minNodeSpacing:r=200,containerWidth:o=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=>{e.source&&e.target&&(a.get(e.source)?.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(a.get(e.parent.identifier)?.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=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,r+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,r+200),y=(e,t,n)=>{const r=d.get(e)||f,o=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+r/2-100,y:o});else{let r=t;for(const e of i){const t=d.get(e)||f;y(e,r,n+1),r+=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:o})}};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,(o-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=r,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]),r=m.get(x[t]);if(Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)<w){const e=r.x-n.x,t=r.y-n.y,o=Math.sqrt(e*e+t*t);if(o>0){const a=w/o,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,r.x+=i,r.y+=s}else n.x-=w/2,r.x+=w/2}}return m},Sp={Agent:vu,Tool:vu,Coordinator:vu},Ep=({flowData:e,width:n="100%",height:r="1000px",className:a="",defaultZoom:c=1,defaultPan:d={x:0,y:0},disableAutoFit:f=!0,showTimeline:p=!1,minNodeSpacing:h=200})=>{const{theme:m}=Pc(),g=e;if(!g)return t.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${m.colors.border}`,borderRadius:"8px",background:m.colors.muted,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:m.colors.mutedForeground,marginBottom:"8px"}},"No flow data available"),t.createElement("div",{style:{fontSize:"14px",color:m.colors.mutedForeground}},"Please provide flowData prop")));const y=l(null),v=l(null),[b,w]=u({width:"number"==typeof n?n:1200,height:"number"==typeof r?r:600}),[x,S]=u(0),[E,_]=u(!1),C=l(null),[k,N]=u(!1),M=o(()=>{const e=g.stamps||g.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[g.stamps,g.steps]);i(()=>(E?C.current=setInterval(()=>{S(e=>e>=M?(_(!1),e):e+1)},250):C.current&&(clearInterval(C.current),C.current=null),()=>{C.current&&clearInterval(C.current)}),[E,M]),i(()=>{const e=g.stamps||g.steps||[];e.length>0&&S(Math.max(...e.map(e=>e.step)))},[g.stamps,g.steps]),i(()=>{const e=()=>{if(y.current){const e=y.current.getBoundingClientRect();w({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof r?r:600)})}};if(e(),window.ResizeObserver&&y.current){const t=new ResizeObserver(e);return t.observe(y.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,r]);const P=o(()=>{if(!g.nodes)return new Map;const e=Math.max(b.width||800,1200);return xp(g.nodes,g.edges||[],{minNodeSpacing:h,containerWidth:e})},[g.nodes,g.edges,b.width,h]),O=s(e=>g.nodes?g.nodes.filter(t=>t.stamp.step<=e):[],[g.nodes]),A=s(e=>(g.edges||[]).filter(t=>t.stamp.step<=e),[g.edges]),R=o(()=>{const e=O(x),t=A(x);return e.map(e=>{const n=P.get(e.identifier)||{x:0,y:0},r=e.stamp.step===x,o="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:r,id:e.identifier,edges:t,edgeDetails:o},style:{filter:r?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[P,x,O,A]),T=o(()=>A(x).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===x;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?m.colors.primary:m.colors.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?jc(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?jc(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[x,A]),[D,$,I]=ds(R),[z,L,B]=fs(T);i(()=>{$(R)},[R,$]),i(()=>{L(T)},[T,L]);const F=s(e=>L(t=>To(e,t)),[L]),H=s(e=>{S(e),_(!1)},[]);s(()=>{_(e=>!e)},[]);const W=(e,t)=>{if(!v.current)return{x:0,y:0};const n=v.current.createSVGPoint();n.x=e,n.y=t;const r=n.matrixTransform(v.current.getScreenCTM()?.inverse());return{x:r.x,y:r.y}},V=za();return i(()=>{if(f||!V||0===R.length)return;const e=new Map;T.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const r=e.get(t.target)||0;e.set(t.target,r+1)});let t="",n=0;e.forEach((e,r)=>{e>n&&(n=e,t=r)}),!t&&R.length>0&&(t=R[0].id),t&&setTimeout(()=>{V.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:c,maxZoom:1})},500)},[R,T,V,f,c]),t.createElement("div",{ref:y,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${m.colors.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:m.colors.background},className:a},p&&t.createElement(mp,{open:k,onOpenChange:N},t.createElement(gp,{asChild:!0},t.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:m.colors.card,border:`1px solid ${m.colors.border}`,borderRadius:"8px",boxShadow:m.shadows.sm,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=m.colors.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=m.colors.card},title:"Open Timeline"},t.createElement(Rs,{size:20,style:{color:m.colors.mutedForeground}}))),t.createElement(yp,null,t.createElement(dp,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:m.colors.background,borderRight:`1px solid ${m.colors.border}`,boxShadow:m.shadows.lg,transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},t.createElement("div",{style:{flex:1,overflowY:"auto"}},t.createElement(Wu,{stamps:g.stamps||g.steps||[],currentStep:x,onStepChange:H}))),t.createElement(hp,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:m.colors.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},t.createElement("svg",{style:{height:"16px",width:"16px"},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",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),t.createElement(cs,{nodes:D,edges:z,onNodesChange:I,onEdgesChange:B,onConnect:F,nodeTypes:Sp,edgeTypes:{default:e=>t.createElement(Ac,{...e,clientToSvgCoords:W,svgRef:v})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:d.x,y:d.y,zoom:c},onInit:()=>{if(y.current){const e=y.current.querySelector("svg");e&&(v.current=e)}}},t.createElement(ws,{variant:ps.Lines,color:m.colors.mutedBorder,gap:16})),t.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${m.colors.card};\n color: ${m.colors.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${m.colors.border};\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 `))},_p=e=>t.createElement(Mc,null,t.createElement(ts,null,t.createElement(Ep,e)));function Cp(e,[t,n]){return Math.min(n,Math.max(t,e))}var kp=e.createContext(void 0);const Np=["top","right","bottom","left"],Mp=Math.min,Pp=Math.max,Op=Math.round,Ap=Math.floor,Rp=e=>({x:e,y:e}),Tp={left:"right",right:"left",bottom:"top",top:"bottom"},Dp={start:"end",end:"start"};function $p(e,t,n){return Pp(e,Mp(t,n))}function Ip(e,t){return"function"==typeof e?e(t):e}function zp(e){return e.split("-")[0]}function Lp(e){return e.split("-")[1]}function Bp(e){return"x"===e?"y":"x"}function Fp(e){return"y"===e?"height":"width"}const Hp=new Set(["top","bottom"]);function Wp(e){return Hp.has(zp(e))?"y":"x"}function Vp(e){return Bp(Wp(e))}function jp(e){return e.replace(/start|end/g,e=>Dp[e])}const Yp=["left","right"],Xp=["right","left"],Kp=["top","bottom"],Up=["bottom","top"];function qp(e,t,n,r){const o=Lp(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Xp:Yp:t?Yp:Xp;case"left":case"right":return t?Kp:Up;default:return[]}}(zp(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(jp)))),a}function Zp(e){return e.replace(/left|right|bottom|top/g,e=>Tp[e])}function Gp(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 Qp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Jp(e,t,n){let{reference:r,floating:o}=e;const a=Wp(t),i=Vp(t),s=Fp(i),l=zp(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Lp(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function eh(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Ip(t,e),h=Gp(p),m=s[f?"floating"===d?"reference":"floating":d],g=Qp(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:r,y:o,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=Qp(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 th(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nh(e){return Np.some(t=>e[t]>=0)}const rh=new Set(["left","top"]);function oh(){return"undefined"!=typeof window}function ah(e){return lh(e)?(e.nodeName||"").toLowerCase():"#document"}function ih(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sh(e){var t;return null==(t=(lh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function lh(e){return!!oh()&&(e instanceof Node||e instanceof ih(e).Node)}function ch(e){return!!oh()&&(e instanceof Element||e instanceof ih(e).Element)}function uh(e){return!!oh()&&(e instanceof HTMLElement||e instanceof ih(e).HTMLElement)}function dh(e){return!(!oh()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ih(e).ShadowRoot)}const fh=new Set(["inline","contents"]);function ph(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ch(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fh.has(o)}const hh=new Set(["table","td","th"]);function mh(e){return hh.has(ah(e))}const gh=[":popover-open",":modal"];function yh(e){return gh.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const vh=["transform","translate","scale","rotate","perspective"],bh=["transform","translate","scale","rotate","perspective","filter"],wh=["paint","layout","strict","content"];function xh(e){const t=Sh(),n=ch(e)?Ch(e):e;return vh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||bh.some(e=>(n.willChange||"").includes(e))||wh.some(e=>(n.contain||"").includes(e))}function Sh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Eh=new Set(["html","body","#document"]);function _h(e){return Eh.has(ah(e))}function Ch(e){return ih(e).getComputedStyle(e)}function kh(e){return ch(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nh(e){if("html"===ah(e))return e;const t=e.assignedSlot||e.parentNode||dh(e)&&e.host||sh(e);return dh(t)?t.host:t}function Mh(e){const t=Nh(e);return _h(t)?e.ownerDocument?e.ownerDocument.body:e.body:uh(t)&&ph(t)?t:Mh(t)}function Ph(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Mh(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=ih(o);if(a){const e=Oh(i);return t.concat(i,i.visualViewport||[],ph(o)?o:[],e&&n?Ph(e):[])}return t.concat(o,Ph(o,[],n))}function Oh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ah(e){const t=Ch(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=uh(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=Op(n)!==a||Op(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Rh(e){return ch(e)?e:e.contextElement}function Th(e){const t=Rh(e);if(!uh(t))return Rp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Ah(t);let i=(a?Op(n.width):n.width)/r,s=(a?Op(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Dh=Rp(0);function $h(e){const t=ih(e);return Sh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Dh}function Ih(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=Rh(e);let i=Rp(1);t&&(r?ch(r)&&(i=Th(r)):i=Th(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ih(e))&&t}(a,n,r)?$h(a):Rp(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=ih(a),t=r&&ch(r)?ih(r):r;let n=e,o=Oh(n);for(;o&&r&&t!==n;){const e=Th(o),t=o.getBoundingClientRect(),r=Ch(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=ih(o),o=Oh(n)}}return Qp({width:u,height:d,x:l,y:c})}function zh(e,t){const n=kh(e).scrollLeft;return t?t.left+n:Ih(sh(e)).left+n}function Lh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-zh(e,n),y:n.top+t.scrollTop}}const Bh=new Set(["absolute","fixed"]);function Fh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ih(e),r=sh(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=Sh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=zh(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=sh(e),n=kh(e),r=e.ownerDocument.body,o=Pp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Pp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+zh(e);const s=-n.scrollTop;return"rtl"===Ch(r).direction&&(i+=Pp(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(sh(e));else if(ch(t))r=function(e,t){const n=Ih(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=uh(e)?Th(e):Rp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=$h(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qp(r)}function Hh(e,t){const n=Nh(e);return!(n===t||!ch(n)||_h(n))&&("fixed"===Ch(n).position||Hh(n,t))}function Wh(e,t,n){const r=uh(t),o=sh(t),a="fixed"===n,i=Ih(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Rp(0);function c(){l.x=zh(o)}if(r||!r&&!a)if(("body"!==ah(t)||ph(o))&&(s=kh(t)),r){const e=Ih(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!r&&o&&c();const u=!o||r||a?Rp(0):Lh(o,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 Vh(e){return"static"===Ch(e).position}function jh(e,t){if(!uh(e)||"fixed"===Ch(e).position)return null;if(t)return t(e);let n=e.offsetParent;return sh(e)===n&&(n=n.ownerDocument.body),n}function Yh(e,t){const n=ih(e);if(yh(e))return n;if(!uh(e)){let t=Nh(e);for(;t&&!_h(t);){if(ch(t)&&!Vh(t))return t;t=Nh(t)}return n}let r=jh(e,t);for(;r&&mh(r)&&Vh(r);)r=jh(r,t);return r&&_h(r)&&Vh(r)&&!xh(r)?n:r||function(e){let t=Nh(e);for(;uh(t)&&!_h(t);){if(xh(t))return t;if(yh(t))return null;t=Nh(t)}return null}(e)||n}const Xh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=sh(r),s=!!t&&yh(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Rp(1);const u=Rp(0),d=uh(r);if((d||!d&&!a)&&(("body"!==ah(r)||ph(i))&&(l=kh(r)),uh(r))){const e=Ih(r);c=Th(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?Rp(0):Lh(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:sh,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a="clippingAncestors"===n?yh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ph(e,[],!1).filter(e=>ch(e)&&"body"!==ah(e)),o=null;const a="fixed"===Ch(e).position;let i=a?Nh(e):e;for(;ch(i)&&!_h(i);){const t=Ch(i),n=xh(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&Bh.has(o.position)||ph(i)&&!n&&Hh(e,i))?r=r.filter(e=>e!==i):o=t,i=Nh(i)}return t.set(e,r),r}(t,this._c):[].concat(n),i=[...a,r],s=i[0],l=i.reduce((e,n)=>{const r=Fh(t,n,o);return e.top=Pp(r.top,e.top),e.right=Mp(r.right,e.right),e.bottom=Mp(r.bottom,e.bottom),e.left=Pp(r.left,e.left),e},Fh(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Yh,getElementRects:async function(e){const t=this.getOffsetParent||Yh,n=this.getDimensions,r=await n(e.floating);return{reference:Wh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ah(e);return{width:t,height:n}},getScale:Th,isElement:ch,isRTL:function(e){return"rtl"===Ch(e).direction}};function Kh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Uh(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Rh(e),u=o||a?[...c?Ph(c):[],...Ph(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=sh(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=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:-Ap(d)+"px "+-Ap(o.clientWidth-(u+f))+"px "+-Ap(o.clientHeight-(d+p))+"px "+-Ap(u)+"px",threshold:Pp(0,Mp(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Kh(c,e.getBoundingClientRect())||i(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.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?Ih(e):null;return l&&function t(){const r=Ih(e);m&&!Kh(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&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,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=zp(n),s=Lp(n),l="y"===Wp(n),c=rh.has(i)?-1:1,u=a&&l?-1:1,d=Ip(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!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Zh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ip(e,t),c={x:n,y:r},u=await eh(t,l),d=Wp(zp(o)),f=Bp(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=$p(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=$p(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-r,enabled:{[f]:a,[d]:i}}}}}},Gh=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,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}=Ip(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=zp(o),v=Wp(s),b=zp(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Zp(s)]:function(e){const t=Zp(e);return[jp(e),t,jp(t)]}(s)),S="none"!==h;!f&&S&&x.push(...qp(s,m,h,w));const E=[s,...x],_=await eh(t,g),C=[];let k=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&C.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Lp(e),o=Vp(e),a=Fp(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Zp(i)),[i,Zp(i)]}(o,i,w);C.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=E[e];if(t){if(!("alignment"===d&&v!==Wp(t))||k.every(e=>Wp(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(M=k.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 P;const e=null==(P=k.filter(e=>{if(S){const t=Wp(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:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Qh=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Ip(e,t),u=await eh(t,c),d=zp(o),f=Lp(o),p="y"===Wp(o),{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=Mp(m-u[g],v),x=Mp(h-u[y],b),S=!t.middlewareData.shift;let E=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=v),S&&!f){const e=Pp(u.left,0),t=Pp(u.right,0),n=Pp(u.top,0),r=Pp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:Pp(u.left,u.right)):E=m-2*(0!==n||0!==r?n+r:Pp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:E});const C=await i.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Jh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ip(e,t);switch(r){case"referenceHidden":{const e=th(await eh(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:nh(e)}}}case"escaped":{const e=th(await eh(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:nh(e)}}}default:return{}}}}},em=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Ip(e,t)||{};if(null==c)return{};const d=Gp(u),f={x:n,y:r},p=Vp(o),h=Fp(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],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let E=S?S[b]:0;E&&await(null==i.isElement?void 0:i.isElement(S))||(E=s.floating[b]||a.floating[h]);const _=w/2-x/2,C=E/2-m[h]/2-1,k=Mp(d[y],C),N=Mp(d[v],C),M=k,P=E-m[h]-N,O=E/2-m[h]/2+_,A=$p(M,O,P),R=!l.arrow&&null!=Lp(o)&&O!==A&&a.reference[h]/2-(O<M?k:N)-m[h]/2<0,T=R?O<M?O-M:O-P:0;return{[p]:f[p]+T,data:{[p]:A,centerOffset:O-A-T,...R&&{alignmentOffset:T}},reset:R}}}),tm=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Ip(e,t),u={x:n,y:r},d=Wp(o),f=Bp(d);let p=u[f],h=u[d];const m=Ip(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=rh.has(zp(o)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=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>r&&(h=r)}return{[f]:p,[d]:h}}}},nm=(e,t,n)=>{const r=new Map,o={platform:Xh,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="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:o}),{x:u,y:d}=Jp(c,r,l),f=r,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:r,placement:f,strategy:o,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:o}):b.rects),({x:u,y:d}=Jp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};var rm="undefined"!=typeof document?f:function(){};function om(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,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!om(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!om(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function am(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function im(e,t){const n=am(e);return Math.round(t*n)/n}function sm(t){const n=e.useRef(t);return rm(()=>{n.current=t}),n}const lm=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?em({element:n.current,padding:r}).fn(t):{}:n?em({element:n,padding:r}).fn(t):{};var o}}),cm=(e,t)=>({...qh(e),options:[e,t]}),um=(e,t)=>({...Zh(e),options:[e,t]}),dm=(e,t)=>({...tm(e),options:[e,t]}),fm=(e,t)=>({...Gh(e),options:[e,t]}),pm=(e,t)=>({...Qh(e),options:[e,t]}),hm=(e,t)=>({...Jh(e),options:[e,t]}),mm=(e,t)=>({...lm(e),options:[e,t]});var gm=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return m(ad.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m("polygon",{points:"0,0 30,0 15,10"})})});gm.displayName="Arrow";var ym=gm;function vm(t){const[n,r]=e.useState(void 0);return qu(()=>{if(t){r({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 o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var bm="Popper",[wm,xm]=Ku(bm),[Sm,Em]=wm(bm),_m=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return m(Sm,{scope:n,anchor:o,onAnchorChange:a,children:r})};_m.displayName=bm;var Cm="PopperAnchor",km=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=Em(Cm,r),s=e.useRef(null),l=Xu(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=o?.current||s.current,e!==c.current&&i.onAnchorChange(c.current)}),o?null:m(ad.div,{...a,ref:l})});km.displayName=Cm;var Nm="PopperContent",[Mm,Pm]=wm(Nm),Om=e.forwardRef((t,n)=>{const{__scopePopper:r,side:o="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=Em(Nm,r),[w,x]=e.useState(null),S=Xu(n,e=>x(e)),[E,_]=e.useState(null),C=vm(E),k=C?.width??0,N=C?.height??0,M=o+("center"!==i?"-"+i:""),P="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],A=O.length>0,R={padding:P,boundary:O.filter(Dm),altBoundary:A},{refs:T,floatingStyles:D,placement:$,isPositioned:I,middlewareData:z}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);om(h,o)||m(o);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!==C.current&&(C.current=e,b(e))},[]),S=i||g,E=s||v,_=e.useRef(null),C=e.useRef(null),k=e.useRef(d),N=null!=c,M=sm(c),P=sm(a),O=sm(u),A=e.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:n,strategy:r,middleware:h};P.current&&(e.platform=P.current),nm(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};R.current&&!om(k.current,t)&&(k.current=t,p.flushSync(()=>{f(t)}))})},[h,n,r,P,O]);rm(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=e.useRef(!1);rm(()=>(R.current=!0,()=>{R.current=!1}),[]),rm(()=>{if(S&&(_.current=S),E&&(C.current=E),S&&E){if(M.current)return M.current(S,E,A);A()}},[S,E,A,M,N]);const T=e.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),D=e.useMemo(()=>({reference:S,floating:E}),[S,E]),$=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=im(D.floating,d.x),n=im(D.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...am(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,D.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:A,refs:T,elements:D,floatingStyles:$}),[d,A,T,D,$])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Uh(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[cm({mainAxis:a+N,alignmentAxis:s}),c&&um({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?dm():void 0,...R}),c&&fm({...R}),pm({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),E&&mm({element:E,padding:l}),$m({arrowWidth:k,arrowHeight:N}),h&&hm({strategy:"referenceHidden",...R})]}),[L,B]=Im($),F=id(y);qu(()=>{I&&F?.()},[I,F]);const H=z.arrow?.x,W=z.arrow?.y,V=0!==z.arrow?.centerOffset,[j,Y]=e.useState();return qu(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),m("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:j,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m(Mm,{scope:r,placedSide:L,onArrowChange:_,arrowX:H,arrowY:W,shouldHideArrow:V,children:m(ad.div,{"data-side":L,"data-align":B,...v,ref:S,style:{...v.style,animation:I?void 0:"none"}})})})});Om.displayName=Nm;var Am="PopperArrow",Rm={top:"bottom",right:"left",bottom:"top",left:"right"},Tm=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=Pm(Am,n),a=Rm[o.placedSide];return m("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:m(ym,{...r,ref:t,style:{...r.style,display:"block"}})})});function Dm(e){return null!==e}Tm.displayName=Am;var $m=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Im(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.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=`${r.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${r.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function Im(e){const[t,n="center"]=e.split("-");return[t,n]}var zm=_m,Lm=km,Bm=Om,Fm=Tm;function Hm(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 Wm=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(ad.span,{...e,ref:t,style:{...Wm,...e.style}})).displayName="VisuallyHidden";var Vm=[" ","Enter","ArrowUp","ArrowDown"],jm=[" ","Enter"],Ym="Select",[Xm,Km,Um]=function(e){const n=e+"CollectionProvider",[r,o]=Ku(n),[a,i]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),i=t.useRef(new Map).current;return m(a,{scope:n,itemMap:i,collectionRef:o,children:r})};s.displayName=n;const l=e+"CollectionSlot",c=td(l),u=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=Xu(t,i(l,n).collectionRef);return m(c,{ref:o,children:r})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=td(d),h=t.forwardRef((e,n)=>{const{scope:r,children:o,...a}=e,s=t.useRef(null),l=Xu(n,s),c=i(d,r);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),m(p,{[f]:"",ref:l,children:o})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const r=i(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},o]}(Ym),[qm,Zm]=Ku(Ym,[Um,xm]),Gm=xm(),[Qm,Jm]=qm(Ym),[eg,tg]=qm(Ym),ng=t=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:a,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:y}=t,v=Gm(n),[b,w]=e.useState(null),[x,S]=e.useState(null),[E,_]=e.useState(!1),C=function(t){const n=e.useContext(kp);return t||n||"ltr"}(u),[k,N]=ed({prop:o,defaultProp:a??!1,onChange:i,caller:Ym}),[M,P]=ed({prop:s,defaultProp:l,onChange:c,caller:Ym}),O=e.useRef(null),A=!b||(y||!!b.closest("form")),[R,T]=e.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return m(zm,{...v,children:g(Qm,{required:h,scope:n,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:E,onValueNodeHasChildrenChange:_,contentId:Qu(),value:M,onValueChange:P,open:k,onOpenChange:N,dir:C,triggerPointerDownPosRef:O,disabled:p,children:[m(Xm.Provider,{scope:n,children:m(eg,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{T(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),A?g(Wg,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:e=>P(e.target.value),disabled:p,form:y,children:[void 0===M?m("option",{value:""}):null,Array.from(R)]},D):null]})})};ng.displayName=Ym;var rg="SelectTrigger",og=e.forwardRef((t,n)=>{const{__scopeSelect:r,disabled:o=!1,...a}=t,i=Gm(r),s=Jm(rg,r),l=s.disabled||o,c=Xu(n,s.onTriggerChange),u=Km(r),d=e.useRef("touch"),[f,p,h]=jg(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=Yg(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m(Lm,{asChild:!0,...i,children:m(ad.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":Vg(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||Vm.includes(e.key)&&(g(),e.preventDefault())})})})});og.displayName=rg;var ag="SelectValue",ig=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...s}=e,l=Jm(ag,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==a,d=Xu(t,l.onValueNodeChange);return qu(()=>{c(u)},[c,u]),m(ad.span,{...s,ref:d,style:{pointerEvents:"none"},children:Vg(l.value)?m(y,{children:i}):a})});ig.displayName=ag;var sg=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m(ad.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});sg.displayName="SelectIcon";var lg=e=>m(kd,{asChild:!0,...e});lg.displayName="SelectPortal";var cg="SelectContent",ug=e.forwardRef((t,n)=>{const r=Jm(cg,t.__scopeSelect),[o,a]=e.useState();if(qu(()=>{a(new DocumentFragment)},[]),!r.open){const e=o;return e?p.createPortal(m(fg,{scope:t.__scopeSelect,children:m(Xm.Slot,{scope:t.__scopeSelect,children:m("div",{children:t.children})})}),e):null}return m(mg,{...t,ref:n})});ug.displayName=cg;var dg=10,[fg,pg]=qm(cg),hg=td("SelectContent.RemoveScroll"),mg=e.forwardRef((t,n)=>{const{__scopeSelect:r,position:o="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=Jm(cg,r),[x,S]=e.useState(null),[E,_]=e.useState(null),C=Xu(n,e=>S(e)),[k,N]=e.useState(null),[M,P]=e.useState(null),O=Km(r),[A,R]=e.useState(!1),T=e.useRef(!1);e.useEffect(()=>{if(x)return Nf(x)},[x]),Od();const D=e.useCallback(e=>{const[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==o)return}},[O,E]),$=e.useCallback(()=>D([k,x]),[D,k,x]);e.useEffect(()=>{A&&$()},[A,$]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;e.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||I(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,I,z]),e.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[L,B]=jg(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Yg(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&(N(e),r&&(T.current=!0))},[w.value]),H=e.useCallback(()=>x?.focus(),[x]),W=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&P(e)},[w.value]),V="popper"===o?yg:gg,j=V===yg?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return m(fg,{scope:r,content:x,viewport:E,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:H,itemTextRefCallback:W,focusSelectedItem:$,selectedItemText:M,position:o,isPositioned:A,searchRef:L,children:m(wf,{as:hg,allowPinchZoom:!0,children:m(bd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Vu(a,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m(fd,{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,...j,onPlaced:()=>R(!0),ref:C,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=O().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,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});mg.displayName="SelectContentImpl";var gg=e.forwardRef((t,n)=>{const{__scopeSelect:r,onPlaced:o,...a}=t,i=Jm(cg,r),s=pg(cg,r),[l,c]=e.useState(null),[u,d]=e.useState(null),f=Xu(n,e=>d(e)),p=Km(r),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(),r=b.getBoundingClientRect();if("rtl"!==i.dir){const o=r.left-t.left,a=n.left-o,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-dg,d=Cp(a,[dg,Math.max(dg,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const o=t.right-r.right,a=window.innerWidth-n.right-o,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-dg,d=Cp(a,[dg,Math.max(dg,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const a=p(),s=window.innerHeight-2*dg,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),S=window.getComputedStyle(y),E=parseInt(S.paddingTop,10),_=parseInt(S.paddingBottom,10),C=e.top+e.height/2-dg,k=s-C,N=v.offsetHeight/2,M=f+m+(v.offsetTop+N),P=w-M;if(M<=C){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(k,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(C,f+y.offsetTop+(e?E:0)+N)+P;l.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}l.style.margin=`${dg}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,l,u,y,v,b,i.dir,o]);qu(()=>x(),[x]);const[S,E]=e.useState();qu(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const _=e.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return m(vg,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:m("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:m(ad.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});gg.displayName="SelectItemAlignedPosition";var yg=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=dg,...a}=e,i=Gm(n);return m(Bm,{...i,...a,ref:t,align:r,collisionPadding:o,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)"}})});yg.displayName="SelectPopperPosition";var[vg,bg]=qm(cg,{}),wg="SelectViewport",xg=e.forwardRef((t,n)=>{const{__scopeSelect:r,nonce:o,...a}=t,i=pg(wg,r),s=bg(wg,r),l=Xu(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:o}),m(Xm.Slot,{scope:r,children:m(ad.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:r}=s;if(r?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*dg,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(i<r){const o=i+e,a=Math.min(r,o),s=o-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})})})]})});xg.displayName=wg;var Sg="SelectGroup",[Eg,_g]=qm(Sg);e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qu();return m(Eg,{scope:n,id:o,children:m(ad.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=Sg;var Cg="SelectLabel",kg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_g(Cg,n);return m(ad.div,{id:o.id,...r,ref:t})});kg.displayName=Cg;var Ng="SelectItem",[Mg,Pg]=qm(Ng),Og=e.forwardRef((t,n)=>{const{__scopeSelect:r,value:o,disabled:a=!1,textValue:i,...s}=t,l=Jm(Ng,r),c=pg(Ng,r),u=l.value===o,[d,f]=e.useState(i??""),[p,h]=e.useState(!1),g=Xu(n,e=>c.itemRefCallback?.(e,o,a)),y=Qu(),v=e.useRef("touch"),b=()=>{a||(l.onValueChange(o),l.onOpenChange(!1))};if(""===o)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(Mg,{scope:r,value:o,disabled:a,textId:y,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:m(Xm.ItemSlot,{scope:r,value:o,disabled:a,textValue:d,children:m(ad.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||(jm.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Og.displayName=Ng;var Ag="SelectItemText",Rg=e.forwardRef((t,n)=>{const{__scopeSelect:r,className:o,style:a,...i}=t,s=Jm(Ag,r),l=pg(Ag,r),c=Pg(Ag,r),u=tg(Ag,r),[d,f]=e.useState(null),h=Xu(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 qu(()=>(w(b),()=>x(b)),[w,x,b]),g(y,{children:[m(ad.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?p.createPortal(i.children,s.valueNode):null]})});Rg.displayName=Ag;var Tg="SelectItemIndicator",Dg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Pg(Tg,n).isSelected?m(ad.span,{"aria-hidden":!0,...r,ref:t}):null});Dg.displayName=Tg;var $g="SelectScrollUpButton",Ig=e.forwardRef((t,n)=>{const r=pg($g,t.__scopeSelect),o=bg($g,t.__scopeSelect),[a,i]=e.useState(!1),s=Xu(n,o.onScrollButtonChange);return qu(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),a?m(Bg,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Ig.displayName=$g;var zg="SelectScrollDownButton",Lg=e.forwardRef((t,n)=>{const r=pg(zg,t.__scopeSelect),o=bg(zg,t.__scopeSelect),[a,i]=e.useState(!1),s=Xu(n,o.onScrollButtonChange);return qu(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;i(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),a?m(Bg,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Lg.displayName=zg;var Bg=e.forwardRef((t,n)=>{const{__scopeSelect:r,onAutoScroll:o,...a}=t,i=pg("SelectScrollButton",r),s=e.useRef(null),l=Km(r),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),qu(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),m(ad.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:Vu(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(o,50))}),onPointerMove:Vu(a.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))}),onPointerLeave:Vu(a.onPointerLeave,()=>{c()})})}),Fg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m(ad.div,{"aria-hidden":!0,...r,ref:t})});Fg.displayName="SelectSeparator";var Hg="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Gm(n),a=Jm(Hg,n),i=pg(Hg,n);return a.open&&"popper"===i.position?m(Fm,{...o,...r,ref:t}):null}).displayName=Hg;var Wg=e.forwardRef(({__scopeSelect:t,value:n,...r},o)=>{const a=e.useRef(null),i=Xu(o,a),s=Hm(n);return e.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[s,n]),m(ad.select,{...r,style:{...Wm,...r.style},ref:i,defaultValue:n})});function Vg(e){return""===e||void 0===e}function jg(t){const n=id(t),r=e.useRef(""),o=e.useRef(0),a=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,a,i]}function Yg(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(e,Math.max(a,0));1===o.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}Wg.displayName="SelectBubbleInput";var Xg=og,Kg=sg,Ug=lg,qg=ug,Zg=xg,Gg=kg,Qg=Og,Jg=Rg,ey=Dg,ty=Ig,ny=Lg,ry=Fg;const oy=ng,ay=ig,iy=Lc(Xg)`
|
|
568
|
+
`,ud=({stamps:e,currentStep:n,onStepChange:r,onToggle:o})=>{const{theme:i}=cc(),a=e.length>0?Math.max(...e.map(e=>e.step)):0,s=e.length>0?Math.min(...e.map(e=>e.step)):0,l=a-s+1,c=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return t.createElement(Ju,{theme:i},t.createElement(ed,{theme:i},t.createElement(td,{theme:i},"Timeline"),o&&t.createElement(nd,{onClick:o,title:"Collapse Panel",theme:i},t.createElement($s,{size:16}))),t.createElement(rd,null,Array.from({length:l},(o,a)=>{const l=s+a,u=l===n,d=l<n,f=e.some(e=>e.step===l),p=(t=>{const n=e.filter(e=>e.step===t);if(0===n.length)return null;const r=t-1,o=e.filter(e=>e.step===r);return 0===o.length?null:Math.min(...n.map(e=>e.time))-Math.max(...o.map(e=>e.time))})(l),h=(t=>{const n=e.filter(e=>e.step===t);return 0===n.length?`Step ${t}`:n[0]?.identifier||`Step ${t}`})(l);return t.createElement(od,{key:l,isActive:u,isPast:d,hasStep:f,onClick:()=>f&&r(l),theme:i},t.createElement(id,null,t.createElement(ad,{isActive:u,isPast:d,hasStep:f,theme:i}),t.createElement(sd,{isActive:u,theme:i},"Step ",l),p&&t.createElement("div",{style:{marginLeft:"auto"}},t.createElement(zc,{variant:c(p)},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(p)))),t.createElement(ld,{hasStep:f,theme:i},f?h:"No activity"),u&&t.createElement(cd,{theme:i}))})))};function dd(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function fd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function pd(...e){return t=>{let n=!1;const r=e.map(e=>{const r=fd(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():fd(e[t],null)}}}}function hd(...t){return e.useCallback(pd(...t),t)}function md(t,n=[]){let r=[];const o=()=>{const n=r.map(t=>e.createContext(t));return function(r){const o=r?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...r,[t]:o}}),[r,o])}};return o.scopeName=t,[function(n,o){const i=e.createContext(o),a=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,l=r?.[t]?.[a]||i,c=e.useMemo(()=>s,Object.values(s));return y(l.Provider,{value:c,children:o})};return s.displayName=n+"Provider",[s,function(r,s){const l=s?.[t]?.[a]||i,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},gd(o,...n)]}function gd(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}var yd=globalThis?.document?e.useLayoutEffect:()=>{},vd=e[" useId ".trim().toString()]||(()=>{}),bd=0;function wd(t){const[n,r]=e.useState(vd());return yd(()=>{t||r(e=>e??String(bd++))},[t]),t||(n?`radix-${n}`:"")}var xd=e[" useInsertionEffect ".trim().toString()]||yd;function Ed({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[i,a,s]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),i=e.useRef(r),a=e.useRef(n);return xd(()=>{a.current=n},[n]),e.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}({defaultProp:n,onChange:r}),l=void 0!==t,c=l?t:i;{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(`${o} 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,o])}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 a(e)},[l,t,a,s]);return[c,u]}function Sd(t){const n=_d(t),r=e.forwardRef((t,r)=>{const{children:o,...i}=t,a=e.Children.toArray(o),s=a.find(kd);if(s){const t=s.props.children,o=a.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return y(n,{...i,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return y(n,{...i,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function _d(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){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}(r),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(i.ref=n?pd(n,t):t),e.cloneElement(r,i)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var Cd=Symbol("radix.slottable");function kd(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===Cd}var Nd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=Sd(`Primitive.${n}`),o=e.forwardRef((e,t)=>{const{asChild:o,...i}=e,a=o?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),y(a,{...i,ref:t})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function Md(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var Ad,Od="dismissableLayer.update",Pd="dismissableLayer.pointerDownOutside",Rd="dismissableLayer.focusOutside",Td=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$d=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=t,u=e.useContext(Td),[d,f]=e.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=e.useState({}),m=hd(n,e=>f(e)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(v),w=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(t,n=globalThis?.document){const r=Md(t),o=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){zd(Pd,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));E&&!n&&(i?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(t,n=globalThis?.document){const r=Md(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){zd(Rd,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(a?.(e),s?.(e),e.defaultPrevented||l?.())},p);return function(t,n=globalThis?.document){const r=Md(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{w===u.layers.size-1&&(o?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ad=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Id(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Ad)}},[d,p,r,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Id())},[d,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(Od,e),()=>document.removeEventListener(Od,e)},[]),y(Nd.div,{...c,ref:m,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:dd(t.onFocusCapture,_.onFocusCapture),onBlurCapture:dd(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:dd(t.onPointerDownCapture,S.onPointerDownCapture)})});$d.displayName="DismissableLayer";var Dd=e.forwardRef((t,n)=>{const r=e.useContext(Td),o=e.useRef(null),i=hd(n,o);return e.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),y(Nd.div,{...t,ref:i})});function Id(){const e=new CustomEvent(Od);document.dispatchEvent(e)}function zd(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}Dd.displayName="DismissableLayerBranch";var Ld="focusScope.autoFocusOnMount",Bd="focusScope.autoFocusOnUnmount",Fd={bubbles:!1,cancelable:!0},Hd=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[l,c]=e.useState(null),u=Md(i),d=Md(a),f=e.useRef(null),p=hd(n,e=>c(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:Yd(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Yd(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Yd(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,l,h.paused]),e.useEffect(()=>{if(l){Xd.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Ld,Fd);l.addEventListener(Ld,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Yd(r,{select:t}),document.activeElement!==n)return}((e=Wd(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Yd(l))}return()=>{l.removeEventListener(Ld,u),setTimeout(()=>{const e=new CustomEvent(Bd,Fd);l.addEventListener(Bd,d),l.dispatchEvent(e),e.defaultPrevented||Yd(t??document.body,{select:!0}),l.removeEventListener(Bd,d),Xd.remove(h)},0)}}var e},[l,u,d,h]);const m=e.useCallback(e=>{if(!r&&!o)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,[o,i]=function(e){const t=Wd(e),n=Vd(t,e),r=Vd(t.reverse(),e);return[n,r]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&Yd(i,{select:!0})):(e.preventDefault(),r&&Yd(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return y(Nd.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});function Wd(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 Vd(e,t){for(const n of e)if(!jd(n,{upTo:t}))return n}function jd(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 Yd(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()}}Hd.displayName="FocusScope";var Xd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Kd(e,t),e.unshift(t)},remove(t){e=Kd(e,t),e[0]?.resume()}}}();function Kd(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Ud=e.forwardRef((t,n)=>{const{container:r,...o}=t,[i,a]=e.useState(!1);yd(()=>a(!0),[]);const s=r||i&&globalThis?.document?.body;return s?h.createPortal(y(Nd.div,{...o,ref:n}),s):null});Ud.displayName="Portal";var qd=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=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=Zd(o.current);a.current="mounted"===l?e:"none"},[l]),yd(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=Zd(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,c]),yd(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=Zd(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(c("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=Zd(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=hd(o.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}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function Zd(e){return e?.animationName||"none"}qd.displayName="Presence";var Gd=0;function Qd(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jd()),document.body.insertAdjacentElement("beforeend",e[1]??Jd()),Gd++,()=>{1===Gd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Gd--}},[])}function Jd(){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 ef=function(){return ef=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ef.apply(this,arguments)};function tf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var nf="right-scroll-bar-position",rf="width-before-scroll-bar";function of(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var af="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,sf=new WeakMap;function lf(e,t){var n,r,o,i=(n=t||null,r=function(t){return e.forEach(function(e){return of(e,t)})},(o=u(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return af(function(){var t=sf.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach(function(e){r.has(e)||of(e,null)}),r.forEach(function(e){n.has(e)||of(e,o)})}sf.set(i,e)},[e]),i}function cf(e){return e}var uf=function(t){var n=t.sideCar,r=tf(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,ef({},r))};uf.isSideCarExport=!0;var df=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=cf);var n=[],r=!1,o={read:function(){if(r)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 o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=ef({async:!0,ssr:!1},e),t}(),ff=function(){},pf=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:ff,onWheelCapture:ff,onTouchMoveCapture:ff}),i=o[0],a=o[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=tf(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=lf([r,n]),_=ef(ef({},x),i);return e.createElement(e.Fragment,null,d&&e.createElement(E,{sideCar:df,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?e.cloneElement(e.Children.only(l),ef(ef({},_),{ref:S})):e.createElement(b,ef({},_,{className:c,ref:S}),l))});pf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pf.classNames={fullWidth:rf,zeroRight:nf};function hf(){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 mf=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=hf())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gf=function(){var t,n=(t=mf(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},yf={left:0,top:0,right:0,gap:0},vf=function(e){return parseInt(e||"",10)||0},bf=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return yf;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[vf(n),vf(r),vf(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wf=gf(),xf="data-scroll-locked",Ef=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(xf,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(nf," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(rf," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(nf," .").concat(nf," {\n right: 0 ").concat(r,";\n }\n \n .").concat(rf," .").concat(rf," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(xf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Sf=function(){var e=parseInt(document.body.getAttribute(xf)||"0",10);return isFinite(e)?e:0},_f=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(xf,(Sf()+1).toString()),function(){var e=Sf()-1;e<=0?document.body.removeAttribute(xf):document.body.setAttribute(xf,e.toString())}},[]);var a=e.useMemo(function(){return bf(i)},[i]);return e.createElement(wf,{styles:Ef(a,!n,i,r?"":"!important")})},Cf=!1;if("undefined"!=typeof window)try{var kf=Object.defineProperty({},"passive",{get:function(){return Cf=!0,!0}});window.addEventListener("test",kf,kf),window.removeEventListener("test",kf,kf)}catch(e){Cf=!1}var Nf=!!Cf&&{passive:!1},Mf=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,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Of(e,r)){var o=Pf(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Of=function(e,t){return"v"===e?function(e){return Mf(e,"overflowY")}(t):function(e){return Mf(e,"overflowX")}(t)},Pf=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},Rf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tf=function(e){return[e.deltaX,e.deltaY]},$f=function(e){return e&&"current"in e?e.current:e},Df=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},If=0,zf=[];function Lf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Bf,Ff=(Bf=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(If++)[0],a=e.useState(gf)[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(i));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map($f),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[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,i=Rf(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[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(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=Pf(e,s),h=p[0],m=p[1]-p[2]-i*h;(h||m)&&Of(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&&(o&&Math.abs(d)<1||!o&&a>d)||!u&&(o&&Math.abs(f)<1||!o&&-a>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(zf.length&&zf[zf.length-1]===a){var r="deltaY"in t?Tf(t):Rf(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(s.current.shards||[]).map($f).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?l(t,i[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:Lf(r)};n.current.push(i),setTimeout(function(){n.current=n.current.filter(function(e){return e!==i})},1)},[]),d=e.useCallback(function(e){r.current=Rf(e),o.current=void 0},[]),f=e.useCallback(function(e){u(e.type,Tf(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,Rf(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return zf.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Nf),document.addEventListener("touchmove",c,Nf),document.addEventListener("touchstart",d,Nf),function(){zf=zf.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Nf),document.removeEventListener("touchmove",c,Nf),document.removeEventListener("touchstart",d,Nf)}},[]);var h=t.removeScrollBar,m=t.inert;return e.createElement(e.Fragment,null,m?e.createElement(a,{styles:Df(i)}):null,h?e.createElement(_f,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},df.useMedium(Bf),uf),Hf=e.forwardRef(function(t,n){return e.createElement(pf,ef({},t,{ref:n,sideCar:Ff}))});Hf.classNames=pf.classNames;var Wf=Hf,Vf=new WeakMap,jf=new WeakMap,Yf={},Xf=0,Kf=function(e){return e&&(e.host||Kf(e.parentNode))},Uf=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Kf(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]);Yf[n]||(Yf[n]=new WeakMap);var i=Yf[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.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(r),o=null!==t&&"false"!==t,l=(Vf.get(e)||0)+1,c=(i.get(e)||0)+1;Vf.set(e,l),i.set(e,c),a.push(e),1===l&&o&&jf.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Xf++,function(){a.forEach(function(e){var t=Vf.get(e)-1,o=i.get(e)-1;Vf.set(e,t),i.set(e,o),t||(jf.has(e)||e.removeAttribute(r),jf.delete(e)),o||e.removeAttribute(n)}),--Xf||(Vf=new WeakMap,Vf=new WeakMap,jf=new WeakMap,Yf={})}},qf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Uf(r,o,n,"aria-hidden")):function(){return null}},Zf="Dialog",[Gf,Qf]=md(Zf),[Jf,ep]=Gf(Zf),tp=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u,d]=Ed({prop:o,defaultProp:i??!1,onChange:a,caller:Zf});return y(Jf,{scope:n,triggerRef:l,contentRef:c,contentId:wd(),titleId:wd(),descriptionId:wd(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};tp.displayName=Zf;var np="DialogTrigger",rp=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ep(np,n),i=hd(t,o.triggerRef);return y(Nd.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Sp(o.open),...r,ref:i,onClick:dd(e.onClick,o.onOpenToggle)})});rp.displayName=np;var op="DialogPortal",[ip,ap]=Gf(op,{forceMount:void 0}),sp=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=t,a=ep(op,n);return y(ip,{scope:n,forceMount:r,children:e.Children.map(o,e=>y(qd,{present:r||a.open,children:y(Ud,{asChild:!0,container:i,children:e})}))})};sp.displayName=op;var lp="DialogOverlay",cp=e.forwardRef((e,t)=>{const n=ap(lp,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ep(lp,e.__scopeDialog);return i.modal?y(qd,{present:r||i.open,children:y(dp,{...o,ref:t})}):null});cp.displayName=lp;var up=Sd("DialogOverlay.RemoveScroll"),dp=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ep(lp,n);return y(Wf,{as:up,allowPinchZoom:!0,shards:[o.contentRef],children:y(Nd.div,{"data-state":Sp(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),fp="DialogContent",pp=e.forwardRef((e,t)=>{const n=ap(fp,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ep(fp,e.__scopeDialog);return y(qd,{present:r||i.open,children:i.modal?y(hp,{...o,ref:t}):y(mp,{...o,ref:t})})});pp.displayName=fp;var hp=e.forwardRef((t,n)=>{const r=ep(fp,t.__scopeDialog),o=e.useRef(null),i=hd(n,r.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return qf(e)},[]),y(gp,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:dd(t.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:dd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:dd(t.onFocusOutside,e=>e.preventDefault())})}),mp=e.forwardRef((t,n)=>{const r=ep(fp,t.__scopeDialog),o=e.useRef(!1),i=e.useRef(!1);return y(gp,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,a=r.triggerRef.current?.contains(n);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),gp=e.forwardRef((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=t,l=ep(fp,r),c=e.useRef(null),u=hd(n,c);return Qd(),v(b,{children:[y(Hd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:y($d,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Sp(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),v(b,{children:[y(Np,{titleId:l.titleId}),y(Mp,{contentRef:c,descriptionId:l.descriptionId})]})]})}),yp="DialogTitle",vp=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ep(yp,n);return y(Nd.h2,{id:o.titleId,...r,ref:t})});vp.displayName=yp;var bp="DialogDescription",wp=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ep(bp,n);return y(Nd.p,{id:o.descriptionId,...r,ref:t})});wp.displayName=bp;var xp="DialogClose",Ep=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ep(xp,n);return y(Nd.button,{type:"button",...r,ref:t,onClick:dd(e.onClick,()=>o.onOpenChange(!1))})});function Sp(e){return e?"open":"closed"}Ep.displayName=xp;var _p="DialogTitleWarning",[Cp,kp]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,i=e.useMemo(()=>o,Object.values(o));return y(r.Provider,{value:i,children:n})};return o.displayName=t+"Provider",[o,function(o){const i=e.useContext(r);if(i)return i;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(_p,{contentName:fp,titleName:yp,docsSlug:"dialog"}),Np=({titleId:t})=>{const n=kp(_p),r=`\`${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(r)}},[r,t]),null},Mp=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kp("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}},[r,t,n]),null},Ap=tp,Op=rp,Pp=sp,Rp=cp,Tp=pp,$p=vp,Dp=wp,Ip=Ep;const zp=Ap,Lp=Op,Bp=Pp,Fp=e.forwardRef(({className:t,...n},r)=>e.createElement(Rp,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:t,...n,ref:r}));Fp.displayName=Rp.displayName;const Hp=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},Wp=e.forwardRef(({side:t="right",className:n,children:r,...o},i)=>e.createElement(Bp,null,e.createElement(Fp,null),e.createElement(Tp,{ref:i,style:Hp(t),className:n,...o},r,e.createElement(Ip,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},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",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));Wp.displayName=Tp.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement($p,{ref:r,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:t,...n})).displayName=$p.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(Dp,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=Dp.displayName;const Vp=(e,t,n={})=>{const{minNodeSpacing:r=200,containerWidth:o=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const i=new Map,a=new Map;e.forEach(e=>i.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(i.get(e.source)?.push(e.target),a.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(i.get(e.parent.identifier)?.push(e.identifier),a.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!a.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of i.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,r+50),h=e=>{const t=i.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,r+200),y=(e,t,n)=>{const r=d.get(e)||f,o=n*g+100,a=i.get(e)||[];if(0===a.length)m.set(e,{x:t+r/2-100,y:o});else{let r=t;for(const e of a){const t=d.get(e)||f;y(e,r,n+1),r+=t+p}const i=a[0],s=a[a.length-1],l=m.get(i),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:o})}};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,(o-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=r,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]),r=m.get(x[t]);if(Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)<w){const e=r.x-n.x,t=r.y-n.y,o=Math.sqrt(e*e+t*t);if(o>0){const i=w/o,a=(e*i-e)/2,s=(t*i-t)/2;n.x-=a,n.y-=s,r.x+=a,r.y+=s}else n.x-=w/2,r.x+=w/2}}return m},jp={Agent:Qu,Tool:Qu,Coordinator:Qu},Yp=({flowData:e,width:n="100%",height:r="1000px",className:i="",defaultZoom:c=1,defaultPan:d={x:0,y:0},disableAutoFit:f=!0,showTimeline:p=!1,minNodeSpacing:h=200,onInspect:m})=>{const{theme:g}=cc(),y=g.colors,v=e;if(!v)return t.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${y.border}`,borderRadius:"8px",background:y.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:i},t.createElement("div",{style:{textAlign:"center"}},t.createElement("div",{style:{fontSize:"16px",color:y.mutedForeground,marginBottom:"8px"}},"No flow data available"),t.createElement("div",{style:{fontSize:"14px",color:y.mutedForeground}},"Please provide flowData prop")));const b=l(null),w=l(null),[x,E]=u({width:"number"==typeof n?n:1200,height:"number"==typeof r?r:600}),[S,_]=u(0),[C,k]=u(!1),N=l(null),[M,A]=u(!1),O=o(()=>{const e=v.stamps||v.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[v.stamps,v.steps]);a(()=>(C?N.current=setInterval(()=>{_(e=>e>=O?(k(!1),e):e+1)},250):N.current&&(clearInterval(N.current),N.current=null),()=>{N.current&&clearInterval(N.current)}),[C,O]),a(()=>{const e=v.stamps||v.steps||[];e.length>0&&_(Math.max(...e.map(e=>e.step)))},[v.stamps,v.steps]),a(()=>{const e=()=>{if(b.current){const e=b.current.getBoundingClientRect();E({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof r?r:600)})}};if(e(),window.ResizeObserver&&b.current){const t=new ResizeObserver(e);return t.observe(b.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,r]);const P=o(()=>{if(!v.nodes)return new Map;const e=Math.max(x.width||800,1200);return Vp(v.nodes,v.edges||[],{minNodeSpacing:h,containerWidth:e})},[v.nodes,v.edges,x.width,h]),R=s(e=>v.nodes?v.nodes.filter(t=>t.stamp.step<=e):[],[v.nodes]),T=s(e=>(v.edges||[]).filter(t=>t.stamp.step<=e),[v.edges]),$=o(()=>{const e=R(S),t=T(S);return e.map(e=>{const n=P.get(e.identifier)||{x:0,y:0},r=e.stamp.step===S,o="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:r,id:e.identifier,edges:t,edgeDetails:o,onInspect:m},style:{filter:r?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[P,S,R,T,m]),D=o(()=>T(S).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===S;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?y.primary:y.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?Cc(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Cc(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[S,T,y.primary,y.mutedForeground]),[I,z,L]=ps($),[B,F,H]=hs(D);a(()=>{z($)},[$,z]),a(()=>{F(D)},[D,F]);const W=s(e=>F(t=>Do(e,t)),[F]),V=s(e=>{_(e),k(!1)},[]);s(()=>{k(e=>!e)},[]);const j=(e,t)=>{if(!w.current)return{x:0,y:0};const n=w.current.createSVGPoint();n.x=e,n.y=t;const r=n.matrixTransform(w.current.getScreenCTM()?.inverse());return{x:r.x,y:r.y}},Y=Bi();return a(()=>{if(f||!Y||0===$.length)return;const e=new Map;D.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const r=e.get(t.target)||0;e.set(t.target,r+1)});let t="",n=0;e.forEach((e,r)=>{e>n&&(n=e,t=r)}),!t&&$.length>0&&(t=$[0].id),t&&setTimeout(()=>{Y.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:c,maxZoom:1})},500)},[$,D,Y,f,c]),t.createElement("div",{ref:b,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${y.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:y.background},className:i},p&&t.createElement(zp,{open:M,onOpenChange:A},t.createElement(Lp,{asChild:!0},t.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:y.card,border:`1px solid ${y.border}`,borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=y.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=y.card},title:"Open Timeline"},t.createElement($s,{size:20,style:{color:y.mutedForeground}}))),t.createElement(Bp,null,t.createElement(Tp,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:y.background,borderRight:`1px solid ${y.border}`,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},t.createElement("div",{style:{flex:1,overflowY:"auto"}},t.createElement(ud,{stamps:v.stamps||v.steps||[],currentStep:S,onStepChange:V}))),t.createElement(Ip,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:y.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},t.createElement("svg",{style:{height:"16px",width:"16px"},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",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),t.createElement(ds,{nodes:I,edges:B,onNodesChange:L,onEdgesChange:H,onConnect:W,nodeTypes:jp,edgeTypes:{default:e=>t.createElement(fc,{...e,clientToSvgCoords:j,svgRef:w})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:d.x,y:d.y,zoom:c},onInit:()=>{if(b.current){const e=b.current.querySelector("svg");e&&(w.current=e)}}},t.createElement(Es,{variant:ms.Lines,color:y.mutedBorder,gap:16})),t.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${y.card};\n color: ${y.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${y.border};\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 `))},Xp=e=>t.createElement(rs,null,t.createElement(Yp,e));function Kp(e,[t,n]){return Math.min(n,Math.max(t,e))}var Up=e.createContext(void 0);const qp=["top","right","bottom","left"],Zp=Math.min,Gp=Math.max,Qp=Math.round,Jp=Math.floor,eh=e=>({x:e,y:e}),th={left:"right",right:"left",bottom:"top",top:"bottom"},nh={start:"end",end:"start"};function rh(e,t,n){return Gp(e,Zp(t,n))}function oh(e,t){return"function"==typeof e?e(t):e}function ih(e){return e.split("-")[0]}function ah(e){return e.split("-")[1]}function sh(e){return"x"===e?"y":"x"}function lh(e){return"y"===e?"height":"width"}const ch=new Set(["top","bottom"]);function uh(e){return ch.has(ih(e))?"y":"x"}function dh(e){return sh(uh(e))}function fh(e){return e.replace(/start|end/g,e=>nh[e])}const ph=["left","right"],hh=["right","left"],mh=["top","bottom"],gh=["bottom","top"];function yh(e,t,n,r){const o=ah(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?hh:ph:t?ph:hh;case"left":case"right":return t?mh:gh;default:return[]}}(ih(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(fh)))),i}function vh(e){return e.replace(/left|right|bottom|top/g,e=>th[e])}function bh(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 wh(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xh(e,t,n){let{reference:r,floating:o}=e;const i=uh(t),a=dh(t),s=lh(a),l=ih(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ah(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function Eh(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=oh(t,e),h=bh(p),m=s[f?"floating"===d?"reference":"floating":d],g=wh(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=wh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.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 Sh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _h(e){return qp.some(t=>e[t]>=0)}const Ch=new Set(["left","top"]);function kh(){return"undefined"!=typeof window}function Nh(e){return Oh(e)?(e.nodeName||"").toLowerCase():"#document"}function Mh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ah(e){var t;return null==(t=(Oh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Oh(e){return!!kh()&&(e instanceof Node||e instanceof Mh(e).Node)}function Ph(e){return!!kh()&&(e instanceof Element||e instanceof Mh(e).Element)}function Rh(e){return!!kh()&&(e instanceof HTMLElement||e instanceof Mh(e).HTMLElement)}function Th(e){return!(!kh()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Mh(e).ShadowRoot)}const $h=new Set(["inline","contents"]);function Dh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Kh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!$h.has(o)}const Ih=new Set(["table","td","th"]);function zh(e){return Ih.has(Nh(e))}const Lh=[":popover-open",":modal"];function Bh(e){return Lh.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Fh=["transform","translate","scale","rotate","perspective"],Hh=["transform","translate","scale","rotate","perspective","filter"],Wh=["paint","layout","strict","content"];function Vh(e){const t=jh(),n=Ph(e)?Kh(e):e;return Fh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Hh.some(e=>(n.willChange||"").includes(e))||Wh.some(e=>(n.contain||"").includes(e))}function jh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function Xh(e){return Yh.has(Nh(e))}function Kh(e){return Mh(e).getComputedStyle(e)}function Uh(e){return Ph(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qh(e){if("html"===Nh(e))return e;const t=e.assignedSlot||e.parentNode||Th(e)&&e.host||Ah(e);return Th(t)?t.host:t}function Zh(e){const t=qh(e);return Xh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rh(t)&&Dh(t)?t:Zh(t)}function Gh(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Zh(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Mh(o);if(i){const e=Qh(a);return t.concat(a,a.visualViewport||[],Dh(o)?o:[],e&&n?Gh(e):[])}return t.concat(o,Gh(o,[],n))}function Qh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jh(e){const t=Kh(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Rh(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Qp(n)!==i||Qp(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function em(e){return Ph(e)?e:e.contextElement}function tm(e){const t=em(e);if(!Rh(t))return eh(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Jh(t);let a=(i?Qp(n.width):n.width)/r,s=(i?Qp(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const nm=eh(0);function rm(e){const t=Mh(e);return jh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:nm}function om(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=em(e);let a=eh(1);t&&(r?Ph(r)&&(a=tm(r)):a=tm(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Mh(e))&&t}(i,n,r)?rm(i):eh(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Mh(i),t=r&&Ph(r)?Mh(r):r;let n=e,o=Qh(n);for(;o&&r&&t!==n;){const e=tm(o),t=o.getBoundingClientRect(),r=Kh(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=Mh(o),o=Qh(n)}}return wh({width:u,height:d,x:l,y:c})}function im(e,t){const n=Uh(e).scrollLeft;return t?t.left+n:om(Ah(e)).left+n}function am(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-im(e,n),y:n.top+t.scrollTop}}const sm=new Set(["absolute","fixed"]);function lm(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Mh(e),r=Ah(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=jh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=im(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Ah(e),n=Uh(e),r=e.ownerDocument.body,o=Gp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Gp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+im(e);const s=-n.scrollTop;return"rtl"===Kh(r).direction&&(a+=Gp(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Ah(e));else if(Ph(t))r=function(e,t){const n=om(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Rh(e)?tm(e):eh(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=rm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wh(r)}function cm(e,t){const n=qh(e);return!(n===t||!Ph(n)||Xh(n))&&("fixed"===Kh(n).position||cm(n,t))}function um(e,t,n){const r=Rh(t),o=Ah(t),i="fixed"===n,a=om(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=eh(0);function c(){l.x=im(o)}if(r||!r&&!i)if(("body"!==Nh(t)||Dh(o))&&(s=Uh(t)),r){const e=om(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?eh(0):am(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function dm(e){return"static"===Kh(e).position}function fm(e,t){if(!Rh(e)||"fixed"===Kh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ah(e)===n&&(n=n.ownerDocument.body),n}function pm(e,t){const n=Mh(e);if(Bh(e))return n;if(!Rh(e)){let t=qh(e);for(;t&&!Xh(t);){if(Ph(t)&&!dm(t))return t;t=qh(t)}return n}let r=fm(e,t);for(;r&&zh(r)&&dm(r);)r=fm(r,t);return r&&Xh(r)&&dm(r)&&!Vh(r)?n:r||function(e){let t=qh(e);for(;Rh(t)&&!Xh(t);){if(Vh(t))return t;if(Bh(t))return null;t=qh(t)}return null}(e)||n}const hm={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Ah(r),s=!!t&&Bh(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=eh(1);const u=eh(0),d=Rh(r);if((d||!d&&!i)&&(("body"!==Nh(r)||Dh(a))&&(l=Uh(r)),Rh(r))){const e=om(r);c=tm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!a||d||i?eh(0):am(a,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:Ah,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?Bh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Gh(e,[],!1).filter(e=>Ph(e)&&"body"!==Nh(e)),o=null;const i="fixed"===Kh(e).position;let a=i?qh(e):e;for(;Ph(a)&&!Xh(a);){const t=Kh(a),n=Vh(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&sm.has(o.position)||Dh(a)&&!n&&cm(e,a))?r=r.filter(e=>e!==a):o=t,a=qh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce((e,n)=>{const r=lm(t,n,o);return e.top=Gp(r.top,e.top),e.right=Zp(r.right,e.right),e.bottom=Zp(r.bottom,e.bottom),e.left=Gp(r.left,e.left),e},lm(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:pm,getElementRects:async function(e){const t=this.getOffsetParent||pm,n=this.getDimensions,r=await n(e.floating);return{reference:um(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Jh(e);return{width:t,height:n}},getScale:tm,isElement:Ph,isRTL:function(e){return"rtl"===Kh(e).direction}};function mm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gm(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=em(e),u=o||i?[...c?Gh(c):[],...Gh(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=Ah(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Jp(d)+"px "+-Jp(o.clientWidth-(u+f))+"px "+-Jp(o.clientHeight-(d+p))+"px "+-Jp(u)+"px",threshold:Gp(0,Zp(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||mm(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.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?om(e):null;return l&&function t(){const r=om(e);m&&!mm(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const ym=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=ih(n),s=ah(n),l="y"===uh(n),c=Ch.has(a)?-1:1,u=i&&l?-1:1,d=oh(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 a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},vm=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=oh(e,t),c={x:n,y:r},u=await Eh(t,l),d=uh(ih(o)),f=sh(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=rh(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";h=rh(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-r,enabled:{[f]:i,[d]:a}}}}}},bm=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,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}=oh(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=ih(o),v=uh(s),b=ih(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[vh(s)]:function(e){const t=vh(e);return[fh(e),t,fh(t)]}(s)),E="none"!==h;!f&&E&&x.push(...yh(s,m,h,w));const S=[s,...x],_=await Eh(t,g),C=[];let k=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=ah(e),o=dh(e),i=lh(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=vh(a)),[a,vh(a)]}(o,a,w);C.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=i.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==uh(t))||k.every(e=>uh(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(M=k.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 A;const e=null==(A=k.filter(e=>{if(E){const t=uh(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:A[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},wm=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=oh(e,t),u=await Eh(t,c),d=ih(o),f=ah(o),p="y"===uh(o),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==a.isRTL?void 0:a.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=Zp(m-u[g],v),x=Zp(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=v),E&&!f){const e=Gp(u.left,0),t=Gp(u.right,0),n=Gp(u.top,0),r=Gp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:Gp(u.left,u.right)):S=m-2*(0!==n||0!==r?n+r:Gp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const C=await a.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},xm=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=oh(e,t);switch(r){case"referenceHidden":{const e=Sh(await Eh(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_h(e)}}}case"escaped":{const e=Sh(await Eh(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:_h(e)}}}default:return{}}}}},Em=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=oh(e,t)||{};if(null==c)return{};const d=bh(u),f={x:n,y:r},p=dh(o),h=lh(p),m=await a.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==a.isElement?void 0:a.isElement(E))||(S=s.floating[b]||i.floating[h]);const _=w/2-x/2,C=S/2-m[h]/2-1,k=Zp(d[y],C),N=Zp(d[v],C),M=k,A=S-m[h]-N,O=S/2-m[h]/2+_,P=rh(M,O,A),R=!l.arrow&&null!=ah(o)&&O!==P&&i.reference[h]/2-(O<M?k:N)-m[h]/2<0,T=R?O<M?O-M:O-A:0;return{[p]:f[p]+T,data:{[p]:P,centerOffset:O-P-T,...R&&{alignmentOffset:T}},reset:R}}}),Sm=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=oh(e,t),u={x:n,y:r},d=uh(o),f=sh(d);let p=u[f],h=u[d];const m=oh(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=Ch.has(ih(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[d]:h}}}},_m=(e,t,n)=>{const r=new Map,o={platform:hm,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xh(c,r,l),f=r,p={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[i]:{...p[i],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=xh(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Cm="undefined"!=typeof document?f:function(){};function km(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,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!km(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!km(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Nm(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mm(e,t){const n=Nm(e);return Math.round(t*n)/n}function Am(t){const n=e.useRef(t);return Cm(()=>{n.current=t}),n}const Om=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Em({element:n.current,padding:r}).fn(t):{}:n?Em({element:n,padding:r}).fn(t):{};var o}}),Pm=(e,t)=>({...ym(e),options:[e,t]}),Rm=(e,t)=>({...vm(e),options:[e,t]}),Tm=(e,t)=>({...Sm(e),options:[e,t]}),$m=(e,t)=>({...bm(e),options:[e,t]}),Dm=(e,t)=>({...wm(e),options:[e,t]}),Im=(e,t)=>({...xm(e),options:[e,t]}),zm=(e,t)=>({...Om(e),options:[e,t]});var Lm=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return y(Nd.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y("polygon",{points:"0,0 30,0 15,10"})})});Lm.displayName="Arrow";var Bm=Lm;function Fm(t){const[n,r]=e.useState(void 0);return yd(()=>{if(t){r({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 o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var Hm="Popper",[Wm,Vm]=md(Hm),[jm,Ym]=Wm(Hm),Xm=t=>{const{__scopePopper:n,children:r}=t,[o,i]=e.useState(null);return y(jm,{scope:n,anchor:o,onAnchorChange:i,children:r})};Xm.displayName=Hm;var Km="PopperAnchor",Um=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:o,...i}=t,a=Ym(Km,r),s=e.useRef(null),l=hd(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=o?.current||s.current,e!==c.current&&a.onAnchorChange(c.current)}),o?null:y(Nd.div,{...i,ref:l})});Um.displayName=Km;var qm="PopperContent",[Zm,Gm]=Wm(qm),Qm=e.forwardRef((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...v}=t,b=Ym(qm,r),[w,x]=e.useState(null),E=hd(n,e=>x(e)),[S,_]=e.useState(null),C=Fm(S),k=C?.width??0,N=C?.height??0,M=o+("center"!==a?"-"+a:""),A="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],P=O.length>0,R={padding:A,boundary:O.filter(ng),altBoundary:P},{refs:T,floatingStyles:$,placement:D,isPositioned:I,middlewareData:z}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);km(h,o)||m(o);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!==C.current&&(C.current=e,b(e))},[]),E=a||g,S=s||v,_=e.useRef(null),C=e.useRef(null),k=e.useRef(d),N=null!=c,M=Am(c),A=Am(i),O=Am(u),P=e.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:n,strategy:r,middleware:h};A.current&&(e.platform=A.current),_m(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};R.current&&!km(k.current,t)&&(k.current=t,p.flushSync(()=>{f(t)}))})},[h,n,r,A,O]);Cm(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=e.useRef(!1);Cm(()=>(R.current=!0,()=>{R.current=!1}),[]),Cm(()=>{if(E&&(_.current=E),S&&(C.current=S),E&&S){if(M.current)return M.current(E,S,P);P()}},[E,S,P,M,N]);const T=e.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),$=e.useMemo(()=>({reference:E,floating:S}),[E,S]),D=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!$.floating)return e;const t=Mm($.floating,d.x),n=Mm($.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Nm($.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,$.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:P,refs:T,elements:$,floatingStyles:D}),[d,P,T,$,D])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>gm(...e,{animationFrame:"always"===m}),elements:{reference:b.anchor},middleware:[Pm({mainAxis:i+N,alignmentAxis:s}),c&&Rm({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Tm():void 0,...R}),c&&$m({...R}),Dm({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&zm({element:S,padding:l}),rg({arrowWidth:k,arrowHeight:N}),h&&Im({strategy:"referenceHidden",...R})]}),[L,B]=og(D),F=Md(g);yd(()=>{I&&F?.()},[I,F]);const H=z.arrow?.x,W=z.arrow?.y,V=0!==z.arrow?.centerOffset,[j,Y]=e.useState();return yd(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),y("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:I?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:j,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y(Zm,{scope:r,placedSide:L,onArrowChange:_,arrowX:H,arrowY:W,shouldHideArrow:V,children:y(Nd.div,{"data-side":L,"data-align":B,...v,ref:E,style:{...v.style,animation:I?void 0:"none"}})})})});Qm.displayName=qm;var Jm="PopperArrow",eg={top:"bottom",right:"left",bottom:"top",left:"right"},tg=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=Gm(Jm,n),i=eg[o.placedSide];return y("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:y(Bm,{...r,ref:t,style:{...r.style,display:"block"}})})});function ng(e){return null!==e}tg.displayName=Jm;var rg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=og(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=i?u:`${d}px`,h=-s+"px"):"top"===l?(p=i?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(p=-s+"px",h=i?u:`${f}px`):"left"===l&&(p=`${r.floating.width+s}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}});function og(e){const[t,n="center"]=e.split("-");return[t,n]}var ig=Xm,ag=Um,sg=Qm,lg=tg;function cg(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 ug=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)=>y(Nd.span,{...e,ref:t,style:{...ug,...e.style}})).displayName="VisuallyHidden";var dg=[" ","Enter","ArrowUp","ArrowDown"],fg=[" ","Enter"],pg="Select",[hg,mg,gg]=function(e){const n=e+"CollectionProvider",[r,o]=md(n),[i,a]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return y(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=n;const l=e+"CollectionSlot",c=Sd(l),u=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=hd(t,a(l,n).collectionRef);return y(c,{ref:o,children:r})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Sd(d),h=t.forwardRef((e,n)=>{const{scope:r,children:o,...i}=e,s=t.useRef(null),l=hd(n,s),c=a(d,r);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...i}),()=>{c.itemMap.delete(s)})),y(p,{[f]:"",ref:l,children:o})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const r=a(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},o]}(pg),[yg,vg]=md(pg,[gg,Vm]),bg=Vm(),[wg,xg]=yg(pg),[Eg,Sg]=yg(pg),_g=t=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:i,onOpenChange:a,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:m}=t,g=bg(n),[b,w]=e.useState(null),[x,E]=e.useState(null),[S,_]=e.useState(!1),C=function(t){const n=e.useContext(Up);return t||n||"ltr"}(u),[k,N]=Ed({prop:o,defaultProp:i??!1,onChange:a,caller:pg}),[M,A]=Ed({prop:s,defaultProp:l,onChange:c,caller:pg}),O=e.useRef(null),P=!b||(m||!!b.closest("form")),[R,T]=e.useState(new Set),$=Array.from(R).map(e=>e.props.value).join(";");return y(ig,{...g,children:v(wg,{required:h,scope:n,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:E,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:wd(),value:M,onValueChange:A,open:k,onOpenChange:N,dir:C,triggerPointerDownPosRef:O,disabled:p,children:[y(hg.Provider,{scope:n,children:y(Eg,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{T(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),P?v(uy,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:e=>A(e.target.value),disabled:p,form:m,children:[void 0===M?y("option",{value:""}):null,Array.from(R)]},$):null]})})};_g.displayName=pg;var Cg="SelectTrigger",kg=e.forwardRef((t,n)=>{const{__scopeSelect:r,disabled:o=!1,...i}=t,a=bg(r),s=xg(Cg,r),l=s.disabled||o,c=hd(n,s.onTriggerChange),u=mg(r),d=e.useRef("touch"),[f,p,h]=fy(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=py(t,e,n);void 0!==r&&s.onValueChange(r.value)}),m=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return y(ag,{asChild:!0,...a,children:y(Nd.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":dy(s.value)?"":void 0,...i,ref:c,onClick:dd(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&m(e)}),onPointerDown:dd(i.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&&(m(e),e.preventDefault())}),onKeyDown:dd(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||dg.includes(e.key)&&(m(),e.preventDefault())})})})});kg.displayName=Cg;var Ng="SelectValue",Mg=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=xg(Ng,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==i,d=hd(t,l.onValueNodeChange);return yd(()=>{c(u)},[c,u]),y(Nd.span,{...s,ref:d,style:{pointerEvents:"none"},children:dy(l.value)?y(b,{children:a}):i})});Mg.displayName=Ng;var Ag=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return y(Nd.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Ag.displayName="SelectIcon";var Og=e=>y(Ud,{asChild:!0,...e});Og.displayName="SelectPortal";var Pg="SelectContent",Rg=e.forwardRef((t,n)=>{const r=xg(Pg,t.__scopeSelect),[o,i]=e.useState();if(yd(()=>{i(new DocumentFragment)},[]),!r.open){const e=o;return e?p.createPortal(y($g,{scope:t.__scopeSelect,children:y(hg.Slot,{scope:t.__scopeSelect,children:y("div",{children:t.children})})}),e):null}return y(zg,{...t,ref:n})});Rg.displayName=Pg;var Tg=10,[$g,Dg]=yg(Pg),Ig=Sd("SelectContent.RemoveScroll"),zg=e.forwardRef((t,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:v,...b}=t,w=xg(Pg,r),[x,E]=e.useState(null),[S,_]=e.useState(null),C=hd(n,e=>E(e)),[k,N]=e.useState(null),[M,A]=e.useState(null),O=mg(r),[P,R]=e.useState(!1),T=e.useRef(!1);e.useEffect(()=>{if(x)return qf(x)},[x]),Qd();const $=e.useCallback(e=>{const[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[O,S]),D=e.useCallback(()=>$([k,x]),[$,k,x]);e.useEffect(()=>{P&&D()},[P,D]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;e.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||I(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,I,z]),e.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[L,B]=fy(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=py(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&(N(e),r&&(T.current=!0))},[w.value]),H=e.useCallback(()=>x?.focus(),[x]),W=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&A(e)},[w.value]),V="popper"===o?Bg:Lg,j=V===Bg?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:v}:{};return y($g,{scope:r,content:x,viewport:S,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:H,itemTextRefCallback:W,focusSelectedItem:D,selectedItemText:M,position:o,isPositioned:P,searchRef:L,children:y(Wf,{as:Ig,allowPinchZoom:!0,children:y(Hd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:dd(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:y($d,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:y(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...j,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:dd(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=O().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,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>$(t)),e.preventDefault()}})})})})})})});zg.displayName="SelectContentImpl";var Lg=e.forwardRef((t,n)=>{const{__scopeSelect:r,onPlaced:o,...i}=t,a=xg(Pg,r),s=Dg(Pg,r),[l,c]=e.useState(null),[u,d]=e.useState(null),f=hd(n,e=>d(e)),p=mg(r),h=e.useRef(!1),m=e.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=s,x=e.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&g&&v&&b){const e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-Tg,d=Kp(i,[Tg,Math.max(Tg,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-Tg,d=Kp(i,[Tg,Math.max(Tg,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const i=p(),s=window.innerHeight-2*Tg,c=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),w=f+m+c+parseInt(d.paddingBottom,10)+y,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(g),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),C=e.top+e.height/2-Tg,k=s-C,N=v.offsetHeight/2,M=f+m+(v.offsetTop+N),A=w-M;if(M<=C){const e=i.length>0&&v===i[i.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=M+Math.max(k,N+(e?_:0)+t+y);l.style.height=n+"px"}else{const e=i.length>0&&v===i[0].ref.current;l.style.top="0px";const t=Math.max(C,f+g.offsetTop+(e?S:0)+N)+A;l.style.height=t+"px",g.scrollTop=M-C+g.offsetTop}l.style.margin=`${Tg}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,l,u,g,v,b,a.dir,o]);yd(()=>x(),[x]);const[E,S]=e.useState();yd(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const _=e.useCallback(e=>{e&&!0===m.current&&(x(),w?.(),m.current=!1)},[x,w]);return y(Fg,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:y("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:y(Nd.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Lg.displayName="SelectItemAlignedPosition";var Bg=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Tg,...i}=e,a=bg(n);return y(sg,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});Bg.displayName="SelectPopperPosition";var[Fg,Hg]=yg(Pg,{}),Wg="SelectViewport",Vg=e.forwardRef((t,n)=>{const{__scopeSelect:r,nonce:o,...i}=t,a=Dg(Wg,r),s=Hg(Wg,r),l=hd(n,a.onViewportChange),c=e.useRef(0);return v(b,{children:[y("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:o}),y(hg.Slot,{scope:r,children:y(Nd.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:dd(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Tg,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a<r){const o=a+e,i=Math.min(r,o),s=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});Vg.displayName=Wg;var jg="SelectGroup",[Yg,Xg]=yg(jg);e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=wd();return y(Yg,{scope:n,id:o,children:y(Nd.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=jg;var Kg="SelectLabel",Ug=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Xg(Kg,n);return y(Nd.div,{id:o.id,...r,ref:t})});Ug.displayName=Kg;var qg="SelectItem",[Zg,Gg]=yg(qg),Qg=e.forwardRef((t,n)=>{const{__scopeSelect:r,value:o,disabled:i=!1,textValue:a,...s}=t,l=xg(qg,r),c=Dg(qg,r),u=l.value===o,[d,f]=e.useState(a??""),[p,h]=e.useState(!1),m=hd(n,e=>c.itemRefCallback?.(e,o,i)),g=wd(),v=e.useRef("touch"),b=()=>{i||(l.onValueChange(o),l.onOpenChange(!1))};if(""===o)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 y(Zg,{scope:r,value:o,disabled:i,textId:g,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:y(hg.ItemSlot,{scope:r,value:o,disabled:i,textValue:d,children:y(Nd.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:m,onFocus:dd(s.onFocus,()=>h(!0)),onBlur:dd(s.onBlur,()=>h(!1)),onClick:dd(s.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:dd(s.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:dd(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:dd(s.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:dd(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:dd(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(fg.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Qg.displayName=qg;var Jg="SelectItemText",ey=e.forwardRef((t,n)=>{const{__scopeSelect:r,className:o,style:i,...a}=t,s=xg(Jg,r),l=Dg(Jg,r),c=Gg(Jg,r),u=Sg(Jg,r),[d,f]=e.useState(null),h=hd(n,e=>f(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),m=d?.textContent,g=e.useMemo(()=>y("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return yd(()=>(w(g),()=>x(g)),[w,x,g]),v(b,{children:[y(Nd.span,{id:c.textId,...a,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?p.createPortal(a.children,s.valueNode):null]})});ey.displayName=Jg;var ty="SelectItemIndicator",ny=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Gg(ty,n).isSelected?y(Nd.span,{"aria-hidden":!0,...r,ref:t}):null});ny.displayName=ty;var ry="SelectScrollUpButton",oy=e.forwardRef((t,n)=>{const r=Dg(ry,t.__scopeSelect),o=Hg(ry,t.__scopeSelect),[i,a]=e.useState(!1),s=hd(n,o.onScrollButtonChange);return yd(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?y(sy,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});oy.displayName=ry;var iy="SelectScrollDownButton",ay=e.forwardRef((t,n)=>{const r=Dg(iy,t.__scopeSelect),o=Hg(iy,t.__scopeSelect),[i,a]=e.useState(!1),s=hd(n,o.onScrollButtonChange);return yd(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?y(sy,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});ay.displayName=iy;var sy=e.forwardRef((t,n)=>{const{__scopeSelect:r,onAutoScroll:o,...i}=t,a=Dg("SelectScrollButton",r),s=e.useRef(null),l=mg(r),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),yd(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),y(Nd.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:dd(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(o,50))}),onPointerMove:dd(i.onPointerMove,()=>{a.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))}),onPointerLeave:dd(i.onPointerLeave,()=>{c()})})}),ly=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y(Nd.div,{"aria-hidden":!0,...r,ref:t})});ly.displayName="SelectSeparator";var cy="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=bg(n),i=xg(cy,n),a=Dg(cy,n);return i.open&&"popper"===a.position?y(lg,{...o,...r,ref:t}):null}).displayName=cy;var uy=e.forwardRef(({__scopeSelect:t,value:n,...r},o)=>{const i=e.useRef(null),a=hd(o,i),s=cg(n);return e.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[s,n]),y(Nd.select,{...r,style:{...ug,...r.style},ref:a,defaultValue:n})});function dy(e){return""===e||void 0===e}function fy(t){const n=Md(t),r=e.useRef(""),o=e.useRef(0),i=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),a=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,a]}function py(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(e,Math.max(i,0));1===o.length&&(a=a.filter(e=>e!==n));const s=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}uy.displayName="SelectBubbleInput";var hy=kg,my=Ag,gy=Og,yy=Rg,vy=Vg,by=Ug,wy=Qg,xy=ey,Ey=ny,Sy=oy,_y=ay,Cy=ly;const ky=_g,Ny=Mg,My=bc(hy)`
|
|
290
569
|
display: flex;
|
|
291
570
|
height: 2.5rem;
|
|
292
571
|
width: 100%;
|
|
@@ -314,29 +593,29 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
314
593
|
&[data-placeholder] {
|
|
315
594
|
color: #6b7280;
|
|
316
595
|
}
|
|
317
|
-
`,
|
|
596
|
+
`,Ay=bc(Os)`
|
|
318
597
|
height: 1rem;
|
|
319
598
|
width: 1rem;
|
|
320
599
|
opacity: 0.5;
|
|
321
|
-
`,
|
|
600
|
+
`,Oy=bc(Sy)`
|
|
322
601
|
display: flex;
|
|
323
602
|
cursor: default;
|
|
324
603
|
align-items: center;
|
|
325
604
|
justify-content: center;
|
|
326
605
|
padding: 0.25rem;
|
|
327
|
-
`,
|
|
606
|
+
`,Py=bc(Rs)`
|
|
328
607
|
height: 1rem;
|
|
329
608
|
width: 1rem;
|
|
330
|
-
`,
|
|
609
|
+
`,Ry=bc(_y)`
|
|
331
610
|
display: flex;
|
|
332
611
|
cursor: default;
|
|
333
612
|
align-items: center;
|
|
334
613
|
justify-content: center;
|
|
335
614
|
padding: 0.25rem;
|
|
336
|
-
`,
|
|
615
|
+
`,Ty=bc(Os)`
|
|
337
616
|
height: 1rem;
|
|
338
617
|
width: 1rem;
|
|
339
|
-
|
|
618
|
+
`,$y=bc(yy)`
|
|
340
619
|
position: relative;
|
|
341
620
|
z-index: 50;
|
|
342
621
|
min-width: 8rem;
|
|
@@ -359,13 +638,13 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
359
638
|
transform: translateY(0);
|
|
360
639
|
}
|
|
361
640
|
}
|
|
362
|
-
`,
|
|
641
|
+
`,Dy=bc(by)`
|
|
363
642
|
padding: 0.375rem 0.75rem;
|
|
364
643
|
padding-left: 2rem;
|
|
365
644
|
font-size: 0.875rem;
|
|
366
645
|
font-weight: 600;
|
|
367
646
|
color: #374151;
|
|
368
|
-
`,
|
|
647
|
+
`,Iy=bc(wy)`
|
|
369
648
|
position: relative;
|
|
370
649
|
display: flex;
|
|
371
650
|
cursor: default;
|
|
@@ -391,7 +670,7 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
391
670
|
background-color: #f3f4f6;
|
|
392
671
|
color: #1f2937;
|
|
393
672
|
}
|
|
394
|
-
`,
|
|
673
|
+
`,zy=bc.span`
|
|
395
674
|
position: absolute;
|
|
396
675
|
left: 0.5rem;
|
|
397
676
|
display: flex;
|
|
@@ -399,39 +678,39 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
399
678
|
width: 0.875rem;
|
|
400
679
|
align-items: center;
|
|
401
680
|
justify-content: center;
|
|
402
|
-
`,
|
|
681
|
+
`,Ly=bc(As)`
|
|
403
682
|
height: 1rem;
|
|
404
683
|
width: 1rem;
|
|
405
|
-
`,
|
|
684
|
+
`,By=bc(Cy)`
|
|
406
685
|
margin: 0.25rem -0.25rem;
|
|
407
686
|
height: 1px;
|
|
408
687
|
background-color: #e5e7eb;
|
|
409
|
-
`,
|
|
688
|
+
`,Fy=e.forwardRef(({children:t,...n},r)=>e.createElement(My,{ref:r,...n},t,e.createElement(my,{asChild:!0},e.createElement(Ay,null))));Fy.displayName=hy.displayName;const Hy=e.forwardRef(({...t},n)=>e.createElement(Oy,{ref:n,...t},e.createElement(Py,null)));Hy.displayName=Sy.displayName;const Wy=e.forwardRef(({...t},n)=>e.createElement(Ry,{ref:n,...t},e.createElement(Ty,null)));Wy.displayName=_y.displayName;const Vy=e.forwardRef(({children:t,position:n="popper",...r},o)=>e.createElement(gy,null,e.createElement($y,{ref:o,position:n,...r},e.createElement(Hy,null),e.createElement(vy,{style:{padding:"4px"}},t),e.createElement(Wy,null))));Vy.displayName=yy.displayName;e.forwardRef(({...t},n)=>e.createElement(Dy,{ref:n,...t})).displayName=by.displayName;const jy=e.forwardRef(({children:t,...n},r)=>e.createElement(Iy,{ref:r,...n},e.createElement(zy,null,e.createElement(Ey,null,e.createElement(Ly,null))),e.createElement(xy,null,t)));jy.displayName=wy.displayName;e.forwardRef(({...t},n)=>e.createElement(By,{ref:n,...t})).displayName=Cy.displayName;const Yy=bc.div`
|
|
410
689
|
display: flex;
|
|
411
690
|
align-items: center;
|
|
412
691
|
gap: 0.5rem;
|
|
413
692
|
min-width: 300px;
|
|
414
|
-
`,
|
|
693
|
+
`,Xy=bc.div`
|
|
415
694
|
padding: 0.5rem 1rem;
|
|
416
695
|
color: ${e=>e.theme.colors.mutedForeground};
|
|
417
696
|
font-size: 0.875rem;
|
|
418
697
|
background-color: ${e=>e.theme.colors.muted};
|
|
419
698
|
border-radius: 0.375rem;
|
|
420
699
|
border: 1px solid ${e=>e.theme.colors.border};
|
|
421
|
-
`,
|
|
700
|
+
`,Ky=bc.div`
|
|
422
701
|
flex: 1;
|
|
423
702
|
min-width: 0;
|
|
424
|
-
`,
|
|
703
|
+
`,Uy=({loading:e,children:n,...r})=>t.createElement(Ky,r,n),qy=bc.div`
|
|
425
704
|
display: flex;
|
|
426
705
|
align-items: center;
|
|
427
706
|
justify-content: space-between;
|
|
428
707
|
width: 100%;
|
|
429
|
-
`,
|
|
708
|
+
`,Zy=bc.div`
|
|
430
709
|
padding: 0.5rem 1rem;
|
|
431
710
|
color: ${e=>e.theme.colors.mutedForeground};
|
|
432
711
|
font-size: 0.875rem;
|
|
433
712
|
text-align: center;
|
|
434
|
-
`,
|
|
713
|
+
`,Gy=bc.button`
|
|
435
714
|
display: flex;
|
|
436
715
|
align-items: center;
|
|
437
716
|
justify-content: center;
|
|
@@ -442,14 +721,14 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
442
721
|
background-color: ${e=>e.theme.colors.card};
|
|
443
722
|
color: ${e=>e.theme.colors.cardForeground};
|
|
444
723
|
transition: all 0.2s ease-in-out;
|
|
445
|
-
opacity: ${e=>e.
|
|
446
|
-
cursor: ${e=>e.
|
|
724
|
+
opacity: ${e=>e.disabled?.5:1};
|
|
725
|
+
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
447
726
|
|
|
448
727
|
&:hover:not(:disabled) {
|
|
449
728
|
background-color: ${e=>e.theme.colors.muted};
|
|
450
729
|
color: ${e=>e.theme.colors.cardForeground};
|
|
451
730
|
}
|
|
452
|
-
`,
|
|
731
|
+
`,Qy=({loading:e,disabled:n,children:r,...o})=>t.createElement(Gy,{disabled:n||e,...o},r),Jy=bc(Ts)`
|
|
453
732
|
height: 1rem;
|
|
454
733
|
width: 1rem;
|
|
455
734
|
animation: spin 1s linear infinite;
|
|
@@ -463,10 +742,10 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
463
742
|
transform: rotate(360deg);
|
|
464
743
|
}
|
|
465
744
|
}
|
|
466
|
-
`,
|
|
745
|
+
`,ev=bc(Ds)`
|
|
467
746
|
height: 1rem;
|
|
468
747
|
width: 1rem;
|
|
469
|
-
`,
|
|
748
|
+
`,tv=({files:e,currentFile:n,onFileSelect:r,onRefresh:o,loading:i=!1,disabled:a=!1})=>{const{theme:s}=cc();return t.createElement(Yy,null,0!==e.length||i?t.createElement(ky,{value:n||"",onValueChange:r,disabled:a||i},t.createElement(Uy,{disabled:a,loading:i},t.createElement(Fy,null,t.createElement(qy,null,t.createElement(Ny,{placeholder:i?"Loading sessions...":0===e.length?"No sessions found":"Select an Agent Session..."})))),t.createElement(Vy,null,0!==e.length||i?e.map(e=>t.createElement(jy,{key:e.name,value:e.name},e.name)):t.createElement(Zy,{theme:s},"No agent sessions available"))):t.createElement(Xy,{theme:s},"No agent sessions available"),e.length>0&&t.createElement(Qy,{onClick:e=>{e.stopPropagation(),o()},disabled:i||a,loading:i,title:i?"Loading...":"Refresh files",theme:s},i?t.createElement(Jy,{theme:s}):t.createElement(ev,null)))};var nv="Checkbox",[rv,ov]=md(nv),[iv,av]=rv(nv);function sv(t){const{__scopeCheckbox:n,checked:r,children:o,defaultChecked:i,disabled:a,form:s,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,h]=Ed({prop:r,defaultProp:i??!1,onChange:c,caller:nv}),[m,g]=e.useState(null),[v,b]=e.useState(null),w=e.useRef(!1),x=!m||(!!s||!!m.closest("form")),E={checked:p,disabled:a,setChecked:h,control:m,setControl:g,name:l,form:s,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:!gv(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return y(iv,{scope:n,...E,children:mv(f)?f(E):o})}var lv="CheckboxTrigger",cv=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:r,...o},i)=>{const{control:a,value:s,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:m}=av(lv,t),g=hd(i,d),v=e.useRef(c);return e.useEffect(()=>{const e=a?.form;if(e){const t=()=>f(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[a,f]),y(Nd.button,{type:"button",role:"checkbox","aria-checked":gv(c)?"mixed":c,"aria-required":u,"data-state":yv(c),"data-disabled":l?"":void 0,disabled:l,value:s,...o,ref:g,onKeyDown:dd(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:dd(r,e=>{f(e=>!!gv(e)||!e),m&&h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});cv.displayName=lv;var uv=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return y(sv,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>v(b,{children:[y(cv,{...d,ref:t,__scopeCheckbox:n}),e&&y(hv,{__scopeCheckbox:n})]})})});uv.displayName=nv;var dv="CheckboxIndicator",fv=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=av(dv,n);return y(qd,{present:r||gv(i.checked)||!0===i.checked,children:y(Nd.span,{"data-state":yv(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});fv.displayName=dv;var pv="CheckboxBubbleInput",hv=e.forwardRef(({__scopeCheckbox:t,...n},r)=>{const{control:o,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:s,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=av(pv,t),m=hd(r,h),g=cg(a),v=Fm(o);e.useEffect(()=>{const e=p;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,r=!i.current;if(g!==a&&n){const t=new Event("click",{bubbles:r});e.indeterminate=gv(a),n.call(e,!gv(a)&&a),e.dispatchEvent(t)}},[p,g,a,i]);const b=e.useRef(!gv(a)&&a);return y(Nd.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:u,value:d,form:f,...n,tabIndex:-1,ref:m,style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function mv(e){return"function"==typeof e}function gv(e){return"indeterminate"===e}function yv(e){return gv(e)?"indeterminate":e?"checked":"unchecked"}hv.displayName=pv;const vv=bc(uv)`
|
|
470
749
|
display: flex;
|
|
471
750
|
align-items: center;
|
|
472
751
|
justify-content: center;
|
|
@@ -493,194 +772,22 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
493
772
|
background-color: #6366f1;
|
|
494
773
|
color: white;
|
|
495
774
|
}
|
|
496
|
-
`,
|
|
775
|
+
`,bv=bc(fv)`
|
|
497
776
|
display: flex;
|
|
498
777
|
align-items: center;
|
|
499
778
|
justify-content: center;
|
|
500
779
|
color: currentColor;
|
|
501
|
-
`,
|
|
780
|
+
`,wv=bc(As)`
|
|
502
781
|
height: 1rem;
|
|
503
782
|
width: 1rem;
|
|
504
|
-
`,Gy=e.forwardRef(({className:t,...n},r)=>e.createElement(Uy,{ref:r,...n},e.createElement(qy,null,e.createElement(Zy,null))));Gy.displayName=Fy.displayName;const Qy=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}),Jy=()=>{const e=t.useContext(Qy);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function ev(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function tv(){return rv(/^iPad/)||rv(/^Mac/)&&navigator.maxTouchPoints>1}function nv(){return rv(/^iPhone/)||tv()}function rv(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 ov="undefined"!=typeof window?f:i;function av(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const iv="undefined"!=typeof document&&window.visualViewport;function sv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function lv(e){for(sv(e)&&(e=e.parentElement);e&&!sv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const cv=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let uv,dv=0;function fv(e={}){let{isDisabled:t}=e;ov(()=>{if(!t)return dv++,1===dv&&nv()&&(uv=function(){let e,t=0,n=n=>{e=lv(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let r=n.changedTouches[0].pageY,o=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((o<=0&&r>t||o>=a&&r<t)&&n.preventDefault(),t=r)},o=e=>{let t=e.target;mv(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;mv(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",iv&&(iv.height<window.innerHeight?requestAnimationFrame(()=>{hv(t)}):iv.addEventListener("resize",()=>hv(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=av(function(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=av(pv(document,"touchstart",n,{passive:!1,capture:!0}),pv(document,"touchmove",r,{passive:!1,capture:!0}),pv(document,"touchend",o,{passive:!1,capture:!0}),pv(document,"focus",a,!0),pv(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{dv--,0===dv&&(null==uv||uv())}},[t])}function pv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function hv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=lv(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function mv(e){return e instanceof HTMLInputElement&&!cv.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function gv(...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 yv=new WeakMap;function vv(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||yv.set(e,r)}const bv=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function wv(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[bv(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[bv(t)?5:4]):null)}function xv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const Sv={DURATION:.5,EASE:[.32,.72,0,1]},Ev=16,_v="vaul-dragging";function Cv(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 kv({prop:e,defaultProp:n,onChange:r=()=>{}}){const[o,a]=function({defaultProp:e,onChange:n}){const r=t.useState(e),[o]=r,a=t.useRef(o),i=Cv(n);return t.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),r}({defaultProp:n,onChange:r}),i=void 0!==e,s=i?e:o,l=Cv(r),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 Nv=null;function Mv({open:e,onOpenChange:n,children:r,onDrag:o,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:S=!1,disablePreventScroll:E=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:P=!1}){var O,A;const[R=!1,T]=kv({defaultProp:S,prop:e,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*Sv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[D,$]=t.useState(!1),[I,z]=t.useState(!1),[L,B]=t.useState(!1),F=t.useRef(null),H=t.useRef(null),W=t.useRef(null),V=t.useRef(null),j=t.useRef(null),Y=t.useRef(!1),X=t.useRef(null),K=t.useRef(0),U=t.useRef(!1),q=t.useRef(!S),Z=t.useRef(0),G=t.useRef(null),Q=t.useRef((null==(O=G.current)?void 0:O.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&&(H.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:r,drawerRef:o,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=kv({prop:e,defaultProp:null==r?void 0:r[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==r?void 0:r[r.length-1])||null,[r,d]),g=t.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===d))?e:null},[r,d]),y=r&&r.length>0&&(i||0===i)&&!Number.isNaN(i)&&r[i]===d||!r,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==r?void 0:r.map(t=>{const n="string"==typeof t;let r=0;if(n&&(r=parseInt(t,10)),bv(l)){const o=n?r:p?t*e.height:0;return p?"bottom"===l?e.height-o:-e.height+o:o}const o=n?r:p?t*e.width:0;return p?"right"===l?e.width-o:-e.width+o:o}))?t:[]},[r,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),vv(o.current,{transition:`transform ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`,transform:bv(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?vv(a.current,{transition:`opacity ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`,opacity:"0"}):vv(a.current,{transition:`opacity ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(n,0)])},[o.current,r,v,i,a,f]);return t.useEffect(()=>{if(d||e){var t;const n=null!=(t=null==r?void 0:r.findIndex(t=>t===e||t===d))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,e,r,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!r||"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 o=n?g+1:g-1,a=n?v[o]-v[o-1]:v[o+1]-v[o],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:o}){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&&vv(a.current,{transition:`opacity ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`}),!u&&n>2&&!d)return void(o?t():w(v[0]));if(!u&&n>2&&d&&v&&r)return void w(v[r.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=bv(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&r)return void w(v[r.length-1]);if(c&&e<0&&o&&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]||vv(o.current,{transform:bv(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:F,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});fv({isDisabled:!R||I||!y||L||!D||!k||!E});const{restorePositionSetting:ue}=function({isOpen:e,modal:n,nested:r,hasBeenOpened:o,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=t.useState(()=>"undefined"!=typeof window?window.location.href:""),c=t.useRef(0),u=t.useCallback(()=>{if(ev()&&null===Nv&&e&&!i){Nv={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(ev()&&null!==Nv&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Nv),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),Nv=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(()=>{!r&&o&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[e,o,s,n,r,u,d]),{restorePositionSetting:d}}({isOpen:R,modal:y,nested:null!=b&&b,hasBeenOpened:D,preventScrollRestoration:C,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let r=e;const o=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?wv(G.current,x):null,i=new Date;if("SELECT"===r.tagName)return!1;if(r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(H.current&&i.getTime()-H.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(o&&o.length>0)return!1;if(j.current&&i.getTime()-j.current.getTime()<u&&0===a)return j.current=i,!1;if(t)return j.current=i,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return j.current=new Date,!1;if("dialog"===r.getAttribute("role"))return!0}r=r.parentNode}return!0}function pe(e){!function(){if(!I||!G.current)return;G.current.classList.remove(_v),Y.current=!1,z(!1),V.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{i&&oe(i[0])},1e3*Sv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=wv(G.current,x);vv(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`}),vv(F.current,{transition:`opacity ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&R&&vv(e,{borderRadius:"8px",overflow:"hidden",...bv(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:`${Sv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Sv.EASE.join(",")})`},!0)}return t.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),t.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(mv(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let r=n-t;const o=G.current.getBoundingClientRect().height||0,a=o>.8*n;ee.current||(ee.current=o);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-r)>60&&(U.current=!U.current),i&&i.length>0&&ie&&re){r+=ie[re]||0}if(Z.current=r,o>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(r,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(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[re,i,ie]),t.useEffect(()=>(R&&(vv(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=yv.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(sp,{defaultOpen:S,onOpenChange:e=>{(d||e)&&(e?$(!0):pe(!0),T(e))},open:R},t.createElement(Qy.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:oe,drawerRef:G,overlayRef:F,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,z(!0),W.current=new Date,nv()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=bv(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(_v),Y.current=!1,z(!1),V.current=new Date;const t=wv(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===W.current)return;const n=V.current.getTime()-W.current.getTime(),r=K.current-(bv(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:r*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:o,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?r>0:r<0)return he(),void(null==a||a(e,!0));if(o>.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&&I){const n="bottom"===x||"right"===x?1:-1,r=(K.current-(bv(x)?e.pageY:e.pageX))*n,a=r>0,l=i&&!d&&!a;if(l&&0===re)return;const c=Math.abs(r),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(_v),Y.current=!0,vv(G.current,{transition:"none"}),vv(F.current,{transition:"none"}),i&&se({draggedDistance:r}),a&&!i){const e=(t=r,8*(Math.log(t+1)-2)),o=Math.min(-1*e,0)*n;return void vv(G.current,{transform:bv(x)?`translate3d(0, ${o}px, 0)`:`translate3d(${o}px, 0, 0)`})}const m=1-f;if((le||p&&re===p-1)&&(null==o||o(e,f),vv(F.current,{opacity:`${m}`,transition:"none"},!0)),u&&F.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);vv(u,{borderRadius:`${t}px`,transform:bv(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;vv(G.current,{transform:bv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:R,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-Ev)/window.innerWidth,r=n+t*(1-n),o=t*Ev-16;vv(G.current,{transform:bv(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-Ev)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),vv(G.current,{transition:`transform ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`,transform:bv(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=wv(G.current,x);vv(G.current,{transition:"none",transform:bv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=bv(x)?window.innerHeight:window.innerWidth,r=t?(n-Ev)/n:1,o=t?-16:0;t&&vv(G.current,{transition:`transform ${Sv.DURATION}s cubic-bezier(${Sv.EASE.join(",")})`,transform:bv(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ie,activeSnapPointIndex:re,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:P}},r))}const Pv=t.forwardRef(function({...e},n){const{overlayRef:r,snapPoints:o,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Jy(),u=gv(n,r),d=o&&o.length>0;if(!l)return null;const f=t.useCallback(e=>a(e),[a]);return t.createElement(up,{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})});Pv.displayName="Drawer.Overlay";const Ov=t.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:r,...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}=Jy(),[S,E]=t.useState(!1),_=gv(i,s),C=t.useRef(null),k=t.useRef(null),N=t.useRef(!1),M=y&&y.length>0;!function(){const{direction:e,isOpen:n,shouldScaleBackground:r,setBackgroundColorOnScale:a,noBodyStyles:i}=Jy(),s=t.useRef(null),l=o(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-26)/window.innerWidth}t.useEffect(()=>{if(n&&r){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;a&&!i&&xv(document.body,{background:"black"}),xv(t,{transformOrigin:bv(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Sv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Sv.EASE.join(",")})`});const n=xv(t,{borderRadius:"8px",overflow:"hidden",...bv(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*Sv.DURATION)}}},[n,r,l])}();function P(e){C.current=null,N.current=!1,c(e)}return t.useEffect(()=>{M&&window.requestAnimationFrame(()=>{E(!0)})},[]),t.createElement(dp,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"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),C.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{null==r||r(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(k.current=e,b)return;if(null==a.onPointerMove||a.onPointerMove.call(a,e),!C.current)return;const t=e.pageY-C.current.y,n=e.pageX-C.current.x,r="touch"===e.pointerType?10:2,o=((e,t,n=0)=>{if(N.current)return!0;const r=Math.abs(e.y),o=Math.abs(e.x),a=o>r,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&o>=0&&o<=n)return a}else if(!(e.y*i<0)&&r>=0&&r<=n)return!a;return N.current=!0,!0})({x:n,y:t},g,r);o?u(e):(Math.abs(n)>r||Math.abs(t)>r)&&(C.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),C.current=null,N.current=!1,c(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),P(k.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),k.current&&P(k.current)}})});Ov.displayName="Drawer.Content";const Av=t.forwardRef(function({preventCycle:e=!1,children:n,...r},o){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Jy(),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:o,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},t.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});Av.displayName="Drawer.Handle";const Rv={Root:Mv,NestedRoot:function({onDrag:e,onOpenChange:n,open:r,...o}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Jy();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return t.createElement(Mv,{nested:!0,open:r,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,...o})},Content:Ov,Overlay:Pv,Trigger:lp,Portal:function(e){const n=Jy(),{container:r=n.container,...o}=e;return t.createElement(cp,{container:r,...o})},Handle:Av,Close:hp,Title:fp,Description:pp},Tv=({shouldScaleBackground:t=!0,...n})=>e.createElement(Rv.Root,{shouldScaleBackground:t,...n});Tv.displayName="Drawer";const Dv=Rv.Portal,$v=e.forwardRef(({className:t,...n},r)=>e.createElement(Rv.Overlay,{ref:r,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:t,...n}));$v.displayName=Rv.Overlay.displayName;const Iv=e.forwardRef(({className:t,children:n,...r},o)=>e.createElement(Dv,null,e.createElement($v,null),e.createElement(Rv.Content,{ref:o,style:{position:"fixed",left:0,right:0,top:0,zIndex:50,marginTop:"96px",display:"flex",height:"auto",flexDirection:"column",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",border:"1px solid hsl(var(--border))",backgroundColor:"hsl(var(--background))"},className:t,...r},e.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),n)));Iv.displayName="DrawerContent";e.forwardRef(({className:t,...n},r)=>e.createElement(Rv.Title,{ref:r,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:t,...n})).displayName=Rv.Title.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(Rv.Description,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=Rv.Description.displayName;const zv=()=>t.createElement(Sc,{styles:Ec`
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
color: #1f2937;
|
|
516
|
-
font-family:
|
|
517
|
-
ui-sans-serif,
|
|
518
|
-
system-ui,
|
|
519
|
-
-apple-system,
|
|
520
|
-
BlinkMacSystemFont,
|
|
521
|
-
"Segoe UI",
|
|
522
|
-
Roboto,
|
|
523
|
-
"Helvetica Neue",
|
|
524
|
-
Arial,
|
|
525
|
-
"Noto Sans",
|
|
526
|
-
sans-serif;
|
|
527
|
-
line-height: 1.5;
|
|
528
|
-
-webkit-font-smoothing: antialiased;
|
|
529
|
-
-moz-osx-font-smoothing: grayscale;
|
|
530
|
-
transition:
|
|
531
|
-
background-color 0.2s ease-in-out,
|
|
532
|
-
color 0.2s ease-in-out;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/* Dark theme styles */
|
|
536
|
-
html.dark,
|
|
537
|
-
html.dark body {
|
|
538
|
-
background-color: #0f172a;
|
|
539
|
-
color: #f1f5f9;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/* ReactFlow overrides */
|
|
543
|
-
.react-flow__edge {
|
|
544
|
-
cursor: default !important;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
.react-flow__edge-path {
|
|
548
|
-
cursor: default !important;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.react-flow__edge-label {
|
|
552
|
-
font-size: 10px;
|
|
553
|
-
background: white;
|
|
554
|
-
padding: 2px 4px;
|
|
555
|
-
border-radius: 4px;
|
|
556
|
-
border: 1px solid #e5e7eb;
|
|
557
|
-
max-width: 150px;
|
|
558
|
-
overflow: hidden;
|
|
559
|
-
text-overflow: ellipsis;
|
|
560
|
-
white-space: nowrap;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
/* Dark theme ReactFlow overrides */
|
|
564
|
-
html.dark .react-flow__edge-label {
|
|
565
|
-
background: #1e293b;
|
|
566
|
-
border: 1px solid #475569;
|
|
567
|
-
color: #f1f5f9;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/* Radix UI Select styles */
|
|
571
|
-
[data-radix-select-trigger],
|
|
572
|
-
.shadcn-select {
|
|
573
|
-
display: flex;
|
|
574
|
-
height: 2.5rem;
|
|
575
|
-
width: 100%;
|
|
576
|
-
align-items: center;
|
|
577
|
-
justify-content: space-between;
|
|
578
|
-
border-radius: 0.375rem;
|
|
579
|
-
border: 1px solid #e5e7eb;
|
|
580
|
-
background-color: #ffffff;
|
|
581
|
-
padding: 0.5rem 0.75rem;
|
|
582
|
-
font-size: 0.875rem;
|
|
583
|
-
line-height: 1.25rem;
|
|
584
|
-
outline: none;
|
|
585
|
-
transition: all 0.2s ease-in-out;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/* Dark theme select styles */
|
|
589
|
-
html.dark [data-radix-select-trigger],
|
|
590
|
-
html.dark .shadcn-select {
|
|
591
|
-
border: 1px solid #475569;
|
|
592
|
-
background-color: #1e293b;
|
|
593
|
-
color: #f1f5f9;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
[data-radix-select-trigger]:focus,
|
|
597
|
-
.shadcn-select:focus {
|
|
598
|
-
outline: none;
|
|
599
|
-
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
[data-radix-select-trigger]:disabled,
|
|
603
|
-
.shadcn-select:disabled {
|
|
604
|
-
cursor: not-allowed;
|
|
605
|
-
opacity: 0.5;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
/* File selector refresh button styles */
|
|
609
|
-
.file-selector-refresh-btn {
|
|
610
|
-
padding: 0.5rem;
|
|
611
|
-
border-radius: 0.375rem;
|
|
612
|
-
border: 1px solid #e5e7eb;
|
|
613
|
-
background-color: #ffffff;
|
|
614
|
-
transition: all 0.2s ease-in-out;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
.file-selector-refresh-btn:hover {
|
|
618
|
-
background-color: #f3f4f6;
|
|
619
|
-
color: #374151;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.file-selector-refresh-btn:disabled {
|
|
623
|
-
opacity: 0.5;
|
|
624
|
-
cursor: not-allowed;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
/* Dark theme file selector refresh button */
|
|
628
|
-
html.dark .file-selector-refresh-btn {
|
|
629
|
-
border: 1px solid #475569;
|
|
630
|
-
background-color: #1e293b;
|
|
631
|
-
color: #f1f5f9;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
html.dark .file-selector-refresh-btn:hover {
|
|
635
|
-
background-color: #334155;
|
|
636
|
-
color: #f1f5f9;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/* CSS Variables for backward compatibility */
|
|
640
|
-
:root {
|
|
641
|
-
--background: #ffffff;
|
|
642
|
-
--foreground: #1f2937;
|
|
643
|
-
--card: #ffffff;
|
|
644
|
-
--card-foreground: #1f2937;
|
|
645
|
-
--popover: #ffffff;
|
|
646
|
-
--popover-foreground: #1f2937;
|
|
647
|
-
--primary: #6366f1;
|
|
648
|
-
--primary-foreground: #ffffff;
|
|
649
|
-
--secondary: #f3f4f6;
|
|
650
|
-
--secondary-foreground: #1f2937;
|
|
651
|
-
--muted: #f3f4f6;
|
|
652
|
-
--muted-foreground: #6b7280;
|
|
653
|
-
--accent: #f3f4f6;
|
|
654
|
-
--accent-foreground: #1f2937;
|
|
655
|
-
--destructive: #ef4444;
|
|
656
|
-
--destructive-foreground: #ffffff;
|
|
657
|
-
--border: #e5e7eb;
|
|
658
|
-
--input: #e5e7eb;
|
|
659
|
-
--ring: #6366f1;
|
|
660
|
-
--radius: 0.5rem;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
/* Dark theme CSS variables */
|
|
664
|
-
html.dark {
|
|
665
|
-
--background: #0f172a;
|
|
666
|
-
--foreground: #f1f5f9;
|
|
667
|
-
--card: #1e293b;
|
|
668
|
-
--card-foreground: #f1f5f9;
|
|
669
|
-
--popover: #1e293b;
|
|
670
|
-
--popover-foreground: #f1f5f9;
|
|
671
|
-
--primary: #6366f1;
|
|
672
|
-
--primary-foreground: #ffffff;
|
|
673
|
-
--secondary: #334155;
|
|
674
|
-
--secondary-foreground: #f1f5f9;
|
|
675
|
-
--muted: #334155;
|
|
676
|
-
--muted-foreground: #94a3b8;
|
|
677
|
-
--accent: #334155;
|
|
678
|
-
--accent-foreground: #f1f5f9;
|
|
679
|
-
--destructive: #ef4444;
|
|
680
|
-
--destructive-foreground: #ffffff;
|
|
681
|
-
--border: #475569;
|
|
682
|
-
--input: #475569;
|
|
683
|
-
--ring: #6366f1;
|
|
684
|
-
--radius: 0.5rem;
|
|
685
|
-
}
|
|
686
|
-
`});export{Ep as AgenticFlowVisualizer,gu as AnthropicIcon,qc as Badge,Gy as Checkbox,Tv as Drawer,Ac as Edge,Ay as FileSelector,zv as GlobalStyles,mu as GoogleIcon,pu as JsonTreeViewer,vu as Node,hu as OpenAIIcon,oy as Select,mp as Sheet,Mc as ThemeProvider,Wu as Timeline,_p as Visualizer,xp as calculateAutoLayout,Fc as cn,Yc as conditionalStyle,Cc as darkTheme,kc as defaultTheme,Wc as formatCurrency,Vc as formatLatency,Kc as getColor,Xc as getSpacing,_c as lightTheme,Hc as toTitleCase,jc as truncateText,Pc as useTheme,Oc as useThemeValue};
|
|
783
|
+
`,xv=e.forwardRef(({className:t,...n},r)=>e.createElement(vv,{ref:r,...n},e.createElement(bv,null,e.createElement(wv,null))));xv.displayName=uv.displayName;const Ev=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}),Sv=()=>{const e=t.useContext(Ev);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function _v(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Cv(){return Nv(/^iPad/)||Nv(/^Mac/)&&navigator.maxTouchPoints>1}function kv(){return Nv(/^iPhone/)||Cv()}function Nv(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 Mv="undefined"!=typeof window?f:a;function Av(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Ov="undefined"!=typeof document&&window.visualViewport;function Pv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Rv(e){for(Pv(e)&&(e=e.parentElement);e&&!Pv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Tv=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let $v,Dv=0;function Iv(e={}){let{isDisabled:t}=e;Mv(()=>{if(!t)return Dv++,1===Dv&&kv()&&($v=function(){let e,t=0,n=n=>{e=Rv(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let r=n.changedTouches[0].pageY,o=e.scrollTop,i=e.scrollHeight-e.clientHeight;0!==i&&((o<=0&&r>t||o>=i&&r<t)&&n.preventDefault(),t=r)},o=e=>{let t=e.target;Bv(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},i=e=>{let t=e.target;Bv(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Ov&&(Ov.height<window.innerHeight?requestAnimationFrame(()=>{Lv(t)}):Ov.addEventListener("resize",()=>Lv(t),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Av(function(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=Av(zv(document,"touchstart",n,{passive:!1,capture:!0}),zv(document,"touchmove",r,{passive:!1,capture:!0}),zv(document,"touchend",o,{passive:!1,capture:!0}),zv(document,"focus",i,!0),zv(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Dv--,0===Dv&&(null==$v||$v())}},[t])}function zv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Lv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Rv(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function Bv(e){return e instanceof HTMLInputElement&&!Tv.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Fv(...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 Hv=new WeakMap;function Wv(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||Hv.set(e,r)}const Vv=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function jv(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Vv(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Vv(t)?5:4]):null)}function Yv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const Xv={DURATION:.5,EASE:[.32,.72,0,1]},Kv=16,Uv="vaul-dragging";function qv(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 Zv({prop:e,defaultProp:n,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:n}){const r=t.useState(e),[o]=r,i=t.useRef(o),a=qv(n);return t.useEffect(()=>{i.current!==o&&(a(o),i.current=o)},[o,i,a]),r}({defaultProp:n,onChange:r}),a=void 0!==e,s=a?e:o,l=qv(r),c=t.useCallback(t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)},[a,e,i,l]);return[s,c]}let Gv=null;function Qv({open:e,onOpenChange:n,children:r,onDrag:o,onRelease:i,snapPoints:a,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=a&&a.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:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:A=!1}){var O,P;const[R=!1,T]=Zv({defaultProp:E,prop:e,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*Xv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[$,D]=t.useState(!1),[I,z]=t.useState(!1),[L,B]=t.useState(!1),F=t.useRef(null),H=t.useRef(null),W=t.useRef(null),V=t.useRef(null),j=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==(O=G.current)?void 0:O.getBoundingClientRect().height)||0),J=t.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().width)||0),ee=t.useRef(0),te=t.useCallback(e=>{a&&e===ae.length-1&&(H.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ie,snapPointsOffset:ae,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:r,drawerRef:o,overlayRef:i,fadeFromIndex:a,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=Zv({prop:e,defaultProp:null==r?void 0:r[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==r?void 0:r[r.length-1])||null,[r,d]),g=t.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===d))?e:null},[r,d]),y=r&&r.length>0&&(a||0===a)&&!Number.isNaN(a)&&r[a]===d||!r,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==r?void 0:r.map(t=>{const n="string"==typeof t;let r=0;if(n&&(r=parseInt(t,10)),Vv(l)){const o=n?r:p?t*e.height:0;return p?"bottom"===l?e.height-o:-e.height+o:o}const o=n?r:p?t*e.width:0;return p?"right"===l?e.width-o:-e.width+o:o}))?t:[]},[r,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),Wv(o.current,{transition:`transform ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`,transform:Vv(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==a&&n!==a&&n<a?Wv(i.current,{transition:`opacity ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`,opacity:"0"}):Wv(i.current,{transition:`opacity ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(n,0)])},[o.current,r,v,a,i,f]);return t.useEffect(()=>{if(d||e){var t;const n=null!=(t=null==r?void 0:r.findIndex(t=>t===e||t===d))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,e,r,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!v||void 0===a)return null;const n=g===a-1;if(g>=a&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const o=n?g+1:g-1,i=n?v[o]-v[o-1]:v[o+1]-v[o],s=e/Math.abs(i);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:o}){if(void 0===a)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===a-1&&Wv(i.current,{transition:`opacity ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`}),!u&&n>2&&!d)return void(o?t():w(v[0]));if(!u&&n>2&&d&&v&&r)return void w(v[r.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=Vv(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&r)return void w(v[r.length-1]);if(c&&e<0&&o&&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]||Wv(o.current,{transform:Vv(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:a,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:F,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Iv({isDisabled:!R||I||!y||L||!$||!k||!S});const{restorePositionSetting:ue}=function({isOpen:e,modal:n,nested:r,hasBeenOpened:o,preventScrollRestoration:i,noBodyStyles:a}){const[s,l]=t.useState(()=>"undefined"!=typeof window?window.location.href:""),c=t.useRef(0),u=t.useCallback(()=>{if(_v()&&null===Gv&&e&&!a){Gv={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(_v()&&null!==Gv&&!a){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Gv),window.requestAnimationFrame(()=>{i&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),Gv=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(()=>{!r&&o&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[e,o,s,n,r,u,d]),{restorePositionSetting:d}}({isOpen:R,modal:y,nested:null!=b&&b,hasBeenOpened:$,preventScrollRestoration:C,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let r=e;const o=null==(n=window.getSelection())?void 0:n.toString(),i=G.current?jv(G.current,x):null,a=new Date;if("SELECT"===r.tagName)return!1;if(r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(H.current&&a.getTime()-H.current.getTime()<500)return!1;if(null!==i&&("bottom"===x?i>0:i<0))return!0;if(o&&o.length>0)return!1;if(j.current&&a.getTime()-j.current.getTime()<u&&0===i)return j.current=a,!1;if(t)return j.current=a,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return j.current=new Date,!1;if("dialog"===r.getAttribute("role"))return!0}r=r.parentNode}return!0}function pe(e){!function(){if(!I||!G.current)return;G.current.classList.remove(Uv),Y.current=!1,z(!1),V.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{a&&oe(a[0])},1e3*Xv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=jv(G.current,x);Wv(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`}),Wv(F.current,{transition:`opacity ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&R&&Wv(e,{borderRadius:"8px",overflow:"hidden",...Vv(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:`${Xv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Xv.EASE.join(",")})`},!0)}return t.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),t.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(Bv(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let r=n-t;const o=G.current.getBoundingClientRect().height||0,i=o>.8*n;ee.current||(ee.current=o);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-r)>60&&(U.current=!U.current),a&&a.length>0&&ae&&re){r+=ae[re]||0}if(Z.current=r,o>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(i?s:26)),G.current.style.height=g?e-Math.max(r,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`);a&&a.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[re,a,ae]),t.useEffect(()=>(R&&(Wv(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Hv.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(Ap,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?D(!0):pe(!0),T(e))},open:R},t.createElement(Ev.Provider,{value:{activeSnapPoint:ne,snapPoints:a,setActiveSnapPoint:oe,drawerRef:G,overlayRef:F,onOpenChange:n,onPress:function(e){var t,n;(d||a)&&(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,z(!0),W.current=new Date,kv()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=Vv(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(Uv),Y.current=!1,z(!1),V.current=new Date;const t=jv(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===W.current)return;const n=V.current.getTime()-W.current.getTime(),r=K.current-(Vv(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),a){return ie({draggedDistance:r*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:o,dismissible:d}),void(null==i||i(e,!0))}if("bottom"===x||"right"===x?r>0:r<0)return he(),void(null==i||i(e,!0));if(o>.4)return pe(),void(null==i||i(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==i||i(e,!1));null==i||i(e,!0),he()},onDrag:function(e){var t;if(G.current&&I){const n="bottom"===x||"right"===x?1:-1,r=(K.current-(Vv(x)?e.pageY:e.pageX))*n,i=r>0,l=a&&!d&&!i;if(l&&0===re)return;const c=Math.abs(r),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,i);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,i))return;if(G.current.classList.add(Uv),Y.current=!0,Wv(G.current,{transition:"none"}),Wv(F.current,{transition:"none"}),a&&se({draggedDistance:r}),i&&!a){const e=(t=r,8*(Math.log(t+1)-2)),o=Math.min(-1*e,0)*n;return void Wv(G.current,{transform:Vv(x)?`translate3d(0, ${o}px, 0)`:`translate3d(${o}px, 0, 0)`})}const m=1-f;if((le||p&&re===p-1)&&(null==o||o(e,f),Wv(F.current,{opacity:`${m}`,transition:"none"},!0)),u&&F.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);Wv(u,{borderRadius:`${t}px`,transform:Vv(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!a){const e=c*n;Wv(G.current,{transform:Vv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:R,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-Kv)/window.innerWidth,r=n+t*(1-n),o=t*Kv-16;Wv(G.current,{transform:Vv(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-Kv)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Wv(G.current,{transition:`transform ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`,transform:Vv(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=jv(G.current,x);Wv(G.current,{transition:"none",transform:Vv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=Vv(x)?window.innerHeight:window.innerWidth,r=t?(n-Kv)/n:1,o=t?-16:0;t&&Wv(G.current,{transition:`transform ${Xv.DURATION}s cubic-bezier(${Xv.EASE.join(",")})`,transform:Vv(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ae,activeSnapPointIndex:re,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:A}},r))}const Jv=t.forwardRef(function({...e},n){const{overlayRef:r,snapPoints:o,onRelease:i,shouldFade:a,isOpen:s,modal:l,shouldAnimate:c}=Sv(),u=Fv(n,r),d=o&&o.length>0;if(!l)return null;const f=t.useCallback(e=>i(e),[i]);return t.createElement(Rp,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&a?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});Jv.displayName="Drawer.Overlay";const eb=t.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:r,...i},a){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}=Sv(),[E,S]=t.useState(!1),_=Fv(a,s),C=t.useRef(null),k=t.useRef(null),N=t.useRef(!1),M=y&&y.length>0;!function(){const{direction:e,isOpen:n,shouldScaleBackground:r,setBackgroundColorOnScale:i,noBodyStyles:a}=Sv(),s=t.useRef(null),l=o(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-26)/window.innerWidth}t.useEffect(()=>{if(n&&r){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;i&&!a&&Yv(document.body,{background:"black"}),Yv(t,{transformOrigin:Vv(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Xv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Xv.EASE.join(",")})`});const n=Yv(t,{borderRadius:"8px",overflow:"hidden",...Vv(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*Xv.DURATION)}}},[n,r,l])}();function A(e){C.current=null,N.current=!1,c(e)}return t.useEffect(()=>{M&&window.requestAnimationFrame(()=>{S(!0)})},[]),t.createElement(Tp,{"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",...i,ref:_,style:f&&f.length>0?{"--snap-point-height":`${f[null!=p?p:0]}px`,...n}:n,onPointerDown:e=>{b||(null==i.onPointerDown||i.onPointerDown.call(i,e),C.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{null==r||r(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(k.current=e,b)return;if(null==i.onPointerMove||i.onPointerMove.call(i,e),!C.current)return;const t=e.pageY-C.current.y,n=e.pageX-C.current.x,r="touch"===e.pointerType?10:2,o=((e,t,n=0)=>{if(N.current)return!0;const r=Math.abs(e.y),o=Math.abs(e.x),i=o>r,a=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*a<0)&&o>=0&&o<=n)return i}else if(!(e.y*a<0)&&r>=0&&r<=n)return!i;return N.current=!0,!0})({x:n,y:t},g,r);o?u(e):(Math.abs(n)>r||Math.abs(t)>r)&&(C.current=null)},onPointerUp:e=>{null==i.onPointerUp||i.onPointerUp.call(i,e),C.current=null,N.current=!1,c(e)},onPointerOut:e=>{null==i.onPointerOut||i.onPointerOut.call(i,e),A(k.current)},onContextMenu:e=>{null==i.onContextMenu||i.onContextMenu.call(i,e),k.current&&A(k.current)}})});eb.displayName="Drawer.Content";const tb=t.forwardRef(function({preventCycle:e=!1,children:n,...r},o){const{closeDrawer:i,isDragging:a,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Sv(),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(a||e||g.current)return void y();if(y(),!s||0===s.length)return void(u||i());if(l===s[s.length-1]&&u)return void i();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:o,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},t.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});tb.displayName="Drawer.Handle";const nb={Root:Qv,NestedRoot:function({onDrag:e,onOpenChange:n,open:r,...o}){const{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:s}=Sv();if(!i)throw new Error("Drawer.NestedRoot must be placed in another drawer");return t.createElement(Qv,{nested:!0,open:r,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&a(e),null==n||n(e)},onRelease:s,...o})},Content:eb,Overlay:Jv,Trigger:Op,Portal:function(e){const n=Sv(),{container:r=n.container,...o}=e;return t.createElement(Pp,{container:r,...o})},Handle:tb,Close:Ip,Title:$p,Description:Dp},rb=({shouldScaleBackground:t=!0,...n})=>e.createElement(nb.Root,{shouldScaleBackground:t,...n});rb.displayName="Drawer";const ob=nb.Portal,ib=e.forwardRef(({className:t,...n},r)=>e.createElement(nb.Overlay,{ref:r,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:t,...n}));ib.displayName=nb.Overlay.displayName;const ab=e.forwardRef(({className:t,children:n,...r},o)=>e.createElement(ob,null,e.createElement(ib,null),e.createElement(nb.Content,{ref:o,style:{position:"fixed",left:0,right:0,top:0,zIndex:50,marginTop:"96px",display:"flex",height:"auto",flexDirection:"column",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",border:"1px solid hsl(var(--border))",backgroundColor:"hsl(var(--background))"},className:t,...r},e.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),n)));ab.displayName="DrawerContent";e.forwardRef(({className:t,...n},r)=>e.createElement(nb.Title,{ref:r,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:t,...n})).displayName=nb.Title.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(nb.Description,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=nb.Description.displayName;const sb=()=>null,lb=({children:e,theme:n,fallbackTheme:r=oc})=>{const o=Rc(n||r);return t.createElement(rc,{theme:o},e)},cb=()=>oc,ub={div:(e,...t)=>bc.div`
|
|
784
|
+
${e.map((n,r)=>{if(0===r)return n;const o=t[r-1];return"function"==typeof o?n+`(${e=>{const t=Rc(e.theme);return o({...e,theme:t})}})`+e[r]:n+o+e[r]}).join("")}
|
|
785
|
+
`,button:(e,...t)=>bc.button`
|
|
786
|
+
${e.map((n,r)=>{if(0===r)return n;const o=t[r-1];return"function"==typeof o?n+`(${e=>{const t=Rc(e.theme);return o({...e,theme:t})}})`+e[r]:n+o+e[r]}).join("")}
|
|
787
|
+
`,span:(e,...t)=>bc.span`
|
|
788
|
+
${e.map((n,r)=>{if(0===r)return n;const o=t[r-1];return"function"==typeof o?n+`(${e=>{const t=Rc(e.theme);return o({...e,theme:t})}})`+e[r]:n+o+e[r]}).join("")}
|
|
789
|
+
`,h3:(e,...t)=>bc.h3`
|
|
790
|
+
${e.map((n,r)=>{if(0===r)return n;const o=t[r-1];return"function"==typeof o?n+`(${e=>{const t=Rc(e.theme);return o({...e,theme:t})}})`+e[r]:n+o+e[r]}).join("")}
|
|
791
|
+
`,textarea:(e,...t)=>bc.textarea`
|
|
792
|
+
${e.map((n,r)=>{if(0===r)return n;const o=t[r-1];return"function"==typeof o?n+`(${e=>{const t=Rc(e.theme);return o({...e,theme:t})}})`+e[r]:n+o+e[r]}).join("")}
|
|
793
|
+
`},db=(e,t)=>n=>Ac(n.theme,e,t),fb=(e,t)=>n=>Oc(n.theme,e,t),pb=(e,t)=>n=>Ac(n.theme,e,t);export{Yp as AgenticFlowVisualizer,uu as AnthropicIcon,zc as Badge,xv as Checkbox,rb as Drawer,fc as Edge,tv as FileSelector,sb as GlobalStyles,cu as GoogleIcon,su as JsonTreeViewer,Qu as Node,lu as OpenAIIcon,lb as SafeThemeProvider,ky as Select,zp as Sheet,lc as ThemeProvider,ud as Timeline,Xp as Visualizer,Vp as calculateAutoLayout,xc as cn,kc as conditionalStyle,Rc as createSafeTheme,ic as darkTheme,ac as defaultTheme,Sc as formatCurrency,_c as formatLatency,Mc as getColor,Ac as getSafeColor,Oc as getSafeSpacing,Pc as getSafeThemeValue,Nc as getSpacing,oc as lightTheme,ub as safeStyled,db as safeThemeColor,fb as safeThemeSpacing,pb as safeThemeValue,Ec as toTitleCase,Cc as truncateText,dc as useComponentTheme,cb as useSafeTheme,cc as useTheme,uc as useThemeValue};
|