@railtownai/railtracks-visualizer 0.0.18 → 0.0.20
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 +32 -0
- package/dist/cjs/index.js +150 -283
- package/dist/esm/index.js +151 -284
- package/dist/types/components/FileSelector.d.ts +2 -0
- package/dist/types/components/icons/index.d.ts +1 -1
- package/dist/types/components/ui/badge.d.ts +7 -4
- package/dist/types/components/ui/tooltip.d.ts +9 -0
- package/dist/types/lib/ThemeProvider.d.ts +1 -0
- package/dist/types/lib/theme.d.ts +1 -0
- package/dist/types/lib/utils.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=r(e),a=r(t);function i(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=i(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,c={exports:{}},u={},d={exports:{}},f={};var p,h,m,g={};function y(){return h||(h=1,"production"===process.env.NODE_ENV?d.exports=function(){if(l)return f;l=1;var t=e,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var c="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 f.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,f}():d.exports=(p||(p=1,"production"!==process.env.NODE_ENV&&function(){function t(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=e,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(e,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,t(p)&&h({inst:p})},[e,d,u]),a(function(){return t(p)&&h({inst:p}),e(function(){t(p)&&h({inst:p})})},[e]),s(d),d};g.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())}()),g)),d.exports}var v,b={};"production"===process.env.NODE_ENV?c.exports=function(){if(m)return u;m=1;var t=e,n=y(),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=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;return u.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},u}():c.exports=(v||(v=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 t=e,n=y(),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=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;b.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())}()),b);var w=s(c.exports);const x=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:()=>{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:E}=e,{useSyncExternalStoreWithSelector:S}=w,_=e=>e;function C(e,t=_,n){const r=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(r),r}const k=(e,t)=>{const n=(e=>e?x(e):x)(e),r=(e,r=t)=>C(n,e,r);return Object.assign(r,n),r};function N(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 M={value:()=>{}};function R(){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 O(r)}function O(e){this._=e}function P(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function A(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=M,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}O.prototype=R.prototype={constructor:O,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]=A(o[n],e.name,t);else if(null==t)for(n in o)o[n]=A(o[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=P(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new O(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 T="http://www.w3.org/1999/xhtml",D={svg:"http://www.w3.org/2000/svg",xhtml:T,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),D.hasOwnProperty(t)?{space:D[t],local:e}:e}function I(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===T&&t.documentElement.namespaceURI===T?t.createElement(e):t.createElementNS(n,e)}}function z(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function L(e){var t=$(e);return(t.local?z:I)(t)}function B(){}function F(e){return null==e?B:function(){return this.querySelector(e)}}function j(){return[]}function H(e){return null==e?j:function(){return this.querySelectorAll(e)}}function V(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function W(e){return function(){return this.matches(e)}}function Y(e){return function(t){return t.matches(e)}}var X=Array.prototype.find;function K(){return this.firstElementChild}var U=Array.prototype.filter;function q(){return Array.from(this.children)}function Z(e){return new Array(e.length)}function G(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Q(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 G(e,a[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function J(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 G(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function ee(e){return e.__data__}function te(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ne(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function re(e){return function(){this.removeAttribute(e)}}function oe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ae(e,t){return function(){this.setAttribute(e,t)}}function ie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function se(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function le(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 ce(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ue(e){return function(){this.style.removeProperty(e)}}function de(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fe(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pe(e,t){return e.style.getPropertyValue(t)||ce(e).getComputedStyle(e,null).getPropertyValue(t)}function he(e){return function(){delete this[e]}}function me(e,t){return function(){this[e]=t}}function ge(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function ye(e){return e.trim().split(/^|\s+/)}function ve(e){return e.classList||new be(e)}function be(e){this._node=e,this._names=ye(e.getAttribute("class")||"")}function we(e,t){for(var n=ve(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function xe(e,t){for(var n=ve(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Ee(e){return function(){we(this,e)}}function Se(e){return function(){xe(this,e)}}function _e(e,t){return function(){(t.apply(this,arguments)?we:xe)(this,e)}}function Ce(){this.textContent=""}function ke(e){return function(){this.textContent=e}}function Ne(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Me(){this.innerHTML=""}function Re(e){return function(){this.innerHTML=e}}function Oe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Pe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ae(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Te(){return null}function De(){var e=this.parentNode;e&&e.removeChild(this)}function $e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ie(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ze(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 Le(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 Be(e,t,n){var r=ce(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 Fe(e,t){return function(){return Be(this,e,t)}}function je(e,t){return function(){return Be(this,e,t.apply(this,arguments))}}G.prototype={constructor:G,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)}},be.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 He=[null];function Ve(e,t){this._groups=e,this._parents=t}function We(){return new Ve([[document.documentElement]],He)}function Ye(e){return"string"==typeof e?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],He)}function Xe(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]}Ve.prototype=We.prototype={constructor:Ve,select:function(e){"function"!=typeof e&&(e=F(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 Ve(r,this._parents)},selectAll:function(e){e="function"==typeof e?V(e):H(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 Ve(r,o)},selectChild:function(e){return this.select(null==e?K:function(e){return function(){return X.call(this.children,e)}}("function"==typeof e?e:Y(e)))},selectChildren:function(e){return this.selectAll(null==e?q:function(e){return function(){return U.call(this.children,e)}}("function"==typeof e?e:Y(e)))},filter:function(e){"function"!=typeof e&&(e=W(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 Ve(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ee);var n,r=t?J:Q,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=te(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 Ve(s,o))._enter=l,s._exit=c,s},enter:function(){return new Ve(this._enter||this._groups.map(Z),this._parents)},exit:function(){return new Ve(this._exit||this._groups.map(Z),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 Ve(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=ne);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 Ve(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=$(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?oe:re:"function"==typeof t?n.local?le:se:n.local?ie:ae)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?ue:"function"==typeof t?fe:de)(e,t,null==n?"":n)):pe(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?he:"function"==typeof t?ge:me)(e,t)):this.node()[e]},classed:function(e,t){var n=ye(e+"");if(arguments.length<2){for(var r=ve(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?_e:t?Ee:Se)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ce:("function"==typeof e?Ne:ke)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Me:("function"==typeof e?Oe:Re)(e)):this.node().innerHTML},raise:function(){return this.each(Pe)},lower:function(){return this.each(Ae)},append:function(e){var t="function"==typeof e?e:L(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:L(e),r=null==t?Te:"function"==typeof t?t:F(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(De)},clone:function(e){return this.select(e?Ie:$e)},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?Le:ze,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:Fe)(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 Ke={passive:!1},Ue={capture:!0,passive:!1};function qe(e){e.stopImmediatePropagation()}function Ze(e){e.preventDefault(),e.stopImmediatePropagation()}function Ge(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",Ze,Ue);"onselectstart"in t?n.on("selectstart.drag",Ze,Ue):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Qe(e,t){var n=e.document.documentElement,r=Ye(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ze,Ue),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 Je=e=>()=>e;function et(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 tt(e){return!e.ctrlKey&&!e.button}function nt(){return this.parentNode}function rt(e,t){return null==t?{x:e.x,y:e.y}:t}function ot(){return navigator.maxTouchPoints||"ontouchstart"in this}function at(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function it(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function st(){}et.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var lt=.7,ct=1/lt,ut="\\s*([+-]?\\d+)\\s*",dt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pt=/^#([0-9a-f]{3,8})$/,ht=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),mt=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),gt=new RegExp(`^rgba\\(${ut},${ut},${ut},${dt}\\)$`),yt=new RegExp(`^rgba\\(${ft},${ft},${ft},${dt}\\)$`),vt=new RegExp(`^hsl\\(${dt},${ft},${ft}\\)$`),bt=new RegExp(`^hsla\\(${dt},${ft},${ft},${dt}\\)$`),wt={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 xt(){return this.rgb().formatHex()}function Et(){return this.rgb().formatRgb()}function St(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?_t(t):3===n?new Nt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ct(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ct(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=ht.exec(e))?new Nt(t[1],t[2],t[3],1):(t=mt.exec(e))?new Nt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gt.exec(e))?Ct(t[1],t[2],t[3],t[4]):(t=yt.exec(e))?Ct(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=vt.exec(e))?Tt(t[1],t[2]/100,t[3]/100,1):(t=bt.exec(e))?Tt(t[1],t[2]/100,t[3]/100,t[4]):wt.hasOwnProperty(e)?_t(wt[e]):"transparent"===e?new Nt(NaN,NaN,NaN,0):null}function _t(e){return new Nt(e>>16&255,e>>8&255,255&e,1)}function Ct(e,t,n,r){return r<=0&&(e=t=n=NaN),new Nt(e,t,n,r)}function kt(e,t,n,r){return 1===arguments.length?((o=e)instanceof st||(o=St(o)),o?new Nt((o=o.rgb()).r,o.g,o.b,o.opacity):new Nt):new Nt(e,t,n,null==r?1:r);var o}function Nt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Mt(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Rt(){const e=Ot(this.opacity);return`${1===e?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${1===e?")":`, ${e})`}`}function Ot(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return((e=Pt(e))<16?"0":"")+e.toString(16)}function Tt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $t(e,t,n,r)}function Dt(e){if(e instanceof $t)return new $t(e.h,e.s,e.l,e.opacity);if(e instanceof st||(e=St(e)),!e)return new $t;if(e instanceof $t)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 $t(i,s,l,e.opacity)}function $t(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function It(e){return(e=(e||0)%360)<0?e+360:e}function zt(e){return Math.max(0,Math.min(1,e||0))}function Lt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}at(st,St,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dt(this).formatHsl()},formatRgb:Et,toString:Et}),at(Nt,kt,it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(Pt(this.r),Pt(this.g),Pt(this.b),Ot(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:Mt,formatHex:Mt,formatHex8:function(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Rt,toString:Rt})),at($t,function(e,t,n,r){return 1===arguments.length?Dt(e):new $t(e,t,n,null==r?1:r)},it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new $t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new $t(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 Nt(Lt(e>=240?e-240:e+120,o,r),Lt(e,o,r),Lt(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new $t(It(this.h),zt(this.s),zt(this.l),Ot(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=Ot(this.opacity);return`${1===e?"hsl(":"hsla("}${It(this.h)}, ${100*zt(this.s)}%, ${100*zt(this.l)}%${1===e?")":`, ${e})`}`}}));var Bt=e=>()=>e;function Ft(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):Bt(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):Bt(isNaN(e)?t:e)}var Ht=function e(t){var n=Ft(t);function r(e,t){var r=n((e=kt(e)).r,(t=kt(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 Vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Wt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yt=new RegExp(Wt.source,"g");function Xt(e,t){var n,r,o,a=Wt.lastIndex=Yt.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=Wt.exec(e))&&(r=Yt.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:Vt(n,r)})),a=Yt.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 Kt,Ut=180/Math.PI,qt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zt(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)*Ut,skewX:Math.atan(l)*Ut,scaleX:i,scaleY:s}}function Gt(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:Vt(e,o)},{i:l-2,x:Vt(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:Vt(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:Vt(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:Vt(e,n)},{i:s-2,x:Vt(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 Qt=Gt(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qt:Zt(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Jt=Gt(function(e){return null==e?qt:(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",e),(e=Kt.transform.baseVal.consolidate())?Zt((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):qt)},", ",")",")");function en(e){return((e=Math.exp(e))+1/e)/2}var tn,nn,rn=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=en(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/en(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),on=0,an=0,sn=0,ln=0,cn=0,un=0,dn="object"==typeof performance&&performance.now?performance:Date,fn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pn(){return cn||(fn(hn),cn=dn.now()+un)}function hn(){cn=0}function mn(){this._call=this._time=this._next=null}function gn(e,t,n){var r=new mn;return r.restart(e,t,n),r}function yn(){cn=(ln=dn.now())+un,on=an=0;try{!function(){pn(),++on;for(var e,t=tn;t;)(e=cn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--on}()}finally{on=0,function(){var e,t,n=tn,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:tn=t);nn=e,bn(r)}(),cn=0}}function vn(){var e=dn.now(),t=e-ln;t>1e3&&(un-=t,ln=e)}function bn(e){on||(an&&(an=clearTimeout(an)),e-cn>24?(e<1/0&&(an=setTimeout(yn,e-dn.now()-un)),sn&&(sn=clearInterval(sn))):(sn||(ln=dn.now(),sn=setInterval(vn,1e3)),on=1,fn(yn)))}function wn(e,t,n){var r=new mn;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}mn.prototype=gn.prototype={constructor:mn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?pn():+n)+(null==t?0:+t),this._next||nn===this||(nn?nn._next=this:tn=this,nn=this),this._call=e,this._time=n,bn()},stop:function(){this._call&&(this._call=null,this._time=1/0,bn())}};var xn=R("start","end","cancel","interrupt"),En=[];function Sn(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 wn(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(wn(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=gn(a,0,n.time)}(e,n,{name:t,index:r,group:o,on:xn,tween:En,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function _n(e,t){var n=kn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Cn(e,t){var n=kn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function kn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Nn(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 Mn(e,t){var n,r;return function(){var o=Cn(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 Rn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var a=Cn(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 On(e,t,n){var r=e._id;return e.each(function(){var e=Cn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return kn(e,r).value[t]}}function Pn(e,t){var n;return("number"==typeof t?Vt:t instanceof St?Ht:(n=St(t))?(t=n,Ht):Xt)(e,t)}function An(e){return function(){this.removeAttribute(e)}}function Tn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dn(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 $n(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 In(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 zn(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 Ln(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 Bn(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 Fn(e,t){return function(){_n(this,e).delay=+t.apply(this,arguments)}}function jn(e,t){return t=+t,function(){_n(this,e).delay=t}}function Hn(e,t){return function(){Cn(this,e).duration=+t.apply(this,arguments)}}function Vn(e,t){return t=+t,function(){Cn(this,e).duration=t}}var Wn=We.prototype.constructor;function Yn(e){return function(){this.style.removeProperty(e)}}var Xn=0;function Kn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Un(){return++Xn}var qn=We.prototype;Kn.prototype={constructor:Kn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=F(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,Sn(d[f],t,n,f,d,kn(s,n)));return new Kn(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=H(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=kn(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&Sn(f,t,n,m,p,h);a.push(p),i.push(l)}return new Kn(a,i,t,n)},selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:function(e){"function"!=typeof e&&(e=W(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 Kn(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 Kn(i,this._parents,this._name,this._id)},selection:function(){return new Wn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Un(),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=kn(i,t);Sn(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Kn(r,this._parents,e,n)},call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:function(e,t){var n=this._id;return arguments.length<2?kn(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)?_n:Cn;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=$(e),r="transform"===n?Jt:Pn;return this.attrTween(e,"function"==typeof t?(n.local?zn:In)(n,r,On(this,"attr."+e,t)):null==t?(n.local?Tn:An)(n):(n.local?$n:Dn)(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=$(e);return this.tween(n,(r.local?Ln:Bn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?Qt:Pn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var a=pe(this,e),i=(this.style.removeProperty(e),pe(this,e));return a===i?null:a===n&&i===r?o:o=t(n=a,r=i)}}(e,r)).on("end.style."+e,Yn(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,a;return function(){var i=pe(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=pe(this,e)),i===l?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}(e,r,On(this,"style."+e,t))).each(function(e,t){var n,r,o,a,i="style."+t,s="end."+i;return function(){var l=Cn(this,e),c=l.on,u=null==l.value[i]?a||(a=Yn(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=pe(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}}(On(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=kn(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?Mn:Rn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Fn:jn)(t,e)):kn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Hn:Vn)(t,e)):kn(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(){Cn(this,e).ease=t}}(t,e)):kn(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;Cn(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=Cn(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]:qn[Symbol.iterator]};var Zn={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Gn(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}We.prototype.interrupt=function(e){return this.each(function(){Nn(this,e)})},We.prototype.transition=function(e){var t,n;e instanceof Kn?(t=e._id,e=e._name):(t=Un(),(n=Zn).time=pn(),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])&&Sn(i,e,t,c,s,n||Gn(i,t));return new Kn(r,this._parents,e,t)};var Qn=e=>()=>e;function Jn(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 er(e,t,n){this.k=e,this.x=t,this.y=n}er.prototype={constructor:er,scale:function(e){return 1===e?this:new er(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new er(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 tr=new er(1,0,0);function nr(e){e.stopImmediatePropagation()}function rr(e){e.preventDefault(),e.stopImmediatePropagation()}function or(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function ar(){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 ir(){return this.__zoom||tr}function sr(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lr(){return navigator.maxTouchPoints||"ontouchstart"in this}function cr(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))}er.prototype;const ur=e.createContext(null),dr=ur.Provider,fr=()=>"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.",pr=e=>`Node type "${e}" not found. Using fallback type "default".`,hr=()=>"The React Flow parent container needs a width and a height to render the graph.",mr=()=>"Only child nodes can use a parent extent.",gr=()=>"Can't create edge. An edge needs a source and a target.",yr=e=>`Marker type "${e}" doesn't exist.`,vr=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,br=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",wr=e=>`Edge type "${e}" not found. Using fallback type "default".`,xr=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.`,Er=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Sr(t,n){const r=e.useContext(ur);if(null===r)throw new Error(Er);return C(r,t,n)}const _r=()=>{const t=e.useContext(ur);if(null===t)throw new Error(Er);return e.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},Cr=e=>e.userSelectionActive?"none":"all";function kr({position:t,children:n,className:r,style:o,...a}){const s=Sr(Cr),l=`${t}`.split("-");return e.createElement("div",{className:i(["react-flow__panel",r,...l]),style:{...o,pointerEvents:s},...a},n)}function Nr({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:e.createElement(kr,{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"},e.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Mr=e.memo(({x:t,y:n,label:r,labelStyle:o={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...f})=>{const p=e.useRef(null),[h,m]=e.useState({x:0,y:0,width:0,height:0}),g=i(["react-flow__edge-textwrapper",d]);return e.useEffect(()=>{if(p.current){const e=p.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}},[r]),void 0!==r&&r?e.createElement("g",{transform:`translate(${t-h.width/2} ${n-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f},a&&e.createElement("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),e.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:o},r),u):null});const Rr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Or=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Pr=(e={x:0,y:0},t)=>({x:Or(e.x,t[0][0],t[1][0]),y:Or(e.y,t[0][1],t[1][1])}),Ar=(e,t,n)=>e<t?Or(Math.abs(e-t),1,50)/50:e>n?-Or(Math.abs(e-n),1,50)/50:0,Tr=(e,t)=>[20*Ar(e.x,35,t.width-35),20*Ar(e.y,35,t.height-35)],Dr=e=>e.getRootNode?.()||window?.document,$r=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ir=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),zr=(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)},Lr=e=>!isNaN(e)&&isFinite(e),Br=Symbol.for("internals"),Fr=["Enter"," ","Escape"],jr=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function Hr(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 Vr=e=>"clientX"in e,Wr=(e,t)=>{const n=Vr(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)}},Yr=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,Xr=({id:t,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})=>e.createElement(e.Fragment,null,e.createElement("path",{id:t,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&e.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Lr(r)&&Lr(o)?e.createElement(Mr,{x:r,y:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function Kr(e,t,n){return void 0===n?n:r=>{const o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function Ur({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 qr({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 Zr,Gr,Qr,Jr,eo,to;function no({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===to.Left||e===to.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function ro({sourceX:e,sourceY:t,sourcePosition:n=to.Bottom,targetX:r,targetY:o,targetPosition:a=to.Top}){const[i,s]=no({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=no({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=qr({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]}Xr.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Zr||(Zr={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(Gr||(Gr={})),function(e){e.Partial="partial",e.Full="full"}(Qr||(Qr={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(Jr||(Jr={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(eo||(eo={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(to||(to={}));const oo=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:a=to.Bottom,targetPosition:i=to.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]=ro({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i});return e.createElement(Xr,{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})});oo.displayName="SimpleBezierEdge";const ao={[to.Left]:{x:-1,y:0},[to.Right]:{x:1,y:0},[to.Top]:{x:0,y:-1},[to.Bottom]:{x:0,y:1}},io=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function so({source:e,sourcePosition:t=to.Bottom,target:n,targetPosition:r=to.Top,center:o,offset:a}){const i=ao[t],s=ao[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=to.Bottom,target:n})=>t===to.Left||t===to.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]=Ur({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 lo({sourceX:e,sourceY:t,sourcePosition:n=to.Bottom,targetX:r,targetY:o,targetPosition:a=to.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=so({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(io(e,t)/2,io(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 co=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=to.Bottom,targetPosition:p=to.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=lo({sourceX:t,sourceY:n,sourcePosition:f,targetX:r,targetY:o,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return e.createElement(Xr,{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})});co.displayName="SmoothStepEdge";const uo=e.memo(t=>e.createElement(co,{...t,pathOptions:e.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));uo.displayName="StepEdge";const fo=e.memo(({sourceX:t,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]=Ur({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,s]}({sourceX:t,sourceY:n,targetX:r,targetY:o});return e.createElement(Xr,{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 po(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ho({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case to.Left:return[t-po(t-r,a),n];case to.Right:return[t+po(r-t,a),n];case to.Top:return[t,n-po(n-o,a)];case to.Bottom:return[t,n+po(o-n,a)]}}function mo({sourceX:e,sourceY:t,sourcePosition:n=to.Bottom,targetX:r,targetY:o,targetPosition:a=to.Top,curvature:i=.25}){const[s,l]=ho({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=ho({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,h]=qr({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]}fo.displayName="StraightEdge";const go=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:a=to.Bottom,targetPosition:i=to.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]=mo({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i,curvature:g?.curvature});return e.createElement(Xr,{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})});go.displayName="BezierEdge";const yo=e.createContext(null),vo=yo.Provider;yo.Consumer;const bo=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,wo=(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("&")}`},xo=(e,t)=>{if(!e.source||!e.target)return jr("006",gr()),t;let n;var r;return n="id"in(r=e)&&"source"in r&&"target"in r?{...e}:{...e,id:bo(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)},Eo=({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},So=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),_o=(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}},Co=(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}=_o(n,t).positionAbsolute;return a=e,i=$r({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)},ko=(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}=_o(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=zr(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},No=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Mo=(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=Or(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Ro=(e,t=0)=>e.transition().duration(t);function Oo(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 Po={source:null,target:null,sourceHandle:null,targetHandle:null},Ao=()=>({handleDomNode:null,isValid:!1,connection:Po,endHandle:null});function To(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={...Ao(),handleDomNode:l};if(l){const e=Do(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===Zr.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 Do(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function $o(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Io(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function zo({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Dr(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:E}=Wr(e),S=u?.elementFromPoint(x,E),_=Do(l,S),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=Wr(e,C),M=!1,R=null,O=!1,P=null;const A=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[Br]){const{handleBounds:a}=o[Br];let i=[],s=[];a&&(i=Oo(o,a,"source",`${t}-${n}-${r}`),s=Oo(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]=Tr(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function D(e){const{transform:r}=a();N=Wr(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,a){const{x:i,y:s}=Wr(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=Do(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:Ao()};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,Eo(N,r,!1,[1,1]),h,A,e=>To(e,d,n,t,o?"target":"source",s,u));if(b=l,M||(T(),M=!0),P=c.handleDomNode,R=c.connection,O=c.isValid,i({connectionPosition:b&&O?So({x:b.x,y:b.y},r):N,connectionStatus:Io(!!b,O),connectionEndHandle:c.endHandle}),!b&&!O&&!P)return $o(k);R.source!==R.target&&P&&($o(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 $(e){(b||P)&&R&&O&&r?.(R),a().onConnectEnd?.(e),l&&c?.(e),$o(k),v(),cancelAnimationFrame(w),M=!1,O=!1,R=null,P=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 Lo=()=>!0,Bo=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Fo=e.forwardRef(({type:t="source",position:n=to.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=l||null,y="target"===t,v=_r(),b=e.useContext(yo),{connectOnClick:w,noPanClassName:x}=Sr(Bo,N),{connecting:E,clickConnecting:S}=Sr(((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}})(b,g,t),N);b||v.getState().onError?.("010",br());const _=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=v.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=v.getState();t(xo(o,e))}n?.(o),c?.(o)},C=e=>{if(!b)return;const t=Vr(e);a&&(t&&0===e.button||!t)&&zo({event:e,handleId:g,nodeId:b,onConnect:_,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:r||v.getState().isValidConnection||Lo}),t?f?.(e):p?.(e)};return e.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${g}-${t}`,className:i(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",x,d,{source:!y,target:y,connectable:o,connectablestart:a,connectableend:s,connecting:S,connectionindicator:o&&(a&&!E||s&&E)}]),onMouseDown:C,onTouchStart:C,onClick:w?e=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=v.getState();if(!b||!i&&!a)return;if(!i)return n?.(e,{nodeId:b,handleId:g,handleType:t}),void v.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:g}});const c=Dr(e.target),u=r||l||Lo,{connection:d,isValid:f}=To({nodeId:b,id:g,type:t},s,i.nodeId,i.handleId||null,i.type,u,c);f&&_(d),o?.(e),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Fo.displayName="Handle";var jo=e.memo(Fo);const Ho=({data:t,isConnectable:n,targetPosition:r=to.Top,sourcePosition:o=to.Bottom})=>e.createElement(e.Fragment,null,e.createElement(jo,{type:"target",position:r,isConnectable:n}),t?.label,e.createElement(jo,{type:"source",position:o,isConnectable:n}));Ho.displayName="DefaultNode";var Vo=e.memo(Ho);const Wo=({data:t,isConnectable:n,sourcePosition:r=to.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(jo,{type:"source",position:r,isConnectable:n}));Wo.displayName="InputNode";var Yo=e.memo(Wo);const Xo=({data:t,isConnectable:n,targetPosition:r=to.Top})=>e.createElement(e.Fragment,null,e.createElement(jo,{type:"target",position:r,isConnectable:n}),t?.label);Xo.displayName="OutputNode";var Ko=e.memo(Xo);const Uo=()=>null;Uo.displayName="GroupNode";const qo=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),Zo=e=>e.id;function Go(e,t){return N(e.selectedNodes.map(Zo),t.selectedNodes.map(Zo))&&N(e.selectedEdges.map(Zo),t.selectedEdges.map(Zo))}const Qo=e.memo(({onSelectionChange:t})=>{const n=_r(),{selectedNodes:r,selectedEdges:o}=Sr(qo,Go);return e.useEffect(()=>{const e={nodes:r,edges:o};t?.(e),n.getState().onSelectionChange.forEach(t=>t(e))},[r,o,t]),null});Qo.displayName="SelectionListener";const Jo=e=>!!e.onSelectionChange;function ea({onSelectionChange:t}){const n=Sr(Jo);return t||n?e.createElement(Qo,{onSelectionChange:t}):null}const ta=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 na(t,n){e.useEffect(()=>{void 0!==t&&n(t)},[t])}function ra(t,n,r){e.useEffect(()=>{void 0!==n&&r({[t]:n})},[n])}const oa=({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:a,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:M,fitView:R,fitViewOptions:O,onNodesDelete:P,onEdgesDelete:A,onNodeDrag:T,onNodeDragStart:D,onNodeDragStop:$,onSelectionDrag:I,onSelectionDragStart:z,onSelectionDragStop:L,noPanClassName:B,nodeOrigin:F,rfId:j,autoPanOnConnect:H,autoPanOnNodeDrag:V,onError:W,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=Sr(ta,N),ne=_r();return e.useEffect(()=>{const e=o?.map(e=>({...e,...M}));return Z(r,e),()=>{te()}},[]),ra("defaultEdgeOptions",M,ne.setState),ra("connectionMode",E,ne.setState),ra("onConnect",a,ne.setState),ra("onConnectStart",i,ne.setState),ra("onConnectEnd",s,ne.setState),ra("onClickConnectStart",l,ne.setState),ra("onClickConnectEnd",c,ne.setState),ra("nodesDraggable",u,ne.setState),ra("nodesConnectable",d,ne.setState),ra("nodesFocusable",f,ne.setState),ra("edgesFocusable",p,ne.setState),ra("edgesUpdatable",h,ne.setState),ra("elementsSelectable",x,ne.setState),ra("elevateNodesOnSelect",m,ne.setState),ra("snapToGrid",_,ne.setState),ra("snapGrid",S,ne.setState),ra("onNodesChange",b,ne.setState),ra("onEdgesChange",w,ne.setState),ra("connectOnClick",k,ne.setState),ra("fitViewOnInit",R,ne.setState),ra("fitViewOnInitOptions",O,ne.setState),ra("onNodesDelete",P,ne.setState),ra("onEdgesDelete",A,ne.setState),ra("onNodeDrag",T,ne.setState),ra("onNodeDragStart",D,ne.setState),ra("onNodeDragStop",$,ne.setState),ra("onSelectionDrag",I,ne.setState),ra("onSelectionDragStart",z,ne.setState),ra("onSelectionDragStop",L,ne.setState),ra("noPanClassName",B,ne.setState),ra("nodeOrigin",F,ne.setState),ra("rfId",j,ne.setState),ra("autoPanOnConnect",H,ne.setState),ra("autoPanOnNodeDrag",V,ne.setState),ra("onError",W,ne.setState),ra("connectionRadius",Y,ne.setState),ra("isValidConnection",X,ne.setState),ra("nodeDragThreshold",K,ne.setState),na(t,U),na(n,q),na(g,G),na(y,Q),na(C,J),na(v,ee),null},aa={display:"none"},ia={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sa="react-flow__node-desc",la="react-flow__edge-desc",ca=e=>e.ariaLiveMessage;function ua({rfId:t}){const n=Sr(ca);return e.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ia},n)}function da({rfId:t,disableKeyboardA11y:n}){return e.createElement(e.Fragment,null,e.createElement("div",{id:`${sa}-${t}`,style:aa},"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."," "),e.createElement("div",{id:`${la}-${t}`,style:aa},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&e.createElement(ua,{rfId:t}))}var fa=(t=null,n={actInsideInputWithModifier:!0})=>{const[r,o]=e.useState(!1),a=e.useRef(!1),i=e.useRef(new Set([])),[s,l]=e.useMemo(()=>{if(null!==t){const e=(Array.isArray(t)?t:[t]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=e.reduce((e,t)=>e.concat(...t),[]);return[e,n]}return[[],[]]},[t]);return e.useEffect(()=>{const e="undefined"!=typeof document?document:null,r=n?.target||e;if(null!==t){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Hr(e))return!1;const t=ha(e.code,l);i.current.add(e[t]),pa(s,i.current,!1)&&(e.preventDefault(),o(!0))},t=e=>{if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Hr(e))return!1;const t=ha(e.code,l);pa(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),a.current=!1},c=()=>{i.current.clear(),o(!1)};return r?.addEventListener("keydown",e),r?.addEventListener("keyup",t),window.addEventListener("blur",c),()=>{r?.removeEventListener("keydown",e),r?.removeEventListener("keyup",t),window.removeEventListener("blur",c)}}},[t,o]),r};function pa(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ha(e,t){return t.includes(e)?"code":"key"}function ma(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const a=t.get(o),i=_o(a,r);return ma(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Br]?.z??0)>(n.z??0)?a[Br]?.z??0:n.z??0},r)}function ga(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}=ma(r,e,{...r.position,z:r[Br]?.z??0},t);r.positionAbsolute={x:o,y:a},r[Br].z=i,n?.[r.id]&&(r[Br].isParent=!0)}})}function ya(e,t,n,r){const o=new Map,a={},i=r?1e3:0;return e.forEach(e=>{const n=(Lr(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,Br,{enumerable:!1,value:{handleBounds:c?void 0:r?.[Br]?.handleBounds,z:n}}),o.set(e.id,s)}),ga(o,n,a),o}function va(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=Co(e,d),{x:c,y:u,zoom:f}=Mo(n,r,o,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=tr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Ro(l,t.duration),p):s.transform(l,p),!0}}return!1}function ba(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Br]:n[Br],selected:e.selected})}),new Map(t)}function wa(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function xa({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:ba(e,o)}),i?.(e)),t?.length&&(c&&r({edges:wa(t,a)}),s?.(t))}const Ea=()=>{},Sa={zoomIn:Ea,zoomOut:Ea,zoomTo:Ea,getZoom:()=>1,setViewport:Ea,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ea,fitBounds:Ea,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},_a=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Ca(){const t=(()=>{const t=_r(),{d3Zoom:n,d3Selection:r}=Sr(_a,N),o=e.useMemo(()=>r&&n?{zoomIn:e=>n.scaleBy(Ro(r,e?.duration),1.2),zoomOut:e=>n.scaleBy(Ro(r,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Ro(r,t?.duration),e),getZoom:()=>t.getState().transform[2],setViewport:(e,o)=>{const[a,i,s]=t.getState().transform,l=tr.translate(e.x??a,e.y??i).scale(e.zoom??s);n.transform(Ro(r,o?.duration),l)},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},fitView:e=>va(t.getState,e),setCenter:(e,o,a)=>{const{width:i,height:s,maxZoom:l}=t.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-e*c,d=s/2-o*c,f=tr.translate(u,d).scale(c);n.transform(Ro(r,a?.duration),f)},fitBounds:(e,o)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=t.getState(),{x:c,y:u,zoom:d}=Mo(e,a,i,s,l,o?.padding??.1),f=tr.translate(c,u).scale(d);n.transform(Ro(r,o?.duration),f)},project:e=>{const{transform:n,snapToGrid:r,snapGrid:o}=t.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"),Eo(e,n,r,o)},screenToFlowPosition:e=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:a}=t.getState();if(!a)return e;const{x:i,y:s}=a.getBoundingClientRect(),l={x:e.x-i,y:e.y-s};return Eo(l,n,r,o)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:o,y:a}=r.getBoundingClientRect(),i=So(e,n);return{x:i.x+o,y:i.y+a}},viewportInitialized:!0}:Sa,[n,r]);return o})(),n=_r(),r=e.useCallback(()=>n.getState().getNodes().map(e=>({...e})),[]),o=e.useCallback(e=>n.getState().nodeInternals.get(e),[]),a=e.useCallback(()=>{const{edges:e=[]}=n.getState();return e.map(e=>({...e}))},[]),i=e.useCallback(e=>{const{edges:t=[]}=n.getState();return t.find(t=>t.id===e)},[]),s=e.useCallback(e=>{const{getNodes:t,setNodes:r,hasDefaultNodes:o,onNodesChange:a}=n.getState(),i=t(),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)}},[]),l=e.useCallback(e=>{const{edges:t=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:a}=n.getState(),i="function"==typeof e?e(t):e;if(o)r(i);else if(a){a(0===i.length?t.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),c=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:a,onNodesChange:i}=n.getState();if(a){o([...r(),...t])}else if(i){const e=t.map(e=>({item:e,type:"add"}));i(e)}},[]),u=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:a,onEdgesChange:i}=n.getState();if(a)o([...r,...t]);else if(i){i(t.map(e=>({item:e,type:"add"})))}},[]),d=e.useCallback(()=>{const{getNodes:e,edges:t=[],transform:r}=n.getState(),[o,a,i]=r;return{nodes:e().map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},[]),f=e.useCallback(({nodes:e,edges:t})=>{const{nodeInternals:r,getNodes:o,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=n.getState(),f=(e||[]).map(e=>e.id),p=(t||[]).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=No(h,m),t=[...g,...e],o=t.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&n.setState({edges:a.filter(e=>!o.includes(e.id))}),i&&(h.forEach(e=>{r.delete(e.id)}),n.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(t),d&&d(o.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),p=e.useCallback(e=>{const t=Lr((r=e).width)&&Lr(r.height)&&Lr(r.x)&&Lr(r.y);var r;const o=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!o)return[null,null,t];return[t?e:Ir(o),o,t]},[]),h=e.useCallback((e,t=!0,r)=>{const[o,a,i]=p(e);return o?(r||n.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const n=Ir(e),r=zr(n,o);return t&&r>0||r>=o.width*o.height}):[]},[]),m=e.useCallback((e,t,n=!0)=>{const[r]=p(e);if(!r)return!1;const o=zr(r,t);return n&&o>0||o>=r.width*r.height},[]);return e.useMemo(()=>({...t,getNodes:r,getNode:o,getEdges:a,getEdge:i,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:m}),[t,r,o,a,i,s,l,c,u,d,f,h,m])}const ka={actInsideInputWithModifier:!1};const Na={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ma=e=>({x:e.x,y:e.y,zoom:e.k}),Ra=(e,t)=>e.target.closest(`.${t}`),Oa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Pa=e=>{const t=e.ctrlKey&&Yr()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Aa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ta=({onMove:t,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:a=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Gr.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:x})=>{const E=e.useRef(),S=_r(),_=e.useRef(!1),C=e.useRef(!1),k=e.useRef(null),M=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:P,d3ZoomHandler:A,userSelectionActive:T}=Sr(Aa,N),D=fa(y),$=e.useRef(0),I=e.useRef(!1),z=e.useRef();return function(t){const n=_r();e.useEffect(()=>{let e;const r=()=>{if(!t.current)return;const e=Rr(t.current);0!==e.height&&0!==e.width||n.getState().onError?.("004",hr()),n.setState({width:e.width||500,height:e.height||500})};return r(),window.addEventListener("resize",r),t.current&&(e=new ResizeObserver(()=>r()),e.observe(t.current)),()=>{window.removeEventListener("resize",r),e&&t.current&&e.unobserve(t.current)}},[])}(k),e.useEffect(()=>{if(k.current){const e=k.current.getBoundingClientRect(),t=function(){var e,t,n,r=or,o=ar,a=cr,i=sr,s=lr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=rn,f=R("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",ir).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 er(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 er(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 er(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 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,i.apply(this,arguments)))),u=Xe(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)],Nn(this),n.start()}rr(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 S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=w(this,t,!0).event(e),s=Ye(e.view).on("mousemove.zoom",function(e){if(rr(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]=Xe(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),Qe(e.view,i.moved),rr(e),i.event(e).end()},!0),l=Xe(e,o),u=e.clientX,d=e.clientY;Ge(e.view),nr(e),i.mouse=[l,this.__zoom.invert(l)],Nn(this),i.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=Xe(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);rr(e),u>0?Ye(this).transition().duration(u).call(b,d,i,e):Ye(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(nr(n),i=0;i<u;++i)l=[l=Xe(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)),Nn(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(rr(e),n=0;n<u;++n)o=Xe(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(nr(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=Xe(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=Ye(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",ir),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(tr.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=Ye(this.that).datum();f.call(e,this.that,new Jn(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:Qn(+e),m):i},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:Qn(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Qn(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:Qn([[+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([m,g]).translateExtent(h),n=Ye(k.current).call(t),r=tr.translate(p.x,p.y).scale(Or(p.zoom,m,g)),o=[[0,0],[e.width,e.height]],a=t.constrain()(r,o,h);t.transform(n,a),t.wheelDelta(Pa),S.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:k.current.closest(".react-flow")})}},[]),e.useEffect(()=>{P&&O&&(!s||D||T?void 0!==A&&P.on("wheel.zoom",function(e,t){if(!v&&"wheel"===e.type&&!e.ctrlKey||Ra(e,w))return null;e.preventDefault(),A.call(this,e,t)},{passive:!1}):P.on("wheel.zoom",e=>{if(Ra(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const o=P.property("__zoom").k||1;if(e.ctrlKey&&i){const t=Xe(e),n=Pa(e),r=o*Math.pow(2,n);return void O.scaleTo(P,r,t,e)}const a=1===e.deltaMode?20:1;let s=c===Gr.Vertical?0:e.deltaX*a,u=c===Gr.Horizontal?0:e.deltaY*a;!Yr()&&e.shiftKey&&c!==Gr.Vertical&&(s=e.deltaY*a,u=0),O.translateBy(P,-s/o*l,-u/o*l,{internal:!0});const d=Ma(P.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=S.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(e,d),f?.(d)),I.current&&(t?.(e,d),p?.(d),z.current=setTimeout(()=>{r?.(e,d),h?.(d),I.current=!1},150))},{passive:!1}))},[T,s,c,P,O,A,D,i,v,w,n,t,r]),e.useEffect(()=>{O&&O.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;$.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=S.getState(),r=Ma(e.transform);_.current=!0,M.current=r,"mousedown"===e.sourceEvent?.type&&S.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)})},[O,n]),e.useEffect(()=>{O&&(T&&!_.current?O.on("zoom",null):T||O.on("zoom",e=>{const{onViewportChange:n}=S.getState();if(S.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),C.current=!(!o||!Oa(f,$.current??0)),(t||n)&&!e.sourceEvent?.internal){const r=Ma(e.transform);n?.(r),t?.(e.sourceEvent,r)}}))},[T,O,t,f,o]),e.useEffect(()=>{O&&O.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=S.getState();if(_.current=!1,S.setState({paneDragging:!1}),o&&Oa(f,$.current??0)&&!C.current&&o(e.sourceEvent),C.current=!1,(r||t)&&(n=M.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Ma(e.transform);M.current=n,clearTimeout(E.current),E.current=setTimeout(()=>{t?.(n),r?.(e.sourceEvent,n)},s?150:0)}var n,a})},[O,s,f,r,o]),e.useEffect(()=>{O&&O.filter(e=>{const t=D||a,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ra(e,"react-flow__node")||Ra(e,"react-flow__edge")))return!0;if(!(f||t||s||u||i))return!1;if(T)return!1;if(!u&&"dblclick"===e.type)return!1;if(Ra(e,w)&&"wheel"===e.type)return!1;if(Ra(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!D))return!1;if(!i&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!s&&!n&&"wheel"===e.type)return!1;if(!f&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(f)&&!f.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(f)&&f.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[T,O,a,i,s,u,f,d,D]),e.createElement("div",{className:"react-flow__renderer",ref:k,style:Na},b)},Da=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function $a(){const{userSelectionActive:t,userSelectionRect:n}=Sr(Da,N);return t&&n?e.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 Ia(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 za(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&&Ia(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&&Ia(t,o);break;case"remove":return t}return t.push(o),t},n)}function La(e,t){return za(e,t)}const Ba=(e,t)=>({id:e,type:"select",selected:t});function Fa(e,t){return e.reduce((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(Ba(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(Ba(n.id,!1))),e},[])}const ja=(e,t)=>n=>{n.target===t.current&&e?.(n)},Ha=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Va=e.memo(({isSelecting:t,selectionMode:n=Qr.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:a,onPaneClick:s,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=e.useRef(null),m=_r(),g=e.useRef(0),y=e.useRef(0),v=e.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=Sr(Ha,N),E=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},S=e=>{s?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},_=c?e=>c(e):void 0,C=w&&(t||b);return e.createElement("div",{className:i(["react-flow__pane",{dragging:x,selection:t}]),onClick:C?void 0:ja(S,h),onContextMenu:ja(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():l?.(e)},h),onWheel:ja(_,h),onMouseEnter:C?void 0:u,onMouseDown:C?e=>{const{resetSelectedElements:n,domNode:r}=m.getState();if(v.current=r?.getBoundingClientRect(),!w||!t||0!==e.button||e.target!==h.current||!v.current)return;const{x:a,y:i}=Wr(e,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),o?.(e)}:void 0,onMouseMove:C?e=>{const{userSelectionRect:r,nodeInternals:o,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!t||!v.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=Wr(e,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=ko(o,h,i,n===Qr.Partial,!0,c),x=No(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Fa(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Fa(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:C?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:C?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}:f,ref:h,style:Na},p,e.createElement($a,null))});function Wa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||Wa(r,t))}function Ya(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 Xa(e,t,n,r){return Array.from(e.values()).filter(n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!Wa(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 Ka(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}=_o(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}=_o(t,o).positionAbsolute;s=t&&Lr(r)&&Lr(a)&&Lr(t.width)&&Lr(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",mr()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=_o(e,o).positionAbsolute}const u=s&&"parent"!==s?Pr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function Ua({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]}Va.displayName="Pane";const qa=(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,...Rr(e)}})};function Za(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Ga({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",xr(e))}function Qa(e){return(t,n,r)=>e?.(t,r)}function Ja({nodeRef:t,disabled:n=!1,noDragClassName:r,handleSelector:o,nodeId:a,isSelectable:i,selectNodesOnDrag:s}){const l=_r(),[c,u]=e.useState(!1),d=e.useRef([]),f=e.useRef({x:null,y:null}),p=e.useRef(0),h=e.useRef(null),m=e.useRef({x:0,y:0}),g=e.useRef(null),y=e.useRef(!1),v=e.useRef(!1),b=e.useRef(!1),w=function(){const t=_r(),n=e.useCallback(({sourceEvent:e})=>{const{transform:n,snapGrid:r,snapToGrid:o}=t.getState(),a=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.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 n}();return e.useEffect(()=>{if(t?.current){const e=Ye(t.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:o,updateNodePositions:i,nodeExtent:s,snapGrid:c,snapToGrid:p,nodeOrigin:h,onError:m}=l.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Co(d.current,h);v=$r(e)}if(d.current=d.current.map(r=>{const o={x:e-r.distance.x,y:t-r.distance.y};p&&(o.x=c[0]*Math.round(o.x/c[0]),o.y=c[1]*Math.round(o.y/c[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!r.extent&&(a[0][0]=r.positionAbsolute.x-v.x+s[0][0],a[1][0]=r.positionAbsolute.x+(r.width??0)-v.x2+s[1][0],a[0][1]=r.positionAbsolute.y-v.y+s[0][1],a[1][1]=r.positionAbsolute.y+(r.height??0)-v.y2+s[1][1]);const i=Ka(r,o,n,a,h,m);return y=y||r.position.x!==i.position.x||r.position.y!==i.position.y,r.position=i.position,r.positionAbsolute=i.positionAbsolute,r}),!y)return;i(d.current,!0,!0),u(!0);const b=a?r:Qa(o);if(b&&g.current){const[e,t]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=Tr(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:r}=l.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],r({x:e,y:t})&&c(f.current)}p.current=requestAnimationFrame(x)},E=e=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:o,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:p}=l.getState();v.current=!0;const h=a?u:Qa(p);s&&i||r||!a||n.get(a)?.selected||c(),a&&i&&s&&Ga({id:a,store:l,nodeRef:t});const m=w(e);if(f.current=m,d.current=Xa(n,o,m,a),h&&d.current){const[t,r]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});h(e.sourceEvent,t,r)}};if(!n){const n=function(){var e,t,n,r,o=tt,a=nt,i=rt,s=ot,l={},c=R("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,Ke).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&&(Ye(i.view).on("mousemove.drag",h,Ue).on("mouseup.drag",m,Ue),Ge(i.view),qe(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(r){if(Ze(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}l.mouse("drag",r)}function m(e){Ye(e.view).on("mousemove.drag mouseup.drag",null),Qe(e.view,n),Ze(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]))&&(qe(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])&&(Ze(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])&&(qe(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var s,d,p,h=c.copy(),m=Xe(a||n,t);if(null!=(p=i.call(e,new et("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=Xe(c||i,t),g=u}h.call(a,e,new et(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:Je(!!e),f):o},f.container=function(e){return arguments.length?(a="function"==typeof e?e:Je(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:Je(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Je(!!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}=l.getState();0===n&&E(e),b.current=!1;const r=w(e);f.current=r,h.current=t?.getBoundingClientRect()||null,m.current=Wr(e.sourceEvent,h.current)}).on("drag",e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&v.current&&n&&(y.current=!0,x()),!v.current){const n=t.xSnapped-(f?.current?.x??0),o=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+o*o)>r&&E(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&v.current&&(g.current=e.sourceEvent,m.current=Wr(e.sourceEvent,h.current),c(t))}}).on("end",e=>{if(v.current&&!b.current&&(u(!1),y.current=!1,v.current=!1,cancelAnimationFrame(p.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:o}=l.getState(),i=a?r:Qa(o);if(t(d.current,!1,!1),i){const[t,r]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});i(e.sourceEvent,t,r)}}}).filter(e=>{const n=e.target;return!e.button&&(!r||!Ya(n,`.${r}`,t))&&(!o||Ya(n,o,t))});return e.call(n),()=>{e.on(".drag",null)}}e.on(".drag",null)}},[t,n,r,o,i,l,a,s,w]),c}function ei(){const t=_r(),n=e.useCallback(e=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=t.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=e.isShiftPressed?4:1,h=e.x*d*p,m=e.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}=Ka(e,t,n,r,void 0,l);e.position=a,e.positionAbsolute=o}return e});o(g,!0,!1)},[]);return n}const ti={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ni=t=>{const n=({id:n,type:r,data:o,xPos:a,yPos:s,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:m,onDoubleClick:g,style:y,className:v,isDraggable:b,isSelectable:w,isConnectable:x,isFocusable:E,selectNodesOnDrag:S,sourcePosition:_,targetPosition:C,hidden:k,resizeObserver:N,dragHandle:M,zIndex:R,isParent:O,noDragClassName:P,noPanClassName:A,initialized:T,disableKeyboardA11y:D,ariaLabel:$,rfId:I,hasHandleBounds:z})=>{const L=_r(),B=e.useRef(null),F=e.useRef(null),j=e.useRef(_),H=e.useRef(C),V=e.useRef(r),W=w||b||d||f||p||h,Y=ei(),X=Za(n,L.getState,f),K=Za(n,L.getState,p),U=Za(n,L.getState,h),q=Za(n,L.getState,m),Z=Za(n,L.getState,g);e.useEffect(()=>()=>{F.current&&(N?.unobserve(F.current),F.current=null)},[]),e.useEffect(()=>{if(B.current&&!k){const e=B.current;T&&z&&F.current===e||(F.current&&N?.unobserve(F.current),N?.observe(e),F.current=e)}},[k,T,z]),e.useEffect(()=>{const e=V.current!==r,t=j.current!==_,o=H.current!==C;B.current&&(e||t||o)&&(e&&(V.current=r),t&&(j.current=_),o&&(H.current=C),L.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,_,C]);const G=Ja({nodeRef:B,disabled:k||!b,noDragClassName:P,handleSelector:M,nodeId:n,isSelectable:w,selectNodesOnDrag:S});return k?null:e.createElement("div",{className:i(["react-flow__node",`react-flow__node-${r}`,{[A]:b},v,{selected:u,selectable:w,parent:O,dragging:G}]),ref:B,style:{zIndex:R,transform:`translate(${l}px,${c}px)`,pointerEvents:W?"all":"none",visibility:T?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:K,onMouseLeave:U,onContextMenu:q,onClick:e=>{const{nodeDragThreshold:t}=L.getState();if(w&&(!S||!b||t>0)&&Ga({id:n,store:L,nodeRef:B}),d){const t=L.getState().nodeInternals.get(n);t&&d(e,{...t})}},onDoubleClick:Z,onKeyDown:E?e=>{if(!Hr(e)&&!D)if(Fr.includes(e.key)&&w){const t="Escape"===e.key;Ga({id:n,store:L,unselect:t,nodeRef:B})}else b&&u&&Object.prototype.hasOwnProperty.call(ti,e.key)&&(L.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),Y({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":D?void 0:`${sa}-${I}`,"aria-label":$},e.createElement(vo,{value:n},e.createElement(t,{id:n,data:o,type:r,xPos:a,yPos:s,selected:u,isConnectable:x,sourcePosition:_,targetPosition:C,dragging:G,dragHandle:M,zIndex:R})))};return n.displayName="NodeWrapper",e.memo(n)};const ri=e=>{const t=e.getNodes().filter(e=>e.selected);return{...Co(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var oi=e.memo(function({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:r}){const o=_r(),{width:a,height:s,x:l,y:c,transformString:u,userSelectionActive:d}=Sr(ri,N),f=ei(),p=e.useRef(null);if(e.useEffect(()=>{r||p.current?.focus({preventScroll:!0})},[r]),Ja({nodeRef:p}),d||!a||!s)return null;const h=t?e=>{const n=o.getState().getNodes().filter(e=>e.selected);t(e,n)}:void 0;return e.createElement("div",{className:i(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u}},e.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(ti,e.key)&&f({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:c,left:l}}))});const ai=e=>e.nodesSelectionActive,ii=({children:t,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:S,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:N,defaultViewport:M,translateExtent:R,minZoom:O,maxZoom:P,preventScrolling:A,onSelectionContextMenu:T,noWheelClassName:D,noPanClassName:$,disableKeyboardA11y:I})=>{const z=Sr(ai),L=fa(f),B=fa(v),F=B||N,j=B||S,H=L||p&&!0!==F;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const r=_r(),{deleteElements:o}=Ca(),a=fa(t,ka),i=fa(n);e.useEffect(()=>{if(a){const{edges:e,getNodes:t}=r.getState(),n=t().filter(e=>e.selected),a=e.filter(e=>e.selected);o({nodes:n,edges:a}),r.setState({nodesSelectionActive:!1})}},[a]),e.useEffect(()=>{r.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:l,multiSelectionKeyCode:y}),e.createElement(Ta,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:j,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!L&&F,defaultViewport:M,translateExtent:R,minZoom:O,maxZoom:P,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:D,noPanClassName:$},e.createElement(Va,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:F,isSelecting:!!H,selectionMode:h},t,z&&e.createElement(oi,{onSelectionContextMenu:T,noPanClassName:$,disableKeyboardA11y:I})))};ii.displayName="FlowRenderer";var si=e.memo(ii);function li(e){return{...{input:ni(e.input||Yo),default:ni(e.default||Vo),output:ni(e.output||Ko),group:ni(e.group||Uo)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ni(e[n]||Vo),t),{})}}const ci=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ui=t=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:a,updateNodeDimensions:i,onError:s}=Sr(ci,N),l=(c=t.onlyRenderVisibleElements,Sr(e.useCallback(e=>c?ko(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[c])));var c;const u=e.useRef(),d=e.useMemo(()=>{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}));i(t)});return u.current=e,e},[]);return e.useEffect(()=>()=>{u?.current?.disconnect()},[]),e.createElement("div",{className:"react-flow__nodes",style:Na},l.map(i=>{let l=i.type||"default";t.nodeTypes[l]||(s?.("003",pr(l)),l="default");const c=t.nodeTypes[l]||t.nodeTypes.default,u=!!(i.draggable||n&&void 0===i.draggable),f=!!(i.selectable||a&&void 0===i.selectable),p=!!(i.connectable||r&&void 0===i.connectable),h=!!(i.focusable||o&&void 0===i.focusable),m=t.nodeExtent?Pr(i.positionAbsolute,t.nodeExtent):i.positionAbsolute,g=m?.x??0,y=m?.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:i.width??0,height:i.height??0,origin:t.nodeOrigin});return e.createElement(c,{key:i.id,id:i.id,className:i.className,style:i.style,type:l,data:i.data,sourcePosition:i.sourcePosition||to.Bottom,targetPosition:i.targetPosition||to.Top,hidden:i.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!i.selected,isDraggable:u,isSelectable:f,isConnectable:p,isFocusable:h,resizeObserver:d,dragHandle:i.dragHandle,zIndex:i[Br]?.z??0,isParent:!!i[Br]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!i.width&&!!i.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[Br]?.handleBounds})}))};ui.displayName="NodeRenderer";var di=e.memo(ui);const fi=(e,t,n)=>n===to.Left?e-t:n===to.Right?e+t:e,pi=(e,t,n)=>n===to.Top?e-t:n===to.Bottom?e+t:e,hi="react-flow__edgeupdater",mi=({position:t,centerX:n,centerY:r,radius:o=10,onMouseDown:a,onMouseEnter:s,onMouseOut:l,type:c})=>e.createElement("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:l,className:i([hi,`${hi}-${c}`]),cx:fi(n,o,t),cy:pi(r,o,t),r:o,stroke:"transparent",fill:"transparent"}),gi=()=>!0;var yi=t=>{const n=({id:n,className:r,type:o,data:a,onClick:s,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:v,target:b,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:C,elementsSelectable:k,hidden:N,sourceHandleId:M,targetHandleId:R,onContextMenu:O,onMouseEnter:P,onMouseMove:A,onMouseLeave:T,reconnectRadius:D,onReconnect:$,onReconnectStart:I,onReconnectEnd:z,markerEnd:L,markerStart:B,rfId:F,ariaLabel:j,isFocusable:H,isReconnectable:V,pathOptions:W,interactionWidth:Y,disableKeyboardA11y:X})=>{const K=e.useRef(null),[U,q]=e.useState(!1),[Z,G]=e.useState(!1),Q=_r(),J=e.useMemo(()=>`url('#${wo(B,F)}')`,[B,F]),ee=e.useMemo(()=>`url('#${wo(L,F)}')`,[L,F]);if(N)return null;const te=Kr(n,Q.getState,l),ne=Kr(n,Q.getState,O),re=Kr(n,Q.getState,P),oe=Kr(n,Q.getState,A),ae=Kr(n,Q.getState,T),ie=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=Q.getState(),a=t?b:v,i=(t?R:M)||null,s=t?"target":"source",l=o||gi,c=t,u=r.find(e=>e.id===n);G(!0),I?.(e,u,s);zo({event:e,handleId:i,nodeId:a,onConnect:e=>$?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{G(!1),z?.(e,u,s)}})},se=()=>q(!0),le=()=>q(!1),ce=!k&&!s;return e.createElement("g",{className:i(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:c,animated:u,inactive:ce,updating:U}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=Q.getState(),i=t.find(e=>e.id===n);i&&(k&&(Q.setState({nodesSelectionActive:!1}),i.selected&&a?(o({nodes:[],edges:[i]}),K.current?.blur()):r([n])),s&&s(e,i))},onDoubleClick:te,onContextMenu:ne,onMouseEnter:re,onMouseMove:oe,onMouseLeave:ae,onKeyDown:H?e=>{if(!X&&Fr.includes(e.key)&&k){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=Q.getState();"Escape"===e.key?(K.current?.blur(),t({edges:[o.find(e=>e.id===n)]})):r([n])}}:void 0,tabIndex:H?0:void 0,role:H?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===j?void 0:j||`Edge from ${v} to ${b}`,"aria-describedby":H?`${la}-${F}`:void 0,ref:K},!Z&&e.createElement(t,{id:n,source:v,target:b,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,data:a,style:y,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:C,sourceHandleId:M,targetHandleId:R,markerStart:J,markerEnd:ee,pathOptions:W,interactionWidth:Y}),V&&e.createElement(e.Fragment,null,("source"===V||!0===V)&&e.createElement(mi,{position:_,centerX:w,centerY:x,radius:D,onMouseDown:e=>ie(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===V||!0===V)&&e.createElement(mi,{position:C,centerX:E,centerY:S,radius:D,onMouseDown:e=>ie(e,!1),onMouseEnter:se,onMouseOut:le,type:"target"})))};return n.displayName="EdgeWrapper",e.memo(n)};function vi(e){return{...{default:yi(e.default||go),straight:yi(e.bezier||fo),step:yi(e.step||uo),smoothstep:yi(e.step||co),simplebezier:yi(e.simplebezier||oo)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=yi(e[n]||go),t),{})}}function bi(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 to.Top:return{x:r+a/2,y:o};case to.Right:return{x:r+a,y:o+i/2};case to.Bottom:return{x:r+a/2,y:o+i};case to.Left:return{x:r,y:o+i/2}}}function wi(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function xi(e){const t=e?.[Br]?.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 Ei=[{level:0,isMaxLevel:!0,edges:[]}];function Si(t,n,r){return function(e,t,n=!1){let r=-1;const o=e.reduce((e,o)=>{const a=Lr(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?.[Br]?.z||0,e?.[Br]?.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?Ei:a}(Sr(e.useCallback(e=>t?e.edges.filter(t=>{const r=n.get(t.source),o=n.get(t.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=$r({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:e.width,height:e.height,transform:e.transform})}):e.edges,[t,n])),n,r)}const _i={[eo.Arrow]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[eo.ArrowClosed]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const Ci=({id:t,type:n,color:r,width:o=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(t){const n=_r();return e.useMemo(()=>Object.prototype.hasOwnProperty.call(_i,t)?_i[t]:(n.getState().onError?.("009",yr(t)),null),[t])}(n);return c?e.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},e.createElement(c,{color:r,strokeWidth:s})):null},ki=({defaultColor:t,rfId:n})=>{const r=Sr(e.useCallback((({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=wo(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:t,rfId:n}),[t,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return e.createElement("defs",null,r.map(t=>e.createElement(Ci,{id:t.id,key:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient})))};ki.displayName="MarkerDefinitions";var Ni=e.memo(ki);const Mi=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}),Ri=({defaultMarkerColor:t,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:a,noPanClassName:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,children:v,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:C,nodeInternals:k,onError:M}=Sr(Mi,N),R=Si(n,k,r);return S?e.createElement(e.Fragment,null,R.map(({level:n,edges:r,isMaxLevel:v})=>e.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},v&&e.createElement(Ni,{defaultColor:t,rfId:o}),e.createElement("g",null,r.map(t=>{const[n,r,v]=xi(k.get(t.source)),[S,_,N]=xi(k.get(t.target));if(!v||!N)return null;let R=t.type||"default";a[R]||(M?.("011",wr(R)),R="default");const O=a[R]||a.default,P=C===Zr.Strict?_.target:(_.target??[]).concat(_.source??[]),A=wi(r.source,t.sourceHandle),T=wi(P,t.targetHandle),D=A?.position||to.Bottom,$=T?.position||to.Top,I=!!(t.focusable||w&&void 0===t.focusable),z=t.reconnectable||t.updatable,L=void 0!==h&&(z||x&&void 0===z);if(!A||!T)return M?.("008",vr(A,t)),null;const{sourceX:B,sourceY:F,targetX:j,targetY:H}=((e,t,n,r,o,a)=>{const i=bi(n,e,t),s=bi(a,r,o);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,A,D,S,T,$);return e.createElement(O,{key:t.id,id:t.id,className:i([t.className,s]),type:R,data:t.data,selected:!!t.selected,animated:!!t.animated,hidden:!!t.hidden,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,source:t.source,target:t.target,sourceHandleId:t.sourceHandle,targetHandleId:t.targetHandle,markerEnd:t.markerEnd,markerStart:t.markerStart,sourceX:B,sourceY:F,targetX:j,targetY:H,sourcePosition:D,targetPosition:$,elementsSelectable:E,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,rfId:o,ariaLabel:t.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))),v):null};Ri.displayName="EdgeRenderer";var Oi=e.memo(Ri);const Pi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ai({children:t}){const n=Sr(Pi);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const Ti={[to.Left]:to.Right,[to.Right]:to.Left,[to.Top]:to.Bottom,[to.Bottom]:to.Top},Di=({nodeId:t,handleType:n,style:r,type:o=Jr.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=Sr(e.useCallback(e=>({fromNode:e.nodeInternals.get(t),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode}),[t]),N),f=s?.[Br]?.handleBounds;let p=f?.[n];if(d===Zr.Loose&&(p=p||f?.["source"===n?"target":"source"]),!s||!p)return null;const h=l?p.find(e=>e.id===l):p[0],m=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,y=(s.positionAbsolute?.x??0)+m,v=(s.positionAbsolute?.y??0)+g,b=h?.position,w=b?Ti[b]:null;if(!b||!w)return null;if(a)return e.createElement(a,{connectionLineType:o,connectionLineStyle:r,fromNode:s,fromHandle:h,fromX:y,fromY:v,toX:c,toY:u,fromPosition:b,toPosition:w,connectionStatus:i});let x="";const E={sourceX:y,sourceY:v,sourcePosition:b,targetX:c,targetY:u,targetPosition:w};return o===Jr.Bezier?[x]=mo(E):o===Jr.Step?[x]=lo({...E,borderRadius:0}):o===Jr.SmoothStep?[x]=lo(E):o===Jr.SimpleBezier?[x]=ro(E):x=`M${y},${v} ${c},${u}`,e.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:r})};Di.displayName="ConnectionLine";const $i=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ii({containerStyle:t,style:n,type:r,component:o}){const{nodeId:a,handleType:s,nodesConnectable:l,width:c,height:u,connectionStatus:d}=Sr($i,N);return!!(a&&s&&c&&l)?e.createElement("svg",{style:t,width:c,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},e.createElement("g",{className:i(["react-flow__connection",d])},e.createElement(Di,{nodeId:a,handleType:s,style:n,type:r,CustomComponent:o,connectionStatus:d}))):null}function zi(t,n){const r=e.useRef(null),o=_r();return e.useMemo(()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);N(r.current,e)&&o.getState().onError?.("002",fr()),r.current=e}return n(t)},[t])}const Li=({nodeTypes:t,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:a,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:v,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:N,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:O,selectNodesOnDrag:P,defaultViewport:A,translateExtent:T,minZoom:D,maxZoom:$,preventScrolling:I,defaultMarkerColor:z,zoomOnScroll:L,zoomOnPinch:B,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:W,onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:U,onPaneScroll:q,onPaneContextMenu:Z,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,elevateEdgesOnSelect:le,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})=>{const pe=zi(t,li),he=zi(n,vi);return function(t){const n=Ca(),r=e.useRef(!1);e.useEffect(()=>{!r.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),r.current=!0)},[t,n.viewportInitialized])}(i),e.createElement(si,{onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:U,onPaneContextMenu:Z,onPaneScroll:q,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:N,elementsSelectable:O,onMove:r,onMoveStart:o,onMoveEnd:a,zoomOnScroll:L,zoomOnPinch:B,zoomOnDoubleClick:V,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:H,panOnDrag:W,defaultViewport:A,translateExtent:T,minZoom:D,maxZoom:$,onSelectionContextMenu:m,preventScrolling:I,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(Ai,null,e.createElement(Oi,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:R,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,defaultMarkerColor:z,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:fe},e.createElement(Ii,{style:b,type:v,component:w,containerStyle:x})),e.createElement("div",{className:"react-flow__edgelabel-renderer"}),e.createElement(di,{nodeTypes:pe,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:P,onlyRenderVisibleElements:R,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})))};Li.displayName="GraphView";var Bi=e.memo(Li);const Fi=[[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:Fi,nodeExtent:Fi,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Zr.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},Hi=()=>{return e=(e,t)=>({...ji,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:a}=t();e({nodeInternals:ya(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?ya(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,[Br]:{...n[Br],handleBounds:void 0}});else if(n){const r=Rr(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[Br]:{...n[Br],handleBounds:{source:qa(".source",t.nodeElement,f,c),target:qa(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);ga(o,c);const h=i||a&&!i&&va(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=ya(La(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=>Ba(e,!0)):(i=Fa(a(),n),s=Fa(o,[])),xa({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=>Ba(e,!0)):(i=Fa(o,n),s=Fa(a(),[])),xa({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:a}=t(),i=r||o;xa({changedNodes:(n||a()).map(e=>(e.selected=!1,Ba(e.id,!1))),changedEdges:i.map(e=>Ba(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();xa({changedNodes:r().filter(e=>e.selected).map(e=>Ba(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ba(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(e=>{e.positionAbsolute=Pr(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=tr.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?k(e,t):k;var e,t},Vi=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=Hi()),e.createElement(dr,{value:n.current},t)};Vi.displayName="ReactFlowProvider";const Wi=({children:t})=>e.useContext(ur)?e.createElement(e.Fragment,null,t):e.createElement(Vi,null,t);Wi.displayName="ReactFlowWrapper";const Yi={input:Yo,default:Vo,output:Ko,group:Uo},Xi={default:go,straight:fo,step:uo,smoothstep:co,simplebezier:oo},Ki=[0,0],Ui=[15,15],qi={x:0,y:0,zoom:1},Zi={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gi=e.forwardRef(({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,className:a,nodeTypes:s=Yi,edgeTypes:l=Xi,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:R,onSelectionChange:O,onSelectionDragStart:P,onSelectionDrag:A,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,connectionMode:z=Zr.Strict,connectionLineType:L=Jr.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:j,deleteKeyCode:H="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:W=!1,selectionMode:Y=Qr.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(Yr()?"Meta":"Control"),zoomActivationKeyCode:U=(Yr()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=Ui,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=Ki,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ae,defaultViewport:ie=qi,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Fi,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=Gr.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:Re,onEdgeMouseMove:Oe,onEdgeMouseLeave:Pe,onEdgeUpdate:Ae,onEdgeUpdateStart:Te,onEdgeUpdateEnd:De,onReconnect:$e,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:je,noDragClassName:He="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return e.createElement("div",{...lt,style:{...at,...Zi},ref:ct,className:i(["react-flow",a]),"data-testid":"rf__wrapper",id:it},e.createElement(Wi,null,e.createElement(Bi,{onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:l,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:j,selectionKeyCode:V,selectionOnDrag:W,selectionMode:Y,deleteKeyCode:H,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Re,onEdgeMouseMove:Oe,onEdgeMouseLeave:Pe,onReconnect:$e??Ae,onReconnectStart:Ie??Te,onReconnectEnd:ze??De,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:He,noWheelClassName:Ve,noPanClassName:We,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),e.createElement(oa,{nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,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:je,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:R,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:A,onSelectionDragStart:P,onSelectionDragStop:T,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),e.createElement(ea,{onSelectionChange:O}),ke,e.createElement(Nr,{proOptions:qe,position:Ue}),e.createElement(da,{rfId:ut,disableKeyboardA11y:Je})))});function Qi(t){return n=>{const[r,o]=e.useState(n),a=e.useCallback(e=>o(n=>t(e,n)),[]);return[r,o,a]}}Gi.displayName="ReactFlow";const Ji=Qi(La),es=Qi(function(e,t){return za(e,t)});var ts;function ns({color:t,dimensions:n,lineWidth:r}){return e.createElement("path",{stroke:t,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function rs({color:t,radius:n}){return e.createElement("circle",{cx:n,cy:n,r:n,fill:t})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ts||(ts={}));const os={[ts.Dots]:"#91919a",[ts.Lines]:"#eee",[ts.Cross]:"#e2e2e2"},as={[ts.Dots]:1,[ts.Lines]:1,[ts.Cross]:6},is=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ss({id:t,variant:n=ts.Dots,gap:r=20,size:o,lineWidth:a=1,offset:s=2,color:l,style:c,className:u}){const d=e.useRef(null),{transform:f,patternId:p}=Sr(is,N),h=l||os[n],m=o||as[n],g=n===ts.Dots,y=n===ts.Cross,v=Array.isArray(r)?r:[r,r],b=[v[0]*f[2]||1,v[1]*f[2]||1],w=m*f[2],x=y?[w,w]:b,E=g?[w/s,w/s]:[x[0]/s,x[1]/s];return e.createElement("svg",{className:i(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},e.createElement("pattern",{id:p+t,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},g?e.createElement(rs,{color:h,radius:w/s}):e.createElement(ns,{dimensions:x,color:h,lineWidth:a})),e.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+t})`}))}ss.displayName="Background";var ls=e.memo(ss);!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
|
+
"use strict";var e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=o(e),a=o(t);function i(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o<e.length;o++)""!==(n=i(e[o]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,c={exports:{}},u={},d={exports:{}},f={};var p,h,m,g={};function y(){return h||(h=1,"production"===process.env.NODE_ENV?d.exports=function(){if(l)return f;l=1;var t=e,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,r=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!n(e,o)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=o({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return a(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),r(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(n),n};return f.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,f}():d.exports=(p||(p=1,"production"!==process.env.NODE_ENV&&function(){function t(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=e,o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,u){l||void 0===n.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();o(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=r({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){p.value=d,p.getSnapshot=u,t(p)&&h({inst:p})},[e,d,u]),a(function(){return t(p)&&h({inst:p}),e(function(){t(p)&&h({inst:p})})},[e]),s(d),d};g.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())}()),g)),d.exports}var v,b={};"production"===process.env.NODE_ENV?c.exports=function(){if(m)return u;m=1;var t=e,n=y(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;return u.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},u}():c.exports=(v||(v=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 t=e,n=y(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;b.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),b);var w=s(c.exports);const x=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(o,r,a);return a},{useDebugValue:E}=e,{useSyncExternalStoreWithSelector:S}=w,_=e=>e;function C(e,t=_,n){const o=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(o),o}const k=(e,t)=>{const n=(e=>e?x(e):x)(e),o=(e,o=t)=>C(n,e,o);return Object.assign(o,n),o};function N(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var M={value:()=>{}};function R(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new O(o)}function O(e){this._=e}function A(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function P(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=M,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}O.prototype=R.prototype={constructor:O,on:function(e,t){var n,o,r=this._,a=(o=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)r[n]=P(r[n],e.name,t);else if(null==t)for(n in r)r[n]=P(r[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=A(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new O(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(o=this._[e]).length;a<n;++a)o[a].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,a=o.length;r<a;++r)o[r].value.apply(t,n)}};var T="http://www.w3.org/1999/xhtml",D={svg:"http://www.w3.org/2000/svg",xhtml:T,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),D.hasOwnProperty(t)?{space:D[t],local:e}:e}function I(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===T&&t.documentElement.namespaceURI===T?t.createElement(e):t.createElementNS(n,e)}}function z(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function L(e){var t=$(e);return(t.local?z:I)(t)}function B(){}function F(e){return null==e?B:function(){return this.querySelector(e)}}function j(){return[]}function H(e){return null==e?j:function(){return this.querySelectorAll(e)}}function W(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function V(e){return function(){return this.matches(e)}}function Y(e){return function(t){return t.matches(e)}}var X=Array.prototype.find;function K(){return this.firstElementChild}var U=Array.prototype.filter;function q(){return Array.from(this.children)}function Z(e){return new Array(e.length)}function G(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Q(e,t,n,o,r,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],o[s]=i):n[s]=new G(e,a[s]);for(;s<l;++s)(i=t[s])&&(r[s]=i)}function J(e,t,n,o,r,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(o[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new G(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(r[s]=l)}function ee(e){return e.__data__}function te(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ne(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oe(e){return function(){this.removeAttribute(e)}}function re(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ae(e,t){return function(){this.setAttribute(e,t)}}function ie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function se(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function le(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 ce(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ue(e){return function(){this.style.removeProperty(e)}}function de(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fe(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function pe(e,t){return e.style.getPropertyValue(t)||ce(e).getComputedStyle(e,null).getPropertyValue(t)}function he(e){return function(){delete this[e]}}function me(e,t){return function(){this[e]=t}}function ge(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function ye(e){return e.trim().split(/^|\s+/)}function ve(e){return e.classList||new be(e)}function be(e){this._node=e,this._names=ye(e.getAttribute("class")||"")}function we(e,t){for(var n=ve(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function xe(e,t){for(var n=ve(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Ee(e){return function(){we(this,e)}}function Se(e){return function(){xe(this,e)}}function _e(e,t){return function(){(t.apply(this,arguments)?we:xe)(this,e)}}function Ce(){this.textContent=""}function ke(e){return function(){this.textContent=e}}function Ne(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Me(){this.innerHTML=""}function Re(e){return function(){this.innerHTML=e}}function Oe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ae(){this.nextSibling&&this.parentNode.appendChild(this)}function Pe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Te(){return null}function De(){var e=this.parentNode;e&&e.removeChild(this)}function $e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ie(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ze(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,a=t.length;o<a;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function Le(e,t,n){return function(){var o,r=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var i=0,s=r.length;i<s;++i)if((o=r[i]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),void(o.value=t);this.addEventListener(e.type,a,n),o={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(o):this.__on=[o]}}function Be(e,t,n){var o=ce(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Fe(e,t){return function(){return Be(this,e,t)}}function je(e,t){return function(){return Be(this,e,t.apply(this,arguments))}}G.prototype={constructor:G,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)}},be.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 He=[null];function We(e,t){this._groups=e,this._parents=t}function Ve(){return new We([[document.documentElement]],He)}function Ye(e){return"string"==typeof e?new We([[document.querySelector(e)]],[document.documentElement]):new We([[e]],He)}function Xe(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}We.prototype=Ve.prototype={constructor:We,select:function(e){"function"!=typeof e&&(e=F(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new We(o,this._parents)},selectAll:function(e){e="function"==typeof e?W(e):H(e);for(var t=this._groups,n=t.length,o=[],r=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(o.push(e.call(i,i.__data__,c,s)),r.push(i));return new We(o,r)},selectChild:function(e){return this.select(null==e?K:function(e){return function(){return X.call(this.children,e)}}("function"==typeof e?e:Y(e)))},selectChildren:function(e){return this.selectAll(null==e?q:function(e){return function(){return U.call(this.children,e)}}("function"==typeof e?e:Y(e)))},filter:function(e){"function"!=typeof e&&(e=V(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new We(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ee);var n,o=t?J:Q,r=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=r[u],f=a[u],p=f.length,h=te(e.call(d,d&&d.__data__,u,r)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);o(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new We(s,r))._enter=l,s._exit=c,s},enter:function(){return new We(this._enter||this._groups.map(Z),this._parents)},exit:function(){return new We(this._exit||this._groups.map(Z),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,a=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?a.remove():n(a),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,a=o.length,i=Math.min(r,a),s=new Array(r),l=0;l<i;++l)for(var c,u=n[l],d=o[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<r;++l)s[l]=n[l];return new We(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],a=r.length-1,i=r[a];--a>=0;)(o=r[a])&&(i&&4^o.compareDocumentPosition(i)&&i.parentNode.insertBefore(o,i),i=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=ne);for(var n=this._groups,o=n.length,r=new Array(o),a=0;a<o;++a){for(var i,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new We(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,a=o.length;r<a;++r){var i=o[r];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,a=t[n],i=0,s=a.length;i<s;++i)(r=a[i])&&e.call(r,r.__data__,i,a);return this},attr:function(e,t){var n=$(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?re:oe:"function"==typeof t?n.local?le:se:n.local?ie:ae)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?ue:"function"==typeof t?fe:de)(e,t,null==n?"":n)):pe(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?he:"function"==typeof t?ge:me)(e,t)):this.node()[e]},classed:function(e,t){var n=ye(e+"");if(arguments.length<2){for(var o=ve(this.node()),r=-1,a=n.length;++r<a;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?_e:t?Ee:Se)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ce:("function"==typeof e?Ne:ke)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Me:("function"==typeof e?Oe:Re)(e)):this.node().innerHTML},raise:function(){return this.each(Ae)},lower:function(){return this.each(Pe)},append:function(e){var t="function"==typeof e?e:L(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:L(e),o=null==t?Te:"function"==typeof t?t:F(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(De)},clone:function(e){return this.select(e?Ie:$e)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Le:ze,o=0;o<i;++o)this.each(s(a[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<i;++o)if((r=a[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?je:Fe)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],a=0,i=r.length;a<i;++a)(o=r[a])&&(yield o)}};const Ke={passive:!1},Ue={capture:!0,passive:!1};function qe(e){e.stopImmediatePropagation()}function Ze(e){e.preventDefault(),e.stopImmediatePropagation()}function Ge(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",Ze,Ue);"onselectstart"in t?n.on("selectstart.drag",Ze,Ue):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Qe(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ze,Ue),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Je=e=>()=>e;function et(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function tt(e){return!e.ctrlKey&&!e.button}function nt(){return this.parentNode}function ot(e,t){return null==t?{x:e.x,y:e.y}:t}function rt(){return navigator.maxTouchPoints||"ontouchstart"in this}function at(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function it(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function st(){}et.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var lt=.7,ct=1/lt,ut="\\s*([+-]?\\d+)\\s*",dt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pt=/^#([0-9a-f]{3,8})$/,ht=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),mt=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),gt=new RegExp(`^rgba\\(${ut},${ut},${ut},${dt}\\)$`),yt=new RegExp(`^rgba\\(${ft},${ft},${ft},${dt}\\)$`),vt=new RegExp(`^hsl\\(${dt},${ft},${ft}\\)$`),bt=new RegExp(`^hsla\\(${dt},${ft},${ft},${dt}\\)$`),wt={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 xt(){return this.rgb().formatHex()}function Et(){return this.rgb().formatRgb()}function St(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?_t(t):3===n?new Nt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ct(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ct(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=ht.exec(e))?new Nt(t[1],t[2],t[3],1):(t=mt.exec(e))?new Nt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gt.exec(e))?Ct(t[1],t[2],t[3],t[4]):(t=yt.exec(e))?Ct(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=vt.exec(e))?Tt(t[1],t[2]/100,t[3]/100,1):(t=bt.exec(e))?Tt(t[1],t[2]/100,t[3]/100,t[4]):wt.hasOwnProperty(e)?_t(wt[e]):"transparent"===e?new Nt(NaN,NaN,NaN,0):null}function _t(e){return new Nt(e>>16&255,e>>8&255,255&e,1)}function Ct(e,t,n,o){return o<=0&&(e=t=n=NaN),new Nt(e,t,n,o)}function kt(e,t,n,o){return 1===arguments.length?((r=e)instanceof st||(r=St(r)),r?new Nt((r=r.rgb()).r,r.g,r.b,r.opacity):new Nt):new Nt(e,t,n,null==o?1:o);var r}function Nt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Mt(){return`#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}`}function Rt(){const e=Ot(this.opacity);return`${1===e?"rgb(":"rgba("}${At(this.r)}, ${At(this.g)}, ${At(this.b)}${1===e?")":`, ${e})`}`}function Ot(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function At(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pt(e){return((e=At(e))<16?"0":"")+e.toString(16)}function Tt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $t(e,t,n,o)}function Dt(e){if(e instanceof $t)return new $t(e.h,e.s,e.l,e.opacity);if(e instanceof st||(e=St(e)),!e)return new $t;if(e instanceof $t)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),a=Math.max(t,n,o),i=NaN,s=a-r,l=(a+r)/2;return s?(i=t===a?(n-o)/s+6*(n<o):n===a?(o-t)/s+2:(t-n)/s+4,s/=l<.5?a+r:2-a-r,i*=60):s=l>0&&l<1?0:i,new $t(i,s,l,e.opacity)}function $t(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function It(e){return(e=(e||0)%360)<0?e+360:e}function zt(e){return Math.max(0,Math.min(1,e||0))}function Lt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}at(st,St,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dt(this).formatHsl()},formatRgb:Et,toString:Et}),at(Nt,kt,it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(At(this.r),At(this.g),At(this.b),Ot(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:Mt,formatHex:Mt,formatHex8:function(){return`#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}${Pt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Rt,toString:Rt})),at($t,function(e,t,n,o){return 1===arguments.length?Dt(e):new $t(e,t,n,null==o?1:o)},it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new $t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new $t(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Nt(Lt(e>=240?e-240:e+120,r,o),Lt(e,r,o),Lt(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new $t(It(this.h),zt(this.s),zt(this.l),Ot(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=Ot(this.opacity);return`${1===e?"hsl(":"hsla("}${It(this.h)}, ${100*zt(this.s)}%, ${100*zt(this.l)}%${1===e?")":`, ${e})`}`}}));var Bt=e=>()=>e;function Ft(e){return 1===(e=+e)?jt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Bt(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):Bt(isNaN(e)?t:e)}var Ht=function e(t){var n=Ft(t);function o(e,t){var o=n((e=kt(e)).r,(t=kt(t)).r),r=n(e.g,t.g),a=n(e.b,t.b),i=jt(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function Wt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Vt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yt=new RegExp(Vt.source,"g");function Xt(e,t){var n,o,r,a=Vt.lastIndex=Yt.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=Vt.exec(e))&&(o=Yt.exec(t));)(r=o.index)>a&&(r=t.slice(a,r),s[i]?s[i]+=r:s[++i]=r),(n=n[0])===(o=o[0])?s[i]?s[i]+=o:s[++i]=o:(s[++i]=null,l.push({i:i,x:Wt(n,o)})),a=Yt.lastIndex;return a<t.length&&(r=t.slice(a),s[i]?s[i]+=r:s[++i]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}var Kt,Ut=180/Math.PI,qt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zt(e,t,n,o,r,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*Ut,skewX:Math.atan(l)*Ut,scaleX:i,scaleY:s}}function Gt(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,o,r,a,i,s){if(e!==r||o!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:Wt(e,r)},{i:l-2,x:Wt(o,a)})}else(r||a)&&i.push("translate("+r+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Wt(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Wt(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(a.skewX,i.skewX,s,l),function(e,t,n,o,a,i){if(e!==n||t!==o){var s=a.push(r(a)+"scale(",null,",",null,")");i.push({i:s-4,x:Wt(e,n)},{i:s-2,x:Wt(t,o)})}else 1===n&&1===o||a.push(r(a)+"scale("+n+","+o+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var Qt=Gt(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qt:Zt(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Jt=Gt(function(e){return null==e?qt:(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",e),(e=Kt.transform.baseVal.consolidate())?Zt((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):qt)},", ",")",")");function en(e){return((e=Math.exp(e))+1/e)/2}var tn,nn,on=function e(t,n,o){function r(e,r){var a,i,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],f=r[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),y=(f*f-c*c+o*m)/(2*c*n*g),v=(f*f-c*c-o*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);i=(w-b)/t,a=function(e){var o,r=e*i,a=en(b),u=c/(n*g)*(a*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/en(t*r+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),rn=0,an=0,sn=0,ln=0,cn=0,un=0,dn="object"==typeof performance&&performance.now?performance:Date,fn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pn(){return cn||(fn(hn),cn=dn.now()+un)}function hn(){cn=0}function mn(){this._call=this._time=this._next=null}function gn(e,t,n){var o=new mn;return o.restart(e,t,n),o}function yn(){cn=(ln=dn.now())+un,rn=an=0;try{!function(){pn(),++rn;for(var e,t=tn;t;)(e=cn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--rn}()}finally{rn=0,function(){var e,t,n=tn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:tn=t);nn=e,bn(o)}(),cn=0}}function vn(){var e=dn.now(),t=e-ln;t>1e3&&(un-=t,ln=e)}function bn(e){rn||(an&&(an=clearTimeout(an)),e-cn>24?(e<1/0&&(an=setTimeout(yn,e-dn.now()-un)),sn&&(sn=clearInterval(sn))):(sn||(ln=dn.now(),sn=setInterval(vn,1e3)),rn=1,fn(yn)))}function wn(e,t,n){var o=new mn;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}mn.prototype=gn.prototype={constructor:mn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?pn():+n)+(null==t?0:+t),this._next||nn===this||(nn?nn._next=this:tn=this,nn=this),this._call=e,this._time=n,bn()},stop:function(){this._call&&(this._call=null,this._time=1/0,bn())}};var xn=R("start","end","cancel","interrupt"),En=[];function Sn(e,t,n,o,r,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function a(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(a){var c,u,d,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return wn(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[c])}if(wn(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=f);o.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=o.length;++a<i;)o[a].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=gn(a,0,n.time)}(e,n,{name:t,index:o,group:r,on:xn,tween:En,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function _n(e,t){var n=kn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Cn(e,t){var n=kn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function kn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Nn(e,t){var n,o,r,a=e.__transition,i=!0;if(a){for(r in t=null==t?null:t+"",a)(n=a[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[r]):i=!1;i&&delete e.__transition}}function Mn(e,t){var n,o;return function(){var r=Cn(this,e),a=r.tween;if(a!==n)for(var i=0,s=(o=n=a).length;i<s;++i)if(o[i].name===t){(o=o.slice()).splice(i,1);break}r.tween=o}}function Rn(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var a=Cn(this,e),i=a.tween;if(i!==o){r=(o=i).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}a.tween=r}}function On(e,t,n){var o=e._id;return e.each(function(){var e=Cn(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return kn(e,o).value[t]}}function An(e,t){var n;return("number"==typeof t?Wt:t instanceof St?Ht:(n=St(t))?(t=n,Ht):Xt)(e,t)}function Pn(e){return function(){this.removeAttribute(e)}}function Tn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dn(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===o?r:r=t(o=i,n)}}function $n(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===o?r:r=t(o=i,n)}}function In(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttribute(e)}}function zn(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttributeNS(e.space,e.local)}}function Ln(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Bn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Fn(e,t){return function(){_n(this,e).delay=+t.apply(this,arguments)}}function jn(e,t){return t=+t,function(){_n(this,e).delay=t}}function Hn(e,t){return function(){Cn(this,e).duration=+t.apply(this,arguments)}}function Wn(e,t){return t=+t,function(){Cn(this,e).duration=t}}var Vn=Ve.prototype.constructor;function Yn(e){return function(){this.style.removeProperty(e)}}var Xn=0;function Kn(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Un(){return++Xn}var qn=Ve.prototype;Kn.prototype={constructor:Kn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=F(e));for(var o=this._groups,r=o.length,a=new Array(r),i=0;i<r;++i)for(var s,l,c=o[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,Sn(d[f],t,n,f,d,kn(s,n)));return new Kn(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=H(e));for(var o=this._groups,r=o.length,a=[],i=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=kn(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&Sn(f,t,n,m,p,h);a.push(p),i.push(l)}return new Kn(a,i,t,n)},selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:function(e){"function"!=typeof e&&(e=V(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Kn(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,a=Math.min(o,r),i=new Array(o),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<o;++s)i[s]=t[s];return new Kn(i,this._parents,this._name,this._id)},selection:function(){return new Vn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Un(),o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=kn(i,t);Sn(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Kn(o,this._parents,e,n)},call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:function(e,t){var n=this._id;return arguments.length<2?kn(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?_n:Cn;return function(){var i=a(this,e),s=i.on;s!==o&&(r=(o=s).copy()).on(t,n),i.on=r}}(n,e,t))},attr:function(e,t){var n=$(e),o="transform"===n?Jt:An;return this.attrTween(e,"function"==typeof t?(n.local?zn:In)(n,o,On(this,"attr."+e,t)):null==t?(n.local?Tn:Pn)(n):(n.local?$n:Dn)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=$(e);return this.tween(n,(o.local?Ln:Bn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Qt:An;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var a=pe(this,e),i=(this.style.removeProperty(e),pe(this,e));return a===i?null:a===n&&i===o?r:r=t(n=a,o=i)}}(e,o)).on("end.style."+e,Yn(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,a;return function(){var i=pe(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=pe(this,e)),i===l?null:i===o&&l===r?a:(r=l,a=t(o=i,s))}}(e,o,On(this,"style."+e,t))).each(function(e,t){var n,o,r,a,i="style."+t,s="end."+i;return function(){var l=Cn(this,e),c=l.on,u=null==l.value[i]?a||(a=Yn(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,a=n+"";return function(){var i=pe(this,e);return i===a?null:i===o?r:r=t(o=i,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function a(){var a=t.apply(this,arguments);return a!==r&&(o=(r=a)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,a,n)),o}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(On(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=kn(this.node(),n).tween,a=0,i=r.length;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((null==t?Mn:Rn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Fn:jn)(t,e)):kn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Hn:Wn)(t,e)):kn(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(){Cn(this,e).ease=t}}(t,e)):kn(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;Cn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--r&&a()}};n.each(function(){var n=Cn(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===r&&a()})},[Symbol.iterator]:qn[Symbol.iterator]};var Zn={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Gn(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}Ve.prototype.interrupt=function(e){return this.each(function(){Nn(this,e)})},Ve.prototype.transition=function(e){var t,n;e instanceof Kn?(t=e._id,e=e._name):(t=Un(),(n=Zn).time=pn(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)(i=s[c])&&Sn(i,e,t,c,s,n||Gn(i,t));return new Kn(o,this._parents,e,t)};var Qn=e=>()=>e;function Jn(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function eo(e,t,n){this.k=e,this.x=t,this.y=n}eo.prototype={constructor:eo,scale:function(e){return 1===e?this:new eo(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new eo(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 to=new eo(1,0,0);function no(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}function ro(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function ao(){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 io(){return this.__zoom||to}function so(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lo(){return navigator.maxTouchPoints||"ontouchstart"in this}function co(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}eo.prototype;const uo=e.createContext(null),fo=uo.Provider,po=()=>"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.",ho=e=>`Node type "${e}" not found. Using fallback type "default".`,mo=()=>"The React Flow parent container needs a width and a height to render the graph.",go=()=>"Only child nodes can use a parent extent.",yo=()=>"Can't create edge. An edge needs a source and a target.",vo=e=>`Marker type "${e}" doesn't exist.`,bo=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,wo=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",xo=e=>`Edge type "${e}" not found. Using fallback type "default".`,Eo=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.`,So=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function _o(t,n){const o=e.useContext(uo);if(null===o)throw new Error(So);return C(o,t,n)}const Co=()=>{const t=e.useContext(uo);if(null===t)throw new Error(So);return e.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},ko=e=>e.userSelectionActive?"none":"all";function No({position:t,children:n,className:o,style:r,...a}){const s=_o(ko),l=`${t}`.split("-");return e.createElement("div",{className:i(["react-flow__panel",o,...l]),style:{...r,pointerEvents:s},...a},n)}function Mo({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:e.createElement(No,{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"},e.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Ro=e.memo(({x:t,y:n,label:o,labelStyle:r={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...f})=>{const p=e.useRef(null),[h,m]=e.useState({x:0,y:0,width:0,height:0}),g=i(["react-flow__edge-textwrapper",d]);return e.useEffect(()=>{if(p.current){const e=p.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}},[o]),void 0!==o&&o?e.createElement("g",{transform:`translate(${t-h.width/2} ${n-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f},a&&e.createElement("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),e.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r},o),u):null});const Oo=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ao=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Po=(e={x:0,y:0},t)=>({x:Ao(e.x,t[0][0],t[1][0]),y:Ao(e.y,t[0][1],t[1][1])}),To=(e,t,n)=>e<t?Ao(Math.abs(e-t),1,50)/50:e>n?-Ao(Math.abs(e-n),1,50)/50:0,Do=(e,t)=>[20*To(e.x,35,t.width-35),20*To(e.y,35,t.height-35)],$o=e=>e.getRootNode?.()||window?.document,Io=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),zo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Lo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Bo=e=>!isNaN(e)&&isFinite(e),Fo=Symbol.for("internals"),jo=["Enter"," ","Escape"],Ho=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function Wo(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 Vo=e=>"clientX"in e,Yo=(e,t)=>{const n=Vo(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Xo=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,Ko=({id:t,path:n,labelX:o,labelY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>e.createElement(e.Fragment,null,e.createElement("path",{id:t,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&e.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Bo(o)&&Bo(r)?e.createElement(Ro,{x:o,y:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function Uo(e,t,n){return void 0===n?n:o=>{const r=t().edges.find(t=>t.id===e);r&&n(o,{...r})}}function qo({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,a=n<e?n+r:n-r,i=Math.abs(o-t)/2;return[a,o<t?o+i:o-i,r,i]}function Zo({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*r+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var Go,Qo,Jo,er,tr,nr;function or({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===nr.Left||e===nr.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function rr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:a=nr.Top}){const[i,s]=or({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=or({pos:a,x1:o,y1:r,x2:e,y2:t}),[u,d,f,p]=Zo({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${o},${r}`,u,d,f,p]}Ko.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Go||(Go={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(Qo||(Qo={})),function(e){e.Partial="partial",e.Full="full"}(Jo||(Jo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(er||(er={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(tr||(tr={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(nr||(nr={}));const ar=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:a=nr.Bottom,targetPosition:i=nr.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]=rr({sourceX:t,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i});return e.createElement(Ko,{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})});ar.displayName="SimpleBezierEdge";const ir={[nr.Left]:{x:-1,y:0},[nr.Right]:{x:1,y:0},[nr.Top]:{x:0,y:-1},[nr.Bottom]:{x:0,y:1}},sr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function lr({source:e,sourcePosition:t=nr.Bottom,target:n,targetPosition:o=nr.Top,center:r,offset:a}){const i=ir[t],s=ir[o],l={x:e.x+i.x*a,y:e.y+i.y*a},c={x:n.x+s.x*a,y:n.y+s.y*a},u=(({source:e,sourcePosition:t=nr.Bottom,target:n})=>t===nr.Left||t===nr.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]=qo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=r.x??v,h=r.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const r=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:r:i.y===f?r:u,t===o){const t=Math.abs(e[d]-n[d]);if(t<=a){const o=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*o:y[d]=(c[d]>n[d]?-1:1)*o}}if(t!==o){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],o=l[e]<c[e];(1===i[d]&&(!t&&n||t&&o)||1!==i[d]&&(!t&&o||t&&n))&&(m="x"===d?r:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function cr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:a=nr.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=lr({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let o="";return o=n>0&&n<u.length-1?function(e,t,n,o){const r=Math.min(sr(e,t)/2,sr(t,n)/2,o),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+r*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+r*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+r*(e.y<n.y?-1:1)}Q ${a},${i} ${a+r*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=o},"");return[m,d,f,p,h]}const ur=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=nr.Bottom,targetPosition:p=nr.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=cr({sourceX:t,sourceY:n,sourcePosition:f,targetX:o,targetY:r,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return e.createElement(Ko,{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})});ur.displayName="SmoothStepEdge";const dr=e.memo(t=>e.createElement(ur,{...t,pathOptions:e.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));dr.displayName="StepEdge";const fr=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,a,i,s]=qo({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,a,i,s]}({sourceX:t,sourceY:n,targetX:o,targetY:r});return e.createElement(Ko,{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 pr(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function hr({pos:e,x1:t,y1:n,x2:o,y2:r,c:a}){switch(e){case nr.Left:return[t-pr(t-o,a),n];case nr.Right:return[t+pr(o-t,a),n];case nr.Top:return[t,n-pr(n-r,a)];case nr.Bottom:return[t,n+pr(r-n,a)]}}function mr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:a=nr.Top,curvature:i=.25}){const[s,l]=hr({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[c,u]=hr({pos:a,x1:o,y1:r,x2:e,y2:t,c:i}),[d,f,p,h]=Zo({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${o},${r}`,d,f,p,h]}fr.displayName="StraightEdge";const gr=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:a=nr.Bottom,targetPosition:i=nr.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]=mr({sourceX:t,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i,curvature:g?.curvature});return e.createElement(Ko,{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})});gr.displayName="BezierEdge";const yr=e.createContext(null),vr=yr.Provider;yr.Consumer;const br=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${n}${o||""}`,wr=(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("&")}`},xr=(e,t)=>{if(!e.source||!e.target)return Ho("006",yo()),t;let n;var o;return n="id"in(o=e)&&"source"in o&&"target"in o?{...e}:{...e,id:br(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)},Er=({x:e,y:t},[n,o,r],a,[i,s])=>{const l={x:(e-n)/r,y:(t-o)/r};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},Sr=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o}),_r=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],o=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-o};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-o}:r}},Cr=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const{x:o,y:r}=_r(n,t).positionAbsolute;return a=e,i=Io({x:o,y:r,width:n.width||0,height:n.height||0}),{x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),x2:Math.max(a.x2,i.x2),y2:Math.max(a.y2,i.y2)};var a,i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}))(n)},kr=(e,t,[n,o,r]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/r,y:(t.y-o)/r,width:t.width/r,height:t.height/r},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:o=!0,hidden:r=!1}=e;if(i&&!o||r)return!1;const{positionAbsolute:u}=_r(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=Lo(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},Nr=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Mr=(e,t,n,o,r,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Ao(l,o,r);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Rr=(e,t=0)=>e.transition().duration(t);function Or(e,t,n,o){return(t[n]||[]).reduce((t,r)=>(`${e.id}-${r.id}-${n}`!==o&&t.push({id:r.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+r.x+r.width/2,y:(e.positionAbsolute?.y??0)+r.y+r.height/2}),t),[])}const Ar={source:null,target:null,sourceHandle:null,targetHandle:null},Pr=()=>({handleDomNode:null,isValid:!1,connection:Ar,endHandle:null});function Tr(e,t,n,o,r,a,i){const s="target"===r,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Pr(),handleDomNode:l};if(l){const e=Dr(void 0,l),r=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?r:n,sourceHandle:s?i:o,target:s?n:r,targetHandle:s?o:i};c.connection=f;u&&d&&(t===Go.Strict?s&&"source"===e||!s&&"target"===e:r!==n||i!==o)&&(c.endHandle={nodeId:r,handleId:i,type:e},c.isValid=a(f))}return c}function Dr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function $r(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Ir(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function zr({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=$o(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:E}=Yo(e),S=u?.elementFromPoint(x,E),_=Dr(l,S),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=Yo(e,C),M=!1,R=null,O=!1,A=null;const P=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((e,r)=>{if(r[Fo]){const{handleBounds:a}=r[Fo];let i=[],s=[];a&&(i=Or(r,a,"source",`${t}-${n}-${o}`),s=Or(r,a,"target",`${t}-${n}-${o}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),T=()=>{if(!p)return;const[e,t]=Do(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function D(e){const{transform:o}=a();N=Yo(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,o,r,a){const{x:i,y:s}=Yo(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=Dr(void 0,l),o=l.getAttribute("data-handleid"),i=a({nodeId:e,id:o,type:t});if(i){const a=r.find(n=>n.nodeId===e&&n.type===t&&n.id===o);return{handle:{id:o,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(r.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=o){const n=a(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:Pr()};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,Er(N,o,!1,[1,1]),h,P,e=>Tr(e,d,n,t,r?"target":"source",s,u));if(b=l,M||(T(),M=!0),A=c.handleDomNode,R=c.connection,O=c.isValid,i({connectionPosition:b&&O?Sr({x:b.x,y:b.y},o):N,connectionStatus:Ir(!!b,O),connectionEndHandle:c.endHandle}),!b&&!O&&!A)return $r(k);R.source!==R.target&&A&&($r(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)&&R&&O&&o?.(R),a().onConnectEnd?.(e),l&&c?.(e),$r(k),v(),cancelAnimationFrame(w),M=!1,O=!1,R=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 Lr=()=>!0,Br=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Fr=e.forwardRef(({type:t="source",position:n=nr.Top,isValidConnection:o,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=l||null,y="target"===t,v=Co(),b=e.useContext(yr),{connectOnClick:w,noPanClassName:x}=_o(Br,N),{connecting:E,clickConnecting:S}=_o(((e,t,n)=>o=>{const{connectionStartHandle:r,connectionEndHandle:a,connectionClickStartHandle:i}=o;return{connecting:r?.nodeId===e&&r?.handleId===t&&r?.type===n||a?.nodeId===e&&a?.handleId===t&&a?.type===n,clickConnecting:i?.nodeId===e&&i?.handleId===t&&i?.type===n}})(b,g,t),N);b||v.getState().onError?.("010",wo());const _=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=v.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=v.getState();t(xr(r,e))}n?.(r),c?.(r)},C=e=>{if(!b)return;const t=Vo(e);a&&(t&&0===e.button||!t)&&zr({event:e,handleId:g,nodeId:b,onConnect:_,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:o||v.getState().isValidConnection||Lr}),t?f?.(e):p?.(e)};return e.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${g}-${t}`,className:i(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",x,d,{source:!y,target:y,connectable:r,connectablestart:a,connectableend:s,connecting:S,connectionindicator:r&&(a&&!E||s&&E)}]),onMouseDown:C,onTouchStart:C,onClick:w?e=>{const{onClickConnectStart:n,onClickConnectEnd:r,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=v.getState();if(!b||!i&&!a)return;if(!i)return n?.(e,{nodeId:b,handleId:g,handleType:t}),void v.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:g}});const c=$o(e.target),u=o||l||Lr,{connection:d,isValid:f}=Tr({nodeId:b,id:g,type:t},s,i.nodeId,i.handleId||null,i.type,u,c);f&&_(d),r?.(e),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Fr.displayName="Handle";var jr=e.memo(Fr);const Hr=({data:t,isConnectable:n,targetPosition:o=nr.Top,sourcePosition:r=nr.Bottom})=>e.createElement(e.Fragment,null,e.createElement(jr,{type:"target",position:o,isConnectable:n}),t?.label,e.createElement(jr,{type:"source",position:r,isConnectable:n}));Hr.displayName="DefaultNode";var Wr=e.memo(Hr);const Vr=({data:t,isConnectable:n,sourcePosition:o=nr.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(jr,{type:"source",position:o,isConnectable:n}));Vr.displayName="InputNode";var Yr=e.memo(Vr);const Xr=({data:t,isConnectable:n,targetPosition:o=nr.Top})=>e.createElement(e.Fragment,null,e.createElement(jr,{type:"target",position:o,isConnectable:n}),t?.label);Xr.displayName="OutputNode";var Kr=e.memo(Xr);const Ur=()=>null;Ur.displayName="GroupNode";const qr=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),Zr=e=>e.id;function Gr(e,t){return N(e.selectedNodes.map(Zr),t.selectedNodes.map(Zr))&&N(e.selectedEdges.map(Zr),t.selectedEdges.map(Zr))}const Qr=e.memo(({onSelectionChange:t})=>{const n=Co(),{selectedNodes:o,selectedEdges:r}=_o(qr,Gr);return e.useEffect(()=>{const e={nodes:o,edges:r};t?.(e),n.getState().onSelectionChange.forEach(t=>t(e))},[o,r,t]),null});Qr.displayName="SelectionListener";const Jr=e=>!!e.onSelectionChange;function ea({onSelectionChange:t}){const n=_o(Jr);return t||n?e.createElement(Qr,{onSelectionChange:t}):null}const ta=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 na(t,n){e.useEffect(()=>{void 0!==t&&n(t)},[t])}function oa(t,n,o){e.useEffect(()=>{void 0!==n&&o({[t]:n})},[n])}const ra=({nodes:t,edges:n,defaultNodes:o,defaultEdges:r,onConnect:a,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:M,fitView:R,fitViewOptions:O,onNodesDelete:A,onEdgesDelete:P,onNodeDrag:T,onNodeDragStart:D,onNodeDragStop:$,onSelectionDrag:I,onSelectionDragStart:z,onSelectionDragStop:L,noPanClassName:B,nodeOrigin:F,rfId:j,autoPanOnConnect:H,autoPanOnNodeDrag:W,onError:V,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=_o(ta,N),ne=Co();return e.useEffect(()=>{const e=r?.map(e=>({...e,...M}));return Z(o,e),()=>{te()}},[]),oa("defaultEdgeOptions",M,ne.setState),oa("connectionMode",E,ne.setState),oa("onConnect",a,ne.setState),oa("onConnectStart",i,ne.setState),oa("onConnectEnd",s,ne.setState),oa("onClickConnectStart",l,ne.setState),oa("onClickConnectEnd",c,ne.setState),oa("nodesDraggable",u,ne.setState),oa("nodesConnectable",d,ne.setState),oa("nodesFocusable",f,ne.setState),oa("edgesFocusable",p,ne.setState),oa("edgesUpdatable",h,ne.setState),oa("elementsSelectable",x,ne.setState),oa("elevateNodesOnSelect",m,ne.setState),oa("snapToGrid",_,ne.setState),oa("snapGrid",S,ne.setState),oa("onNodesChange",b,ne.setState),oa("onEdgesChange",w,ne.setState),oa("connectOnClick",k,ne.setState),oa("fitViewOnInit",R,ne.setState),oa("fitViewOnInitOptions",O,ne.setState),oa("onNodesDelete",A,ne.setState),oa("onEdgesDelete",P,ne.setState),oa("onNodeDrag",T,ne.setState),oa("onNodeDragStart",D,ne.setState),oa("onNodeDragStop",$,ne.setState),oa("onSelectionDrag",I,ne.setState),oa("onSelectionDragStart",z,ne.setState),oa("onSelectionDragStop",L,ne.setState),oa("noPanClassName",B,ne.setState),oa("nodeOrigin",F,ne.setState),oa("rfId",j,ne.setState),oa("autoPanOnConnect",H,ne.setState),oa("autoPanOnNodeDrag",W,ne.setState),oa("onError",V,ne.setState),oa("connectionRadius",Y,ne.setState),oa("isValidConnection",X,ne.setState),oa("nodeDragThreshold",K,ne.setState),na(t,U),na(n,q),na(g,G),na(y,Q),na(C,J),na(v,ee),null},aa={display:"none"},ia={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sa="react-flow__node-desc",la="react-flow__edge-desc",ca=e=>e.ariaLiveMessage;function ua({rfId:t}){const n=_o(ca);return e.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ia},n)}function da({rfId:t,disableKeyboardA11y:n}){return e.createElement(e.Fragment,null,e.createElement("div",{id:`${sa}-${t}`,style:aa},"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."," "),e.createElement("div",{id:`${la}-${t}`,style:aa},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&e.createElement(ua,{rfId:t}))}var fa=(t=null,n={actInsideInputWithModifier:!0})=>{const[o,r]=e.useState(!1),a=e.useRef(!1),i=e.useRef(new Set([])),[s,l]=e.useMemo(()=>{if(null!==t){const e=(Array.isArray(t)?t:[t]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=e.reduce((e,t)=>e.concat(...t),[]);return[e,n]}return[[],[]]},[t]);return e.useEffect(()=>{const e="undefined"!=typeof document?document:null,o=n?.target||e;if(null!==t){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Wo(e))return!1;const t=ha(e.code,l);i.current.add(e[t]),pa(s,i.current,!1)&&(e.preventDefault(),r(!0))},t=e=>{if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Wo(e))return!1;const t=ha(e.code,l);pa(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),a.current=!1},c=()=>{i.current.clear(),r(!1)};return o?.addEventListener("keydown",e),o?.addEventListener("keyup",t),window.addEventListener("blur",c),()=>{o?.removeEventListener("keydown",e),o?.removeEventListener("keyup",t),window.removeEventListener("blur",c)}}},[t,r]),o};function pa(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ha(e,t){return t.includes(e)?"code":"key"}function ma(e,t,n,o){const r=e.parentNode||e.parentId;if(!r)return n;const a=t.get(r),i=_r(a,o);return ma(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Fo]?.z??0)>(n.z??0)?a[Fo]?.z??0:n.z??0},o)}function ga(e,t,n){e.forEach(o=>{const r=o.parentNode||o.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n?.[o.id]){const{x:r,y:a,z:i}=ma(o,e,{...o.position,z:o[Fo]?.z??0},t);o.positionAbsolute={x:r,y:a},o[Fo].z=i,n?.[o.id]&&(o[Fo].isParent=!0)}})}function ya(e,t,n,o){const r=new Map,a={},i=o?1e3:0;return e.forEach(e=>{const n=(Bo(e.zIndex)?e.zIndex:0)+(e.selected?i:0),o=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(a[l]=!0);const c=o?.type&&o?.type!==e.type;Object.defineProperty(s,Fo,{enumerable:!1,value:{handleBounds:c?void 0:o?.[Fo]?.handleBounds,z:n}}),r.set(e.id,s)}),ga(r,n,a),r}function va(e,t={}){const{getNodes:n,width:o,height:r,minZoom:a,maxZoom:i,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=Cr(e,d),{x:c,y:u,zoom:f}=Mr(n,o,r,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=to.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Rr(l,t.duration),p):s.transform(l,p),!0}}return!1}function ba(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Fo]:n[Fo],selected:e.selected})}),new Map(t)}function wa(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function xa({changedNodes:e,changedEdges:t,get:n,set:o}){const{nodeInternals:r,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&o({nodeInternals:ba(e,r)}),i?.(e)),t?.length&&(c&&o({edges:wa(t,a)}),s?.(t))}const Ea=()=>{},Sa={zoomIn:Ea,zoomOut:Ea,zoomTo:Ea,getZoom:()=>1,setViewport:Ea,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ea,fitBounds:Ea,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},_a=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Ca(){const t=(()=>{const t=Co(),{d3Zoom:n,d3Selection:o}=_o(_a,N),r=e.useMemo(()=>o&&n?{zoomIn:e=>n.scaleBy(Rr(o,e?.duration),1.2),zoomOut:e=>n.scaleBy(Rr(o,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Rr(o,t?.duration),e),getZoom:()=>t.getState().transform[2],setViewport:(e,r)=>{const[a,i,s]=t.getState().transform,l=to.translate(e.x??a,e.y??i).scale(e.zoom??s);n.transform(Rr(o,r?.duration),l)},getViewport:()=>{const[e,n,o]=t.getState().transform;return{x:e,y:n,zoom:o}},fitView:e=>va(t.getState,e),setCenter:(e,r,a)=>{const{width:i,height:s,maxZoom:l}=t.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-e*c,d=s/2-r*c,f=to.translate(u,d).scale(c);n.transform(Rr(o,a?.duration),f)},fitBounds:(e,r)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=t.getState(),{x:c,y:u,zoom:d}=Mr(e,a,i,s,l,r?.padding??.1),f=to.translate(c,u).scale(d);n.transform(Rr(o,r?.duration),f)},project:e=>{const{transform:n,snapToGrid:o,snapGrid:r}=t.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"),Er(e,n,o,r)},screenToFlowPosition:e=>{const{transform:n,snapToGrid:o,snapGrid:r,domNode:a}=t.getState();if(!a)return e;const{x:i,y:s}=a.getBoundingClientRect(),l={x:e.x-i,y:e.y-s};return Er(l,n,o,r)},flowToScreenPosition:e=>{const{transform:n,domNode:o}=t.getState();if(!o)return e;const{x:r,y:a}=o.getBoundingClientRect(),i=Sr(e,n);return{x:i.x+r,y:i.y+a}},viewportInitialized:!0}:Sa,[n,o]);return r})(),n=Co(),o=e.useCallback(()=>n.getState().getNodes().map(e=>({...e})),[]),r=e.useCallback(e=>n.getState().nodeInternals.get(e),[]),a=e.useCallback(()=>{const{edges:e=[]}=n.getState();return e.map(e=>({...e}))},[]),i=e.useCallback(e=>{const{edges:t=[]}=n.getState();return t.find(t=>t.id===e)},[]),s=e.useCallback(e=>{const{getNodes:t,setNodes:o,hasDefaultNodes:r,onNodesChange:a}=n.getState(),i=t(),s="function"==typeof e?e(i):e;if(r)o(s);else if(a){const e=0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));a(e)}},[]),l=e.useCallback(e=>{const{edges:t=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:a}=n.getState(),i="function"==typeof e?e(t):e;if(r)o(i);else if(a){a(0===i.length?t.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),c=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{getNodes:o,setNodes:r,hasDefaultNodes:a,onNodesChange:i}=n.getState();if(a){r([...o(),...t])}else if(i){const e=t.map(e=>({item:e,type:"add"}));i(e)}},[]),u=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{edges:o=[],setEdges:r,hasDefaultEdges:a,onEdgesChange:i}=n.getState();if(a)r([...o,...t]);else if(i){i(t.map(e=>({item:e,type:"add"})))}},[]),d=e.useCallback(()=>{const{getNodes:e,edges:t=[],transform:o}=n.getState(),[r,a,i]=o;return{nodes:e().map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:r,y:a,zoom:i}}},[]),f=e.useCallback(({nodes:e,edges:t})=>{const{nodeInternals:o,getNodes:r,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=n.getState(),f=(e||[]).map(e=>e.id),p=(t||[]).map(e=>e.id),h=r().reduce((e,t)=>{const n=t.parentNode||t.parentId,o=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||o)&&e.push(t),e},[]),m=a.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Nr(h,m),t=[...g,...e],r=t.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&n.setState({edges:a.filter(e=>!r.includes(e.id))}),i&&(h.forEach(e=>{o.delete(e.id)}),n.setState({nodeInternals:new Map(o)}))),r.length>0&&(c?.(t),d&&d(r.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),p=e.useCallback(e=>{const t=Bo((o=e).width)&&Bo(o.height)&&Bo(o.x)&&Bo(o.y);var o;const r=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!r)return[null,null,t];return[t?e:zo(r),r,t]},[]),h=e.useCallback((e,t=!0,o)=>{const[r,a,i]=p(e);return r?(o||n.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const n=zo(e),o=Lo(n,r);return t&&o>0||o>=r.width*r.height}):[]},[]),m=e.useCallback((e,t,n=!0)=>{const[o]=p(e);if(!o)return!1;const r=Lo(o,t);return n&&r>0||r>=o.width*o.height},[]);return e.useMemo(()=>({...t,getNodes:o,getNode:r,getEdges:a,getEdge:i,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:m}),[t,o,r,a,i,s,l,c,u,d,f,h,m])}const ka={actInsideInputWithModifier:!1};const Na={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ma=e=>({x:e.x,y:e.y,zoom:e.k}),Ra=(e,t)=>e.target.closest(`.${t}`),Oa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Aa=e=>{const t=e.ctrlKey&&Xo()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Pa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ta=({onMove:t,onMoveStart:n,onMoveEnd:o,onPaneContextMenu:r,zoomOnScroll:a=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Qo.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:x})=>{const E=e.useRef(),S=Co(),_=e.useRef(!1),C=e.useRef(!1),k=e.useRef(null),M=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:A,d3ZoomHandler:P,userSelectionActive:T}=_o(Pa,N),D=fa(y),$=e.useRef(0),I=e.useRef(!1),z=e.useRef();return function(t){const n=Co();e.useEffect(()=>{let e;const o=()=>{if(!t.current)return;const e=Oo(t.current);0!==e.height&&0!==e.width||n.getState().onError?.("004",mo()),n.setState({width:e.width||500,height:e.height||500})};return o(),window.addEventListener("resize",o),t.current&&(e=new ResizeObserver(()=>o()),e.observe(t.current)),()=>{window.removeEventListener("resize",o),e&&t.current&&e.unobserve(t.current)}},[])}(k),e.useEffect(()=>{if(k.current){const e=k.current.getBoundingClientRect(),t=function(){var e,t,n,o=ro,r=ao,a=co,i=so,s=lo,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=on,f=R("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",io).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 eo(t,e.x,e.y)}function y(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new eo(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",function(){w(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(o).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(o),s=r.apply(e,a),l=null==n?v(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new eo(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function E(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,i.apply(this,arguments)))),u=Xe(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Nn(this),n.start()}oo(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,i=w(this,t,!0).event(e),s=Ye(e.view).on("mousemove.zoom",function(e){if(oo(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]=Xe(e,r),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),Qe(e.view,i.moved),oo(e),i.event(e).end()},!0),l=Xe(e,r),u=e.clientX,d=e.clientY;Ge(e.view),no(e),i.mouse=[l,this.__zoom.invert(l)],Nn(this),i.start()}}function _(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,i=Xe(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(y(g(n,l),i,s),r.apply(this,t),c);oo(e),u>0?Ye(this).transition().duration(u).call(b,d,i,e):Ye(this).call(m.transform,d,i,e)}}function C(n,...r){if(o.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,r,n.changedTouches.length===u).event(n);for(no(n),i=0;i<u;++i)l=[l=Xe(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)),Nn(this),d.start())}}function k(e,...t){if(this.__zooming){var n,o,r,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(oo(e),n=0;n<u;++n)r=Xe(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;o=g(o,Math.sqrt(m/v)),r=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(o,r,i),s.extent,c))}}function N(e,...o){if(this.__zooming){var r,a,i=w(this,o).event(e),s=e.changedTouches,l=s.length;for(no(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<l;++r)a=s[r],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=Xe(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=Ye(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",io),e!==r?b(e,t,n,o):r.interrupt().each(function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,o){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,o)},m.scaleTo=function(e,t,n,o){m.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(o,l),i,s),e,c)},n,o)},m.translateBy=function(e,t,n,o){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,o)},m.translateTo=function(e,t,n,o,i){m.transform(e,function(){var e=r.apply(this,arguments),i=this.__zoom,s=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return a(to.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},o,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=Ye(this.that).datum();f.call(e,this.that,new Jn(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:Qn(+e),m):i},m.filter=function(e){return arguments.length?(o="function"==typeof e?e:Qn(!!e),m):o},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Qn(!!e),m):s},m.extent=function(e){return arguments.length?(r="function"==typeof e?e:Qn([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):r},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([m,g]).translateExtent(h),n=Ye(k.current).call(t),o=to.translate(p.x,p.y).scale(Ao(p.zoom,m,g)),r=[[0,0],[e.width,e.height]],a=t.constrain()(o,r,h);t.transform(n,a),t.wheelDelta(Aa),S.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:k.current.closest(".react-flow")})}},[]),e.useEffect(()=>{A&&O&&(!s||D||T?void 0!==P&&A.on("wheel.zoom",function(e,t){if(!v&&"wheel"===e.type&&!e.ctrlKey||Ra(e,w))return null;e.preventDefault(),P.call(this,e,t)},{passive:!1}):A.on("wheel.zoom",e=>{if(Ra(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const r=A.property("__zoom").k||1;if(e.ctrlKey&&i){const t=Xe(e),n=Aa(e),o=r*Math.pow(2,n);return void O.scaleTo(A,o,t,e)}const a=1===e.deltaMode?20:1;let s=c===Qo.Vertical?0:e.deltaX*a,u=c===Qo.Horizontal?0:e.deltaY*a;!Xo()&&e.shiftKey&&c!==Qo.Vertical&&(s=e.deltaY*a,u=0),O.translateBy(A,-s/r*l,-u/r*l,{internal:!0});const d=Ma(A.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=S.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(e,d),f?.(d)),I.current&&(t?.(e,d),p?.(d),z.current=setTimeout(()=>{o?.(e,d),h?.(d),I.current=!1},150))},{passive:!1}))},[T,s,c,A,O,P,D,i,v,w,n,t,o]),e.useEffect(()=>{O&&O.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;$.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=S.getState(),o=Ma(e.transform);_.current=!0,M.current=o,"mousedown"===e.sourceEvent?.type&&S.setState({paneDragging:!0}),t?.(o),n?.(e.sourceEvent,o)})},[O,n]),e.useEffect(()=>{O&&(T&&!_.current?O.on("zoom",null):T||O.on("zoom",e=>{const{onViewportChange:n}=S.getState();if(S.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),C.current=!(!r||!Oa(f,$.current??0)),(t||n)&&!e.sourceEvent?.internal){const o=Ma(e.transform);n?.(o),t?.(e.sourceEvent,o)}}))},[T,O,t,f,r]),e.useEffect(()=>{O&&O.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=S.getState();if(_.current=!1,S.setState({paneDragging:!1}),r&&Oa(f,$.current??0)&&!C.current&&r(e.sourceEvent),C.current=!1,(o||t)&&(n=M.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Ma(e.transform);M.current=n,clearTimeout(E.current),E.current=setTimeout(()=>{t?.(n),o?.(e.sourceEvent,n)},s?150:0)}var n,a})},[O,s,f,o,r]),e.useEffect(()=>{O&&O.filter(e=>{const t=D||a,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ra(e,"react-flow__node")||Ra(e,"react-flow__edge")))return!0;if(!(f||t||s||u||i))return!1;if(T)return!1;if(!u&&"dblclick"===e.type)return!1;if(Ra(e,w)&&"wheel"===e.type)return!1;if(Ra(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!D))return!1;if(!i&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!s&&!n&&"wheel"===e.type)return!1;if(!f&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(f)&&!f.includes(e.button)&&"mousedown"===e.type)return!1;const o=Array.isArray(f)&&f.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&o})},[T,O,a,i,s,u,f,d,D]),e.createElement("div",{className:"react-flow__renderer",ref:k,style:Na},b)},Da=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function $a(){const{userSelectionActive:t,userSelectionRect:n}=_o(Da,N);return t&&n?e.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 Ia(e,t){const n=t.parentNode||t.parentId,o=e.find(e=>e.id===n);if(o){const e=t.position.x+t.width-o.width,n=t.position.y+t.height-o.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(o.style={...o.style}||{},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,e>0&&(o.style.width+=e),n>0&&(o.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);o.position.x=o.position.x-e,o.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);o.position.y=o.position.y-e,o.style.height+=e,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function za(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const o=e.filter(e=>e.id===n.id);if(0===o.length)return t.push(n),t;const r={...n};for(const e of o)if(e)switch(e.type){case"select":r.selected=e.selected;break;case"position":void 0!==e.position&&(r.position=e.position),void 0!==e.positionAbsolute&&(r.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(r.dragging=e.dragging),r.expandParent&&Ia(t,r);break;case"dimensions":void 0!==e.dimensions&&(r.width=e.dimensions.width,r.height=e.dimensions.height),void 0!==e.updateStyle&&(r.style={...r.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(r.resizing=e.resizing),r.expandParent&&Ia(t,r);break;case"remove":return t}return t.push(r),t},n)}function La(e,t){return za(e,t)}const Ba=(e,t)=>({id:e,type:"select",selected:t});function Fa(e,t){return e.reduce((e,n)=>{const o=t.includes(n.id);return!n.selected&&o?(n.selected=!0,e.push(Ba(n.id,!0))):n.selected&&!o&&(n.selected=!1,e.push(Ba(n.id,!1))),e},[])}const ja=(e,t)=>n=>{n.target===t.current&&e?.(n)},Ha=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Wa=e.memo(({isSelecting:t,selectionMode:n=Jo.Full,panOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:s,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=e.useRef(null),m=Co(),g=e.useRef(0),y=e.useRef(0),v=e.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=_o(Ha,N),E=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},S=e=>{s?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},_=c?e=>c(e):void 0,C=w&&(t||b);return e.createElement("div",{className:i(["react-flow__pane",{dragging:x,selection:t}]),onClick:C?void 0:ja(S,h),onContextMenu:ja(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():l?.(e)},h),onWheel:ja(_,h),onMouseEnter:C?void 0:u,onMouseDown:C?e=>{const{resetSelectedElements:n,domNode:o}=m.getState();if(v.current=o?.getBoundingClientRect(),!w||!t||0!==e.button||e.target!==h.current||!v.current)return;const{x:a,y:i}=Yo(e,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),r?.(e)}:void 0,onMouseMove:C?e=>{const{userSelectionRect:o,nodeInternals:r,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!t||!v.current||!o)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=Yo(e,v.current),f=o.startX??0,p=o.startY??0,h={...o,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},b=u(),w=kr(r,h,i,n===Jo.Partial,!0,c),x=Nr(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Fa(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Fa(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:C?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:C?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}:f,ref:h,style:Na},p,e.createElement($a,null))});function Va(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return!!o&&(!!o.selected||Va(o,t))}function Ya(e,t,n){let o=e;do{if(o?.matches(t))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function Xa(e,t,n,o){return Array.from(e.values()).filter(n=>(n.selected||n.id===o)&&(!n.parentNode||n.parentId||!Va(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 Ka(e,t,n,o,r=[0,0],a){const i=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||o);let s=i;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:o,y:a}=_r(t,r).positionAbsolute;s=[[e.extent[0][0]+o,e.extent[0][1]+a],[e.extent[1][0]+o,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:o,y:a}=_r(t,r).positionAbsolute;s=t&&Bo(o)&&Bo(a)&&Bo(t.width)&&Bo(t.height)?[[o+e.width*r[0],a+e.height*r[1]],[o+t.width-e.width+e.width*r[0],a+t.height-e.height+e.height*r[1]]]:s}else a?.("005",go()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=_r(e,r).positionAbsolute}const u=s&&"parent"!==s?Po(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function Ua({nodeId:e,dragItems:t,nodeInternals:n}){const o=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?o.find(t=>t.id===e):o[0],o]}Wa.displayName="Pane";const qa=(e,t,n,o)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const a=Array.from(r),i=t.getBoundingClientRect(),s=i.width*o[0],l=i.height*o[1];return a.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-i.left-s)/n,y:(t.top-i.top-l)/n,...Oo(e)}})};function Za(e,t,n){return void 0===n?n:o=>{const r=t().nodeInternals.get(e);r&&n(o,{...r})}}function Ga({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:i,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):l?.("012",Eo(e))}function Qa(e){return(t,n,o)=>e?.(t,o)}function Ja({nodeRef:t,disabled:n=!1,noDragClassName:o,handleSelector:r,nodeId:a,isSelectable:i,selectNodesOnDrag:s}){const l=Co(),[c,u]=e.useState(!1),d=e.useRef([]),f=e.useRef({x:null,y:null}),p=e.useRef(0),h=e.useRef(null),m=e.useRef({x:0,y:0}),g=e.useRef(null),y=e.useRef(!1),v=e.useRef(!1),b=e.useRef(!1),w=function(){const t=Co(),n=e.useCallback(({sourceEvent:e})=>{const{transform:n,snapGrid:o,snapToGrid:r}=t.getState(),a=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,s={x:(a-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(s.x/o[0]):s.x,ySnapped:r?o[1]*Math.round(s.y/o[1]):s.y,...s}},[]);return n}();return e.useEffect(()=>{if(t?.current){const e=Ye(t.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:o,onSelectionDrag:r,updateNodePositions:i,nodeExtent:s,snapGrid:c,snapToGrid:p,nodeOrigin:h,onError:m}=l.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Cr(d.current,h);v=Io(e)}if(d.current=d.current.map(o=>{const r={x:e-o.distance.x,y:t-o.distance.y};p&&(r.x=c[0]*Math.round(r.x/c[0]),r.y=c[1]*Math.round(r.y/c[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!o.extent&&(a[0][0]=o.positionAbsolute.x-v.x+s[0][0],a[1][0]=o.positionAbsolute.x+(o.width??0)-v.x2+s[1][0],a[0][1]=o.positionAbsolute.y-v.y+s[0][1],a[1][1]=o.positionAbsolute.y+(o.height??0)-v.y2+s[1][1]);const i=Ka(o,r,n,a,h,m);return y=y||o.position.x!==i.position.x||o.position.y!==i.position.y,o.position=i.position,o.positionAbsolute=i.positionAbsolute,o}),!y)return;i(d.current,!0,!0),u(!0);const b=a?o:Qa(r);if(b&&g.current){const[e,t]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=Do(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:o}=l.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],o({x:e,y:t})&&c(f.current)}p.current=requestAnimationFrame(x)},E=e=>{const{nodeInternals:n,multiSelectionActive:o,nodesDraggable:r,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:p}=l.getState();v.current=!0;const h=a?u:Qa(p);s&&i||o||!a||n.get(a)?.selected||c(),a&&i&&s&&Ga({id:a,store:l,nodeRef:t});const m=w(e);if(f.current=m,d.current=Xa(n,r,m,a),h&&d.current){const[t,o]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});h(e.sourceEvent,t,o)}};if(!n){const n=function(){var e,t,n,o,r=tt,a=nt,i=ot,s=rt,l={},c=R("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,Ke).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!o&&r.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(Ye(i.view).on("mousemove.drag",h,Ue).on("mouseup.drag",m,Ue),Ge(i.view),qe(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(o){if(Ze(o),!n){var r=o.clientX-e,a=o.clientY-t;n=r*r+a*a>d}l.mouse("drag",o)}function m(e){Ye(e.view).on("mousemove.drag mouseup.drag",null),Qe(e.view,n),Ze(e),l.mouse("end",e)}function g(e,t){if(r.call(this,e,t)){var n,o,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(o=b(this,s,e,t,i[n].identifier,i[n]))&&(qe(e),o("start",e,i[n]))}}function y(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=l[o[t].identifier])&&(Ze(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,a=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<a;++t)(n=l[r[t].identifier])&&(qe(e),n("end",e,r[t]))}function b(e,t,n,o,r,a){var s,d,p,h=c.copy(),m=Xe(a||n,t);if(null!=(p=i.call(e,new et("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),o)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,y=m;switch(a){case"start":l[r]=n,g=u++;break;case"end":delete l[r],--u;case"drag":m=Xe(c||i,t),g=u}h.call(a,e,new et(a,{sourceEvent:i,subject:p,target:f,identifier:r,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:Je(!!e),f):r},f.container=function(e){return arguments.length?(a="function"==typeof e?e:Je(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:Je(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Je(!!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}=l.getState();0===n&&E(e),b.current=!1;const o=w(e);f.current=o,h.current=t?.getBoundingClientRect()||null,m.current=Yo(e.sourceEvent,h.current)}).on("drag",e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:o}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&v.current&&n&&(y.current=!0,x()),!v.current){const n=t.xSnapped-(f?.current?.x??0),r=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+r*r)>o&&E(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&v.current&&(g.current=e.sourceEvent,m.current=Yo(e.sourceEvent,h.current),c(t))}}).on("end",e=>{if(v.current&&!b.current&&(u(!1),y.current=!1,v.current=!1,cancelAnimationFrame(p.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:o,onSelectionDragStop:r}=l.getState(),i=a?o:Qa(r);if(t(d.current,!1,!1),i){const[t,o]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});i(e.sourceEvent,t,o)}}}).filter(e=>{const n=e.target;return!e.button&&(!o||!Ya(n,`.${o}`,t))&&(!r||Ya(n,r,t))});return e.call(n),()=>{e.on(".drag",null)}}e.on(".drag",null)}},[t,n,o,r,i,l,a,s,w]),c}function ei(){const t=Co(),n=e.useCallback(e=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=t.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=e.isShiftPressed?4:1,h=e.x*d*p,m=e.y*f*p,g=u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:r,position:a}=Ka(e,t,n,o,void 0,l);e.position=a,e.positionAbsolute=r}return e});r(g,!0,!1)},[]);return n}const ti={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ni=t=>{const n=({id:n,type:o,data:r,xPos:a,yPos:s,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:m,onDoubleClick:g,style:y,className:v,isDraggable:b,isSelectable:w,isConnectable:x,isFocusable:E,selectNodesOnDrag:S,sourcePosition:_,targetPosition:C,hidden:k,resizeObserver:N,dragHandle:M,zIndex:R,isParent:O,noDragClassName:A,noPanClassName:P,initialized:T,disableKeyboardA11y:D,ariaLabel:$,rfId:I,hasHandleBounds:z})=>{const L=Co(),B=e.useRef(null),F=e.useRef(null),j=e.useRef(_),H=e.useRef(C),W=e.useRef(o),V=w||b||d||f||p||h,Y=ei(),X=Za(n,L.getState,f),K=Za(n,L.getState,p),U=Za(n,L.getState,h),q=Za(n,L.getState,m),Z=Za(n,L.getState,g);e.useEffect(()=>()=>{F.current&&(N?.unobserve(F.current),F.current=null)},[]),e.useEffect(()=>{if(B.current&&!k){const e=B.current;T&&z&&F.current===e||(F.current&&N?.unobserve(F.current),N?.observe(e),F.current=e)}},[k,T,z]),e.useEffect(()=>{const e=W.current!==o,t=j.current!==_,r=H.current!==C;B.current&&(e||t||r)&&(e&&(W.current=o),t&&(j.current=_),r&&(H.current=C),L.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,o,_,C]);const G=Ja({nodeRef:B,disabled:k||!b,noDragClassName:A,handleSelector:M,nodeId:n,isSelectable:w,selectNodesOnDrag:S});return k?null:e.createElement("div",{className:i(["react-flow__node",`react-flow__node-${o}`,{[P]:b},v,{selected:u,selectable:w,parent:O,dragging:G}]),ref:B,style:{zIndex:R,transform:`translate(${l}px,${c}px)`,pointerEvents:V?"all":"none",visibility:T?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:K,onMouseLeave:U,onContextMenu:q,onClick:e=>{const{nodeDragThreshold:t}=L.getState();if(w&&(!S||!b||t>0)&&Ga({id:n,store:L,nodeRef:B}),d){const t=L.getState().nodeInternals.get(n);t&&d(e,{...t})}},onDoubleClick:Z,onKeyDown:E?e=>{if(!Wo(e)&&!D)if(jo.includes(e.key)&&w){const t="Escape"===e.key;Ga({id:n,store:L,unselect:t,nodeRef:B})}else b&&u&&Object.prototype.hasOwnProperty.call(ti,e.key)&&(L.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),Y({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":D?void 0:`${sa}-${I}`,"aria-label":$},e.createElement(vr,{value:n},e.createElement(t,{id:n,data:r,type:o,xPos:a,yPos:s,selected:u,isConnectable:x,sourcePosition:_,targetPosition:C,dragging:G,dragHandle:M,zIndex:R})))};return n.displayName="NodeWrapper",e.memo(n)};const oi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...Cr(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var ri=e.memo(function({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:o}){const r=Co(),{width:a,height:s,x:l,y:c,transformString:u,userSelectionActive:d}=_o(oi,N),f=ei(),p=e.useRef(null);if(e.useEffect(()=>{o||p.current?.focus({preventScroll:!0})},[o]),Ja({nodeRef:p}),d||!a||!s)return null;const h=t?e=>{const n=r.getState().getNodes().filter(e=>e.selected);t(e,n)}:void 0;return e.createElement("div",{className:i(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u}},e.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:o?void 0:-1,onKeyDown:o?void 0:e=>{Object.prototype.hasOwnProperty.call(ti,e.key)&&f({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:c,left:l}}))});const ai=e=>e.nodesSelectionActive,ii=({children:t,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:S,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:N,defaultViewport:M,translateExtent:R,minZoom:O,maxZoom:A,preventScrolling:P,onSelectionContextMenu:T,noWheelClassName:D,noPanClassName:$,disableKeyboardA11y:I})=>{const z=_o(ai),L=fa(f),B=fa(v),F=B||N,j=B||S,H=L||p&&!0!==F;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const o=Co(),{deleteElements:r}=Ca(),a=fa(t,ka),i=fa(n);e.useEffect(()=>{if(a){const{edges:e,getNodes:t}=o.getState(),n=t().filter(e=>e.selected),a=e.filter(e=>e.selected);r({nodes:n,edges:a}),o.setState({nodesSelectionActive:!1})}},[a]),e.useEffect(()=>{o.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:l,multiSelectionKeyCode:y}),e.createElement(Ta,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:j,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!L&&F,defaultViewport:M,translateExtent:R,minZoom:O,maxZoom:A,zoomActivationKeyCode:b,preventScrolling:P,noWheelClassName:D,noPanClassName:$},e.createElement(Wa,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:F,isSelecting:!!H,selectionMode:h},t,z&&e.createElement(ri,{onSelectionContextMenu:T,noPanClassName:$,disableKeyboardA11y:I})))};ii.displayName="FlowRenderer";var si=e.memo(ii);function li(e){return{...{input:ni(e.input||Yr),default:ni(e.default||Wr),output:ni(e.output||Kr),group:ni(e.group||Ur)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ni(e[n]||Wr),t),{})}}const ci=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ui=t=>{const{nodesDraggable:n,nodesConnectable:o,nodesFocusable:r,elementsSelectable:a,updateNodeDimensions:i,onError:s}=_o(ci,N),l=(c=t.onlyRenderVisibleElements,_o(e.useCallback(e=>c?kr(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[c])));var c;const u=e.useRef(),d=e.useMemo(()=>{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}));i(t)});return u.current=e,e},[]);return e.useEffect(()=>()=>{u?.current?.disconnect()},[]),e.createElement("div",{className:"react-flow__nodes",style:Na},l.map(i=>{let l=i.type||"default";t.nodeTypes[l]||(s?.("003",ho(l)),l="default");const c=t.nodeTypes[l]||t.nodeTypes.default,u=!!(i.draggable||n&&void 0===i.draggable),f=!!(i.selectable||a&&void 0===i.selectable),p=!!(i.connectable||o&&void 0===i.connectable),h=!!(i.focusable||r&&void 0===i.focusable),m=t.nodeExtent?Po(i.positionAbsolute,t.nodeExtent):i.positionAbsolute,g=m?.x??0,y=m?.y??0,v=(({x:e,y:t,width:n,height:o,origin:r})=>n&&o?r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-o*r[1]}:{x:e,y:t})({x:g,y:y,width:i.width??0,height:i.height??0,origin:t.nodeOrigin});return e.createElement(c,{key:i.id,id:i.id,className:i.className,style:i.style,type:l,data:i.data,sourcePosition:i.sourcePosition||nr.Bottom,targetPosition:i.targetPosition||nr.Top,hidden:i.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!i.selected,isDraggable:u,isSelectable:f,isConnectable:p,isFocusable:h,resizeObserver:d,dragHandle:i.dragHandle,zIndex:i[Fo]?.z??0,isParent:!!i[Fo]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!i.width&&!!i.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[Fo]?.handleBounds})}))};ui.displayName="NodeRenderer";var di=e.memo(ui);const fi=(e,t,n)=>n===nr.Left?e-t:n===nr.Right?e+t:e,pi=(e,t,n)=>n===nr.Top?e-t:n===nr.Bottom?e+t:e,hi="react-flow__edgeupdater",mi=({position:t,centerX:n,centerY:o,radius:r=10,onMouseDown:a,onMouseEnter:s,onMouseOut:l,type:c})=>e.createElement("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:l,className:i([hi,`${hi}-${c}`]),cx:fi(n,r,t),cy:pi(o,r,t),r:r,stroke:"transparent",fill:"transparent"}),gi=()=>!0;var yi=t=>{const n=({id:n,className:o,type:r,data:a,onClick:s,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:v,target:b,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:C,elementsSelectable:k,hidden:N,sourceHandleId:M,targetHandleId:R,onContextMenu:O,onMouseEnter:A,onMouseMove:P,onMouseLeave:T,reconnectRadius:D,onReconnect:$,onReconnectStart:I,onReconnectEnd:z,markerEnd:L,markerStart:B,rfId:F,ariaLabel:j,isFocusable:H,isReconnectable:W,pathOptions:V,interactionWidth:Y,disableKeyboardA11y:X})=>{const K=e.useRef(null),[U,q]=e.useState(!1),[Z,G]=e.useState(!1),Q=Co(),J=e.useMemo(()=>`url('#${wr(B,F)}')`,[B,F]),ee=e.useMemo(()=>`url('#${wr(L,F)}')`,[L,F]);if(N)return null;const te=Uo(n,Q.getState,l),ne=Uo(n,Q.getState,O),oe=Uo(n,Q.getState,A),re=Uo(n,Q.getState,P),ae=Uo(n,Q.getState,T),ie=(e,t)=>{if(0!==e.button)return;const{edges:o,isValidConnection:r}=Q.getState(),a=t?b:v,i=(t?R:M)||null,s=t?"target":"source",l=r||gi,c=t,u=o.find(e=>e.id===n);G(!0),I?.(e,u,s);zr({event:e,handleId:i,nodeId:a,onConnect:e=>$?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{G(!1),z?.(e,u,s)}})},se=()=>q(!0),le=()=>q(!1),ce=!k&&!s;return e.createElement("g",{className:i(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:c,animated:u,inactive:ce,updating:U}]),onClick:e=>{const{edges:t,addSelectedEdges:o,unselectNodesAndEdges:r,multiSelectionActive:a}=Q.getState(),i=t.find(e=>e.id===n);i&&(k&&(Q.setState({nodesSelectionActive:!1}),i.selected&&a?(r({nodes:[],edges:[i]}),K.current?.blur()):o([n])),s&&s(e,i))},onDoubleClick:te,onContextMenu:ne,onMouseEnter:oe,onMouseMove:re,onMouseLeave:ae,onKeyDown:H?e=>{if(!X&&jo.includes(e.key)&&k){const{unselectNodesAndEdges:t,addSelectedEdges:o,edges:r}=Q.getState();"Escape"===e.key?(K.current?.blur(),t({edges:[r.find(e=>e.id===n)]})):o([n])}}:void 0,tabIndex:H?0:void 0,role:H?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===j?void 0:j||`Edge from ${v} to ${b}`,"aria-describedby":H?`${la}-${F}`:void 0,ref:K},!Z&&e.createElement(t,{id:n,source:v,target:b,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,data:a,style:y,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:C,sourceHandleId:M,targetHandleId:R,markerStart:J,markerEnd:ee,pathOptions:V,interactionWidth:Y}),W&&e.createElement(e.Fragment,null,("source"===W||!0===W)&&e.createElement(mi,{position:_,centerX:w,centerY:x,radius:D,onMouseDown:e=>ie(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===W||!0===W)&&e.createElement(mi,{position:C,centerX:E,centerY:S,radius:D,onMouseDown:e=>ie(e,!1),onMouseEnter:se,onMouseOut:le,type:"target"})))};return n.displayName="EdgeWrapper",e.memo(n)};function vi(e){return{...{default:yi(e.default||gr),straight:yi(e.bezier||fr),step:yi(e.step||dr),smoothstep:yi(e.step||ur),simplebezier:yi(e.simplebezier||ar)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=yi(e[n]||gr),t),{})}}function bi(e,t,n=null){const o=(n?.x||0)+t.x,r=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case nr.Top:return{x:o+a/2,y:r};case nr.Right:return{x:o+a,y:r+i/2};case nr.Bottom:return{x:o+a/2,y:r+i};case nr.Left:return{x:o,y:r+i/2}}}function wi(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function xi(e){const t=e?.[Fo]?.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 Ei=[{level:0,isMaxLevel:!0,edges:[]}];function Si(t,n,o){return function(e,t,n=!1){let o=-1;const r=e.reduce((e,r)=>{const a=Bo(r.zIndex);let i=a?r.zIndex:0;if(n){const e=t.get(r.target),n=t.get(r.source),o=r.selected||e?.selected||n?.selected,s=Math.max(n?.[Fo]?.z||0,e?.[Fo]?.z||0,1e3);i=(a?r.zIndex:0)+(o?s:0)}return e[i]?e[i].push(r):e[i]=[r],o=i>o?i:o,e},{}),a=Object.entries(r).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===o}});return 0===a.length?Ei:a}(_o(e.useCallback(e=>t?e.edges.filter(t=>{const o=n.get(t.source),r=n.get(t.target);return o?.width&&o?.height&&r?.width&&r?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:a,width:i,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Io({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:i/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:r.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:r.width,targetHeight:r.height,width:e.width,height:e.height,transform:e.transform})}):e.edges,[t,n])),n,o)}const _i={[tr.Arrow]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[tr.ArrowClosed]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const Ci=({id:t,type:n,color:o,width:r=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(t){const n=Co();return e.useMemo(()=>Object.prototype.hasOwnProperty.call(_i,t)?_i[t]:(n.getState().onError?.("009",vo(t)),null),[t])}(n);return c?e.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},e.createElement(c,{color:o,strokeWidth:s})):null},ki=({defaultColor:t,rfId:n})=>{const o=_o(e.useCallback((({defaultColor:e,rfId:t})=>n=>{const o=[];return n.edges.reduce((n,r)=>([r.markerStart,r.markerEnd].forEach(r=>{if(r&&"object"==typeof r){const a=wr(r,t);o.includes(a)||(n.push({id:a,color:r.color||e,...r}),o.push(a))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:t,rfId:n}),[t,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return e.createElement("defs",null,o.map(t=>e.createElement(Ci,{id:t.id,key:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient})))};ki.displayName="MarkerDefinitions";var Ni=e.memo(ki);const Mi=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}),Ri=({defaultMarkerColor:t,onlyRenderVisibleElements:n,elevateEdgesOnSelect:o,rfId:r,edgeTypes:a,noPanClassName:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,children:v,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:C,nodeInternals:k,onError:M}=_o(Mi,N),R=Si(n,k,o);return S?e.createElement(e.Fragment,null,R.map(({level:n,edges:o,isMaxLevel:v})=>e.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},v&&e.createElement(Ni,{defaultColor:t,rfId:r}),e.createElement("g",null,o.map(t=>{const[n,o,v]=xi(k.get(t.source)),[S,_,N]=xi(k.get(t.target));if(!v||!N)return null;let R=t.type||"default";a[R]||(M?.("011",xo(R)),R="default");const O=a[R]||a.default,A=C===Go.Strict?_.target:(_.target??[]).concat(_.source??[]),P=wi(o.source,t.sourceHandle),T=wi(A,t.targetHandle),D=P?.position||nr.Bottom,$=T?.position||nr.Top,I=!!(t.focusable||w&&void 0===t.focusable),z=t.reconnectable||t.updatable,L=void 0!==h&&(z||x&&void 0===z);if(!P||!T)return M?.("008",bo(P,t)),null;const{sourceX:B,sourceY:F,targetX:j,targetY:H}=((e,t,n,o,r,a)=>{const i=bi(n,e,t),s=bi(a,o,r);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,P,D,S,T,$);return e.createElement(O,{key:t.id,id:t.id,className:i([t.className,s]),type:R,data:t.data,selected:!!t.selected,animated:!!t.animated,hidden:!!t.hidden,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,source:t.source,target:t.target,sourceHandleId:t.sourceHandle,targetHandleId:t.targetHandle,markerEnd:t.markerEnd,markerStart:t.markerStart,sourceX:B,sourceY:F,targetX:j,targetY:H,sourcePosition:D,targetPosition:$,elementsSelectable:E,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,rfId:r,ariaLabel:t.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))),v):null};Ri.displayName="EdgeRenderer";var Oi=e.memo(Ri);const Ai=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Pi({children:t}){const n=_o(Ai);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const Ti={[nr.Left]:nr.Right,[nr.Right]:nr.Left,[nr.Top]:nr.Bottom,[nr.Bottom]:nr.Top},Di=({nodeId:t,handleType:n,style:o,type:r=er.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=_o(e.useCallback(e=>({fromNode:e.nodeInternals.get(t),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode}),[t]),N),f=s?.[Fo]?.handleBounds;let p=f?.[n];if(d===Go.Loose&&(p=p||f?.["source"===n?"target":"source"]),!s||!p)return null;const h=l?p.find(e=>e.id===l):p[0],m=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,y=(s.positionAbsolute?.x??0)+m,v=(s.positionAbsolute?.y??0)+g,b=h?.position,w=b?Ti[b]:null;if(!b||!w)return null;if(a)return e.createElement(a,{connectionLineType:r,connectionLineStyle:o,fromNode:s,fromHandle:h,fromX:y,fromY:v,toX:c,toY:u,fromPosition:b,toPosition:w,connectionStatus:i});let x="";const E={sourceX:y,sourceY:v,sourcePosition:b,targetX:c,targetY:u,targetPosition:w};return r===er.Bezier?[x]=mr(E):r===er.Step?[x]=cr({...E,borderRadius:0}):r===er.SmoothStep?[x]=cr(E):r===er.SimpleBezier?[x]=rr(E):x=`M${y},${v} ${c},${u}`,e.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:o})};Di.displayName="ConnectionLine";const $i=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ii({containerStyle:t,style:n,type:o,component:r}){const{nodeId:a,handleType:s,nodesConnectable:l,width:c,height:u,connectionStatus:d}=_o($i,N);return!!(a&&s&&c&&l)?e.createElement("svg",{style:t,width:c,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},e.createElement("g",{className:i(["react-flow__connection",d])},e.createElement(Di,{nodeId:a,handleType:s,style:n,type:o,CustomComponent:r,connectionStatus:d}))):null}function zi(t,n){const o=e.useRef(null),r=Co();return e.useMemo(()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);N(o.current,e)&&r.getState().onError?.("002",po()),o.current=e}return n(t)},[t])}const Li=({nodeTypes:t,edgeTypes:n,onMove:o,onMoveStart:r,onMoveEnd:a,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:v,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:N,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:O,selectNodesOnDrag:A,defaultViewport:P,translateExtent:T,minZoom:D,maxZoom:$,preventScrolling:I,defaultMarkerColor:z,zoomOnScroll:L,zoomOnPinch:B,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:H,zoomOnDoubleClick:W,panOnDrag:V,onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:U,onPaneScroll:q,onPaneContextMenu:Z,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,reconnectRadius:re,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,elevateEdgesOnSelect:le,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})=>{const pe=zi(t,li),he=zi(n,vi);return function(t){const n=Ca(),o=e.useRef(!1);e.useEffect(()=>{!o.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),o.current=!0)},[t,n.viewportInitialized])}(i),e.createElement(si,{onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:U,onPaneContextMenu:Z,onPaneScroll:q,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:N,elementsSelectable:O,onMove:o,onMoveStart:r,onMoveEnd:a,zoomOnScroll:L,zoomOnPinch:B,zoomOnDoubleClick:W,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:H,panOnDrag:V,defaultViewport:P,translateExtent:T,minZoom:D,maxZoom:$,onSelectionContextMenu:m,preventScrolling:I,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(Pi,null,e.createElement(Oi,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:R,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,reconnectRadius:re,defaultMarkerColor:z,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:fe},e.createElement(Ii,{style:b,type:v,component:w,containerStyle:x})),e.createElement("div",{className:"react-flow__edgelabel-renderer"}),e.createElement(di,{nodeTypes:pe,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:A,onlyRenderVisibleElements:R,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})))};Li.displayName="GraphView";var Bi=e.memo(Li);const Fi=[[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:Fi,nodeExtent:Fi,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Go.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:Ho,isValidConnection:void 0},Hi=()=>{return e=(e,t)=>({...ji,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:a}=t();e({nodeInternals:ya(n,o,r,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=t();e({edges:n.map(e=>({...o,...e}))})},setDefaultNodesAndEdges:(n,o)=>{const r=void 0!==n,a=void 0!==o,i=r?ya(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?o:[],hasDefaultNodes:r,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:a,fitViewOnInitDone:i,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=r.get(t.id);if(n?.hidden)r.set(n.id,{...n,[Fo]:{...n[Fo],handleBounds:void 0}});else if(n){const o=Oo(t.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||t.forceUpdate)&&(r.set(n.id,{...n,[Fo]:{...n[Fo],handleBounds:{source:qa(".source",t.nodeElement,f,c),target:qa(".target",t.nodeElement,f,c)}},...o}),e.push({id:n.id,type:"dimensions",dimensions:o}))}return e},[]);ga(r,c);const h=i||a&&!i&&va(t,{initial:!0,...s});e({nodeInternals:new Map(r),fitViewOnInitDone:h}),p?.length>0&&o?.(p)},updateNodePositions:(e,n=!0,o=!1)=>{const{triggerNodeChanges:r}=t(),a=e.map(e=>{const t={id:e.id,type:"position",dragging:o};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});r(a)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=ya(La(n,s()),r,i,l);e({nodeInternals:t})}o?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ba(e,!0)):(i=Fa(a(),n),s=Fa(r,[])),xa({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ba(e,!0)):(i=Fa(r,n),s=Fa(a(),[])),xa({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:a}=t(),i=o||r;xa({changedNodes:(n||a()).map(e=>(e.selected=!1,Ba(e.id,!1))),changedEdges:i.map(e=>Ba(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=t();o?.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=t();o?.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=t();xa({changedNodes:o().filter(e=>e.selected).map(e=>Ba(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ba(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:o}=t();o.forEach(e=>{e.positionAbsolute=Po(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(o)})},panBy:e=>{const{transform:n,width:o,height:r,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=to.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[o,r]],u=a?.constrain()(l,c,s);return a.transform(i,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:ji.connectionNodeId,connectionHandleId:ji.connectionHandleId,connectionHandleType:ji.connectionHandleType,connectionStatus:ji.connectionStatus,connectionStartHandle:ji.connectionStartHandle,connectionEndHandle:ji.connectionEndHandle}),reset:()=>e({...ji})}),t=Object.is,e?k(e,t):k;var e,t},Wi=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=Hi()),e.createElement(fo,{value:n.current},t)};Wi.displayName="ReactFlowProvider";const Vi=({children:t})=>e.useContext(uo)?e.createElement(e.Fragment,null,t):e.createElement(Wi,null,t);Vi.displayName="ReactFlowWrapper";const Yi={input:Yr,default:Wr,output:Kr,group:Ur},Xi={default:gr,straight:fr,step:dr,smoothstep:ur,simplebezier:ar},Ki=[0,0],Ui=[15,15],qi={x:0,y:0,zoom:1},Zi={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gi=e.forwardRef(({nodes:t,edges:n,defaultNodes:o,defaultEdges:r,className:a,nodeTypes:s=Yi,edgeTypes:l=Xi,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:R,onSelectionChange:O,onSelectionDragStart:A,onSelectionDrag:P,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,connectionMode:z=Go.Strict,connectionLineType:L=er.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:j,deleteKeyCode:H="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:V=!1,selectionMode:Y=Jo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(Xo()?"Meta":"Control"),zoomActivationKeyCode:U=(Xo()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=Ui,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=Ki,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,defaultViewport:ie=qi,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Fi,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=Qo.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:Re,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ae,onEdgeUpdate:Pe,onEdgeUpdateStart:Te,onEdgeUpdateEnd:De,onReconnect:$e,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:je,noDragClassName:He="nodrag",noWheelClassName:We="nowheel",noPanClassName:Ve="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:ot,onError:rt,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return e.createElement("div",{...lt,style:{...at,...Zi},ref:ct,className:i(["react-flow",a]),"data-testid":"rf__wrapper",id:it},e.createElement(Vi,null,e.createElement(Bi,{onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:l,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:j,selectionKeyCode:W,selectionOnDrag:V,selectionMode:Y,deleteKeyCode:H,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Re,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ae,onReconnect:$e??Pe,onReconnectStart:Ie??Te,onReconnectEnd:ze??De,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:He,noWheelClassName:We,noPanClassName:Ve,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),e.createElement(ra,{nodes:t,edges:n,defaultNodes:o,defaultEdges:r,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Fe,onEdgesChange:je,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:R,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:P,onSelectionDragStart:A,onSelectionDragStop:T,noPanClassName:Ve,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:rt,connectionRadius:nt,isValidConnection:ot,nodeDragThreshold:st}),e.createElement(ea,{onSelectionChange:O}),ke,e.createElement(Mo,{proOptions:qe,position:Ue}),e.createElement(da,{rfId:ut,disableKeyboardA11y:Je})))});function Qi(t){return n=>{const[o,r]=e.useState(n),a=e.useCallback(e=>r(n=>t(e,n)),[]);return[o,r,a]}}Gi.displayName="ReactFlow";const Ji=Qi(La),es=Qi(function(e,t){return za(e,t)});var ts;function ns({color:t,dimensions:n,lineWidth:o}){return e.createElement("path",{stroke:t,strokeWidth:o,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function os({color:t,radius:n}){return e.createElement("circle",{cx:n,cy:n,r:n,fill:t})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ts||(ts={}));const rs={[ts.Dots]:"#91919a",[ts.Lines]:"#eee",[ts.Cross]:"#e2e2e2"},as={[ts.Dots]:1,[ts.Lines]:1,[ts.Cross]:6},is=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ss({id:t,variant:n=ts.Dots,gap:o=20,size:r,lineWidth:a=1,offset:s=2,color:l,style:c,className:u}){const d=e.useRef(null),{transform:f,patternId:p}=_o(is,N),h=l||rs[n],m=r||as[n],g=n===ts.Dots,y=n===ts.Cross,v=Array.isArray(o)?o:[o,o],b=[v[0]*f[2]||1,v[1]*f[2]||1],w=m*f[2],x=y?[w,w]:b,E=g?[w/s,w/s]:[x[0]/s,x[1]/s];return e.createElement("svg",{className:i(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},e.createElement("pattern",{id:p+t,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},g?e.createElement(os,{color:h,radius:w/s}):e.createElement(ns,{dimensions:x,color:h,lineWidth:a})),e.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+t})`}))}ss.displayName="Background";var ls=e.memo(ss);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:-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
|
*
|
|
@@ -12,7 +12,42 @@ const cs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperC
|
|
|
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 fs={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 ps=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...fs,width:n,height:n,stroke:t,strokeWidth:o?24*Number(r)/Number(n):r,className:us("lucide",a),...!i&&!ds(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(i)?i:[i]])),hs=(t,n)=>{const r=e.forwardRef(({className:r,...o},a)=>{return e.createElement(ps,{ref:a,iconNode:n,className:us(`lucide-${i=cs(t),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,r),...o});var i});return r.displayName=cs(t),r},ms=hs("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),gs=hs("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ys=hs("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),vs=hs("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),bs=hs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ws=hs("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),xs=hs("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"}]]),Es={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%)",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"}},Ss={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%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:Es.spacing,borderRadius:Es.borderRadius,fontSize:Es.fontSize,fontWeight:Es.fontWeight,shadows:Es.shadows,transitions:Es.transitions},_s=Es,Cs=()=>{const[t,n]=e.useState(()=>{const e=localStorage.getItem("theme");return!!e&&"dark"===e}),[r,o]=e.useState(t?Ss:Es);e.useEffect(()=>{const e=document.documentElement;o(t?Ss:Es),t?(e.classList.add("dark"),localStorage.setItem("theme","dark")):(e.classList.remove("dark"),localStorage.setItem("theme","light"))},[t]);return{isDarkMode:t,theme:r,toggleTheme:()=>{n(!t)},setTheme:e=>{n("dark"===e)}}},ks=({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i,targetPosition:s,style:l={},markerEnd:c,bidirectional:u=!1,data:d,clientToSvgCoords:f,svgRef:p})=>{e.useState(!1);const{theme:h}=Cs(),[m,g,y]=e.useMemo(()=>mo({sourceX:n,sourceY:r,targetX:o,targetY:a}),[n,r,o,a]),v={...l,stroke:(()=>{const e=d?.details?.state;switch(e){case"Open":case"Completed":default:return h.colors.mutedForeground;case"Error":return h.colors.destructive}})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(Xr,{path:m,style:v}))};function Ns(){return Ns=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},Ns.apply(null,arguments)}var Ms=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}(),Rs="-ms-",Os="-moz-",Ps="-webkit-",As="comm",Ts="rule",Ds="decl",$s="@keyframes",Is=Math.abs,zs=String.fromCharCode,Ls=Object.assign;function Bs(e){return e.trim()}function Fs(e,t,n){return e.replace(t,n)}function js(e,t){return e.indexOf(t)}function Hs(e,t){return 0|e.charCodeAt(t)}function Vs(e,t,n){return e.slice(t,n)}function Ws(e){return e.length}function Ys(e){return e.length}function Xs(e,t){return t.push(e),e}var Ks=1,Us=1,qs=0,Zs=0,Gs=0,Qs="";function Js(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:Ks,column:Us,length:i,return:""}}function el(e,t){return Ls(Js("",null,null,"",null,null,0),e,{length:-e.length},t)}function tl(){return Gs=Zs>0?Hs(Qs,--Zs):0,Us--,10===Gs&&(Us=1,Ks--),Gs}function nl(){return Gs=Zs<qs?Hs(Qs,Zs++):0,Us++,10===Gs&&(Us=1,Ks++),Gs}function rl(){return Hs(Qs,Zs)}function ol(){return Zs}function al(e,t){return Vs(Qs,e,t)}function il(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 sl(e){return Ks=Us=1,qs=Ws(Qs=e),Zs=0,[]}function ll(e){return Qs="",e}function cl(e){return Bs(al(Zs-1,fl(91===e?e+2:40===e?e+1:e)))}function ul(e){for(;(Gs=rl())&&Gs<33;)nl();return il(e)>2||il(Gs)>3?"":" "}function dl(e,t){for(;--t&&nl()&&!(Gs<48||Gs>102||Gs>57&&Gs<65||Gs>70&&Gs<97););return al(e,ol()+(t<6&&32==rl()&&32==nl()))}function fl(e){for(;nl();)switch(Gs){case e:return Zs;case 34:case 39:34!==e&&39!==e&&fl(Gs);break;case 40:41===e&&fl(e);break;case 92:nl()}return Zs}function pl(e,t){for(;nl()&&e+Gs!==57&&(e+Gs!==84||47!==rl()););return"/*"+al(t,Zs-1)+"*"+zs(47===e?e:nl())}function hl(e){for(;!il(rl());)nl();return al(e,Zs)}function ml(e){return ll(gl("",null,null,null,[""],e=sl(e),0,[0],e))}function gl(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,E=r,S=b;g;)switch(h=v,v=nl()){case 40:if(108!=h&&58==Hs(S,d-1)){-1!=js(S+=Fs(cl(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=cl(v);break;case 9:case 10:case 13:case 32:S+=ul(h);break;case 92:S+=dl(ol()-1,7);continue;case 47:switch(rl()){case 42:case 47:Xs(vl(pl(nl(),ol()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=Ws(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=Fs(S,/\f/g,"")),p>0&&Ws(S)-d&&Xs(p>32?bl(S+";",r,n,d-1):bl(Fs(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Xs(E=yl(S,t,n,c,u,o,s,b,w=[],x=[],d),a),123===v)if(0===u)gl(S,t,E,E,w,a,d,s,x);else switch(99===f&&110===Hs(S,3)?100:f){case 100:case 108:case 109:case 115:gl(e,E,E,r&&Xs(yl(e,E,E,0,0,o,s,b,o,w=[],d),x),o,x,d,s,r?w:x);break;default:gl(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=i;break;case 58:d=1+Ws(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==tl())continue;switch(S+=zs(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ws(S)-1)*y,y=1;break;case 64:45===rl()&&(S+=cl(nl())),f=rl(),u=d=Ws(b=S+=hl(ol())),v++;break;case 45:45===h&&2==Ws(S)&&(m=0)}}return a}function yl(e,t,n,r,o,a,i,s,l,c,u){for(var d=o-1,f=0===o?a:[""],p=Ys(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=Vs(e,d+1,d=Is(m=i[h])),b=e;y<p;++y)(b=Bs(m>0?f[y]+" "+v:Fs(v,/&\f/g,f[y])))&&(l[g++]=b);return Js(e,t,n,0===o?Ts:s,l,c,u)}function vl(e,t,n){return Js(e,t,n,As,zs(Gs),Vs(e,2,-2),0)}function bl(e,t,n,r){return Js(e,t,n,Ds,Vs(e,0,r),Vs(e,r+1,-1),r)}function wl(e,t){for(var n="",r=Ys(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function xl(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ds:return e.return=e.return||e.value;case As:return"";case $s:return e.return=e.value+"{"+wl(e.children,r)+"}";case Ts:e.value=e.props.join(",")}return Ws(n=wl(e.children,r))?e.return=e.value+"{"+n+"}":""}var El=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 Sl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var _l=function(e,t,n){for(var r=0,o=0;r=o,o=rl(),38===r&&12===o&&(t[n]=1),!il(o);)nl();return al(e,Zs)},Cl=function(e,t){return ll(function(e,t){var n=-1,r=44;do{switch(il(r)){case 0:38===r&&12===rl()&&(t[n]=1),e[n]+=_l(Zs-1,t,n);break;case 2:e[n]+=cl(r);break;case 4:if(44===r){e[++n]=58===rl()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=zs(r)}}while(r=nl());return e}(sl(e),t))},kl=new WeakMap,Nl=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)||kl.get(n))&&!r){kl.set(e,!0);for(var o=[],a=Cl(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]}}},Ml=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Rl(e,t){switch(function(e,t){return 45^Hs(e,0)?(((t<<2^Hs(e,0))<<2^Hs(e,1))<<2^Hs(e,2))<<2^Hs(e,3):0}(e,t)){case 5103:return Ps+"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 Ps+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ps+e+Os+e+Rs+e+e;case 6828:case 4268:return Ps+e+Rs+e+e;case 6165:return Ps+e+Rs+"flex-"+e+e;case 5187:return Ps+e+Fs(e,/(\w+).+(:[^]+)/,Ps+"box-$1$2"+Rs+"flex-$1$2")+e;case 5443:return Ps+e+Rs+"flex-item-"+Fs(e,/flex-|-self/,"")+e;case 4675:return Ps+e+Rs+"flex-line-pack"+Fs(e,/align-content|flex-|-self/,"")+e;case 5548:return Ps+e+Rs+Fs(e,"shrink","negative")+e;case 5292:return Ps+e+Rs+Fs(e,"basis","preferred-size")+e;case 6060:return Ps+"box-"+Fs(e,"-grow","")+Ps+e+Rs+Fs(e,"grow","positive")+e;case 4554:return Ps+Fs(e,/([^-])(transform)/g,"$1"+Ps+"$2")+e;case 6187:return Fs(Fs(Fs(e,/(zoom-|grab)/,Ps+"$1"),/(image-set)/,Ps+"$1"),e,"")+e;case 5495:case 3959:return Fs(e,/(image-set\([^]*)/,Ps+"$1$`$1");case 4968:return Fs(Fs(e,/(.+:)(flex-)?(.*)/,Ps+"box-pack:$3"+Rs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ps+e+e;case 4095:case 3583:case 4068:case 2532:return Fs(e,/(.+)-inline(.+)/,Ps+"$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(Ws(e)-1-t>6)switch(Hs(e,t+1)){case 109:if(45!==Hs(e,t+4))break;case 102:return Fs(e,/(.+:)(.+)-([^]+)/,"$1"+Ps+"$2-$3$1"+Os+(108==Hs(e,t+3)?"$3":"$2-$3"))+e;case 115:return~js(e,"stretch")?Rl(Fs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Hs(e,t+1))break;case 6444:switch(Hs(e,Ws(e)-3-(~js(e,"!important")&&10))){case 107:return Fs(e,":",":"+Ps)+e;case 101:return Fs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ps+(45===Hs(e,14)?"inline-":"")+"box$3$1"+Ps+"$2$3$1"+Rs+"$2box$3")+e}break;case 5936:switch(Hs(e,t+11)){case 114:return Ps+e+Rs+Fs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ps+e+Rs+Fs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ps+e+Rs+Fs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ps+e+Rs+e+e}return e}var Ol,Pl=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ds:e.return=Rl(e.value,e.length);break;case $s:return wl([el(e,{value:Fs(e.value,"@","@"+Ps)})],r);case Ts: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 wl([el(e,{props:[Fs(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return wl([el(e,{props:[Fs(t,/:(plac\w+)/,":"+Ps+"input-$1")]}),el(e,{props:[Fs(t,/:(plac\w+)/,":-moz-$1")]}),el(e,{props:[Fs(t,/:(plac\w+)/,Rs+"input-$1")]})],r)}return""})}}],Al=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||Pl,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=[xl,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Ys(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}([Nl,Ml].concat(a,u));o=function(e,t,n,r){l=n,wl(ml(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Ms({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},Tl={exports:{}},Dl={};var $l,Il={};"production"===process.env.NODE_ENV?Tl.exports=function(){if(Ol)return Dl;Ol=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 Dl.AsyncMode=l,Dl.ConcurrentMode=c,Dl.ContextConsumer=s,Dl.ContextProvider=i,Dl.Element=t,Dl.ForwardRef=u,Dl.Fragment=r,Dl.Lazy=h,Dl.Memo=p,Dl.Portal=n,Dl.Profiler=a,Dl.StrictMode=o,Dl.Suspense=d,Dl.isAsyncMode=function(e){return w(e)||b(e)===l},Dl.isConcurrentMode=w,Dl.isContextConsumer=function(e){return b(e)===s},Dl.isContextProvider=function(e){return b(e)===i},Dl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Dl.isForwardRef=function(e){return b(e)===u},Dl.isFragment=function(e){return b(e)===r},Dl.isLazy=function(e){return b(e)===h},Dl.isMemo=function(e){return b(e)===p},Dl.isPortal=function(e){return b(e)===n},Dl.isProfiler=function(e){return b(e)===a},Dl.isStrictMode=function(e){return b(e)===o},Dl.isSuspense=function(e){return b(e)===d},Dl.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)},Dl.typeOf=b,Dl}():Tl.exports=($l||($l=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,E=s,S=i,_=t,C=u,k=r,N=h,M=p,R=n,O=a,P=o,A=d,T=!1;function D(e){return b(e)===c}Il.AsyncMode=w,Il.ConcurrentMode=x,Il.ContextConsumer=E,Il.ContextProvider=S,Il.Element=_,Il.ForwardRef=C,Il.Fragment=k,Il.Lazy=N,Il.Memo=M,Il.Portal=R,Il.Profiler=O,Il.StrictMode=P,Il.Suspense=A,Il.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},Il.isConcurrentMode=D,Il.isContextConsumer=function(e){return b(e)===s},Il.isContextProvider=function(e){return b(e)===i},Il.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Il.isForwardRef=function(e){return b(e)===u},Il.isFragment=function(e){return b(e)===r},Il.isLazy=function(e){return b(e)===h},Il.isMemo=function(e){return b(e)===p},Il.isPortal=function(e){return b(e)===n},Il.isProfiler=function(e){return b(e)===a},Il.isStrictMode=function(e){return b(e)===o},Il.isSuspense=function(e){return b(e)===d},Il.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)},Il.typeOf=b}()),Il);var zl=Tl.exports,Ll={};Ll[zl.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ll[zl.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function Bl(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var Fl=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},jl=function(e,t,n){Fl(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 Hl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Vl=/[A-Z]|^ms/g,Wl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Yl=function(e){return 45===e.charCodeAt(1)},Xl=function(e){return null!=e&&"boolean"!=typeof e},Kl=Sl(function(e){return Yl(e)?e:e.replace(Vl,"-$&").toLowerCase()}),Ul=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Wl,function(e,t,n){return Zl={name:t,styles:n,next:Zl},t})}return 1===Hl[e]||Yl(e)||"number"!=typeof t||0===t?t:t+"px"};function ql(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 Zl={name:o.name,styles:o.styles,next:Zl},o.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)Zl={name:i.name,styles:i.styles,next:Zl},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+=ql(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]+"}":Xl(s)&&(r+=Kl(a)+":"+Ul(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=ql(e,t,i);switch(a){case"animation":case"animationName":r+=Kl(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Xl(i[c])&&(r+=Kl(a)+":"+Ul(a,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Zl,l=n(e);return Zl=s,ql(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Zl,Gl=/label:\s*([^\s;{]+)\s*(;|$)/g;function Ql(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="";Zl=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=ql(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++){if(o+=ql(n,t,e[i]),r)o+=a[i]}Gl.lastIndex=0;for(var s,l="";null!==(s=Gl.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:Zl}}var Jl=!!o.useInsertionEffect&&o.useInsertionEffect,ec=Jl||function(e){return e()},tc=Jl||o.useLayoutEffect,nc=o.createContext("undefined"!=typeof HTMLElement?Al({key:"css"}):null);nc.Provider;var rc,oc,ac=function(t){return e.forwardRef(function(n,r){var o=e.useContext(nc);return t(n,o,r)})},ic=o.createContext({}),sc=El(function(e){return El(function(t){return function(e,t){return"function"==typeof t?t(e):Ns({},e,t)}(e,t)})}),lc=function(e){var t=o.useContext(ic);return e.theme!==t&&(t=sc(t)(e.theme)),o.createElement(ic.Provider,{value:t},e.children)},cc={}.hasOwnProperty,uc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",dc=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Fl(t,n,r),ec(function(){return jl(t,n,r)}),null},fc=ac(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var a=e[uc],i=[r],s="";"string"==typeof e.className?s=Bl(t.registered,i,e.className):null!=e.className&&(s=e.className+" ");var l=Ql(i,void 0,o.useContext(ic));s+=t.key+"-"+l.name;var c={};for(var u in e)cc.call(e,u)&&"css"!==u&&u!==uc&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),o.createElement(o.Fragment,null,o.createElement(dc,{cache:t,serialized:l,isStringTag:"string"==typeof a}),o.createElement(a,c))}),pc=fc,hc=function(e,t){var n=arguments;if(null==t||!cc.call(t,"css"))return o.createElement.apply(void 0,n);var r=n.length,a=new Array(r);a[0]=pc,a[1]=function(e,t){var n={};for(var r in t)cc.call(t,r)&&(n[r]=t[r]);return n[uc]=e,n}(e,t);for(var i=2;i<r;i++)a[i]=n[i];return o.createElement.apply(null,a)};rc=hc||(hc={}),oc||(oc=rc.JSX||(rc.JSX={}));var mc=ac(function(e,t){var n=Ql([e.styles],void 0,o.useContext(ic)),r=o.useRef();return tc(function(){var e=t.key+"-global",o=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,i=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return t.sheet.tags.length&&(o.before=t.sheet.tags[0]),null!==i&&(a=!0,i.setAttribute("data-emotion",e),o.hydrate([i])),r.current=[o,a],function(){o.flush()}},[t]),tc(function(){var e=r.current,o=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&jl(t,n.next,!0),o.tags.length){var a=o.tags[o.tags.length-1].nextElementSibling;o.before=a,o.flush()}t.insert("",n,o,!1)}},[t,n.name]),null});function gc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ql(t)}var yc=/^((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)-.*))$/,vc=Sl(function(e){return yc.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),bc=function(e){return"theme"!==e},wc=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?vc:bc},xc=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},Ec=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Fl(t,n,r),ec(function(){return jl(t,n,r)}),null},Sc=function e(t,n){var r,a,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var l=xc(t,n,i),c=l||wc(s),u=!c("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),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=ac(function(e,t,n){var r=u&&e.as||s,i="",d=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=o.useContext(ic)}"string"==typeof e.className?i=Bl(t.registered,d,e.className):null!=e.className&&(i=e.className+" ");var m=Ql(f.concat(d),t.registered,p);i+=t.key+"-"+m.name,void 0!==a&&(i+=" "+a);var g=u&&void 0===l?wc(r):c,y={};for(var v in e)u&&"as"===v||g(v)&&(y[v]=e[v]);return y.className=i,n&&(y.ref=n),o.createElement(o.Fragment,null,o.createElement(Ec,{cache:t,serialized:m,isStringTag:"string"==typeof r}),o.createElement(r,y))});return g.displayName=void 0!==r?r:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=t.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(t,r){return e(t,Ns({},n,r,{shouldForwardProp:xc(g,r,!0)})).apply(void 0,f)},g}}.bind(null);function _c(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=_c(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Cc(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function kc(e){return null==e?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)}function Nc(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 Mc(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}["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){Sc[e]=Sc(e)});const Rc=Sc.div`
|
|
15
|
+
var fs={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 ps=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...fs,width:n,height:n,stroke:t,strokeWidth:r?24*Number(o)/Number(n):o,className:us("lucide",a),...!i&&!ds(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(i)?i:[i]])),hs=(t,n)=>{const o=e.forwardRef(({className:o,...r},a)=>{return e.createElement(ps,{ref:a,iconNode:n,className:us(`lucide-${i=cs(t),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,o),...r});var i});return o.displayName=cs(t),o},ms=hs("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),gs=hs("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ys=hs("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),vs=hs("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),bs=hs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ws=hs("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),xs=hs("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 Es=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}(),Ss="-ms-",_s="-moz-",Cs="-webkit-",ks="comm",Ns="rule",Ms="decl",Rs="@keyframes",Os=Math.abs,As=String.fromCharCode,Ps=Object.assign;function Ts(e){return e.trim()}function Ds(e,t,n){return e.replace(t,n)}function $s(e,t){return e.indexOf(t)}function Is(e,t){return 0|e.charCodeAt(t)}function zs(e,t,n){return e.slice(t,n)}function Ls(e){return e.length}function Bs(e){return e.length}function Fs(e,t){return t.push(e),e}var js=1,Hs=1,Ws=0,Vs=0,Ys=0,Xs="";function Ks(e,t,n,o,r,a,i){return{value:e,root:t,parent:n,type:o,props:r,children:a,line:js,column:Hs,length:i,return:""}}function Us(e,t){return Ps(Ks("",null,null,"",null,null,0),e,{length:-e.length},t)}function qs(){return Ys=Vs>0?Is(Xs,--Vs):0,Hs--,10===Ys&&(Hs=1,js--),Ys}function Zs(){return Ys=Vs<Ws?Is(Xs,Vs++):0,Hs++,10===Ys&&(Hs=1,js++),Ys}function Gs(){return Is(Xs,Vs)}function Qs(){return Vs}function Js(e,t){return zs(Xs,e,t)}function el(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 tl(e){return js=Hs=1,Ws=Ls(Xs=e),Vs=0,[]}function nl(e){return Xs="",e}function ol(e){return Ts(Js(Vs-1,il(91===e?e+2:40===e?e+1:e)))}function rl(e){for(;(Ys=Gs())&&Ys<33;)Zs();return el(e)>2||el(Ys)>3?"":" "}function al(e,t){for(;--t&&Zs()&&!(Ys<48||Ys>102||Ys>57&&Ys<65||Ys>70&&Ys<97););return Js(e,Qs()+(t<6&&32==Gs()&&32==Zs()))}function il(e){for(;Zs();)switch(Ys){case e:return Vs;case 34:case 39:34!==e&&39!==e&&il(Ys);break;case 40:41===e&&il(e);break;case 92:Zs()}return Vs}function sl(e,t){for(;Zs()&&e+Ys!==57&&(e+Ys!==84||47!==Gs()););return"/*"+Js(t,Vs-1)+"*"+As(47===e?e:Zs())}function ll(e){for(;!el(Gs());)Zs();return Js(e,Vs)}function cl(e){return nl(ul("",null,null,null,[""],e=tl(e),0,[0],e))}function ul(e,t,n,o,r,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=r,x=a,E=o,S=b;g;)switch(h=v,v=Zs()){case 40:if(108!=h&&58==Is(S,d-1)){-1!=$s(S+=Ds(ol(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=ol(v);break;case 9:case 10:case 13:case 32:S+=rl(h);break;case 92:S+=al(Qs()-1,7);continue;case 47:switch(Gs()){case 42:case 47:Fs(fl(sl(Zs(),Qs()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=Ls(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=Ds(S,/\f/g,"")),p>0&&Ls(S)-d&&Fs(p>32?pl(S+";",o,n,d-1):pl(Ds(S," ","")+";",o,n,d-2),l);break;case 59:S+=";";default:if(Fs(E=dl(S,t,n,c,u,r,s,b,w=[],x=[],d),a),123===v)if(0===u)ul(S,t,E,E,w,a,d,s,x);else switch(99===f&&110===Is(S,3)?100:f){case 100:case 108:case 109:case 115:ul(e,E,E,o&&Fs(dl(e,E,E,0,0,r,s,b,r,w=[],d),x),r,x,d,s,o?w:x);break;default:ul(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=i;break;case 58:d=1+Ls(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==qs())continue;switch(S+=As(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ls(S)-1)*y,y=1;break;case 64:45===Gs()&&(S+=ol(Zs())),f=Gs(),u=d=Ls(b=S+=ll(Qs())),v++;break;case 45:45===h&&2==Ls(S)&&(m=0)}}return a}function dl(e,t,n,o,r,a,i,s,l,c,u){for(var d=r-1,f=0===r?a:[""],p=Bs(f),h=0,m=0,g=0;h<o;++h)for(var y=0,v=zs(e,d+1,d=Os(m=i[h])),b=e;y<p;++y)(b=Ts(m>0?f[y]+" "+v:Ds(v,/&\f/g,f[y])))&&(l[g++]=b);return Ks(e,t,n,0===r?Ns:s,l,c,u)}function fl(e,t,n){return Ks(e,t,n,ks,As(Ys),zs(e,2,-2),0)}function pl(e,t,n,o){return Ks(e,t,n,Ms,zs(e,0,o),zs(e,o+1,-1),o)}function hl(e,t){for(var n="",o=Bs(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function ml(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ms:return e.return=e.return||e.value;case ks:return"";case Rs:return e.return=e.value+"{"+hl(e.children,o)+"}";case Ns:e.value=e.props.join(",")}return Ls(n=hl(e.children,o))?e.return=e.value+"{"+n+"}":""}var gl=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var o=e(n);return t.set(n,o),o}};function yl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var vl=function(e,t,n){for(var o=0,r=0;o=r,r=Gs(),38===o&&12===r&&(t[n]=1),!el(r);)Zs();return Js(e,Vs)},bl=function(e,t){return nl(function(e,t){var n=-1,o=44;do{switch(el(o)){case 0:38===o&&12===Gs()&&(t[n]=1),e[n]+=vl(Vs-1,t,n);break;case 2:e[n]+=ol(o);break;case 4:if(44===o){e[++n]=58===Gs()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=As(o)}}while(o=Zs());return e}(tl(e),t))},wl=new WeakMap,xl=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||wl.get(n))&&!o){wl.set(e,!0);for(var r=[],a=bl(t,r),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},El=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Sl(e,t){switch(function(e,t){return 45^Is(e,0)?(((t<<2^Is(e,0))<<2^Is(e,1))<<2^Is(e,2))<<2^Is(e,3):0}(e,t)){case 5103:return Cs+"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 Cs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Cs+e+_s+e+Ss+e+e;case 6828:case 4268:return Cs+e+Ss+e+e;case 6165:return Cs+e+Ss+"flex-"+e+e;case 5187:return Cs+e+Ds(e,/(\w+).+(:[^]+)/,Cs+"box-$1$2"+Ss+"flex-$1$2")+e;case 5443:return Cs+e+Ss+"flex-item-"+Ds(e,/flex-|-self/,"")+e;case 4675:return Cs+e+Ss+"flex-line-pack"+Ds(e,/align-content|flex-|-self/,"")+e;case 5548:return Cs+e+Ss+Ds(e,"shrink","negative")+e;case 5292:return Cs+e+Ss+Ds(e,"basis","preferred-size")+e;case 6060:return Cs+"box-"+Ds(e,"-grow","")+Cs+e+Ss+Ds(e,"grow","positive")+e;case 4554:return Cs+Ds(e,/([^-])(transform)/g,"$1"+Cs+"$2")+e;case 6187:return Ds(Ds(Ds(e,/(zoom-|grab)/,Cs+"$1"),/(image-set)/,Cs+"$1"),e,"")+e;case 5495:case 3959:return Ds(e,/(image-set\([^]*)/,Cs+"$1$`$1");case 4968:return Ds(Ds(e,/(.+:)(flex-)?(.*)/,Cs+"box-pack:$3"+Ss+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Cs+e+e;case 4095:case 3583:case 4068:case 2532:return Ds(e,/(.+)-inline(.+)/,Cs+"$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(Ls(e)-1-t>6)switch(Is(e,t+1)){case 109:if(45!==Is(e,t+4))break;case 102:return Ds(e,/(.+:)(.+)-([^]+)/,"$1"+Cs+"$2-$3$1"+_s+(108==Is(e,t+3)?"$3":"$2-$3"))+e;case 115:return~$s(e,"stretch")?Sl(Ds(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Is(e,t+1))break;case 6444:switch(Is(e,Ls(e)-3-(~$s(e,"!important")&&10))){case 107:return Ds(e,":",":"+Cs)+e;case 101:return Ds(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Cs+(45===Is(e,14)?"inline-":"")+"box$3$1"+Cs+"$2$3$1"+Ss+"$2box$3")+e}break;case 5936:switch(Is(e,t+11)){case 114:return Cs+e+Ss+Ds(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Cs+e+Ss+Ds(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Cs+e+Ss+Ds(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Cs+e+Ss+e+e}return e}var _l=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Ms:e.return=Sl(e.value,e.length);break;case Rs:return hl([Us(e,{value:Ds(e.value,"@","@"+Cs)})],o);case Ns: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 hl([Us(e,{props:[Ds(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return hl([Us(e,{props:[Ds(t,/:(plac\w+)/,":"+Cs+"input-$1")]}),Us(e,{props:[Ds(t,/:(plac\w+)/,":-moz-$1")]}),Us(e,{props:[Ds(t,/:(plac\w+)/,Ss+"input-$1")]})],o)}return""})}}],Cl=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var o,r,a=e.stylisPlugins||_l,i={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u=[ml,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Bs(e);return function(n,o,r,a){for(var i="",s=0;s<t;s++)i+=e[s](n,o,r,a)||"";return i}}([xl,El].concat(a,u));r=function(e,t,n,o){l=n,hl(cl(e?e+"{"+t.styles+"}":t.styles),d),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Es({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return f.sheet.hydrate(s),f};function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},kl.apply(null,arguments)}var Nl=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)};var Ml={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},Rl=/[A-Z]|^ms/g,Ol=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Al=function(e){return 45===e.charCodeAt(1)},Pl=function(e){return null!=e&&"boolean"!=typeof e},Tl=yl(function(e){return Al(e)?e:e.replace(Rl,"-$&").toLowerCase()}),Dl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ol,function(e,t,n){return Il={name:t,styles:n,next:Il},t})}return 1===Ml[e]||Al(e)||"number"!=typeof t||0===t?t:t+"px"};function $l(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return Il={name:r.name,styles:r.styles,next:Il},r.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)Il={name:i.name,styles:i.styles,next:Il},i=i.next;return a.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=$l(e,t,n[r])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?o+=a+"{"+t[s]+"}":Pl(s)&&(o+=Tl(a)+":"+Dl(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=$l(e,t,i);switch(a){case"animation":case"animationName":o+=Tl(a)+":"+l+";";break;default:o+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Pl(i[c])&&(o+=Tl(a)+":"+Dl(a,i[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=Il,l=n(e);return Il=s,$l(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Il,zl=/label:\s*([^\s;{]+)\s*(;|$)/g;var Ll=!!r.useInsertionEffect&&r.useInsertionEffect||function(e){return e()},Bl=r.createContext("undefined"!=typeof HTMLElement?Cl({key:"css"}):null);Bl.Provider;var Fl=r.createContext({}),jl=gl(function(e){return gl(function(t){return function(e,t){return"function"==typeof t?t(e):kl({},e,t)}(e,t)})}),Hl=function(e){var t=r.useContext(Fl);return e.theme!==t&&(t=jl(t)(e.theme)),r.createElement(Fl.Provider,{value:t},e.children)};const Wl={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"}},Vl={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:Wl.spacing,borderRadius:Wl.borderRadius,fontSize:Wl.fontSize,fontWeight:Wl.fontWeight,shadows:Wl.shadows,transitions:Wl.transitions},Yl=Wl,Xl=e.createContext(void 0),Kl=()=>{const t=e.useContext(Xl);return void 0===t?{theme:Wl,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")}}:t},Ul=({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,sourcePosition:i,targetPosition:s,style:l={},markerEnd:c,bidirectional:u=!1,data:d,clientToSvgCoords:f,svgRef:p})=>{e.useState(!1);const{theme:h}=Kl(),m=h.colors,[g,y,v]=e.useMemo(()=>mr({sourceX:n,sourceY:o,targetX:r,targetY:a}),[n,o,r,a]),b={...l,stroke:(()=>{const e=d?.details?.state;switch(e){case"Open":case"Completed":default:return m.mutedForeground;case"Error":return m.destructive}})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(Ko,{path:g,style:b}))};var ql=/^((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)-.*))$/,Zl=yl(function(e){return ql.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Gl=function(e){return"theme"!==e},Ql=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Zl:Gl},Jl=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},ec=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Nl(t,n,o),Ll(function(){return function(e,t,n){Nl(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}),null},tc=function t(n,o){var a,i,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==o&&(a=o.label,i=o.target);var c=Jl(n,o,s),u=c||Ql(l),d=!u("as");return function(){var f=arguments,p=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==a&&p.push("label:"+a+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{var h=f[0];p.push(h[0]);for(var m=f.length,g=1;g<m;g++)p.push(f[g],h[g])}var y,v=(y=function(e,t,n){var o,a,s,f,h=d&&e.as||l,m="",g=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=r.useContext(Fl)}"string"==typeof e.className?(o=t.registered,a=g,s=e.className,f="",s.split(" ").forEach(function(e){void 0!==o[e]?a.push(o[e]+";"):e&&(f+=e+" ")}),m=f):null!=e.className&&(m=e.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";Il=void 0;var a=e[0];null==a||void 0===a.raw?(o=!1,r+=$l(n,t,a)):r+=a[0];for(var i=1;i<e.length;i++)r+=$l(n,t,e[i]),o&&(r+=a[i]);zl.lastIndex=0;for(var s,l="";null!==(s=zl.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Il}}(p.concat(g),t.registered,y);m+=t.key+"-"+b.name,void 0!==i&&(m+=" "+i);var w=d&&void 0===c?Ql(h):u,x={};for(var E in e)d&&"as"===E||w(E)&&(x[E]=e[E]);return x.className=m,n&&(x.ref=n),r.createElement(r.Fragment,null,r.createElement(ec,{cache:t,serialized:b,isStringTag:"string"==typeof h}),r.createElement(h,x))},e.forwardRef(function(t,n){var o=e.useContext(Bl);return y(t,o,n)}));return v.displayName=void 0!==a?a:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",v.defaultProps=n.defaultProps,v.__emotion_real=v,v.__emotion_base=l,v.__emotion_styles=p,v.__emotion_forwardProp=c,Object.defineProperty(v,"toString",{value:function(){return"."+i}}),v.withComponent=function(e,n){return t(e,kl({},o,n,{shouldForwardProp:Jl(v,n,!0)})).apply(void 0,p)},v}}.bind(null);function nc(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=nc(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function oc(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function rc(e){if(null==e)return"$0.00";if(Math.abs(e)<.01&&0!==e)return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:3,maximumFractionDigits:6}).format(e);const t=e.toString().split(".")[1]?.length||0,n=Math.max(2,Math.min(t,6));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:n}).format(e)}function ac(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 ic(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}["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){tc[e]=tc(e)});const sc=tc.div`
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
`,lc=tc.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
|
+
`,cc=({children:e,content:t,placement:n="top",delay:o=300})=>{const{theme:a}=Kl(),[i,s]=r.useState(!1),l=r.useRef(),c=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(!0)},o)},u=()=>{l.current&&clearTimeout(l.current),s(!1)};return r.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),r.createElement(sc,{onMouseEnter:c,onMouseLeave:u,onFocus:c,onBlur:u},e,r.createElement(lc,{isVisible:i,placement:n,themeColors:a.colors,role:"tooltip"},t))},uc=tc.div`
|
|
16
51
|
display: inline-flex;
|
|
17
52
|
align-items: center;
|
|
18
53
|
border-radius: 9999px;
|
|
@@ -28,10 +63,10 @@ var fs={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
|
+
`,dc=({variant:e="default",children:t,title:n,placement:o="top"})=>{const{theme:a}=Kl(),i=a.colors,s=r.createElement(uc,{variant:e,themeColors:i},t);return n?r.createElement(cc,{content:n,placement:o},s):s},fc=tc.div`
|
|
33
68
|
user-select: none;
|
|
34
|
-
`,
|
|
69
|
+
`,pc=tc.div`
|
|
35
70
|
display: flex;
|
|
36
71
|
align-items: center;
|
|
37
72
|
gap: 0.25rem;
|
|
@@ -41,79 +76,91 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
41
76
|
transition: background-color 0.15s ease-in-out;
|
|
42
77
|
|
|
43
78
|
&:hover {
|
|
44
|
-
background-color: ${e=>e.isExpandable?e.
|
|
79
|
+
background-color: ${e=>e.isExpandable?e.themeColors.muted:"transparent"};
|
|
45
80
|
}
|
|
46
|
-
`,
|
|
81
|
+
`,hc=tc.div`
|
|
47
82
|
width: 0.5rem;
|
|
48
83
|
height: 0.5rem;
|
|
49
84
|
flex-shrink: 0;
|
|
50
85
|
display: flex;
|
|
51
86
|
align-items: center;
|
|
52
87
|
justify-content: center;
|
|
53
|
-
color: ${e=>e.
|
|
54
|
-
`,
|
|
88
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
89
|
+
`,mc=tc.span`
|
|
55
90
|
font-weight: 500;
|
|
56
|
-
color: ${e=>e.
|
|
91
|
+
color: ${e=>e.themeColors.foreground};
|
|
57
92
|
font-size: 0.75rem;
|
|
58
|
-
|
|
93
|
+
`,gc=tc.span`
|
|
59
94
|
font-size: 0.75rem;
|
|
60
|
-
color: ${e=>
|
|
61
|
-
`,
|
|
95
|
+
color: ${e=>e.themeColors.primary};
|
|
96
|
+
`,yc=tc.span`
|
|
62
97
|
font-size: 0.75rem;
|
|
63
|
-
color: ${e=>e.
|
|
64
|
-
`,
|
|
65
|
-
border-left: 1px solid ${e=>e.
|
|
98
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
99
|
+
`,vc=tc.div`
|
|
100
|
+
border-left: 1px solid ${e=>e.themeColors.border};
|
|
66
101
|
margin-left: 0.5rem;
|
|
67
|
-
`,
|
|
102
|
+
`,bc=tc.div`
|
|
68
103
|
width: 100%;
|
|
69
|
-
background-color: ${e=>e.
|
|
104
|
+
background-color: ${e=>e.themeColors.muted};
|
|
70
105
|
border-radius: 0.5rem;
|
|
71
|
-
border: 1px solid ${e=>e.
|
|
106
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
72
107
|
overflow: hidden;
|
|
73
|
-
`,
|
|
108
|
+
`,wc=tc.div`
|
|
74
109
|
width: 100%;
|
|
75
110
|
max-height: 16rem;
|
|
76
111
|
overflow-y: auto;
|
|
77
112
|
padding: 0.5rem;
|
|
78
|
-
`,
|
|
113
|
+
`,xc=tc.div`
|
|
79
114
|
width: 100%;
|
|
80
115
|
padding: 1rem;
|
|
81
116
|
text-align: center;
|
|
82
|
-
color: ${e=>e.
|
|
117
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
83
118
|
font-size: 0.875rem;
|
|
84
|
-
background-color: ${e=>e.
|
|
119
|
+
background-color: ${e=>e.themeColors.muted};
|
|
85
120
|
border-radius: 0.5rem;
|
|
86
|
-
border: 1px solid ${e=>e.
|
|
87
|
-
`,
|
|
121
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
122
|
+
`,Ec=tc.div`
|
|
88
123
|
width: 100%;
|
|
89
124
|
padding: 0.5rem;
|
|
90
|
-
background-color: ${e=>e.
|
|
125
|
+
background-color: ${e=>e.themeColors.muted};
|
|
91
126
|
border-radius: 0.5rem;
|
|
92
|
-
border: 1px solid ${e=>e.
|
|
93
|
-
|
|
127
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
128
|
+
font-size: 0.75rem;
|
|
129
|
+
color: ${e=>e.themeColors.foreground};
|
|
130
|
+
word-break: break-all;
|
|
131
|
+
`;tc.div`
|
|
132
|
+
width: 100%;
|
|
133
|
+
padding: 1rem;
|
|
134
|
+
text-align: center;
|
|
135
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
136
|
+
font-size: 0.875rem;
|
|
137
|
+
background-color: ${e=>e.themeColors.muted};
|
|
138
|
+
border-radius: 0.5rem;
|
|
139
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
140
|
+
margin-bottom: 0.5rem;
|
|
141
|
+
`;const Sc=tc.span`
|
|
94
142
|
font-weight: 500;
|
|
95
|
-
color: ${e=>e.
|
|
143
|
+
color: ${e=>e.themeColors.cardForeground};
|
|
96
144
|
font-size: 0.875rem;
|
|
97
|
-
`,
|
|
98
|
-
color: ${e=>e.
|
|
145
|
+
`,_c=tc.span`
|
|
146
|
+
color: ${e=>e.themeColors.foreground};
|
|
99
147
|
font-size: 0.875rem;
|
|
100
|
-
`,
|
|
148
|
+
`,Cc=tc.div`
|
|
101
149
|
width: 100%;
|
|
102
150
|
padding: 1rem;
|
|
103
151
|
text-align: center;
|
|
104
|
-
color: ${e=>e.
|
|
152
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
105
153
|
font-size: 0.875rem;
|
|
106
|
-
background-color: ${e=>e.
|
|
154
|
+
background-color: ${e=>e.themeColors.muted};
|
|
107
155
|
border-radius: 0.5rem;
|
|
108
|
-
border: 1px solid ${e=>e.
|
|
109
|
-
`,
|
|
110
|
-
color: ${e=>e.
|
|
111
|
-
`,
|
|
112
|
-
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
156
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
157
|
+
`,kc=tc.span`
|
|
158
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
159
|
+
`,Nc=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const o=t.indexOf(e),r=t.indexOf(n);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:e.localeCompare(n)}),Mc=({data:t,label:n,depth:o,maxDepth:r,path:a,priorityKeys:i})=>{const[s,l]=e.useState(!1),{theme:c}=Kl(),u=c.colors,d=null!==t&&"object"==typeof t&&!Array.isArray(t),f=Array.isArray(t),p=(d||f)&&o<r,h=p&&Object.keys(t).length>0;return e.createElement(fc,null,e.createElement(pc,{isExpandable:p,themeColors:u,onClick:()=>{p&&l(!s)},style:{paddingLeft:12*o+8+"px"}},e.createElement(hc,{themeColors:u},p&&h?s?e.createElement(gs,{size:12}):e.createElement(ys,{size:12}):e.createElement("div",{style:{width:"12px",height:"12px"}})),e.createElement(mc,{themeColors:u},n,":"),!p&&e.createElement(gc,{valueType:(m=t,null===m?"null":void 0===m?"undefined":typeof m),themeColors:u},(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))(t)),p&&!h&&e.createElement(yc,{themeColors:u},f?"[]":"{}"),p&&h&&!s&&e.createElement(yc,{themeColors:u},f?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),s&&h&&e.createElement(vc,{themeColors:u},Nc(t,i).map(([t,n])=>e.createElement(Mc,{key:`${a}.${t}`,data:n,label:t,depth:o+1,maxDepth:r,path:`${a}.${t}`,priorityKeys:i}))));var m},Rc=({data:t,maxDepth:n=4,initialExpanded:o=!1,className:r="",priorityKeys:a=["input","output"]})=>{const{theme:i}=Kl(),s=i.colors;return null==t?e.createElement(xc,{themeColors:s,className:r},"No data available"):"object"!=typeof t?e.createElement(Ec,{themeColors:s,className:r},e.createElement(Sc,{themeColors:s},"Value:")," ",e.createElement(_c,{themeColors:s},String(t))):0===Object.keys(t).length?e.createElement(Cc,{themeColors:s,className:r},e.createElement(kc,{themeColors:s},Array.isArray(t)?"Empty array":"Empty object")):e.createElement(bc,{themeColors:s,className:r},e.createElement(wc,null,Nc(t,a).map(([t,o])=>e.createElement(Mc,{key:t,data:o,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a}))))},Oc=({width:t="1.5rem",height:n="1.5rem"})=>e.createElement("svg",{style:{width:"number"==typeof t?`${t}px`:t,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"},e.createElement("title",null,"OpenAI icon"),e.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"})),Ac=({width:t="1.5rem",height:n="1.5rem"})=>e.createElement("svg",{style:{width:"number"==typeof t?`${t}px`:t,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},e.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"}),e.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"}),e.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"}),e.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"}),e.createElement("path",{d:"M1 1h22v22H1z",fill:"none"})),Pc=({width:t="1.5rem",height:n="1.5rem"})=>e.createElement("svg",{style:{width:"number"==typeof t?`${t}px`:t,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"},e.createElement("path",{fill:"currentColor",d:"m13.788825 3.932 6.43325 16.136075h3.5279L17.316725 3.932H13.788825Z",strokeWidth:"0.25"}),e.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"})),Tc=({label:t,content:n,isExpanded:o,onToggle:r})=>{const{theme:a}=Kl(),i=a.colors,s=o?n:n?.slice(0,100)+(n?.length>100?"...":"");return e.createElement(Hc,null,e.createElement(Wc,{onClick:r,onMouseEnter:e=>{e.currentTarget.style.backgroundColor=i.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},e.createElement(Vc,{style:{color:i.mutedForeground}},t),e.createElement(Xc,null,o?e.createElement(gs,{style:{width:"12px",height:"12px",color:i.mutedForeground}}):e.createElement(ys,{style:{width:"12px",height:"12px",color:i.mutedForeground}}))),e.createElement(Yc,{value:s||"",readOnly:!0,rows:o?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2,style:{border:`1px solid ${i.border}`,backgroundColor:i.muted,color:i.foreground}}))},Dc=({data:t,id:n})=>{Ca();const{theme:o}=Kl(),r=o.colors,[a,i]=e.useState(!1),[s,l]=e.useState(!1),c=t.edges?.some(e=>e.source===n)||!1,u=t.edges?.some(e=>e.target===n)||!1,d=t.nodeType||"Agent",f=t.label||oc(d)||"Agent",p=t.details?.internals?.llm_details?.[0]?.model_provider,h=((t,n)=>{if("tool"===t)return"🔧";if("coordinator"===t)return"🎯";if("agent"===t){if("OpenAI"===n)return e.createElement(Oc,null);if("Anthropic"===n)return e.createElement(Pc,null);if("Google"===n||"Vertex_AI"===n)return e.createElement(Ac,null)}return"🤖"})(d.toLowerCase(),p),m=t.details?.internals?.llm_details?.[0]?.model_name||"Unknown",g=rc(t.details?.internals?.llm_details?.[0]?.total_cost),y=t.details?.internals?.llm_details?.[0]?.total_cost,v=t.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",b=t.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"",w=t.details?.internals?.latency?.total_time;return e.createElement($c,{onClick:()=>{console.log("Node clicked:",{label:t.label,nodeType:t.nodeType,details:t.details})}},u&&e.createElement(jr,{type:"target",position:nr.Top,style:{width:"8px",height:"8px",border:`2px solid ${r.primary}`,backgroundColor:r.background,cursor:"default"},isConnectable:!1}),e.createElement(Ic,null,e.createElement(zc,null,e.createElement(Lc,null,h),e.createElement(Bc,null,f)),"Agent"===d&&e.createElement(Fc,null,e.createElement(dc,{variant:"gray",title:m},m),e.createElement(dc,{variant:"cost",title:y?.toString()||""},g)),"Tool"===d&&null!=w&&e.createElement(Fc,null,e.createElement(dc,{variant:"latency"},ac(w))),"Coordinator"===d&&e.createElement(Fc,null,e.createElement(dc,{variant:"gray"},"Coordinator"))),e.createElement(jc,null,"Agent"===d?e.createElement(e.Fragment,null,e.createElement(Tc,{label:"System Message",content:v,isExpanded:a,onToggle:()=>i(!a)}),e.createElement(Tc,{label:"User Message",content:b,isExpanded:s,onToggle:()=>l(!s)})):"Tool"===d?e.createElement(Rc,{data:(()=>{const e=t.details?.internals||{};return t.edgeDetails&&t.edgeDetails.length>0?{...e,input:{args:t.edgeDetails[0]?.input_args,kwargs:t.edgeDetails[0]?.input_kwargs},output:t.edgeDetails[0]?.output,state:t.edgeDetails[0]?.state,status:t.edgeDetails[0]?.status}:e})()}):"Coordinator"===d?e.createElement(Rc,{data:t.details?.internals||{}}):null),c&&e.createElement(jr,{type:"source",position:nr.Bottom,style:{width:"8px",height:"8px",border:`2px solid ${r.primary}`,backgroundColor:r.background,cursor:"default"},isConnectable:!1}))},$c=tc.div`
|
|
113
160
|
border-radius: 0.5rem;
|
|
114
161
|
background-color: ${e=>e.theme.colors.card};
|
|
115
162
|
border: 2px solid ${e=>e.theme.colors.border};
|
|
116
|
-
box-shadow:
|
|
163
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
117
164
|
min-width: 300px;
|
|
118
165
|
max-width: 500px;
|
|
119
166
|
transition: all 0.2s ease-in-out;
|
|
@@ -121,45 +168,48 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
121
168
|
cursor: pointer;
|
|
122
169
|
|
|
123
170
|
&:hover {
|
|
124
|
-
border-color:
|
|
125
|
-
box-shadow:
|
|
171
|
+
border-color: ${e=>e.theme.colors.primary};
|
|
172
|
+
box-shadow:
|
|
173
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
174
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
126
175
|
}
|
|
127
|
-
`,
|
|
176
|
+
`,Ic=tc.div`
|
|
128
177
|
display: flex;
|
|
129
178
|
justify-content: space-between;
|
|
130
179
|
align-items: center;
|
|
131
180
|
gap: 0.5rem;
|
|
132
181
|
padding: 0.75rem;
|
|
133
182
|
border-bottom: 1px solid ${e=>e.theme.colors.border};
|
|
134
|
-
`,
|
|
183
|
+
`,zc=tc.div`
|
|
135
184
|
display: flex;
|
|
136
185
|
align-items: center;
|
|
137
186
|
gap: 0.5rem;
|
|
138
|
-
`,
|
|
187
|
+
`,Lc=tc.div`
|
|
139
188
|
font-size: 1.25rem;
|
|
140
189
|
display: flex;
|
|
141
190
|
align-items: center;
|
|
142
191
|
justify-content: center;
|
|
143
|
-
|
|
192
|
+
color: ${e=>e.theme.colors.foreground};
|
|
193
|
+
`,Bc=tc.div`
|
|
144
194
|
font-weight: 600;
|
|
145
195
|
color: ${e=>e.theme.colors.foreground};
|
|
146
196
|
font-size: 0.875rem;
|
|
147
197
|
word-break: break-words;
|
|
148
|
-
`,
|
|
198
|
+
`,Fc=tc.div`
|
|
149
199
|
display: flex;
|
|
150
200
|
gap: 0.5rem;
|
|
151
201
|
justify-content: flex-end;
|
|
152
202
|
align-items: center;
|
|
153
|
-
`,
|
|
203
|
+
`,jc=tc.div`
|
|
154
204
|
padding: 0.75rem;
|
|
155
205
|
display: flex;
|
|
156
206
|
flex-direction: column;
|
|
157
207
|
align-items: flex-start;
|
|
158
208
|
justify-content: center;
|
|
159
209
|
gap: 0.5rem;
|
|
160
|
-
`,
|
|
210
|
+
`,Hc=tc.div`
|
|
161
211
|
width: 100%;
|
|
162
|
-
`,
|
|
212
|
+
`,Wc=tc.div`
|
|
163
213
|
display: flex;
|
|
164
214
|
justify-content: space-between;
|
|
165
215
|
align-items: center;
|
|
@@ -173,48 +223,47 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
173
223
|
&:hover {
|
|
174
224
|
background-color: transparent;
|
|
175
225
|
}
|
|
176
|
-
`,
|
|
226
|
+
`,Vc=tc.span`
|
|
177
227
|
font-weight: 600;
|
|
178
228
|
font-size: 0.75rem;
|
|
179
|
-
`,
|
|
229
|
+
`,Yc=tc.textarea`
|
|
180
230
|
box-sizing: border-box;
|
|
181
231
|
width: 100%;
|
|
182
232
|
border-radius: 0.25rem;
|
|
183
233
|
padding: 0.5rem;
|
|
184
|
-
font-size: 0.75rem;
|
|
185
234
|
resize: none;
|
|
186
235
|
min-height: 40px;
|
|
187
236
|
font-family: inherit;
|
|
188
237
|
|
|
189
238
|
&:focus {
|
|
190
239
|
outline: none;
|
|
191
|
-
border-color:
|
|
192
|
-
box-shadow: 0 0 0 1px
|
|
240
|
+
border-color: ${e=>e.theme.colors.primary};
|
|
241
|
+
box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary};
|
|
193
242
|
}
|
|
194
243
|
|
|
195
244
|
transition: all 0.2s ease-in-out;
|
|
196
|
-
`,
|
|
245
|
+
`,Xc=tc.div`
|
|
197
246
|
transition: transform 0.2s ease-in-out;
|
|
198
|
-
`,
|
|
247
|
+
`,Kc=tc.div`
|
|
199
248
|
background-color: ${e=>e.theme.colors.card};
|
|
200
249
|
border: 1px solid ${e=>e.theme.colors.border};
|
|
201
250
|
border-radius: 0.5rem;
|
|
202
251
|
overflow: hidden;
|
|
203
252
|
width: 100%;
|
|
204
253
|
max-width: 400px;
|
|
205
|
-
`,
|
|
254
|
+
`,Uc=tc.div`
|
|
206
255
|
display: flex;
|
|
207
256
|
justify-content: space-between;
|
|
208
257
|
align-items: center;
|
|
209
258
|
padding: 0.75rem;
|
|
210
259
|
border-bottom: 1px solid ${e=>e.theme.colors.border};
|
|
211
260
|
background-color: ${e=>e.theme.colors.muted};
|
|
212
|
-
`,
|
|
261
|
+
`,qc=tc.h3`
|
|
213
262
|
margin: 0;
|
|
214
263
|
font-size: 0.875rem;
|
|
215
264
|
font-weight: 600;
|
|
216
265
|
color: ${e=>e.theme.colors.cardForeground};
|
|
217
|
-
`,
|
|
266
|
+
`,Zc=tc.button`
|
|
218
267
|
display: flex;
|
|
219
268
|
align-items: center;
|
|
220
269
|
justify-content: center;
|
|
@@ -230,11 +279,11 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
230
279
|
background-color: ${e=>e.theme.colors.accent};
|
|
231
280
|
color: ${e=>e.theme.colors.accentForeground};
|
|
232
281
|
}
|
|
233
|
-
`,
|
|
282
|
+
`,Gc=tc.div`
|
|
234
283
|
padding: 0.75rem;
|
|
235
284
|
max-height: 400px;
|
|
236
285
|
overflow-y: auto;
|
|
237
|
-
`,
|
|
286
|
+
`,Qc=tc.div`
|
|
238
287
|
position: relative;
|
|
239
288
|
padding: 0.5rem;
|
|
240
289
|
border-radius: 0.375rem;
|
|
@@ -247,26 +296,26 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
247
296
|
&:hover {
|
|
248
297
|
background-color: ${e=>e.hasStep&&!e.isActive?e.theme.colors.accent:e.isActive?e.theme.colors.primary:"transparent"};
|
|
249
298
|
}
|
|
250
|
-
`,
|
|
299
|
+
`,Jc=tc.div`
|
|
251
300
|
display: flex;
|
|
252
301
|
align-items: center;
|
|
253
302
|
gap: 0.5rem;
|
|
254
303
|
margin-bottom: 0.25rem;
|
|
255
|
-
`,
|
|
304
|
+
`,eu=tc.div`
|
|
256
305
|
width: 0.5rem;
|
|
257
306
|
height: 0.5rem;
|
|
258
307
|
border-radius: 50%;
|
|
259
308
|
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
309
|
flex-shrink: 0;
|
|
261
|
-
`,
|
|
310
|
+
`,tu=tc.span`
|
|
262
311
|
font-weight: 600;
|
|
263
312
|
font-size: 0.75rem;
|
|
264
313
|
color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.theme.colors.cardForeground};
|
|
265
|
-
`,
|
|
314
|
+
`,nu=tc.div`
|
|
266
315
|
font-size: 0.75rem;
|
|
267
316
|
color: ${e=>e.hasStep?e.theme.colors.cardForeground:e.theme.colors.mutedForeground};
|
|
268
317
|
font-style: ${e=>e.hasStep?"normal":"italic"};
|
|
269
|
-
`,
|
|
318
|
+
`,ou=tc.div`
|
|
270
319
|
position: absolute;
|
|
271
320
|
top: 0;
|
|
272
321
|
left: 0;
|
|
@@ -286,7 +335,7 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
286
335
|
opacity: 0.5;
|
|
287
336
|
}
|
|
288
337
|
}
|
|
289
|
-
`,Su=({stamps:t,currentStep:n,onStepChange:r,onToggle:o})=>{const a=t.length>0?Math.max(...t.map(e=>e.step)):0,i=t.length>0?Math.min(...t.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return e.createElement(fu,null,e.createElement(pu,null,e.createElement(hu,null,"Timeline"),o&&e.createElement(mu,{onClick:o,title:"Collapse Panel"},e.createElement(ws,{size:16}))),e.createElement(gu,null,Array.from({length:s},(o,a)=>{const s=i+a,c=s===n,u=s<n,d=t.some(e=>e.step===s),f=(e=>{const n=t.filter(t=>t.step===e);if(0===n.length)return null;const r=e-1,o=t.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=(e=>{const n=t.filter(t=>t.step===e);return 0===n.length?`Step ${e}`:n[0]?.identifier||`Step ${e}`})(s);return e.createElement(yu,{key:s,isActive:c,isPast:u,hasStep:d,onClick:()=>d&&r(s)},e.createElement(vu,null,e.createElement(bu,{isActive:c,isPast:u,hasStep:d}),e.createElement(wu,{isActive:c},"Step ",s),f&&e.createElement(Oc,{variant:l(f),style:{marginLeft:"auto"}},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(f))),e.createElement(xu,{hasStep:d},d?p:"No activity"),c&&e.createElement(Eu,null))})))};function _u(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Cu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ku(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Cu(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():Cu(e[t],null)}}}}function Nu(...e){return o.useCallback(ku(...e),e)}function Mu(e,t=[]){let r=[];const a=()=>{const t=r.map(e=>o.createContext(e));return function(n){const r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return a.scopeName=e,[function(t,a){const i=o.createContext(a),s=r.length;r=[...r,a];const l=t=>{const{scope:r,children:a,...l}=t,c=r?.[e]?.[s]||i,u=o.useMemo(()=>l,Object.values(l));return n.jsx(c.Provider,{value:u,children:a})};return l.displayName=t+"Provider",[l,function(n,r){const l=r?.[e]?.[s]||i,c=o.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Ru(a,...t)]}function Ru(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Ou=globalThis?.document?o.useLayoutEffect:()=>{},Pu=o[" useId ".trim().toString()]||(()=>{}),Au=0;function Tu(e){const[t,n]=o.useState(Pu());return Ou(()=>{e||n(e=>e??String(Au++))},[e]),e||(t?`radix-${t}`:"")}var Du=o[" useInsertionEffect ".trim().toString()]||Ou;function $u({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),i=o.useRef(t);return Du(()=>{i.current=t},[t]),o.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=o.useRef(void 0!==e);o.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}const u=o.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,u]}function Iu(e){const t=zu(e),r=o.forwardRef((e,r)=>{const{children:a,...i}=e,s=o.Children.toArray(a),l=s.find(Bu);if(l){const e=l.props.children,a=s.map(t=>t===l?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:t);return n.jsx(t,{...i,ref:r,children:o.isValidElement(e)?o.cloneElement(e,void 0,a):null})}return n.jsx(t,{...i,ref:r,children:a})});return r.displayName=`${e}.Slot`,r}function zu(e){const t=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const e=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}(n),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}}(r,n.props);return n.type!==o.Fragment&&(a.ref=t?ku(t,e):e),o.cloneElement(n,a)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lu=Symbol("radix.slottable");function Bu(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Lu}var Fu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=Iu(`Primitive.${t}`),a=o.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),n.jsx(s,{...i,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function ju(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}var Hu,Vu="dismissableLayer.update",Wu="dismissableLayer.pointerDownOutside",Yu="dismissableLayer.focusOutside",Xu=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ku=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=o.useContext(Xu),[f,p]=o.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=o.useState({}),g=Nu(t,e=>p(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(e,t=globalThis?.document){const n=ju(e),r=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Zu(Wu,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},h),_=function(e,t=globalThis?.document){const n=ju(e),r=o.useRef(!1);return o.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Zu(Yu,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=ju(e);o.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),o.useEffect(()=>{if(f)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Hu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),qu(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Hu)}},[f,h,r,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),qu())},[f,d]),o.useEffect(()=>{const e=()=>m({});return document.addEventListener(Vu,e),()=>document.removeEventListener(Vu,e)},[]),n.jsx(Fu.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:_u(e.onFocusCapture,_.onFocusCapture),onBlurCapture:_u(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:_u(e.onPointerDownCapture,S.onPointerDownCapture)})});Ku.displayName="DismissableLayer";var Uu=o.forwardRef((e,t)=>{const r=o.useContext(Xu),a=o.useRef(null),i=Nu(t,a);return o.useEffect(()=>{const e=a.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),n.jsx(Fu.div,{...e,ref:i})});function qu(){const e=new CustomEvent(Vu);document.dispatchEvent(e)}function Zu(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&&a.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}Uu.displayName="DismissableLayerBranch";var Gu="focusScope.autoFocusOnMount",Qu="focusScope.autoFocusOnUnmount",Ju={bubbles:!1,cancelable:!0},ed=o.forwardRef((e,t)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=o.useState(null),d=ju(i),f=ju(s),p=o.useRef(null),h=Nu(t,e=>u(e)),m=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:od(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||od(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&od(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,c,m.paused]),o.useEffect(()=>{if(c){ad.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(Gu,Ju);c.addEventListener(Gu,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(od(r,{select:t}),document.activeElement!==n)return}((e=td(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&od(c))}return()=>{c.removeEventListener(Gu,d),setTimeout(()=>{const e=new CustomEvent(Qu,Ju);c.addEventListener(Qu,f),c.dispatchEvent(e),e.defaultPrevented||od(t??document.body,{select:!0}),c.removeEventListener(Qu,f),ad.remove(m)},0)}}var e},[c,d,f,m]);const g=o.useCallback(e=>{if(!r&&!a)return;if(m.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=td(e),n=nd(t,e),r=nd(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&od(a,{select:!0})):(e.preventDefault(),r&&od(o,{select:!0})):n===t&&e.preventDefault()}},[r,a,m.paused]);return n.jsx(Fu.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function td(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 nd(e,t){for(const n of e)if(!rd(n,{upTo:t}))return n}function rd(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 od(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()}}ed.displayName="FocusScope";var ad=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=id(e,t),e.unshift(t)},remove(t){e=id(e,t),e[0]?.resume()}}}();function id(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var sd=o.forwardRef((e,r)=>{const{container:a,...i}=e,[s,l]=o.useState(!1);Ou(()=>l(!0),[]);const c=a||s&&globalThis?.document?.body;return c?t.createPortal(n.jsx(Fu.div,{...i,ref:r}),c):null});sd.displayName="Portal";var ld=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=o.useState(),r=o.useRef(null),a=o.useRef(e),i=o.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=cd(r.current);i.current="mounted"===l?e:"none"},[l]),Ou(()=>{const t=r.current,n=a.current;if(n!==e){const r=i.current,o=cd(t);if(e)c("MOUNT");else if("none"===o||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Ou(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,o=o=>{const i=cd(r.current).includes(CSS.escape(o.animationName));if(o.target===t&&i&&(c("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=cd(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:r.isPresent}):o.Children.only(n),i=Nu(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||r.isPresent?o.cloneElement(a,{ref:i}):null};function cd(e){return e?.animationName||"none"}ld.displayName="Presence";var ud=0;function dd(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fd()),document.body.insertAdjacentElement("beforeend",e[1]??fd()),ud++,()=>{1===ud&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ud--}},[])}function fd(){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 pd=function(){return pd=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},pd.apply(this,arguments)};function hd(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 md="right-scroll-bar-position",gd="width-before-scroll-bar";function yd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var vd="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,bd=new WeakMap;function wd(t,n){var r,o,a,i=(r=n||null,o=function(e){return t.forEach(function(t){return yd(t,e)})},(a=e.useState(function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=o,a.facade);return vd(function(){var e=bd.get(i);if(e){var n=new Set(e),r=new Set(t),o=i.current;n.forEach(function(e){r.has(e)||yd(e,null)}),r.forEach(function(e){n.has(e)||yd(e,o)})}bd.set(i,t)},[t]),i}function xd(e){return e}var Ed=function(e){var t=e.sideCar,n=hd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,pd({},n))};Ed.isSideCarExport=!0;var Sd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=xd);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=pd({async:!0,ssr:!1},e),t}(),_d=function(){},Cd=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:_d,onWheelCapture:_d,onTouchMoveCapture:_d}),a=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,x=hd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=wd([n,t]),_=pd(pd({},x),a);return o.createElement(o.Fragment,null,d&&o.createElement(E,{sideCar:Sd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?o.cloneElement(o.Children.only(l),pd(pd({},_),{ref:S})):o.createElement(b,pd({},_,{className:c,ref:S}),l))});Cd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Cd.classNames={fullWidth:gd,zeroRight:md};function kd(){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 Nd=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=kd())&&(!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)}}},Md=function(){var e,t=(e=Nd(),function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Rd={left:0,top:0,right:0,gap:0},Od=function(e){return parseInt(e||"",10)||0},Pd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Rd;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[Od(n),Od(r),Od(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])}},Ad=Md(),Td="data-scroll-locked",Dd=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(Td,"] {\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(md," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(gd," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(md," .").concat(md," {\n right: 0 ").concat(r,";\n }\n \n .").concat(gd," .").concat(gd," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Td,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},$d=function(){var e=parseInt(document.body.getAttribute(Td)||"0",10);return isFinite(e)?e:0},Id=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;o.useEffect(function(){return document.body.setAttribute(Td,($d()+1).toString()),function(){var e=$d()-1;e<=0?document.body.removeAttribute(Td):document.body.setAttribute(Td,e.toString())}},[]);var i=o.useMemo(function(){return Pd(a)},[a]);return o.createElement(Ad,{styles:Dd(i,!t,a,n?"":"!important")})},zd=!1;if("undefined"!=typeof window)try{var Ld=Object.defineProperty({},"passive",{get:function(){return zd=!0,!0}});window.addEventListener("test",Ld,Ld),window.removeEventListener("test",Ld,Ld)}catch(e){zd=!1}var Bd=!!zd&&{passive:!1},Fd=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])},jd=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Hd(e,r)){var o=Vd(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hd=function(e,t){return"v"===e?function(e){return Fd(e,"overflowY")}(t):function(e){return Fd(e,"overflowX")}(t)},Vd=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},Wd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yd=function(e){return[e.deltaX,e.deltaY]},Xd=function(e){return e&&"current"in e?e.current:e},Kd=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ud=0,qd=[];function Zd(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gd,Qd=(Gd=function(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),a=o.useState(Ud++)[0],i=o.useState(Md)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=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))}([e.lockRef.current],(e.shards||[]).map(Xd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=Wd(e),i=n.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=jd(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=jd(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;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=Vd(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&Hd(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=o.useCallback(function(e){var n=e;if(qd.length&&qd[qd.length-1]===i){var r="deltaY"in n?Yd(n):Wd(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var a=(s.current.shards||[]).map(Xd).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?l(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Zd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=Wd(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Yd(t),t.target,l(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,Wd(t),t.target,l(t,e.lockRef.current))},[]);o.useEffect(function(){return qd.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Bd),document.addEventListener("touchmove",c,Bd),document.addEventListener("touchstart",d,Bd),function(){qd=qd.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,Bd),document.removeEventListener("touchmove",c,Bd),document.removeEventListener("touchstart",d,Bd)}},[]);var h=e.removeScrollBar,m=e.inert;return o.createElement(o.Fragment,null,m?o.createElement(i,{styles:Kd(a)}):null,h?o.createElement(Id,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Sd.useMedium(Gd),Ed),Jd=o.forwardRef(function(e,t){return o.createElement(Cd,pd({},e,{ref:t,sideCar:Qd}))});Jd.classNames=Cd.classNames;var ef=Jd,tf=new WeakMap,nf=new WeakMap,rf={},of=0,af=function(e){return e&&(e.host||af(e.parentNode))},sf=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=af(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]);rf[n]||(rf[n]=new WeakMap);var a=rf[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=(tf.get(e)||0)+1,c=(a.get(e)||0)+1;tf.set(e,l),a.set(e,c),i.push(e),1===l&&o&&nf.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(),of++,function(){i.forEach(function(e){var t=tf.get(e)-1,o=a.get(e)-1;tf.set(e,t),a.set(e,o),t||(nf.has(e)||e.removeAttribute(r),nf.delete(e)),o||e.removeAttribute(n)}),--of||(tf=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf={})}},lf=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"))),sf(r,o,n,"aria-hidden")):function(){return null}},cf="Dialog",[uf,df]=Mu(cf),[ff,pf]=uf(cf),hf=e=>{const{__scopeDialog:t,children:r,open:a,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=o.useRef(null),u=o.useRef(null),[d,f]=$u({prop:a,defaultProp:i??!1,onChange:s,caller:cf});return n.jsx(ff,{scope:t,triggerRef:c,contentRef:u,contentId:Tu(),titleId:Tu(),descriptionId:Tu(),open:d,onOpenChange:f,onOpenToggle:o.useCallback(()=>f(e=>!e),[f]),modal:l,children:r})};hf.displayName=cf;var mf="DialogTrigger",gf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=pf(mf,r),i=Nu(t,a.triggerRef);return n.jsx(Fu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":If(a.open),...o,ref:i,onClick:_u(e.onClick,a.onOpenToggle)})});gf.displayName=mf;var yf="DialogPortal",[vf,bf]=uf(yf,{forceMount:void 0}),wf=e=>{const{__scopeDialog:t,forceMount:r,children:a,container:i}=e,s=pf(yf,t);return n.jsx(vf,{scope:t,forceMount:r,children:o.Children.map(a,e=>n.jsx(ld,{present:r||s.open,children:n.jsx(sd,{asChild:!0,container:i,children:e})}))})};wf.displayName=yf;var xf="DialogOverlay",Ef=o.forwardRef((e,t)=>{const r=bf(xf,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=pf(xf,e.__scopeDialog);return i.modal?n.jsx(ld,{present:o||i.open,children:n.jsx(_f,{...a,ref:t})}):null});Ef.displayName=xf;var Sf=Iu("DialogOverlay.RemoveScroll"),_f=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=pf(xf,r);return n.jsx(ef,{as:Sf,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(Fu.div,{"data-state":If(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Cf="DialogContent",kf=o.forwardRef((e,t)=>{const r=bf(Cf,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=pf(Cf,e.__scopeDialog);return n.jsx(ld,{present:o||i.open,children:i.modal?n.jsx(Nf,{...a,ref:t}):n.jsx(Mf,{...a,ref:t})})});kf.displayName=Cf;var Nf=o.forwardRef((e,t)=>{const r=pf(Cf,e.__scopeDialog),a=o.useRef(null),i=Nu(t,r.contentRef,a);return o.useEffect(()=>{const e=a.current;if(e)return lf(e)},[]),n.jsx(Rf,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_u(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:_u(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:_u(e.onFocusOutside,e=>e.preventDefault())})}),Mf=o.forwardRef((e,t)=>{const r=pf(Cf,e.__scopeDialog),a=o.useRef(!1),i=o.useRef(!1);return n.jsx(Rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||r.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,o=r.triggerRef.current?.contains(n);o&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Rf=o.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=pf(Cf,r),u=o.useRef(null),d=Nu(t,u);return dd(),n.jsxs(n.Fragment,{children:[n.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:n.jsx(Ku,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":If(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(Ff,{titleId:c.titleId}),n.jsx(jf,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Of="DialogTitle",Pf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=pf(Of,r);return n.jsx(Fu.h2,{id:a.titleId,...o,ref:t})});Pf.displayName=Of;var Af="DialogDescription",Tf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=pf(Af,r);return n.jsx(Fu.p,{id:a.descriptionId,...o,ref:t})});Tf.displayName=Af;var Df="DialogClose",$f=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=pf(Df,r);return n.jsx(Fu.button,{type:"button",...o,ref:t,onClick:_u(e.onClick,()=>a.onOpenChange(!1))})});function If(e){return e?"open":"closed"}$f.displayName=Df;var zf="DialogTitleWarning",[Lf,Bf]=function(e,t){const r=o.createContext(t),a=e=>{const{children:t,...a}=e,i=o.useMemo(()=>a,Object.values(a));return n.jsx(r.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(n){const a=o.useContext(r);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(zf,{contentName:Cf,titleName:Of,docsSlug:"dialog"}),Ff=({titleId:e})=>{const t=Bf(zf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return o.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},jf=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bf("DialogDescriptionWarning").contentName}}.`;return o.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},Hf=hf,Vf=gf,Wf=wf,Yf=Ef,Xf=kf,Kf=Pf,Uf=Tf,qf=$f;const Zf=Hf,Gf=Vf,Qf=Wf,Jf=o.forwardRef(({className:e,...t},n)=>o.createElement(Yf,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:e,...t,ref:n}));Jf.displayName=Yf.displayName;const ep=(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"}}},tp=o.forwardRef(({side:e="right",className:t,children:n,...r},a)=>o.createElement(Qf,null,o.createElement(Jf,null),o.createElement(Xf,{ref:a,style:ep(e),className:t,...r},n,o.createElement(qf,{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"}},o.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),o.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")))));tp.displayName=Xf.displayName;o.forwardRef(({className:e,...t},n)=>o.createElement(Kf,{ref:n,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:e,...t})).displayName=Kf.displayName;o.forwardRef(({className:e,...t},n)=>o.createElement(Uf,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=Uf.displayName;const np=(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},rp={Agent:Jc,Tool:Jc,Coordinator:Jc},op=({flowData:t,width:n="100%",height:r="1000px",className:o="",defaultZoom:a=1,defaultPan:i={x:0,y:0},disableAutoFit:s=!0,showTimeline:l=!1,minNodeSpacing:c=200})=>{const{theme:u}=Cs(),d=t;if(!d)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${u.colors.border}`,borderRadius:"8px",background:u.colors.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:o},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:u.colors.mutedForeground,marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:u.colors.mutedForeground}},"Please provide flowData prop")));const f=e.useRef(null),p=e.useRef(null),[h,m]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof r?r:600}),[g,y]=e.useState(0),[v,b]=e.useState(!1),w=e.useRef(null),[x,E]=e.useState(!1),S=e.useMemo(()=>{const e=d.stamps||d.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[d.stamps,d.steps]);e.useEffect(()=>(v?w.current=setInterval(()=>{y(e=>e>=S?(b(!1),e):e+1)},250):w.current&&(clearInterval(w.current),w.current=null),()=>{w.current&&clearInterval(w.current)}),[v,S]),e.useEffect(()=>{const e=d.stamps||d.steps||[];e.length>0&&y(Math.max(...e.map(e=>e.step)))},[d.stamps,d.steps]),e.useEffect(()=>{const e=()=>{if(f.current){const e=f.current.getBoundingClientRect();m({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof r?r:600)})}};if(e(),window.ResizeObserver&&f.current){const t=new ResizeObserver(e);return t.observe(f.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,r]);const _=e.useMemo(()=>{if(!d.nodes)return new Map;const e=Math.max(h.width||800,1200);return np(d.nodes,d.edges||[],{minNodeSpacing:c,containerWidth:e})},[d.nodes,d.edges,h.width,c]),C=e.useCallback(e=>d.nodes?d.nodes.filter(t=>t.stamp.step<=e):[],[d.nodes]),k=e.useCallback(e=>(d.edges||[]).filter(t=>t.stamp.step<=e),[d.edges]),N=e.useMemo(()=>{const e=C(g),t=k(g);return e.map(e=>{const n=_.get(e.identifier)||{x:0,y:0},r=e.stamp.step===g,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"}}})},[_,g,C,k]),M=e.useMemo(()=>k(g).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===g;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?"#6366f1":"#9ca3af",strokeWidth:t?3:2},label:e.stamp?.identifier?Mc(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Mc(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[g,k]),[R,O,P]=Ji(N),[A,T,D]=es(M);e.useEffect(()=>{O(N)},[N,O]),e.useEffect(()=>{T(M)},[M,T]);const $=e.useCallback(e=>T(t=>xo(e,t)),[T]),I=e.useCallback(e=>{y(e),b(!1)},[]);e.useCallback(()=>{b(e=>!e)},[]);const z=(e,t)=>{if(!p.current)return{x:0,y:0};const n=p.current.createSVGPoint();n.x=e,n.y=t;const r=n.matrixTransform(p.current.getScreenCTM()?.inverse());return{x:r.x,y:r.y}},L=Ca();return e.useEffect(()=>{if(s||!L||0===N.length)return;const e=new Map;M.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&&N.length>0&&(t=N[0].id),t&&setTimeout(()=>{L.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:a,maxZoom:1})},500)},[N,M,L,s,a]),e.createElement("div",{ref:f,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${u.colors.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:u.colors.background},className:o},l&&e.createElement(Zf,{open:x,onOpenChange:E},e.createElement(Gf,{asChild:!0},e.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:u.colors.card,border:`1px solid ${u.colors.border}`,borderRadius:"8px",boxShadow:u.shadows.sm,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=u.colors.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=u.colors.card},title:"Open Timeline"},e.createElement(ws,{size:20,style:{color:u.colors.mutedForeground}}))),e.createElement(Qf,null,e.createElement(Xf,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:u.colors.background,borderRight:`1px solid ${u.colors.border}`,boxShadow:u.shadows.lg,transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},e.createElement("div",{style:{flex:1,overflowY:"auto"}},e.createElement(Su,{stamps:d.stamps||d.steps||[],currentStep:g,onStepChange:I}))),e.createElement(qf,{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:u.colors.mutedForeground},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"))))),e.createElement(Gi,{nodes:R,edges:A,onNodesChange:P,onEdgesChange:D,onConnect:$,nodeTypes:rp,edgeTypes:{default:t=>e.createElement(ks,{...t,clientToSvgCoords:z,svgRef:p})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:i.x,y:i.y,zoom:a},onInit:()=>{if(f.current){const e=f.current.querySelector("svg");e&&(p.current=e)}}},e.createElement(ls,{variant:ts.Lines,color:u.colors.border,gap:16})),e.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${u.colors.card};\n color: ${u.colors.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${u.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 `))};function ap(e,[t,n]){return Math.min(n,Math.max(t,e))}var ip=o.createContext(void 0);const sp=["top","right","bottom","left"],lp=Math.min,cp=Math.max,up=Math.round,dp=Math.floor,fp=e=>({x:e,y:e}),pp={left:"right",right:"left",bottom:"top",top:"bottom"},hp={start:"end",end:"start"};function mp(e,t,n){return cp(e,lp(t,n))}function gp(e,t){return"function"==typeof e?e(t):e}function yp(e){return e.split("-")[0]}function vp(e){return e.split("-")[1]}function bp(e){return"x"===e?"y":"x"}function wp(e){return"y"===e?"height":"width"}const xp=new Set(["top","bottom"]);function Ep(e){return xp.has(yp(e))?"y":"x"}function Sp(e){return bp(Ep(e))}function _p(e){return e.replace(/start|end/g,e=>hp[e])}const Cp=["left","right"],kp=["right","left"],Np=["top","bottom"],Mp=["bottom","top"];function Rp(e,t,n,r){const o=vp(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?kp:Cp:t?Cp:kp;case"left":case"right":return t?Np:Mp;default:return[]}}(yp(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(_p)))),a}function Op(e){return e.replace(/left|right|bottom|top/g,e=>pp[e])}function Pp(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 Ap(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 Tp(e,t,n){let{reference:r,floating:o}=e;const a=Ep(t),i=Sp(t),s=wp(i),l=yp(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(vp(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function Dp(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}=gp(t,e),h=Pp(p),m=s[f?"floating"===d?"reference":"floating":d],g=Ap(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=Ap(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 $p(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ip(e){return sp.some(t=>e[t]>=0)}const zp=new Set(["left","top"]);function Lp(){return"undefined"!=typeof window}function Bp(e){return Hp(e)?(e.nodeName||"").toLowerCase():"#document"}function Fp(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function jp(e){var t;return null==(t=(Hp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Hp(e){return!!Lp()&&(e instanceof Node||e instanceof Fp(e).Node)}function Vp(e){return!!Lp()&&(e instanceof Element||e instanceof Fp(e).Element)}function Wp(e){return!!Lp()&&(e instanceof HTMLElement||e instanceof Fp(e).HTMLElement)}function Yp(e){return!(!Lp()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Fp(e).ShadowRoot)}const Xp=new Set(["inline","contents"]);function Kp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ah(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Xp.has(o)}const Up=new Set(["table","td","th"]);function qp(e){return Up.has(Bp(e))}const Zp=[":popover-open",":modal"];function Gp(e){return Zp.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Qp=["transform","translate","scale","rotate","perspective"],Jp=["transform","translate","scale","rotate","perspective","filter"],eh=["paint","layout","strict","content"];function th(e){const t=nh(),n=Vp(e)?ah(e):e;return Qp.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Jp.some(e=>(n.willChange||"").includes(e))||eh.some(e=>(n.contain||"").includes(e))}function nh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const rh=new Set(["html","body","#document"]);function oh(e){return rh.has(Bp(e))}function ah(e){return Fp(e).getComputedStyle(e)}function ih(e){return Vp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sh(e){if("html"===Bp(e))return e;const t=e.assignedSlot||e.parentNode||Yp(e)&&e.host||jp(e);return Yp(t)?t.host:t}function lh(e){const t=sh(e);return oh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wp(t)&&Kp(t)?t:lh(t)}function ch(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=lh(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=Fp(o);if(a){const e=uh(i);return t.concat(i,i.visualViewport||[],Kp(o)?o:[],e&&n?ch(e):[])}return t.concat(o,ch(o,[],n))}function uh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dh(e){const t=ah(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Wp(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=up(n)!==a||up(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function fh(e){return Vp(e)?e:e.contextElement}function ph(e){const t=fh(e);if(!Wp(t))return fp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=dh(t);let i=(a?up(n.width):n.width)/r,s=(a?up(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const hh=fp(0);function mh(e){const t=Fp(e);return nh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:hh}function gh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=fh(e);let i=fp(1);t&&(r?Vp(r)&&(i=ph(r)):i=ph(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Fp(e))&&t}(a,n,r)?mh(a):fp(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=Fp(a),t=r&&Vp(r)?Fp(r):r;let n=e,o=uh(n);for(;o&&r&&t!==n;){const e=ph(o),t=o.getBoundingClientRect(),r=ah(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=Fp(o),o=uh(n)}}return Ap({width:u,height:d,x:l,y:c})}function yh(e,t){const n=ih(e).scrollLeft;return t?t.left+n:gh(jp(e)).left+n}function vh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yh(e,n),y:n.top+t.scrollTop}}const bh=new Set(["absolute","fixed"]);function wh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Fp(e),r=jp(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=nh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=yh(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=jp(e),n=ih(e),r=e.ownerDocument.body,o=cp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=cp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+yh(e);const s=-n.scrollTop;return"rtl"===ah(r).direction&&(i+=cp(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(jp(e));else if(Vp(t))r=function(e,t){const n=gh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Wp(e)?ph(e):fp(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=mh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ap(r)}function xh(e,t){const n=sh(e);return!(n===t||!Vp(n)||oh(n))&&("fixed"===ah(n).position||xh(n,t))}function Eh(e,t,n){const r=Wp(t),o=jp(t),a="fixed"===n,i=gh(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=fp(0);function c(){l.x=yh(o)}if(r||!r&&!a)if(("body"!==Bp(t)||Kp(o))&&(s=ih(t)),r){const e=gh(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?fp(0):vh(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 Sh(e){return"static"===ah(e).position}function _h(e,t){if(!Wp(e)||"fixed"===ah(e).position)return null;if(t)return t(e);let n=e.offsetParent;return jp(e)===n&&(n=n.ownerDocument.body),n}function Ch(e,t){const n=Fp(e);if(Gp(e))return n;if(!Wp(e)){let t=sh(e);for(;t&&!oh(t);){if(Vp(t)&&!Sh(t))return t;t=sh(t)}return n}let r=_h(e,t);for(;r&&qp(r)&&Sh(r);)r=_h(r,t);return r&&oh(r)&&Sh(r)&&!th(r)?n:r||function(e){let t=sh(e);for(;Wp(t)&&!oh(t);){if(th(t))return t;if(Gp(t))return null;t=sh(t)}return null}(e)||n}const kh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=jp(r),s=!!t&&Gp(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=fp(1);const u=fp(0),d=Wp(r);if((d||!d&&!a)&&(("body"!==Bp(r)||Kp(i))&&(l=ih(r)),Wp(r))){const e=gh(r);c=ph(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?fp(0):vh(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:jp,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a="clippingAncestors"===n?Gp(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ch(e,[],!1).filter(e=>Vp(e)&&"body"!==Bp(e)),o=null;const a="fixed"===ah(e).position;let i=a?sh(e):e;for(;Vp(i)&&!oh(i);){const t=ah(i),n=th(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&bh.has(o.position)||Kp(i)&&!n&&xh(e,i))?r=r.filter(e=>e!==i):o=t,i=sh(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=wh(t,n,o);return e.top=cp(r.top,e.top),e.right=lp(r.right,e.right),e.bottom=lp(r.bottom,e.bottom),e.left=cp(r.left,e.left),e},wh(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Ch,getElementRects:async function(e){const t=this.getOffsetParent||Ch,n=this.getDimensions,r=await n(e.floating);return{reference:Eh(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}=dh(e);return{width:t,height:n}},getScale:ph,isElement:Vp,isRTL:function(e){return"rtl"===ah(e).direction}};function Nh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mh(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=fh(e),u=o||a?[...c?ch(c):[],...ch(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=jp(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:-dp(d)+"px "+-dp(o.clientWidth-(u+f))+"px "+-dp(o.clientHeight-(d+p))+"px "+-dp(u)+"px",threshold:cp(0,lp(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||Nh(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?gh(e):null;return l&&function t(){const r=gh(e);m&&!Nh(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 Rh=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=yp(n),s=vp(n),l="y"===Ep(n),c=zp.has(i)?-1:1,u=a&&l?-1:1,d=gp(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}}}}},Oh=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}=gp(e,t),c={x:n,y:r},u=await Dp(t,l),d=Ep(yp(o)),f=bp(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=mp(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=mp(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}}}}}},Ph=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}=gp(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=yp(o),v=Ep(s),b=yp(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Op(s)]:function(e){const t=Op(e);return[_p(e),t,_p(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Rp(s,m,h,w));const S=[s,...x],_=await Dp(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=vp(e),o=Sp(e),a=wp(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Op(i)),[i,Op(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=S[e];if(t){if(!("alignment"===d&&v!==Ep(t))||k.every(e=>Ep(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 R;const e=null==(R=k.filter(e=>{if(E){const t=Ep(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:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Ah=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}=gp(e,t),u=await Dp(t,c),d=yp(o),f=vp(o),p="y"===Ep(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=lp(m-u[g],v),x=lp(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=cp(u.left,0),t=cp(u.right,0),n=cp(u.top,0),r=cp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:cp(u.left,u.right)):S=m-2*(0!==n||0!==r?n+r:cp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const C=await i.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Th=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=gp(e,t);switch(r){case"referenceHidden":{const e=$p(await Dp(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ip(e)}}}case"escaped":{const e=$p(await Dp(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ip(e)}}}default:return{}}}}},Dh=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}=gp(e,t)||{};if(null==c)return{};const d=Pp(u),f={x:n,y:r},p=Sp(o),h=wp(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,C=S/2-m[h]/2-1,k=lp(d[y],C),N=lp(d[v],C),M=k,R=S-m[h]-N,O=S/2-m[h]/2+_,P=mp(M,O,R),A=!l.arrow&&null!=vp(o)&&O!==P&&a.reference[h]/2-(O<M?k:N)-m[h]/2<0,T=A?O<M?O-M:O-R:0;return{[p]:f[p]+T,data:{[p]:P,centerOffset:O-P-T,...A&&{alignmentOffset:T}},reset:A}}}),$h=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}=gp(e,t),u={x:n,y:r},d=Ep(o),f=bp(d);let p=u[f],h=u[d];const m=gp(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=zp.has(yp(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}}}},Ih=(e,t,n)=>{const r=new Map,o={platform:kh,...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}=Tp(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}=Tp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};var zh="undefined"!=typeof document?e.useLayoutEffect:function(){};function Lh(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(!Lh(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)&&!Lh(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Bh(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fh(e,t){const n=Bh(e);return Math.round(t*n)/n}function jh(e){const t=o.useRef(e);return zh(()=>{t.current=e}),t}const Hh=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?Dh({element:n.current,padding:r}).fn(t):{}:n?Dh({element:n,padding:r}).fn(t):{};var o}}),Vh=(e,t)=>({...Rh(e),options:[e,t]}),Wh=(e,t)=>({...Oh(e),options:[e,t]}),Yh=(e,t)=>({...$h(e),options:[e,t]}),Xh=(e,t)=>({...Ph(e),options:[e,t]}),Kh=(e,t)=>({...Ah(e),options:[e,t]}),Uh=(e,t)=>({...Th(e),options:[e,t]}),qh=(e,t)=>({...Hh(e),options:[e,t]});var Zh=o.forwardRef((e,t)=>{const{children:r,width:o=10,height:a=5,...i}=e;return n.jsx(Fu.svg,{...i,ref:t,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Zh.displayName="Arrow";var Gh=Zh;function Qh(e){const[t,n]=o.useState(void 0);return Ou(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var Jh="Popper",[em,tm]=Mu(Jh),[nm,rm]=em(Jh),om=e=>{const{__scopePopper:t,children:r}=e,[a,i]=o.useState(null);return n.jsx(nm,{scope:t,anchor:a,onAnchorChange:i,children:r})};om.displayName=Jh;var am="PopperAnchor",im=o.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:a,...i}=e,s=rm(am,r),l=o.useRef(null),c=Nu(t,l),u=o.useRef(null);return o.useEffect(()=>{const e=u.current;u.current=a?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:n.jsx(Fu.div,{...i,ref:c})});im.displayName=am;var sm="PopperContent",[lm,cm]=em(sm),um=o.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,b=rm(sm,r),[w,x]=o.useState(null),E=Nu(t,e=>x(e)),[S,_]=o.useState(null),C=Qh(S),k=C?.width??0,N=C?.height??0,M=i+("center"!==l?"-"+l:""),R="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},O=Array.isArray(f)?f:[f],P=O.length>0,A={padding:R,boundary:O.filter(hm),altBoundary:P},{refs:T,floatingStyles:D,placement:$,isPositioned:I,middlewareData:z}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);Lh(h,r)||m(r);const[g,y]=o.useState(null),[v,b]=o.useState(null),w=o.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=o.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=s||g,S=l||v,_=o.useRef(null),C=o.useRef(null),k=o.useRef(f),N=null!=u,M=jh(u),R=jh(i),O=jh(d),P=o.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),Ih(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};A.current&&!Lh(k.current,t)&&(k.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,R,O]);zh(()=>{!1===d&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=o.useRef(!1);zh(()=>(A.current=!0,()=>{A.current=!1}),[]),zh(()=>{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=o.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),D=o.useMemo(()=>({reference:E,floating:S}),[E,S]),$=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=Fh(D.floating,f.x),r=Fh(D.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Bh(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,D.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:P,refs:T,elements:D,floatingStyles:$}),[f,P,T,D,$])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Mh(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[Vh({mainAxis:s+N,alignmentAxis:c}),d&&Wh({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Yh():void 0,...A}),d&&Xh({...A}),Kh({...A,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`)}}),S&&qh({element:S,padding:u}),mm({arrowWidth:k,arrowHeight:N}),m&&Uh({strategy:"referenceHidden",...A})]}),[L,B]=gm($),F=ju(y);Ou(()=>{I&&F?.()},[I,F]);const j=z.arrow?.x,H=z.arrow?.y,V=0!==z.arrow?.centerOffset,[W,Y]=o.useState();return Ou(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(lm,{scope:r,placedSide:L,onArrowChange:_,arrowX:j,arrowY:H,shouldHideArrow:V,children:n.jsx(Fu.div,{"data-side":L,"data-align":B,...v,ref:E,style:{...v.style,animation:I?void 0:"none"}})})})});um.displayName=sm;var dm="PopperArrow",fm={top:"bottom",right:"left",bottom:"top",left:"right"},pm=o.forwardRef(function(e,t){const{__scopePopper:r,...o}=e,a=cm(dm,r),i=fm[a.placedSide];return n.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:n.jsx(Gh,{...o,ref:t,style:{...o.style,display:"block"}})})});function hm(e){return null!==e}pm.displayName=dm;var mm=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]=gm(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 gm(e){const[t,n="center"]=e.split("-");return[t,n]}var ym=om,vm=im,bm=um,wm=pm;function xm(e){const t=o.useRef({value:e,previous:e});return o.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Em=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"});o.forwardRef((e,t)=>n.jsx(Fu.span,{...e,ref:t,style:{...Em,...e.style}})).displayName="VisuallyHidden";var Sm=[" ","Enter","ArrowUp","ArrowDown"],_m=[" ","Enter"],Cm="Select",[km,Nm,Mm]=function(t){const r=t+"CollectionProvider",[o,a]=Mu(r),[i,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:r,children:o}=t,a=e.useRef(null),s=e.useRef(new Map).current;return n.jsx(i,{scope:r,itemMap:s,collectionRef:a,children:o})};l.displayName=r;const c=t+"CollectionSlot",u=Iu(c),d=e.forwardRef((e,t)=>{const{scope:r,children:o}=e,a=Nu(t,s(c,r).collectionRef);return n.jsx(u,{ref:a,children:o})});d.displayName=c;const f=t+"CollectionItemSlot",p="data-radix-collection-item",h=Iu(f),m=e.forwardRef((t,r)=>{const{scope:o,children:a,...i}=t,l=e.useRef(null),c=Nu(r,l),u=s(f,o);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),n.jsx(h,{[p]:"",ref:c,children:a})});return m.displayName=f,[{Provider:l,Slot:d,ItemSlot:m},function(n){const r=s(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},a]}(Cm),[Rm,Om]=Mu(Cm,[Mm,tm]),Pm=tm(),[Am,Tm]=Rm(Cm),[Dm,$m]=Rm(Cm),Im=e=>{const{__scopeSelect:t,children:r,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:m,form:g}=e,y=Pm(t),[v,b]=o.useState(null),[w,x]=o.useState(null),[E,S]=o.useState(!1),_=function(e){const t=o.useContext(ip);return e||t||"ltr"}(d),[C,k]=$u({prop:a,defaultProp:i??!1,onChange:s,caller:Cm}),[N,M]=$u({prop:l,defaultProp:c,onChange:u,caller:Cm}),R=o.useRef(null),O=!v||(g||!!v.closest("form")),[P,A]=o.useState(new Set),T=Array.from(P).map(e=>e.props.value).join(";");return n.jsx(ym,{...y,children:n.jsxs(Am,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:Tu(),value:N,onValueChange:M,open:C,onOpenChange:k,dir:_,triggerPointerDownPosRef:R,disabled:h,children:[n.jsx(km.Provider,{scope:t,children:n.jsx(Dm,{scope:e.__scopeSelect,onNativeOptionAdd:o.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:o.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),O?n.jsxs(Eg,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===N?n.jsx("option",{value:""}):null,Array.from(P)]},T):null]})})};Im.displayName=Cm;var zm="SelectTrigger",Lm=o.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:a=!1,...i}=e,s=Pm(r),l=Tm(zm,r),c=l.disabled||a,u=Nu(t,l.onTriggerChange),d=Nm(r),f=o.useRef("touch"),[p,h,m]=_g(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),r=Cg(t,e,n);void 0!==r&&l.onValueChange(r.value)}),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return n.jsx(vm,{asChild:!0,...s,children:n.jsx(Fu.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Sg(l.value)?"":void 0,...i,ref:u,onClick:_u(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:_u(i.onPointerDown,e=>{f.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:_u(i.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Sm.includes(e.key)&&(g(),e.preventDefault())})})})});Lm.displayName=zm;var Bm="SelectValue",Fm=o.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:a,children:i,placeholder:s="",...l}=e,c=Tm(Bm,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,f=Nu(t,c.onValueNodeChange);return Ou(()=>{u(d)},[u,d]),n.jsx(Fu.span,{...l,ref:f,style:{pointerEvents:"none"},children:Sg(c.value)?n.jsx(n.Fragment,{children:s}):i})});Fm.displayName=Bm;var jm=o.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...a}=e;return n.jsx(Fu.span,{"aria-hidden":!0,...a,ref:t,children:o||"▼"})});jm.displayName="SelectIcon";var Hm=e=>n.jsx(sd,{asChild:!0,...e});Hm.displayName="SelectPortal";var Vm="SelectContent",Wm=o.forwardRef((e,t)=>{const r=Tm(Vm,e.__scopeSelect),[i,s]=o.useState();if(Ou(()=>{s(new DocumentFragment)},[]),!r.open){const t=i;return t?a.createPortal(n.jsx(Xm,{scope:e.__scopeSelect,children:n.jsx(km.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),t):null}return n.jsx(qm,{...e,ref:t})});Wm.displayName=Vm;var Ym=10,[Xm,Km]=Rm(Vm),Um=Iu("SelectContent.RemoveScroll"),qm=o.forwardRef((e,t)=>{const{__scopeSelect:r,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,w=Tm(Vm,r),[x,E]=o.useState(null),[S,_]=o.useState(null),C=Nu(t,e=>E(e)),[k,N]=o.useState(null),[M,R]=o.useState(null),O=Nm(r),[P,A]=o.useState(!1),T=o.useRef(!1);o.useEffect(()=>{if(x)return lf(x)},[x]),dd();const D=o.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]),$=o.useCallback(()=>D([k,x]),[D,k,x]);o.useEffect(()=>{P&&$()},[P,$]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;o.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]),o.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]=_g(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Cg(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=o.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]),j=o.useCallback(()=>x?.focus(),[x]),H=o.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&R(e)},[w.value]),V="popper"===a?Gm:Zm,W=V===Gm?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return n.jsx(Xm,{scope:r,content:x,viewport:S,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:j,itemTextRefCallback:H,focusSelectedItem:$,selectedItemText:M,position:a,isPositioned:P,searchRef:L,children:n.jsx(ef,{as:Um,allowPinchZoom:!0,children:n.jsx(ed,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:_u(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:n.jsx(Ku,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:n.jsx(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...W,onPlaced:()=>A(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:_u(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()}})})})})})})});qm.displayName="SelectContentImpl";var Zm=o.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:a,...i}=e,s=Tm(Vm,r),l=Km(Vm,r),[c,u]=o.useState(null),[d,f]=o.useState(null),p=Nu(t,e=>f(e)),h=Nm(r),m=o.useRef(!1),g=o.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,x=o.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,a=n.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-Ym,d=ap(a,[Ym,Math.max(Ym,u-l)]);c.style.minWidth=s+"px",c.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,l=Math.max(s,t.width),u=window.innerWidth-Ym,d=ap(a,[Ym,Math.max(Ym,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const o=h(),i=window.innerHeight-2*Ym,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+p+l+parseInt(u.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),C=e.top+e.height/2-Ym,k=i-C,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),R=w-M;if(M<=C){const e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(k,N+(e?_:0)+t+g);c.style.height=n+"px"}else{const e=o.length>0&&v===o[0].ref.current;c.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?S:0)+N)+R;c.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}c.style.margin=`${Ym}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,a]);Ou(()=>x(),[x]);const[E,S]=o.useState();Ou(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const _=o.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return n.jsx(Qm,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:n.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:n.jsx(Fu.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Zm.displayName="SelectItemAlignedPosition";var Gm=o.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:a=Ym,...i}=e,s=Pm(r);return n.jsx(bm,{...s,...i,ref:t,align:o,collisionPadding:a,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)"}})});Gm.displayName="SelectPopperPosition";var[Qm,Jm]=Rm(Vm,{}),eg="SelectViewport",tg=o.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:a,...i}=e,s=Km(eg,r),l=Jm(eg,r),c=Nu(t,s.onViewportChange),u=o.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("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:a}),n.jsx(km.Slot,{scope:r,children:n.jsx(Fu.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:_u(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Ym,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")}}}u.current=t.scrollTop})})})]})});tg.displayName=eg;var ng="SelectGroup",[rg,og]=Rm(ng);o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,a=Tu();return n.jsx(rg,{scope:r,id:a,children:n.jsx(Fu.div,{role:"group","aria-labelledby":a,...o,ref:t})})}).displayName=ng;var ag="SelectLabel",ig=o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,a=og(ag,r);return n.jsx(Fu.div,{id:a.id,...o,ref:t})});ig.displayName=ag;var sg="SelectItem",[lg,cg]=Rm(sg),ug=o.forwardRef((e,t)=>{const{__scopeSelect:r,value:a,disabled:i=!1,textValue:s,...l}=e,c=Tm(sg,r),u=Km(sg,r),d=c.value===a,[f,p]=o.useState(s??""),[h,m]=o.useState(!1),g=Nu(t,e=>u.itemRefCallback?.(e,a,i)),y=Tu(),v=o.useRef("touch"),b=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)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 n.jsx(lg,{scope:r,value:a,disabled:i,textId:y,isSelected:d,onItemTextChange:o.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:n.jsx(km.ItemSlot,{scope:r,value:a,disabled:i,textValue:f,children:n.jsx(Fu.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:_u(l.onFocus,()=>m(!0)),onBlur:_u(l.onBlur,()=>m(!1)),onClick:_u(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:_u(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:_u(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:_u(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_u(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:_u(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(_m.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});ug.displayName=sg;var dg="SelectItemText",fg=o.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:s,...l}=e,c=Tm(dg,r),u=Km(dg,r),d=cg(dg,r),f=$m(dg,r),[p,h]=o.useState(null),m=Nu(t,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,y=o.useMemo(()=>n.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return Ou(()=>(v(y),()=>b(y)),[v,b,y]),n.jsxs(n.Fragment,{children:[n.jsx(Fu.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});fg.displayName=dg;var pg="SelectItemIndicator",hg=o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return cg(pg,r).isSelected?n.jsx(Fu.span,{"aria-hidden":!0,...o,ref:t}):null});hg.displayName=pg;var mg="SelectScrollUpButton",gg=o.forwardRef((e,t)=>{const r=Km(mg,e.__scopeSelect),a=Jm(mg,e.__scopeSelect),[i,s]=o.useState(!1),l=Nu(t,a.onScrollButtonChange);return Ou(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?n.jsx(bg,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});gg.displayName=mg;var yg="SelectScrollDownButton",vg=o.forwardRef((e,t)=>{const r=Km(yg,e.__scopeSelect),a=Jm(yg,e.__scopeSelect),[i,s]=o.useState(!1),l=Nu(t,a.onScrollButtonChange);return Ou(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?n.jsx(bg,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});vg.displayName=yg;var bg=o.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:a,...i}=e,s=Km("SelectScrollButton",r),l=o.useRef(null),c=Nm(r),u=o.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return o.useEffect(()=>()=>u(),[u]),Ou(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),n.jsx(Fu.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:_u(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:_u(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:_u(i.onPointerLeave,()=>{u()})})}),wg=o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return n.jsx(Fu.div,{"aria-hidden":!0,...o,ref:t})});wg.displayName="SelectSeparator";var xg="SelectArrow";o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,a=Pm(r),i=Tm(xg,r),s=Km(xg,r);return i.open&&"popper"===s.position?n.jsx(wm,{...a,...o,ref:t}):null}).displayName=xg;var Eg=o.forwardRef(({__scopeSelect:e,value:t,...r},a)=>{const i=o.useRef(null),s=Nu(a,i),l=xm(t);return o.useEffect(()=>{const e=i.current;if(!e)return;const n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,"value").set;if(l!==t&&r){const n=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[l,t]),n.jsx(Fu.select,{...r,style:{...Em,...r.style},ref:s,defaultValue:t})});function Sg(e){return""===e||void 0===e}function _g(e){const t=ju(e),n=o.useRef(""),r=o.useRef(0),a=o.useCallback(e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),i=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function Cg(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}Eg.displayName="SelectBubbleInput";var kg=Lm,Ng=jm,Mg=Hm,Rg=Wm,Og=tg,Pg=ig,Ag=ug,Tg=fg,Dg=hg,$g=gg,Ig=vg,zg=wg;const Lg=Im,Bg=Fm,Fg=Sc(kg)`
|
|
338
|
+
`,ru=({stamps:t,currentStep:n,onStepChange:o,onToggle:r})=>{const a=t.length>0?Math.max(...t.map(e=>e.step)):0,i=t.length>0?Math.min(...t.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return e.createElement(Kc,null,e.createElement(Uc,null,e.createElement(qc,null,"Timeline"),r&&e.createElement(Zc,{onClick:r,title:"Collapse Panel"},e.createElement(ws,{size:16}))),e.createElement(Gc,null,Array.from({length:s},(r,a)=>{const s=i+a,c=s===n,u=s<n,d=t.some(e=>e.step===s),f=(e=>{const n=t.filter(t=>t.step===e);if(0===n.length)return null;const o=e-1,r=t.filter(e=>e.step===o);return 0===r.length?null:Math.min(...n.map(e=>e.time))-Math.max(...r.map(e=>e.time))})(s),p=(e=>{const n=t.filter(t=>t.step===e);return 0===n.length?`Step ${e}`:n[0]?.identifier||`Step ${e}`})(s);return e.createElement(Qc,{key:s,isActive:c,isPast:u,hasStep:d,onClick:()=>d&&o(s)},e.createElement(Jc,null,e.createElement(eu,{isActive:c,isPast:u,hasStep:d}),e.createElement(tu,{isActive:c},"Step ",s),f&&e.createElement("div",{style:{marginLeft:"auto"}},e.createElement(dc,{variant:l(f)},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(f)))),e.createElement(nu,{hasStep:d},d?p:"No activity"),c&&e.createElement(ou,null))})))};function au(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function iu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function su(...e){return t=>{let n=!1;const o=e.map(e=>{const o=iu(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():iu(e[t],null)}}}}function lu(...e){return r.useCallback(su(...e),e)}function cu(e,t=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(t,a){const i=r.createContext(a),s=o.length;o=[...o,a];const l=t=>{const{scope:o,children:a,...l}=t,c=o?.[e]?.[s]||i,u=r.useMemo(()=>l,Object.values(l));return n.jsx(c.Provider,{value:u,children:a})};return l.displayName=t+"Provider",[l,function(n,o){const l=o?.[e]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},uu(a,...t)]}function uu(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var du=globalThis?.document?r.useLayoutEffect:()=>{},fu=r[" useId ".trim().toString()]||(()=>{}),pu=0;function hu(e){const[t,n]=r.useState(fu());return du(()=>{e||n(e=>e??String(pu++))},[e]),e||(t?`radix-${t}`:"")}var mu=r[" useInsertionEffect ".trim().toString()]||du;function gu({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return mu(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.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.`)}t.current=l},[l,o])}const u=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,u]}function yu(e){const t=vu(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,s=r.Children.toArray(a),l=s.find(wu);if(l){const e=l.props.children,a=s.map(t=>t===l?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return n.jsx(t,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return n.jsx(t,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}function vu(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=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}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?su(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bu=Symbol("radix.slottable");function wu(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===bu}var xu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const o=yu(`Primitive.${t}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,s=a?o:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),n.jsx(s,{...i,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function Eu(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var Su,_u="dismissableLayer.update",Cu="dismissableLayer.pointerDownOutside",ku="dismissableLayer.focusOutside",Nu=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mu=r.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=r.useContext(Nu),[f,p]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=r.useState({}),g=lu(t,e=>p(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(e,t=globalThis?.document){const n=Eu(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){Au(Cu,n,r,{discrete:!0})};const r={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=o,t.addEventListener("click",a.current,{once:!0})):o()}else t.removeEventListener("click",a.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},h),_=function(e,t=globalThis?.document){const n=Eu(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){Au(ku,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=Eu(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),r.useEffect(()=>{if(f)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Su=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ou(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Su)}},[f,h,o,d]),r.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ou())},[f,d]),r.useEffect(()=>{const e=()=>m({});return document.addEventListener(_u,e),()=>document.removeEventListener(_u,e)},[]),n.jsx(xu.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:au(e.onFocusCapture,_.onFocusCapture),onBlurCapture:au(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:au(e.onPointerDownCapture,S.onPointerDownCapture)})});Mu.displayName="DismissableLayer";var Ru=r.forwardRef((e,t)=>{const o=r.useContext(Nu),a=r.useRef(null),i=lu(t,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),n.jsx(xu.div,{...e,ref:i})});function Ou(){const e=new CustomEvent(_u);document.dispatchEvent(e)}function Au(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(r,i):r.dispatchEvent(i)}Ru.displayName="DismissableLayerBranch";var Pu="focusScope.autoFocusOnMount",Tu="focusScope.autoFocusOnUnmount",Du={bubbles:!1,cancelable:!0},$u=r.forwardRef((e,t)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=r.useState(null),d=Eu(i),f=Eu(s),p=r.useRef(null),h=lu(t,e=>u(e)),m=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:Bu(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Bu(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Bu(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,m.paused]),r.useEffect(()=>{if(c){Fu.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(Pu,Du);c.addEventListener(Pu,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Bu(o,{select:t}),document.activeElement!==n)return}((e=Iu(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Bu(c))}return()=>{c.removeEventListener(Pu,d),setTimeout(()=>{const e=new CustomEvent(Tu,Du);c.addEventListener(Tu,f),c.dispatchEvent(e),e.defaultPrevented||Bu(t??document.body,{select:!0}),c.removeEventListener(Tu,f),Fu.remove(m)},0)}}var e},[c,d,f,m]);const g=r.useCallback(e=>{if(!o&&!a)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=Iu(e),n=zu(t,e),o=zu(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&Bu(a,{select:!0})):(e.preventDefault(),o&&Bu(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,m.paused]);return n.jsx(xu.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function Iu(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 zu(e,t){for(const n of e)if(!Lu(n,{upTo:t}))return n}function Lu(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 Bu(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()}}$u.displayName="FocusScope";var Fu=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ju(e,t),e.unshift(t)},remove(t){e=ju(e,t),e[0]?.resume()}}}();function ju(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Hu=r.forwardRef((e,o)=>{const{container:a,...i}=e,[s,l]=r.useState(!1);du(()=>l(!0),[]);const c=a||s&&globalThis?.document?.body;return c?t.createPortal(n.jsx(xu.div,{...i,ref:o}),c):null});Hu.displayName="Portal";var Wu=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Vu(o.current);i.current="mounted"===l?e:"none"},[l]),du(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=Vu(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),du(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=Vu(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(i.current=Vu(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=lu(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 n||o.isPresent?r.cloneElement(a,{ref:i}):null};function Vu(e){return e?.animationName||"none"}Wu.displayName="Presence";var Yu=0;function Xu(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ku()),document.body.insertAdjacentElement("beforeend",e[1]??Ku()),Yu++,()=>{1===Yu&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Yu--}},[])}function Ku(){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 Uu=function(){return Uu=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Uu.apply(this,arguments)};function qu(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Zu="right-scroll-bar-position",Gu="width-before-scroll-bar";function Qu(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ju="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,ed=new WeakMap;function td(t,n){var o,r,a,i=(o=n||null,r=function(e){return t.forEach(function(t){return Qu(t,e)})},(a=e.useState(function(){return{value:o,callback:r,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=r,a.facade);return Ju(function(){var e=ed.get(i);if(e){var n=new Set(e),o=new Set(t),r=i.current;n.forEach(function(e){o.has(e)||Qu(e,null)}),o.forEach(function(e){n.has(e)||Qu(e,r)})}ed.set(i,t)},[t]),i}function nd(e){return e}var od=function(e){var t=e.sideCar,n=qu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return r.createElement(o,Uu({},n))};od.isSideCarExport=!0;var rd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=nd);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return r}(null);return t.options=Uu({async:!0,ssr:!1},e),t}(),ad=function(){},id=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:ad,onWheelCapture:ad,onTouchMoveCapture:ad}),a=o[0],i=o[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,x=qu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=td([n,t]),_=Uu(Uu({},x),a);return r.createElement(r.Fragment,null,d&&r.createElement(E,{sideCar:rd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?r.cloneElement(r.Children.only(l),Uu(Uu({},_),{ref:S})):r.createElement(b,Uu({},_,{className:c,ref:S}),l))});id.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},id.classNames={fullWidth:Gu,zeroRight:Zu};function sd(){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 ld=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=sd())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cd=function(){var e,t=(e=ld(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},ud={left:0,top:0,right:0,gap:0},dd=function(e){return parseInt(e||"",10)||0},fd=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"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[dd(n),dd(o),dd(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},pd=cd(),hd="data-scroll-locked",md=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(hd,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Zu," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Gu," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Zu," .").concat(Zu," {\n right: 0 ").concat(o,";\n }\n \n .").concat(Gu," .").concat(Gu," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(hd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},gd=function(){var e=parseInt(document.body.getAttribute(hd)||"0",10);return isFinite(e)?e:0},yd=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,a=void 0===o?"margin":o;r.useEffect(function(){return document.body.setAttribute(hd,(gd()+1).toString()),function(){var e=gd()-1;e<=0?document.body.removeAttribute(hd):document.body.setAttribute(hd,e.toString())}},[]);var i=r.useMemo(function(){return fd(a)},[a]);return r.createElement(pd,{styles:md(i,!t,a,n?"":"!important")})},vd=!1;if("undefined"!=typeof window)try{var bd=Object.defineProperty({},"passive",{get:function(){return vd=!0,!0}});window.addEventListener("test",bd,bd),window.removeEventListener("test",bd,bd)}catch(e){vd=!1}var wd=!!vd&&{passive:!1},xd=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])},Ed=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),Sd(e,o)){var r=_d(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Sd=function(e,t){return"v"===e?function(e){return xd(e,"overflowY")}(t):function(e){return xd(e,"overflowX")}(t)},_d=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},Cd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kd=function(e){return[e.deltaX,e.deltaY]},Nd=function(e){return e&&"current"in e?e.current:e},Md=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Rd=0,Od=[];function Ad(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Pd,Td=(Pd=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),a=r.useState(Rd++)[0],i=r.useState(cd)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Nd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,a=Cd(e),i=n.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=Ed(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=Ed(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=r),!r)return!0;var p=o.current||r;return function(e,t,n,o,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*o,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=_d(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&Sd(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(d)<1||!r&&i>d)||!u&&(r&&Math.abs(f)<1||!r&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(Od.length&&Od[Od.length-1]===i){var o="deltaY"in n?kd(n):Cd(n),r=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=o,t[0]===r[0]&&t[1]===r[1]);var t,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var a=(s.current.shards||[]).map(Nd).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?l(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=r.useCallback(function(e,n,o,r){var a={name:e,delta:n,target:o,should:r,shadowParent:Ad(o)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=r.useCallback(function(e){n.current=Cd(e),o.current=void 0},[]),f=r.useCallback(function(t){u(t.type,kd(t),t.target,l(t,e.lockRef.current))},[]),p=r.useCallback(function(t){u(t.type,Cd(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return Od.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,wd),document.addEventListener("touchmove",c,wd),document.addEventListener("touchstart",d,wd),function(){Od=Od.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,wd),document.removeEventListener("touchmove",c,wd),document.removeEventListener("touchstart",d,wd)}},[]);var h=e.removeScrollBar,m=e.inert;return r.createElement(r.Fragment,null,m?r.createElement(i,{styles:Md(a)}):null,h?r.createElement(yd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},rd.useMedium(Pd),od),Dd=r.forwardRef(function(e,t){return r.createElement(id,Uu({},e,{ref:t,sideCar:Td}))});Dd.classNames=id.classNames;var $d=Dd,Id=new WeakMap,zd=new WeakMap,Ld={},Bd=0,Fd=function(e){return e&&(e.host||Fd(e.parentNode))},jd=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Fd(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]);Ld[n]||(Ld[n]=new WeakMap);var a=Ld[n],i=[],s=new Set,l=new Set(r),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};r.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,l=(Id.get(e)||0)+1,c=(a.get(e)||0)+1;Id.set(e,l),a.set(e,c),i.push(e),1===l&&r&&zd.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Bd++,function(){i.forEach(function(e){var t=Id.get(e)-1,r=a.get(e)-1;Id.set(e,t),a.set(e,r),t||(zd.has(e)||e.removeAttribute(o),zd.delete(e)),r||e.removeAttribute(n)}),--Bd||(Id=new WeakMap,Id=new WeakMap,zd=new WeakMap,Ld={})}},Hd=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),jd(o,r,n,"aria-hidden")):function(){return null}},Wd="Dialog",[Vd,Yd]=cu(Wd),[Xd,Kd]=Vd(Wd),Ud=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=r.useRef(null),u=r.useRef(null),[d,f]=gu({prop:a,defaultProp:i??!1,onChange:s,caller:Wd});return n.jsx(Xd,{scope:t,triggerRef:c,contentRef:u,contentId:hu(),titleId:hu(),descriptionId:hu(),open:d,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:l,children:o})};Ud.displayName=Wd;var qd="DialogTrigger",Zd=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Kd(qd,o),i=lu(t,a.triggerRef);return n.jsx(xu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":yf(a.open),...r,ref:i,onClick:au(e.onClick,a.onOpenToggle)})});Zd.displayName=qd;var Gd="DialogPortal",[Qd,Jd]=Vd(Gd,{forceMount:void 0}),ef=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:i}=e,s=Kd(Gd,t);return n.jsx(Qd,{scope:t,forceMount:o,children:r.Children.map(a,e=>n.jsx(Wu,{present:o||s.open,children:n.jsx(Hu,{asChild:!0,container:i,children:e})}))})};ef.displayName=Gd;var tf="DialogOverlay",nf=r.forwardRef((e,t)=>{const o=Jd(tf,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=Kd(tf,e.__scopeDialog);return i.modal?n.jsx(Wu,{present:r||i.open,children:n.jsx(rf,{...a,ref:t})}):null});nf.displayName=tf;var of=yu("DialogOverlay.RemoveScroll"),rf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Kd(tf,o);return n.jsx($d,{as:of,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(xu.div,{"data-state":yf(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),af="DialogContent",sf=r.forwardRef((e,t)=>{const o=Jd(af,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=Kd(af,e.__scopeDialog);return n.jsx(Wu,{present:r||i.open,children:i.modal?n.jsx(lf,{...a,ref:t}):n.jsx(cf,{...a,ref:t})})});sf.displayName=af;var lf=r.forwardRef((e,t)=>{const o=Kd(af,e.__scopeDialog),a=r.useRef(null),i=lu(t,o.contentRef,a);return r.useEffect(()=>{const e=a.current;if(e)return Hd(e)},[]),n.jsx(uf,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:au(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:au(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:au(e.onFocusOutside,e=>e.preventDefault())})}),cf=r.forwardRef((e,t)=>{const o=Kd(af,e.__scopeDialog),a=r.useRef(!1),i=r.useRef(!1);return n.jsx(uf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,r=o.triggerRef.current?.contains(n);r&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),uf=r.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=Kd(af,o),u=r.useRef(null),d=lu(t,u);return Xu(),n.jsxs(n.Fragment,{children:[n.jsx($u,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:n.jsx(Mu,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":yf(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(xf,{titleId:c.titleId}),n.jsx(Ef,{contentRef:u,descriptionId:c.descriptionId})]})]})}),df="DialogTitle",ff=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Kd(df,o);return n.jsx(xu.h2,{id:a.titleId,...r,ref:t})});ff.displayName=df;var pf="DialogDescription",hf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Kd(pf,o);return n.jsx(xu.p,{id:a.descriptionId,...r,ref:t})});hf.displayName=pf;var mf="DialogClose",gf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Kd(mf,o);return n.jsx(xu.button,{type:"button",...r,ref:t,onClick:au(e.onClick,()=>a.onOpenChange(!1))})});function yf(e){return e?"open":"closed"}gf.displayName=mf;var vf="DialogTitleWarning",[bf,wf]=function(e,t){const o=r.createContext(t),a=e=>{const{children:t,...a}=e,i=r.useMemo(()=>a,Object.values(a));return n.jsx(o.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(n){const a=r.useContext(o);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(vf,{contentName:af,titleName:df,docsSlug:"dialog"}),xf=({titleId:e})=>{const t=wf(vf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return r.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},Ef=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wf("DialogDescriptionWarning").contentName}}.`;return r.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");if(t&&o){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},Sf=Ud,_f=Zd,Cf=ef,kf=nf,Nf=sf,Mf=ff,Rf=hf,Of=gf;const Af=Sf,Pf=_f,Tf=Cf,Df=r.forwardRef(({className:e,...t},n)=>r.createElement(kf,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:e,...t,ref:n}));Df.displayName=kf.displayName;const $f=(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"}}},If=r.forwardRef(({side:e="right",className:t,children:n,...o},a)=>r.createElement(Tf,null,r.createElement(Df,null),r.createElement(Nf,{ref:a,style:$f(e),className:t,...o},n,r.createElement(Of,{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"}},r.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),r.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")))));If.displayName=Nf.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Mf,{ref:n,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:e,...t})).displayName=Mf.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Rf,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=Rf.displayName;const zf=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{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,o+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of i){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=o,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),o=m.get(x[t]);if(Math.sqrt((o.x-n.x)**2+(o.y-n.y)**2)<w){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const a=w/r,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,o.x+=i,o.y+=s}else n.x-=w/2,o.x+=w/2}}return m},Lf={Agent:Dc,Tool:Dc,Coordinator:Dc},Bf=({flowData:t,width:n="100%",height:o="1000px",className:r="",defaultZoom:a=1,defaultPan:i={x:0,y:0},disableAutoFit:s=!0,showTimeline:l=!1,minNodeSpacing:c=200})=>{const{theme:u}=Kl(),d=u.colors,f=t;if(!f)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:`1px solid ${d.border}`,borderRadius:"8px",background:d.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:r},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:d.mutedForeground,marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:d.mutedForeground}},"Please provide flowData prop")));const p=e.useRef(null),h=e.useRef(null),[m,g]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[y,v]=e.useState(0),[b,w]=e.useState(!1),x=e.useRef(null),[E,S]=e.useState(!1),_=e.useMemo(()=>{const e=f.stamps||f.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[f.stamps,f.steps]);e.useEffect(()=>(b?x.current=setInterval(()=>{v(e=>e>=_?(w(!1),e):e+1)},250):x.current&&(clearInterval(x.current),x.current=null),()=>{x.current&&clearInterval(x.current)}),[b,_]),e.useEffect(()=>{const e=f.stamps||f.steps||[];e.length>0&&v(Math.max(...e.map(e=>e.step)))},[f.stamps,f.steps]),e.useEffect(()=>{const e=()=>{if(p.current){const e=p.current.getBoundingClientRect();g({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&p.current){const t=new ResizeObserver(e);return t.observe(p.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const C=e.useMemo(()=>{if(!f.nodes)return new Map;const e=Math.max(m.width||800,1200);return zf(f.nodes,f.edges||[],{minNodeSpacing:c,containerWidth:e})},[f.nodes,f.edges,m.width,c]),k=e.useCallback(e=>f.nodes?f.nodes.filter(t=>t.stamp.step<=e):[],[f.nodes]),N=e.useCallback(e=>(f.edges||[]).filter(t=>t.stamp.step<=e),[f.edges]),M=e.useMemo(()=>{const e=k(y),t=N(y);return e.map(e=>{const n=C.get(e.identifier)||{x:0,y:0},o=e.stamp.step===y,r="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:o,id:e.identifier,edges:t,edgeDetails:r},style:{filter:o?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[C,y,k,N]),R=e.useMemo(()=>N(y).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===y;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?d.primary:d.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?ic(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?ic(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[y,N,d.primary,d.mutedForeground]),[O,A,P]=Ji(M),[T,D,$]=es(R);e.useEffect(()=>{A(M)},[M,A]),e.useEffect(()=>{D(R)},[R,D]);const I=e.useCallback(e=>D(t=>xr(e,t)),[D]),z=e.useCallback(e=>{v(e),w(!1)},[]);e.useCallback(()=>{w(e=>!e)},[]);const L=(e,t)=>{if(!h.current)return{x:0,y:0};const n=h.current.createSVGPoint();n.x=e,n.y=t;const o=n.matrixTransform(h.current.getScreenCTM()?.inverse());return{x:o.x,y:o.y}},B=Ca();return e.useEffect(()=>{if(s||!B||0===M.length)return;const e=new Map;R.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const o=e.get(t.target)||0;e.set(t.target,o+1)});let t="",n=0;e.forEach((e,o)=>{e>n&&(n=e,t=o)}),!t&&M.length>0&&(t=M[0].id),t&&setTimeout(()=>{B.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:a,maxZoom:1})},500)},[M,R,B,s,a]),e.createElement("div",{ref:p,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:`1px solid ${d.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:d.background},className:r},l&&e.createElement(Af,{open:E,onOpenChange:S},e.createElement(Pf,{asChild:!0},e.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:d.card,border:`1px solid ${d.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=d.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=d.card},title:"Open Timeline"},e.createElement(ws,{size:20,style:{color:d.mutedForeground}}))),e.createElement(Tf,null,e.createElement(Nf,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:d.background,borderRight:`1px solid ${d.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()},e.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},e.createElement("div",{style:{flex:1,overflowY:"auto"}},e.createElement(ru,{stamps:f.stamps||f.steps||[],currentStep:y,onStepChange:z}))),e.createElement(Of,{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:d.mutedForeground},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"))))),e.createElement(Gi,{nodes:O,edges:T,onNodesChange:P,onEdgesChange:$,onConnect:I,nodeTypes:Lf,edgeTypes:{default:t=>e.createElement(Ul,{...t,clientToSvgCoords:L,svgRef:h})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:i.x,y:i.y,zoom:a},onInit:()=>{if(p.current){const e=p.current.querySelector("svg");e&&(h.current=e)}}},e.createElement(ls,{variant:ts.Lines,color:d.mutedBorder,gap:16})),e.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${d.card};\n color: ${d.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${d.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 `))};function Ff(e,[t,n]){return Math.min(n,Math.max(t,e))}var jf=r.createContext(void 0);const Hf=["top","right","bottom","left"],Wf=Math.min,Vf=Math.max,Yf=Math.round,Xf=Math.floor,Kf=e=>({x:e,y:e}),Uf={left:"right",right:"left",bottom:"top",top:"bottom"},qf={start:"end",end:"start"};function Zf(e,t,n){return Vf(e,Wf(t,n))}function Gf(e,t){return"function"==typeof e?e(t):e}function Qf(e){return e.split("-")[0]}function Jf(e){return e.split("-")[1]}function ep(e){return"x"===e?"y":"x"}function tp(e){return"y"===e?"height":"width"}const np=new Set(["top","bottom"]);function op(e){return np.has(Qf(e))?"y":"x"}function rp(e){return ep(op(e))}function ap(e){return e.replace(/start|end/g,e=>qf[e])}const ip=["left","right"],sp=["right","left"],lp=["top","bottom"],cp=["bottom","top"];function up(e,t,n,o){const r=Jf(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?sp:ip:t?ip:sp;case"left":case"right":return t?lp:cp;default:return[]}}(Qf(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(ap)))),a}function dp(e){return e.replace(/left|right|bottom|top/g,e=>Uf[e])}function fp(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 pp(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function hp(e,t,n){let{reference:o,floating:r}=e;const a=op(t),i=rp(t),s=tp(i),l=Qf(t),c="y"===a,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Jf(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function mp(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Gf(t,e),h=fp(p),m=s[f?"floating"===d?"reference":"floating":d],g=pp(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=pp(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 gp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yp(e){return Hf.some(t=>e[t]>=0)}const vp=new Set(["left","top"]);function bp(){return"undefined"!=typeof window}function wp(e){return Sp(e)?(e.nodeName||"").toLowerCase():"#document"}function xp(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ep(e){var t;return null==(t=(Sp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sp(e){return!!bp()&&(e instanceof Node||e instanceof xp(e).Node)}function _p(e){return!!bp()&&(e instanceof Element||e instanceof xp(e).Element)}function Cp(e){return!!bp()&&(e instanceof HTMLElement||e instanceof xp(e).HTMLElement)}function kp(e){return!(!bp()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof xp(e).ShadowRoot)}const Np=new Set(["inline","contents"]);function Mp(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Fp(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Np.has(r)}const Rp=new Set(["table","td","th"]);function Op(e){return Rp.has(wp(e))}const Ap=[":popover-open",":modal"];function Pp(e){return Ap.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Tp=["transform","translate","scale","rotate","perspective"],Dp=["transform","translate","scale","rotate","perspective","filter"],$p=["paint","layout","strict","content"];function Ip(e){const t=zp(),n=_p(e)?Fp(e):e;return Tp.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Dp.some(e=>(n.willChange||"").includes(e))||$p.some(e=>(n.contain||"").includes(e))}function zp(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Lp=new Set(["html","body","#document"]);function Bp(e){return Lp.has(wp(e))}function Fp(e){return xp(e).getComputedStyle(e)}function jp(e){return _p(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hp(e){if("html"===wp(e))return e;const t=e.assignedSlot||e.parentNode||kp(e)&&e.host||Ep(e);return kp(t)?t.host:t}function Wp(e){const t=Hp(e);return Bp(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cp(t)&&Mp(t)?t:Wp(t)}function Vp(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Wp(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=xp(r);if(a){const e=Yp(i);return t.concat(i,i.visualViewport||[],Mp(r)?r:[],e&&n?Vp(e):[])}return t.concat(r,Vp(r,[],n))}function Yp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xp(e){const t=Fp(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Cp(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=Yf(n)!==a||Yf(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Kp(e){return _p(e)?e:e.contextElement}function Up(e){const t=Kp(e);if(!Cp(t))return Kf(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=Xp(t);let i=(a?Yf(n.width):n.width)/o,s=(a?Yf(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const qp=Kf(0);function Zp(e){const t=xp(e);return zp()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:qp}function Gp(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Kp(e);let i=Kf(1);t&&(o?_p(o)&&(i=Up(o)):i=Up(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==xp(e))&&t}(a,n,o)?Zp(a):Kf(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(a){const e=xp(a),t=o&&_p(o)?xp(o):o;let n=e,r=Yp(n);for(;r&&o&&t!==n;){const e=Up(r),t=r.getBoundingClientRect(),o=Fp(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=xp(r),r=Yp(n)}}return pp({width:u,height:d,x:l,y:c})}function Qp(e,t){const n=jp(e).scrollLeft;return t?t.left+n:Gp(Ep(e)).left+n}function Jp(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qp(e,n),y:n.top+t.scrollTop}}const eh=new Set(["absolute","fixed"]);function th(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=xp(e),o=Ep(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){a=r.width,i=r.height;const e=zp();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=Qp(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=Ep(e),n=jp(e),o=e.ownerDocument.body,r=Vf(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Vf(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Qp(e);const s=-n.scrollTop;return"rtl"===Fp(o).direction&&(i+=Vf(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(Ep(e));else if(_p(t))o=function(e,t){const n=Gp(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Cp(e)?Up(e):Kf(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:r*a.x,y:o*a.y}}(t,n);else{const n=Zp(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pp(o)}function nh(e,t){const n=Hp(e);return!(n===t||!_p(n)||Bp(n))&&("fixed"===Fp(n).position||nh(n,t))}function oh(e,t,n){const o=Cp(t),r=Ep(t),a="fixed"===n,i=Gp(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Kf(0);function c(){l.x=Qp(r)}if(o||!o&&!a)if(("body"!==wp(t)||Mp(r))&&(s=jp(t)),o){const e=Gp(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();a&&!o&&r&&c();const u=!r||o||a?Kf(0):Jp(r,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function rh(e){return"static"===Fp(e).position}function ah(e,t){if(!Cp(e)||"fixed"===Fp(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ep(e)===n&&(n=n.ownerDocument.body),n}function ih(e,t){const n=xp(e);if(Pp(e))return n;if(!Cp(e)){let t=Hp(e);for(;t&&!Bp(t);){if(_p(t)&&!rh(t))return t;t=Hp(t)}return n}let o=ah(e,t);for(;o&&Op(o)&&rh(o);)o=ah(o,t);return o&&Bp(o)&&rh(o)&&!Ip(o)?n:o||function(e){let t=Hp(e);for(;Cp(t)&&!Bp(t);){if(Ip(t))return t;if(Pp(t))return null;t=Hp(t)}return null}(e)||n}const sh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=Ep(o),s=!!t&&Pp(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Kf(1);const u=Kf(0),d=Cp(o);if((d||!d&&!a)&&(("body"!==wp(o)||Mp(i))&&(l=jp(o)),Cp(o))){const e=Gp(o);c=Up(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!i||d||a?Kf(0):Jp(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:Ep,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a="clippingAncestors"===n?Pp(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Vp(e,[],!1).filter(e=>_p(e)&&"body"!==wp(e)),r=null;const a="fixed"===Fp(e).position;let i=a?Hp(e):e;for(;_p(i)&&!Bp(i);){const t=Fp(i),n=Ip(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&eh.has(r.position)||Mp(i)&&!n&&nh(e,i))?o=o.filter(e=>e!==i):r=t,i=Hp(i)}return t.set(e,o),o}(t,this._c):[].concat(n),i=[...a,o],s=i[0],l=i.reduce((e,n)=>{const o=th(t,n,r);return e.top=Vf(o.top,e.top),e.right=Wf(o.right,e.right),e.bottom=Wf(o.bottom,e.bottom),e.left=Vf(o.left,e.left),e},th(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ih,getElementRects:async function(e){const t=this.getOffsetParent||ih,n=this.getDimensions,o=await n(e.floating);return{reference:oh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Xp(e);return{width:t,height:n}},getScale:Up,isElement:_p,isRTL:function(e){return"rtl"===Fp(e).direction}};function lh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ch(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Kp(e),u=r||a?[...c?Vp(c):[],...Vp(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,o=null;const r=Ep(e);function a(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Xf(d)+"px "+-Xf(r.clientWidth-(u+f))+"px "+-Xf(r.clientHeight-(d+p))+"px "+-Xf(u)+"px",threshold:Vf(0,Wf(1,l))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!m)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||lh(c,e.getBoundingClientRect())||i(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Gp(e):null;return l&&function t(){const o=Gp(e);m&&!lh(m,o)&&n();m=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const uh=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,a=await(null==o.isRTL?void 0:o.isRTL(r.floating)),i=Qf(n),s=Jf(n),l="y"===op(n),c=vp.has(i)?-1:1,u=a&&l?-1:1,d=Gf(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},dh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Gf(e,t),c={x:n,y:o},u=await mp(t,l),d=op(Qf(r)),f=ep(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=Zf(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=Zf(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:a,[d]:i}}}}}},fh=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Gf(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=Qf(r),v=op(s),b=Qf(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[dp(s)]:function(e){const t=dp(e);return[ap(e),t,ap(t)]}(s)),E="none"!==h;!f&&E&&x.push(...up(s,m,h,w));const S=[s,...x],_=await mp(t,g),C=[];let k=(null==(o=a.flip)?void 0:o.overflows)||[];if(u&&C.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Jf(e),r=rp(e),a=tp(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=dp(i)),[i,dp(i)]}(r,i,w);C.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:r,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==op(t))||k.every(e=>op(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 R;const e=null==(R=k.filter(e=>{if(E){const t=op(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:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ph=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Gf(e,t),u=await mp(t,c),d=Qf(r),f=Jf(r),p="y"===op(r),{width:h,height:m}=a.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=Wf(m-u[g],v),x=Wf(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(S=v),E&&!f){const e=Vf(u.left,0),t=Vf(u.right,0),n=Vf(u.top,0),o=Vf(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:Vf(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:Vf(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const C=await i.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},hh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Gf(e,t);switch(o){case"referenceHidden":{const e=gp(await mp(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yp(e)}}}case"escaped":{const e=gp(await mp(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yp(e)}}}default:return{}}}}},mh=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Gf(e,t)||{};if(null==c)return{};const d=fp(u),f={x:n,y:o},p=rp(r),h=tp(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,C=S/2-m[h]/2-1,k=Wf(d[y],C),N=Wf(d[v],C),M=k,R=S-m[h]-N,O=S/2-m[h]/2+_,A=Zf(M,O,R),P=!l.arrow&&null!=Jf(r)&&O!==A&&a.reference[h]/2-(O<M?k:N)-m[h]/2<0,T=P?O<M?O-M:O-R:0;return{[p]:f[p]+T,data:{[p]:A,centerOffset:O-A-T,...P&&{alignmentOffset:T}},reset:P}}}),gh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Gf(e,t),u={x:n,y:o},d=op(r),f=ep(d);let p=u[f],h=u[d];const m=Gf(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=vp.has(Qf(r)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),o=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[f]:p,[d]:h}}}},yh=(e,t,n)=>{const o=new Map,r={platform:sh,...n},a={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=hp(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[a]:{...p[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:u,y:d}=hp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:a})};var vh="undefined"!=typeof document?e.useLayoutEffect:function(){};function bh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!bh(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!bh(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function wh(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xh(e,t){const n=wh(e);return Math.round(t*n)/n}function Eh(e){const t=r.useRef(e);return vh(()=>{t.current=e}),t}const Sh=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?mh({element:n.current,padding:o}).fn(t):{}:n?mh({element:n,padding:o}).fn(t):{};var r}}),_h=(e,t)=>({...uh(e),options:[e,t]}),Ch=(e,t)=>({...dh(e),options:[e,t]}),kh=(e,t)=>({...gh(e),options:[e,t]}),Nh=(e,t)=>({...fh(e),options:[e,t]}),Mh=(e,t)=>({...ph(e),options:[e,t]}),Rh=(e,t)=>({...hh(e),options:[e,t]}),Oh=(e,t)=>({...Sh(e),options:[e,t]});var Ah=r.forwardRef((e,t)=>{const{children:o,width:r=10,height:a=5,...i}=e;return n.jsx(xu.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ah.displayName="Arrow";var Ph=Ah;function Th(e){const[t,n]=r.useState(void 0);return du(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var Dh="Popper",[$h,Ih]=cu(Dh),[zh,Lh]=$h(Dh),Bh=e=>{const{__scopePopper:t,children:o}=e,[a,i]=r.useState(null);return n.jsx(zh,{scope:t,anchor:a,onAnchorChange:i,children:o})};Bh.displayName=Dh;var Fh="PopperAnchor",jh=r.forwardRef((e,t)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=Lh(Fh,o),l=r.useRef(null),c=lu(t,l),u=r.useRef(null);return r.useEffect(()=>{const e=u.current;u.current=a?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:n.jsx(xu.div,{...i,ref:c})});jh.displayName=Fh;var Hh="PopperContent",[Wh,Vh]=$h(Hh),Yh=r.forwardRef((e,t)=>{const{__scopePopper:o,side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,b=Lh(Hh,o),[w,x]=r.useState(null),E=lu(t,e=>x(e)),[S,_]=r.useState(null),C=Th(S),k=C?.width??0,N=C?.height??0,M=i+("center"!==l?"-"+l:""),R="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},O=Array.isArray(f)?f:[f],A=O.length>0,P={padding:R,boundary:O.filter(qh),altBoundary:A},{refs:T,floatingStyles:D,placement:$,isPositioned:I,middlewareData:z}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=r.useState(o);bh(h,o)||m(o);const[g,y]=r.useState(null),[v,b]=r.useState(null),w=r.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=r.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=s||g,S=l||v,_=r.useRef(null),C=r.useRef(null),k=r.useRef(f),N=null!=u,M=Eh(u),R=Eh(i),O=Eh(d),A=r.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),yh(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};P.current&&!bh(k.current,t)&&(k.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,R,O]);vh(()=>{!1===d&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const P=r.useRef(!1);vh(()=>(P.current=!0,()=>{P.current=!1}),[]),vh(()=>{if(E&&(_.current=E),S&&(C.current=S),E&&S){if(M.current)return M.current(E,S,A);A()}},[E,S,A,M,N]);const T=r.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),D=r.useMemo(()=>({reference:E,floating:S}),[E,S]),$=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=xh(D.floating,f.x),o=xh(D.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...wh(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,D.floating,f.x,f.y]);return r.useMemo(()=>({...f,update:A,refs:T,elements:D,floatingStyles:$}),[f,A,T,D,$])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>ch(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[_h({mainAxis:s+N,alignmentAxis:c}),d&&Ch({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?kh():void 0,...P}),d&&Nh({...P}),Mh({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&Oh({element:S,padding:u}),Zh({arrowWidth:k,arrowHeight:N}),m&&Rh({strategy:"referenceHidden",...P})]}),[L,B]=Gh($),F=Eu(y);du(()=>{I&&F?.()},[I,F]);const j=z.arrow?.x,H=z.arrow?.y,W=0!==z.arrow?.centerOffset,[V,Y]=r.useState();return du(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(Wh,{scope:o,placedSide:L,onArrowChange:_,arrowX:j,arrowY:H,shouldHideArrow:W,children:n.jsx(xu.div,{"data-side":L,"data-align":B,...v,ref:E,style:{...v.style,animation:I?void 0:"none"}})})})});Yh.displayName=Hh;var Xh="PopperArrow",Kh={top:"bottom",right:"left",bottom:"top",left:"right"},Uh=r.forwardRef(function(e,t){const{__scopePopper:o,...r}=e,a=Vh(Xh,o),i=Kh[a.placedSide];return n.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:n.jsx(Ph,{...r,ref:t,style:{...r.style,display:"block"}})})});function qh(e){return null!==e}Uh.displayName=Xh;var Zh=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Gh(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(r.arrow?.x??0)+i/2,f=(r.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${o.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${o.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function Gh(e){const[t,n="center"]=e.split("-");return[t,n]}var Qh=Bh,Jh=jh,em=Yh,tm=Uh;function nm(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var om=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"});r.forwardRef((e,t)=>n.jsx(xu.span,{...e,ref:t,style:{...om,...e.style}})).displayName="VisuallyHidden";var rm=[" ","Enter","ArrowUp","ArrowDown"],am=[" ","Enter"],im="Select",[sm,lm,cm]=function(t){const o=t+"CollectionProvider",[r,a]=cu(o),[i,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:o,children:r}=t,a=e.useRef(null),s=e.useRef(new Map).current;return n.jsx(i,{scope:o,itemMap:s,collectionRef:a,children:r})};l.displayName=o;const c=t+"CollectionSlot",u=yu(c),d=e.forwardRef((e,t)=>{const{scope:o,children:r}=e,a=lu(t,s(c,o).collectionRef);return n.jsx(u,{ref:a,children:r})});d.displayName=c;const f=t+"CollectionItemSlot",p="data-radix-collection-item",h=yu(f),m=e.forwardRef((t,o)=>{const{scope:r,children:a,...i}=t,l=e.useRef(null),c=lu(o,l),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),n.jsx(h,{[p]:"",ref:c,children:a})});return m.displayName=f,[{Provider:l,Slot:d,ItemSlot:m},function(n){const o=s(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},a]}(im),[um,dm]=cu(im,[cm,Ih]),fm=Ih(),[pm,hm]=um(im),[mm,gm]=um(im),ym=e=>{const{__scopeSelect:t,children:o,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:m,form:g}=e,y=fm(t),[v,b]=r.useState(null),[w,x]=r.useState(null),[E,S]=r.useState(!1),_=function(e){const t=r.useContext(jf);return e||t||"ltr"}(d),[C,k]=gu({prop:a,defaultProp:i??!1,onChange:s,caller:im}),[N,M]=gu({prop:l,defaultProp:c,onChange:u,caller:im}),R=r.useRef(null),O=!v||(g||!!v.closest("form")),[A,P]=r.useState(new Set),T=Array.from(A).map(e=>e.props.value).join(";");return n.jsx(Qh,{...y,children:n.jsxs(pm,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:hu(),value:N,onValueChange:M,open:C,onOpenChange:k,dir:_,triggerPointerDownPosRef:R,disabled:h,children:[n.jsx(sm.Provider,{scope:t,children:n.jsx(mm,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{P(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),O?n.jsxs(og,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===N?n.jsx("option",{value:""}):null,Array.from(A)]},T):null]})})};ym.displayName=im;var vm="SelectTrigger",bm=r.forwardRef((e,t)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=fm(o),l=hm(vm,o),c=l.disabled||a,u=lu(t,l.onTriggerChange),d=lm(o),f=r.useRef("touch"),[p,h,m]=ag(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=ig(t,e,n);void 0!==o&&l.onValueChange(o.value)}),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return n.jsx(Jh,{asChild:!0,...s,children:n.jsx(xu.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":rg(l.value)?"":void 0,...i,ref:u,onClick:au(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:au(i.onPointerDown,e=>{f.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:au(i.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||rm.includes(e.key)&&(g(),e.preventDefault())})})})});bm.displayName=vm;var wm="SelectValue",xm=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=e,c=hm(wm,o),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,f=lu(t,c.onValueNodeChange);return du(()=>{u(d)},[u,d]),n.jsx(xu.span,{...l,ref:f,style:{pointerEvents:"none"},children:rg(c.value)?n.jsx(n.Fragment,{children:s}):i})});xm.displayName=wm;var Em=r.forwardRef((e,t)=>{const{__scopeSelect:o,children:r,...a}=e;return n.jsx(xu.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});Em.displayName="SelectIcon";var Sm=e=>n.jsx(Hu,{asChild:!0,...e});Sm.displayName="SelectPortal";var _m="SelectContent",Cm=r.forwardRef((e,t)=>{const o=hm(_m,e.__scopeSelect),[i,s]=r.useState();if(du(()=>{s(new DocumentFragment)},[]),!o.open){const t=i;return t?a.createPortal(n.jsx(Nm,{scope:e.__scopeSelect,children:n.jsx(sm.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),t):null}return n.jsx(Om,{...e,ref:t})});Cm.displayName=_m;var km=10,[Nm,Mm]=um(_m),Rm=yu("SelectContent.RemoveScroll"),Om=r.forwardRef((e,t)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,w=hm(_m,o),[x,E]=r.useState(null),[S,_]=r.useState(null),C=lu(t,e=>E(e)),[k,N]=r.useState(null),[M,R]=r.useState(null),O=lm(o),[A,P]=r.useState(!1),T=r.useRef(!1);r.useEffect(()=>{if(x)return Hd(x)},[x]),Xu();const D=r.useCallback(e=>{const[t,...n]=O().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===o&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==r)return}},[O,S]),$=r.useCallback(()=>D([k,x]),[D,k,x]);r.useEffect(()=>{A&&$()},[A,$]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;r.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]),r.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]=ag(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=ig(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),F=r.useCallback((e,t,n)=>{const o=!T.current&&!n;(void 0!==w.value&&w.value===t||o)&&(N(e),o&&(T.current=!0))},[w.value]),j=r.useCallback(()=>x?.focus(),[x]),H=r.useCallback((e,t,n)=>{const o=!T.current&&!n;(void 0!==w.value&&w.value===t||o)&&R(e)},[w.value]),W="popper"===a?Pm:Am,V=W===Pm?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return n.jsx(Nm,{scope:o,content:x,viewport:S,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:j,itemTextRefCallback:H,focusSelectedItem:$,selectedItemText:M,position:a,isPositioned:A,searchRef:L,children:n.jsx($d,{as:Rm,allowPinchZoom:!0,children:n.jsx($u,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:au(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:n.jsx(Mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:n.jsx(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>P(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:au(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,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});Om.displayName="SelectContentImpl";var Am=r.forwardRef((e,t)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=hm(_m,o),l=Mm(_m,o),[c,u]=r.useState(null),[d,f]=r.useState(null),p=lu(t,e=>f(e)),h=lm(o),m=r.useRef(!1),g=r.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,x=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-km,d=Ff(a,[km,Math.max(km,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-km,d=Ff(a,[km,Math.max(km,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const r=h(),i=window.innerHeight-2*km,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+p+l+parseInt(u.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),C=e.top+e.height/2-km,k=i-C,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),R=w-M;if(M<=C){const e=r.length>0&&v===r[r.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(k,N+(e?_:0)+t+g);c.style.height=n+"px"}else{const e=r.length>0&&v===r[0].ref.current;c.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?S:0)+N)+R;c.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}c.style.margin=`${km}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,a]);du(()=>x(),[x]);const[E,S]=r.useState();du(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const _=r.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return n.jsx(Tm,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:n.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:n.jsx(xu.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Am.displayName="SelectItemAlignedPosition";var Pm=r.forwardRef((e,t)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=km,...i}=e,s=fm(o);return n.jsx(em,{...s,...i,ref:t,align:r,collisionPadding:a,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)"}})});Pm.displayName="SelectPopperPosition";var[Tm,Dm]=um(_m,{}),$m="SelectViewport",Im=r.forwardRef((e,t)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=Mm($m,o),l=Dm($m,o),c=lu(t,s.onViewportChange),u=r.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("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:a}),n.jsx(sm.Slot,{scope:o,children:n.jsx(xu.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:au(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*km,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});Im.displayName=$m;var zm="SelectGroup",[Lm,Bm]=um(zm);r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=hu();return n.jsx(Lm,{scope:o,id:a,children:n.jsx(xu.div,{role:"group","aria-labelledby":a,...r,ref:t})})}).displayName=zm;var Fm="SelectLabel",jm=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Bm(Fm,o);return n.jsx(xu.div,{id:a.id,...r,ref:t})});jm.displayName=Fm;var Hm="SelectItem",[Wm,Vm]=um(Hm),Ym=r.forwardRef((e,t)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=hm(Hm,o),u=Mm(Hm,o),d=c.value===a,[f,p]=r.useState(s??""),[h,m]=r.useState(!1),g=lu(t,e=>u.itemRefCallback?.(e,a,i)),y=hu(),v=r.useRef("touch"),b=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)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 n.jsx(Wm,{scope:o,value:a,disabled:i,textId:y,isSelected:d,onItemTextChange:r.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:n.jsx(sm.ItemSlot,{scope:o,value:a,disabled:i,textValue:f,children:n.jsx(xu.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:au(l.onFocus,()=>m(!0)),onBlur:au(l.onBlur,()=>m(!1)),onClick:au(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:au(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:au(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:au(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:au(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:au(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(am.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Ym.displayName=Hm;var Xm="SelectItemText",Km=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=hm(Xm,o),u=Mm(Xm,o),d=Vm(Xm,o),f=gm(Xm,o),[p,h]=r.useState(null),m=lu(t,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,y=r.useMemo(()=>n.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return du(()=>(v(y),()=>b(y)),[v,b,y]),n.jsxs(n.Fragment,{children:[n.jsx(xu.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});Km.displayName=Xm;var Um="SelectItemIndicator",qm=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return Vm(Um,o).isSelected?n.jsx(xu.span,{"aria-hidden":!0,...r,ref:t}):null});qm.displayName=Um;var Zm="SelectScrollUpButton",Gm=r.forwardRef((e,t)=>{const o=Mm(Zm,e.__scopeSelect),a=Dm(Zm,e.__scopeSelect),[i,s]=r.useState(!1),l=lu(t,a.onScrollButtonChange);return du(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?n.jsx(eg,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Gm.displayName=Zm;var Qm="SelectScrollDownButton",Jm=r.forwardRef((e,t)=>{const o=Mm(Qm,e.__scopeSelect),a=Dm(Qm,e.__scopeSelect),[i,s]=r.useState(!1),l=lu(t,a.onScrollButtonChange);return du(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?n.jsx(eg,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Jm.displayName=Qm;var eg=r.forwardRef((e,t)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=Mm("SelectScrollButton",o),l=r.useRef(null),c=lm(o),u=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),du(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),n.jsx(xu.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:au(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:au(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:au(i.onPointerLeave,()=>{u()})})}),tg=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return n.jsx(xu.div,{"aria-hidden":!0,...r,ref:t})});tg.displayName="SelectSeparator";var ng="SelectArrow";r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=fm(o),i=hm(ng,o),s=Mm(ng,o);return i.open&&"popper"===s.position?n.jsx(tm,{...a,...r,ref:t}):null}).displayName=ng;var og=r.forwardRef(({__scopeSelect:e,value:t,...o},a)=>{const i=r.useRef(null),s=lu(a,i),l=nm(t);return r.useEffect(()=>{const e=i.current;if(!e)return;const n=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(n,"value").set;if(l!==t&&o){const n=new Event("change",{bubbles:!0});o.call(e,t),e.dispatchEvent(n)}},[l,t]),n.jsx(xu.select,{...o,style:{...om,...o.style},ref:s,defaultValue:t})});function rg(e){return""===e||void 0===e}function ag(e){const t=Eu(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function ig(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(a,0));1===r.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}og.displayName="SelectBubbleInput";var sg=bm,lg=Em,cg=Sm,ug=Cm,dg=Im,fg=jm,pg=Ym,hg=Km,mg=qm,gg=Gm,yg=Jm,vg=tg;const bg=ym,wg=xm,xg=tc(sg)`
|
|
290
339
|
display: flex;
|
|
291
340
|
height: 2.5rem;
|
|
292
341
|
width: 100%;
|
|
@@ -314,29 +363,29 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
314
363
|
&[data-placeholder] {
|
|
315
364
|
color: #6b7280;
|
|
316
365
|
}
|
|
317
|
-
`,
|
|
366
|
+
`,Eg=tc(gs)`
|
|
318
367
|
height: 1rem;
|
|
319
368
|
width: 1rem;
|
|
320
369
|
opacity: 0.5;
|
|
321
|
-
`,
|
|
370
|
+
`,Sg=tc(gg)`
|
|
322
371
|
display: flex;
|
|
323
372
|
cursor: default;
|
|
324
373
|
align-items: center;
|
|
325
374
|
justify-content: center;
|
|
326
375
|
padding: 0.25rem;
|
|
327
|
-
`,
|
|
376
|
+
`,_g=tc(vs)`
|
|
328
377
|
height: 1rem;
|
|
329
378
|
width: 1rem;
|
|
330
|
-
`,
|
|
379
|
+
`,Cg=tc(yg)`
|
|
331
380
|
display: flex;
|
|
332
381
|
cursor: default;
|
|
333
382
|
align-items: center;
|
|
334
383
|
justify-content: center;
|
|
335
384
|
padding: 0.25rem;
|
|
336
|
-
`,
|
|
385
|
+
`,kg=tc(gs)`
|
|
337
386
|
height: 1rem;
|
|
338
387
|
width: 1rem;
|
|
339
|
-
`,
|
|
388
|
+
`,Ng=tc(ug)`
|
|
340
389
|
position: relative;
|
|
341
390
|
z-index: 50;
|
|
342
391
|
min-width: 8rem;
|
|
@@ -359,13 +408,13 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
359
408
|
transform: translateY(0);
|
|
360
409
|
}
|
|
361
410
|
}
|
|
362
|
-
`,
|
|
411
|
+
`,Mg=tc(fg)`
|
|
363
412
|
padding: 0.375rem 0.75rem;
|
|
364
413
|
padding-left: 2rem;
|
|
365
414
|
font-size: 0.875rem;
|
|
366
415
|
font-weight: 600;
|
|
367
416
|
color: #374151;
|
|
368
|
-
`,
|
|
417
|
+
`,Rg=tc(pg)`
|
|
369
418
|
position: relative;
|
|
370
419
|
display: flex;
|
|
371
420
|
cursor: default;
|
|
@@ -391,7 +440,7 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
391
440
|
background-color: #f3f4f6;
|
|
392
441
|
color: #1f2937;
|
|
393
442
|
}
|
|
394
|
-
`,
|
|
443
|
+
`,Og=tc.span`
|
|
395
444
|
position: absolute;
|
|
396
445
|
left: 0.5rem;
|
|
397
446
|
display: flex;
|
|
@@ -399,61 +448,61 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
399
448
|
width: 0.875rem;
|
|
400
449
|
align-items: center;
|
|
401
450
|
justify-content: center;
|
|
402
|
-
`,
|
|
451
|
+
`,Ag=tc(ms)`
|
|
403
452
|
height: 1rem;
|
|
404
453
|
width: 1rem;
|
|
405
|
-
`,
|
|
454
|
+
`,Pg=tc(vg)`
|
|
406
455
|
margin: 0.25rem -0.25rem;
|
|
407
456
|
height: 1px;
|
|
408
457
|
background-color: #e5e7eb;
|
|
409
|
-
`,
|
|
458
|
+
`,Tg=r.forwardRef(({children:e,...t},n)=>r.createElement(xg,{ref:n,...t},e,r.createElement(lg,{asChild:!0},r.createElement(Eg,null))));Tg.displayName=sg.displayName;const Dg=r.forwardRef(({...e},t)=>r.createElement(Sg,{ref:t,...e},r.createElement(_g,null)));Dg.displayName=gg.displayName;const $g=r.forwardRef(({...e},t)=>r.createElement(Cg,{ref:t,...e},r.createElement(kg,null)));$g.displayName=yg.displayName;const Ig=r.forwardRef(({children:e,position:t="popper",...n},o)=>r.createElement(cg,null,r.createElement(Ng,{ref:o,position:t,...n},r.createElement(Dg,null),r.createElement(dg,{style:{padding:"4px"}},e),r.createElement($g,null))));Ig.displayName=ug.displayName;r.forwardRef(({...e},t)=>r.createElement(Mg,{ref:t,...e})).displayName=fg.displayName;const zg=r.forwardRef(({children:e,...t},n)=>r.createElement(Rg,{ref:n,...t},r.createElement(Og,null,r.createElement(mg,null,r.createElement(Ag,null))),r.createElement(hg,null,e)));zg.displayName=pg.displayName;r.forwardRef(({...e},t)=>r.createElement(Pg,{ref:t,...e})).displayName=vg.displayName;const Lg=tc.div`
|
|
410
459
|
display: flex;
|
|
411
460
|
align-items: center;
|
|
412
461
|
gap: 0.5rem;
|
|
413
462
|
min-width: 300px;
|
|
414
|
-
`,
|
|
463
|
+
`,Bg=tc.div`
|
|
415
464
|
padding: 0.5rem 1rem;
|
|
416
|
-
color: ${e=>e.
|
|
465
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
417
466
|
font-size: 0.875rem;
|
|
418
|
-
background-color: ${e=>e.
|
|
467
|
+
background-color: ${e=>e.themeColors.muted};
|
|
419
468
|
border-radius: 0.375rem;
|
|
420
|
-
border: 1px solid ${e=>e.
|
|
421
|
-
`,
|
|
469
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
470
|
+
`,Fg=tc.div`
|
|
422
471
|
flex: 1;
|
|
423
472
|
min-width: 0;
|
|
424
|
-
`,
|
|
473
|
+
`,jg=tc.div`
|
|
425
474
|
display: flex;
|
|
426
475
|
align-items: center;
|
|
427
476
|
justify-content: space-between;
|
|
428
477
|
width: 100%;
|
|
429
|
-
`,
|
|
478
|
+
`,Hg=tc.div`
|
|
430
479
|
padding: 0.5rem 1rem;
|
|
431
|
-
color: ${e=>e.
|
|
480
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
432
481
|
font-size: 0.875rem;
|
|
433
482
|
text-align: center;
|
|
434
|
-
`,
|
|
483
|
+
`,Wg=tc.button`
|
|
435
484
|
display: flex;
|
|
436
485
|
align-items: center;
|
|
437
486
|
justify-content: center;
|
|
438
487
|
padding: 0.5rem;
|
|
439
488
|
border: none;
|
|
440
489
|
border-radius: 0.375rem;
|
|
441
|
-
border: 1px solid ${e=>e.
|
|
442
|
-
background-color: ${e=>e.
|
|
443
|
-
color: ${e=>e.
|
|
490
|
+
border: 1px solid ${e=>e.themeColors.border};
|
|
491
|
+
background-color: ${e=>e.themeColors.card};
|
|
492
|
+
color: ${e=>e.themeColors.cardForeground};
|
|
444
493
|
transition: all 0.2s ease-in-out;
|
|
445
494
|
opacity: ${e=>e.loading||e.disabled?.5:1};
|
|
446
495
|
cursor: ${e=>e.loading||e.disabled?"not-allowed":"pointer"};
|
|
447
496
|
|
|
448
497
|
&:hover:not(:disabled) {
|
|
449
|
-
background-color: ${e=>e.
|
|
450
|
-
color: ${e=>e.
|
|
498
|
+
background-color: ${e=>e.themeColors.muted};
|
|
499
|
+
color: ${e=>e.themeColors.cardForeground};
|
|
451
500
|
}
|
|
452
|
-
`,
|
|
501
|
+
`,Vg=tc(bs)`
|
|
453
502
|
height: 1rem;
|
|
454
503
|
width: 1rem;
|
|
455
504
|
animation: spin 1s linear infinite;
|
|
456
|
-
color: ${e=>e.
|
|
505
|
+
color: ${e=>e.themeColors.mutedForeground};
|
|
457
506
|
|
|
458
507
|
@keyframes spin {
|
|
459
508
|
from {
|
|
@@ -463,10 +512,10 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
463
512
|
transform: rotate(360deg);
|
|
464
513
|
}
|
|
465
514
|
}
|
|
466
|
-
`,
|
|
515
|
+
`,Yg=tc(xs)`
|
|
467
516
|
height: 1rem;
|
|
468
517
|
width: 1rem;
|
|
469
|
-
`;var
|
|
518
|
+
`;var Xg="Checkbox",[Kg,Ug]=cu(Xg),[qg,Zg]=Kg(Xg);function Gg(e){const{__scopeCheckbox:t,checked:o,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:p}=e,[h,m]=gu({prop:o,defaultProp:i??!1,onChange:u,caller:Xg}),[g,y]=r.useState(null),[v,b]=r.useState(null),w=r.useRef(!1),x=!g||(!!l||!!g.closest("form")),E={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:c,form:l,value:f,hasConsumerStoppedPropagationRef:w,required:d,defaultChecked:!iy(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return n.jsx(qg,{scope:t,...E,children:ay(p)?p(E):a})}var Qg="CheckboxTrigger",Jg=r.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:o,...a},i)=>{const{control:s,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:g}=Zg(Qg,e),y=lu(i,f),v=r.useRef(u);return r.useEffect(()=>{const e=s?.form;if(e){const t=()=>p(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,p]),n.jsx(xu.button,{type:"button",role:"checkbox","aria-checked":iy(u)?"mixed":u,"aria-required":d,"data-state":sy(u),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:y,onKeyDown:au(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:au(o,e=>{p(e=>!!iy(e)||!e),g&&m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});Jg.displayName=Qg;var ey=r.forwardRef((e,t)=>{const{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return n.jsx(Gg,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:e})=>n.jsxs(n.Fragment,{children:[n.jsx(Jg,{...f,ref:t,__scopeCheckbox:o}),e&&n.jsx(ry,{__scopeCheckbox:o})]})})});ey.displayName=Xg;var ty="CheckboxIndicator",ny=r.forwardRef((e,t)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=Zg(ty,o);return n.jsx(Wu,{present:r||iy(i.checked)||!0===i.checked,children:n.jsx(xu.span,{"data-state":sy(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});ny.displayName=ty;var oy="CheckboxBubbleInput",ry=r.forwardRef(({__scopeCheckbox:e,...t},o)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=Zg(oy,e),g=lu(o,m),y=nm(s),v=Th(a);r.useEffect(()=>{const e=h;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!i.current;if(y!==s&&n){const t=new Event("click",{bubbles:o});e.indeterminate=iy(s),n.call(e,!iy(s)&&s),e.dispatchEvent(t)}},[h,y,s,i]);const b=r.useRef(!iy(s)&&s);return n.jsx(xu.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??b.current,required:c,disabled:u,name:d,value:f,form:p,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function ay(e){return"function"==typeof e}function iy(e){return"indeterminate"===e}function sy(e){return iy(e)?"indeterminate":e?"checked":"unchecked"}ry.displayName=oy;const ly=tc(ey)`
|
|
470
519
|
display: flex;
|
|
471
520
|
align-items: center;
|
|
472
521
|
justify-content: center;
|
|
@@ -493,194 +542,12 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
493
542
|
background-color: #6366f1;
|
|
494
543
|
color: white;
|
|
495
544
|
}
|
|
496
|
-
`,
|
|
545
|
+
`,cy=tc(ny)`
|
|
497
546
|
display: flex;
|
|
498
547
|
align-items: center;
|
|
499
548
|
justify-content: center;
|
|
500
549
|
color: currentColor;
|
|
501
|
-
`,
|
|
550
|
+
`,uy=tc(ms)`
|
|
502
551
|
height: 1rem;
|
|
503
552
|
width: 1rem;
|
|
504
|
-
`,Oy=o.forwardRef(({className:e,...t},n)=>o.createElement(Ny,{ref:n,...t},o.createElement(My,null,o.createElement(Ry,null))));Oy.displayName=by.displayName;const Py=e.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}),Ay=()=>{const t=e.useContext(Py);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};function Ty(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Dy(){return Iy(/^iPad/)||Iy(/^Mac/)&&navigator.maxTouchPoints>1}function $y(){return Iy(/^iPhone/)||Dy()}function Iy(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 zy="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function Ly(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const By="undefined"!=typeof document&&window.visualViewport;function Fy(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function jy(e){for(Fy(e)&&(e=e.parentElement);e&&!Fy(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Hy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Vy,Wy=0;function Yy(e={}){let{isDisabled:t}=e;zy(()=>{if(!t)return Wy++,1===Wy&&$y()&&(Vy=function(){let e,t=0,n=n=>{e=jy(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;Uy(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;Uy(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",By&&(By.height<window.innerHeight?requestAnimationFrame(()=>{Ky(t)}):By.addEventListener("resize",()=>Ky(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Ly(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=Ly(Xy(document,"touchstart",n,{passive:!1,capture:!0}),Xy(document,"touchmove",r,{passive:!1,capture:!0}),Xy(document,"touchend",o,{passive:!1,capture:!0}),Xy(document,"focus",a,!0),Xy(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Wy--,0===Wy&&(null==Vy||Vy())}},[t])}function Xy(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ky(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=jy(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function Uy(e){return e instanceof HTMLInputElement&&!Hy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function qy(...e){return o.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...e),e)}const Zy=new WeakMap;function Gy(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||Zy.set(e,r)}const Qy=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Jy(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(", ")[Qy(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Qy(t)?5:4]):null)}function ev(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const tv={DURATION:.5,EASE:[.32,.72,0,1]},nv=16,rv="vaul-dragging";function ov(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function av({prop:t,defaultProp:n,onChange:r=()=>{}}){const[o,a]=function({defaultProp:t,onChange:n}){const r=e.useState(t),[o]=r,a=e.useRef(o),i=ov(n);return e.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),r}({defaultProp:n,onChange:r}),i=void 0!==t,s=i?t:o,l=ov(r),c=e.useCallback(e=>{if(i){const n="function"==typeof e?e(t):e;n!==t&&l(n)}else a(e)},[i,t,a,l]);return[s,c]}let iv=null;function sv({open:t,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:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:R=!1}){var O,P;const[A=!1,T]=av({defaultProp:E,prop:t,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*tv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[D,$]=e.useState(!1),[I,z]=e.useState(!1),[L,B]=e.useState(!1),F=e.useRef(null),j=e.useRef(null),H=e.useRef(null),V=e.useRef(null),W=e.useRef(null),Y=e.useRef(!1),X=e.useRef(null),K=e.useRef(0),U=e.useRef(!1),q=e.useRef(!E),Z=e.useRef(0),G=e.useRef(null),Q=e.useRef((null==(O=G.current)?void 0:O.getBoundingClientRect().height)||0),J=e.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().width)||0),ee=e.useRef(0),te=e.useCallback(e=>{i&&e===ie.length-1&&(j.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:t,setActiveSnapPointProp:n,snapPoints:r,drawerRef:o,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=av({prop:t,defaultProp:null==r?void 0:r[0],onChange:n}),[p,h]=e.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);e.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=e.useMemo(()=>d===(null==r?void 0:r[r.length-1])||null,[r,d]),g=e.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=e.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)),Qy(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=e.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=e.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),Gy(o.current,{transition:`transform ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`,transform:Qy(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?Gy(a.current,{transition:`opacity ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`,opacity:"0"}):Gy(a.current,{transition:`opacity ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(n,0)])},[o.current,r,v,i,a,f]);return e.useEffect(()=>{if(d||t){var e;const n=null!=(e=null==r?void 0:r.findIndex(e=>e===t||e===d))?e:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,t,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&&Gy(a.current,{transition:`opacity ${tv.DURATION}s cubic-bezier(${tv.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=Qy(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]||Gy(o.current,{transform:Qy(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:_});Yy({isDisabled:!A||I||!y||L||!D||!k||!S});const{restorePositionSetting:ue}=function({isOpen:t,modal:n,nested:r,hasBeenOpened:o,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=e.useState(()=>"undefined"!=typeof window?window.location.href:""),c=e.useRef(0),u=e.useCallback(()=>{if(Ty()&&null===iv&&t&&!i){iv={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)}},[t]),d=e.useCallback(()=>{if(Ty()&&null!==iv&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,iv),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),iv=null}},[s]);return e.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),e.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),e.useEffect(()=>{!r&&o&&(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[t,o,s,n,r,u,d]),{restorePositionSetting:d}}({isOpen:A,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?Jy(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(j.current&&i.getTime()-j.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(o&&o.length>0)return!1;if(W.current&&i.getTime()-W.current.getTime()<u&&0===a)return W.current=i,!1;if(t)return W.current=i,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return W.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(rv),Y.current=!1,z(!1),V.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{i&&oe(i[0])},1e3*tv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=Jy(G.current,x);Gy(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`}),Gy(F.current,{transition:`opacity ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&A&&Gy(e,{borderRadius:"8px",overflow:"hidden",...Qy(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:`${tv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${tv.EASE.join(",")})`},!0)}return e.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),e.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(Uy(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]),e.useEffect(()=>(A&&(Gy(document.documentElement,{scrollBehavior:"auto"}),j.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Zy.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[A]),e.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),e.createElement(Hf,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?$(!0):pe(!0),T(e))},open:A},e.createElement(Py.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),H.current=new Date,$y()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=Qy(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(rv),Y.current=!1,z(!1),V.current=new Date;const t=Jy(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===H.current)return;const n=V.current.getTime()-H.current.getTime(),r=K.current-(Qy(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-(Qy(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(rv),Y.current=!0,Gy(G.current,{transition:"none"}),Gy(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 Gy(G.current,{transform:Qy(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),Gy(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);Gy(u,{borderRadius:`${t}px`,transform:Qy(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;Gy(G.current,{transform:Qy(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:A,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-nv)/window.innerWidth,r=n+t*(1-n),o=t*nv-16;Gy(G.current,{transform:Qy(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-nv)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Gy(G.current,{transition:`transform ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`,transform:Qy(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=Jy(G.current,x);Gy(G.current,{transition:"none",transform:Qy(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=Qy(x)?window.innerHeight:window.innerWidth,r=t?(n-nv)/n:1,o=t?-16:0;t&&Gy(G.current,{transition:`transform ${tv.DURATION}s cubic-bezier(${tv.EASE.join(",")})`,transform:Qy(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:R}},r))}const lv=e.forwardRef(function({...t},n){const{overlayRef:r,snapPoints:o,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Ay(),u=qy(n,r),d=o&&o.length>0;if(!l)return null;const f=e.useCallback(e=>a(e),[a]);return e.createElement(Yf,{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",...t})});lv.displayName="Drawer.Overlay";const cv=e.forwardRef(function({onPointerDownOutside:t,style:n,onOpenAutoFocus:r,...o},a){const{drawerRef:i,onPress:s,onRelease:l,onDrag:c,keyboardIsOpen:u,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:h,direction:m,snapPoints:g,container:y,handleOnly:v,shouldAnimate:b,autoFocus:w}=Ay(),[x,E]=e.useState(!1),S=qy(a,i),_=e.useRef(null),C=e.useRef(null),k=e.useRef(!1),N=g&&g.length>0;!function(){const{direction:t,isOpen:n,shouldScaleBackground:r,setBackgroundColorOnScale:o,noBodyStyles:a}=Ay(),i=e.useRef(null),s=e.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-26)/window.innerWidth}e.useEffect(()=>{if(n&&r){i.current&&clearTimeout(i.current);const e=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!e)return;o&&!a&&ev(document.body,{background:"black"}),ev(e,{transformOrigin:Qy(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${tv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${tv.EASE.join(",")})`});const n=ev(e,{borderRadius:"8px",overflow:"hidden",...Qy(t)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},1e3*tv.DURATION)}}},[n,r,s])}();function M(e){_.current=null,k.current=!1,l(e)}return e.useEffect(()=>{N&&window.requestAnimationFrame(()=>{E(!0)})},[]),e.createElement(Xf,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":h&&N?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...o,ref:S,style:d&&d.length>0?{"--snap-point-height":`${d[null!=f?f:0]}px`,...n}:n,onPointerDown:e=>{v||(null==o.onPointerDown||o.onPointerDown.call(o,e),_.current={x:e.pageX,y:e.pageY},s(e))},onOpenAutoFocus:e=>{null==r||r(e),w||e.preventDefault()},onPointerDownOutside:e=>{null==t||t(e),p&&!e.defaultPrevented?u.current&&(u.current=!1):e.preventDefault()},onFocusOutside:e=>{p||e.preventDefault()},onPointerMove:e=>{if(C.current=e,v)return;if(null==o.onPointerMove||o.onPointerMove.call(o,e),!_.current)return;const t=e.pageY-_.current.y,n=e.pageX-_.current.x,r="touch"===e.pointerType?10:2,a=((e,t,n=0)=>{if(k.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 k.current=!0,!0})({x:n,y:t},m,r);a?c(e):(Math.abs(n)>r||Math.abs(t)>r)&&(_.current=null)},onPointerUp:e=>{null==o.onPointerUp||o.onPointerUp.call(o,e),_.current=null,k.current=!1,l(e)},onPointerOut:e=>{null==o.onPointerOut||o.onPointerOut.call(o,e),M(C.current)},onContextMenu:e=>{null==o.onContextMenu||o.onContextMenu.call(o,e),C.current&&M(C.current)}})});cv.displayName="Drawer.Content";const uv=e.forwardRef(function({preventCycle:t=!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}=Ay(),m=e.useRef(null),g=e.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return e.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||t||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 e=s.findIndex(e=>e===l);if(-1===e)return;const n=s[e+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},e.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});uv.displayName="Drawer.Handle";const dv={Root:sv,NestedRoot:function({onDrag:t,onOpenChange:n,open:r,...o}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Ay();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return e.createElement(sv,{nested:!0,open:r,onClose:()=>{i(!1)},onDrag:(e,n)=>{a(e,n),null==t||t(e,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...o})},Content:cv,Overlay:lv,Trigger:Vf,Portal:function(t){const n=Ay(),{container:r=n.container,...o}=t;return e.createElement(Wf,{container:r,...o})},Handle:uv,Close:qf,Title:Kf,Description:Uf},fv=({shouldScaleBackground:e=!0,...t})=>o.createElement(dv.Root,{shouldScaleBackground:e,...t});fv.displayName="Drawer";const pv=dv.Portal,hv=o.forwardRef(({className:e,...t},n)=>o.createElement(dv.Overlay,{ref:n,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:e,...t}));hv.displayName=dv.Overlay.displayName;const mv=o.forwardRef(({className:e,children:t,...n},r)=>o.createElement(pv,null,o.createElement(hv,null),o.createElement(dv.Content,{ref:r,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:e,...n},o.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),t)));mv.displayName="DrawerContent";o.forwardRef(({className:e,...t},n)=>o.createElement(dv.Title,{ref:n,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:e,...t})).displayName=dv.Title.displayName;o.forwardRef(({className:e,...t},n)=>o.createElement(dv.Description,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=dv.Description.displayName;const gv=e.createContext(void 0),yv=()=>{const t=e.useContext(gv);if(void 0===t)throw new Error("useTheme must be used within a ThemeProvider");return t};exports.AgenticFlowVisualizer=op,exports.AnthropicIcon=Zc,exports.Badge=Oc,exports.Checkbox=Oy,exports.Drawer=fv,exports.Edge=ks,exports.FileSelector=({files:t,currentFile:n,onFileSelect:r,onRefresh:o,loading:a=!1,disabled:i=!1})=>e.createElement(ry,null,0!==t.length||a?e.createElement(Lg,{value:n||"",onValueChange:r,disabled:i||a},e.createElement(ay,{disabled:i,loading:a},e.createElement(Qg,null,e.createElement(iy,null,e.createElement(Bg,{placeholder:a?"Loading sessions...":0===t.length?"No sessions found":"Select an Agent Session..."})))),e.createElement(ty,null,0!==t.length||a?t.map(t=>e.createElement(ny,{key:t.name,value:t.name},t.name)):e.createElement(sy,null,"No agent sessions available"))):e.createElement(oy,null,"No agent sessions available"),t.length>0&&e.createElement(ly,{onClick:e=>{e.stopPropagation(),o()},disabled:a||i,loading:a,title:a?"Loading...":"Refresh files"},a?e.createElement(cy,null):e.createElement(uy,null))),exports.GlobalStyles=()=>e.createElement(mc,{styles:gc`
|
|
505
|
-
* {
|
|
506
|
-
box-sizing: border-box;
|
|
507
|
-
border-color: #e5e7eb;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
html,
|
|
511
|
-
body {
|
|
512
|
-
margin: 0;
|
|
513
|
-
padding: 0;
|
|
514
|
-
background-color: #ffffff;
|
|
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
|
-
`}),exports.GoogleIcon=Gc,exports.JsonTreeViewer=Uc,exports.Node=Jc,exports.OpenAIIcon=qc,exports.Select=Lg,exports.Sheet=Zf,exports.ThemeProvider=({children:t,theme:n=_s})=>{const[r,o]=e.useState(n),a=e.useMemo(()=>({theme:r,setTheme:o}),[r]);return e.createElement(gv.Provider,{value:a},e.createElement(lc,{theme:r},t))},exports.Timeline=Su,exports.Visualizer=t=>e.createElement(Vi,null,e.createElement(op,t)),exports.calculateAutoLayout=np,exports.cn=function(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=_c(e))&&(r&&(r+=" "),r+=t);return r}(e)},exports.conditionalStyle=function(e,t,n=""){return e?t:n},exports.darkTheme=Ss,exports.defaultTheme=_s,exports.formatCurrency=kc,exports.formatLatency=Nc,exports.getColor=function(e,t){return e.colors[t]||e.colors.foreground},exports.getSpacing=function(e,t){return e.spacing[t]||e.spacing.md},exports.lightTheme=Es,exports.toTitleCase=Cc,exports.truncateText=Mc,exports.useTheme=yv,exports.useThemeValue=()=>{const{theme:e}=yv();return e};
|
|
553
|
+
`,dy=r.forwardRef(({className:e,...t},n)=>r.createElement(ly,{ref:n,...t},r.createElement(cy,null,r.createElement(uy,null))));dy.displayName=ey.displayName;const fy=e.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}),py=()=>{const t=e.useContext(fy);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};function hy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function my(){return yy(/^iPad/)||yy(/^Mac/)&&navigator.maxTouchPoints>1}function gy(){return yy(/^iPhone/)||my()}function yy(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 vy="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function by(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const wy="undefined"!=typeof document&&window.visualViewport;function xy(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ey(e){for(xy(e)&&(e=e.parentElement);e&&!xy(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Sy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let _y,Cy=0;function ky(e={}){let{isDisabled:t}=e;vy(()=>{if(!t)return Cy++,1===Cy&&gy()&&(_y=function(){let e,t=0,n=n=>{e=Ey(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},o=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let o=n.changedTouches[0].pageY,r=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((r<=0&&o>t||r>=a&&o<t)&&n.preventDefault(),t=o)},r=e=>{let t=e.target;Ry(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;Ry(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",wy&&(wy.height<window.innerHeight?requestAnimationFrame(()=>{My(t)}):wy.addEventListener("resize",()=>My(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=by(function(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=by(Ny(document,"touchstart",n,{passive:!1,capture:!0}),Ny(document,"touchmove",o,{passive:!1,capture:!0}),Ny(document,"touchend",r,{passive:!1,capture:!0}),Ny(document,"focus",a,!0),Ny(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Cy--,0===Cy&&(null==_y||_y())}},[t])}function Ny(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function My(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Ey(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,o=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=o-n)}e=t.parentElement}}function Ry(e){return e instanceof HTMLInputElement&&!Sy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Oy(...e){return r.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...e),e)}const Ay=new WeakMap;function Py(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let o={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(o[t]=e.style[t],e.style[t]=n)}),n||Ay.set(e,o)}const Ty=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Dy(e,t){if(!e)return null;const n=window.getComputedStyle(e),o=n.transform||n.webkitTransform||n.mozTransform;let r=o.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[Ty(t)?13:12]):(r=o.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[Ty(t)?5:4]):null)}function $y(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const Iy={DURATION:.5,EASE:[.32,.72,0,1]},zy=16,Ly="vaul-dragging";function By(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function Fy({prop:t,defaultProp:n,onChange:o=()=>{}}){const[r,a]=function({defaultProp:t,onChange:n}){const o=e.useState(t),[r]=o,a=e.useRef(r),i=By(n);return e.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),o}({defaultProp:n,onChange:o}),i=void 0!==t,s=i?t:r,l=By(o),c=e.useCallback(e=>{if(i){const n="function"==typeof e?e(t):e;n!==t&&l(n)}else a(e)},[i,t,a,l]);return[s,c]}let jy=null;function Hy({open:t,onOpenChange:n,children:o,onDrag:r,onRelease:a,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:R=!1}){var O,A;const[P=!1,T]=Fy({defaultProp:E,prop:t,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*Iy.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[D,$]=e.useState(!1),[I,z]=e.useState(!1),[L,B]=e.useState(!1),F=e.useRef(null),j=e.useRef(null),H=e.useRef(null),W=e.useRef(null),V=e.useRef(null),Y=e.useRef(!1),X=e.useRef(null),K=e.useRef(0),U=e.useRef(!1),q=e.useRef(!E),Z=e.useRef(0),G=e.useRef(null),Q=e.useRef((null==(O=G.current)?void 0:O.getBoundingClientRect().height)||0),J=e.useRef((null==(A=G.current)?void 0:A.getBoundingClientRect().width)||0),ee=e.useRef(0),te=e.useCallback(e=>{i&&e===ie.length-1&&(j.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:oe,setActiveSnapPoint:re,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:t,setActiveSnapPointProp:n,snapPoints:o,drawerRef:r,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=Fy({prop:t,defaultProp:null==o?void 0:o[0],onChange:n}),[p,h]=e.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);e.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=e.useMemo(()=>d===(null==o?void 0:o[o.length-1])||null,[o,d]),g=e.useMemo(()=>{var e;return null!=(e=null==o?void 0:o.findIndex(e=>e===d))?e:null},[o,d]),y=o&&o.length>0&&(i||0===i)&&!Number.isNaN(i)&&o[i]===d||!o,v=e.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==o?void 0:o.map(t=>{const n="string"==typeof t;let o=0;if(n&&(o=parseInt(t,10)),Ty(l)){const r=n?o:p?t*e.height:0;return p?"bottom"===l?e.height-r:-e.height+r:r}const r=n?o:p?t*e.width:0;return p?"right"===l?e.width-r:-e.width+r:r}))?t:[]},[o,p,c]),b=e.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=e.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),Py(r.current,{transition:`transform ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`,transform:Ty(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?Py(a.current,{transition:`opacity ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`,opacity:"0"}):Py(a.current,{transition:`opacity ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`,opacity:"1"}),f(null==o?void 0:o[Math.max(n,0)])},[r.current,o,v,i,a,f]);return e.useEffect(()=>{if(d||t){var e;const n=null!=(e=null==o?void 0:o.findIndex(e=>e===t||e===d))?e:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,t,o,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!o||"number"!=typeof g||!v||void 0===i)return null;const n=g===i-1;if(g>=i&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const r=n?g+1:g-1,a=n?v[r]-v[r-1]:v[r+1]-v[r],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:r}){if(void 0===i)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===i-1&&Py(a.current,{transition:`opacity ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`}),!u&&n>2&&!d)return void(r?t():w(v[0]));if(!u&&n>2&&d&&v&&o)return void w(v[o.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=Ty(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&o)return void w(v[o.length-1]);if(c&&e<0&&r&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||Py(r.current,{transform:Ty(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:_});ky({isDisabled:!P||I||!y||L||!D||!k||!S});const{restorePositionSetting:ue}=function({isOpen:t,modal:n,nested:o,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=e.useState(()=>"undefined"!=typeof window?window.location.href:""),c=e.useRef(0),u=e.useCallback(()=>{if(hy()&&null===jy&&t&&!i){jy={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)}},[t]),d=e.useCallback(()=>{if(hy()&&null!==jy&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,jy),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),jy=null}},[s]);return e.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),e.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),e.useEffect(()=>{!o&&r&&(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[t,r,s,n,o,u,d]),{restorePositionSetting:d}}({isOpen:P,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 o=e;const r=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?Dy(G.current,x):null,i=new Date;if("SELECT"===o.tagName)return!1;if(o.hasAttribute("data-vaul-no-drag")||o.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(j.current&&i.getTime()-j.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(r&&r.length>0)return!1;if(V.current&&i.getTime()-V.current.getTime()<u&&0===a)return V.current=i,!1;if(t)return V.current=i,!1;for(;o;){if(o.scrollHeight>o.clientHeight){if(0!==o.scrollTop)return V.current=new Date,!1;if("dialog"===o.getAttribute("role"))return!0}o=o.parentNode}return!0}function pe(e){!function(){if(!I||!G.current)return;G.current.classList.remove(Ly),Y.current=!1,z(!1),W.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{i&&re(i[0])},1e3*Iy.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=Dy(G.current,x);Py(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`}),Py(F.current,{transition:`opacity ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&P&&Py(e,{borderRadius:"8px",overflow:"hidden",...Ty(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:`${Iy.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Iy.EASE.join(",")})`},!0)}return e.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),e.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(Ry(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let o=n-t;const r=G.current.getBoundingClientRect().height||0,a=r>.8*n;ee.current||(ee.current=r);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-o)>60&&(U.current=!U.current),i&&i.length>0&&ie&&oe){o+=ie[oe]||0}if(Z.current=o,r>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),G.current.style.height=g?e-Math.max(o,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);i&&i.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(o,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[oe,i,ie]),e.useEffect(()=>(P&&(Py(document.documentElement,{scrollBehavior:"auto"}),j.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Ay.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[P]),e.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),e.createElement(Sf,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?$(!0):pe(!0),T(e))},open:P},e.createElement(fy.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:re,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),H.current=new Date,gy()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=Ty(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(Ly),Y.current=!1,z(!1),W.current=new Date;const t=Dy(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===H.current)return;const n=W.current.getTime()-H.current.getTime(),o=K.current-(Ty(x)?e.pageY:e.pageX),r=Math.abs(o)/n;if(r>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:o*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:r,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?o>0:o<0)return he(),void(null==a||a(e,!0));if(r>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&I){const n="bottom"===x||"right"===x?1:-1,o=(K.current-(Ty(x)?e.pageY:e.pageX))*n,a=o>0,l=i&&!d&&!a;if(l&&0===oe)return;const c=Math.abs(o),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,a);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,a))return;if(G.current.classList.add(Ly),Y.current=!0,Py(G.current,{transition:"none"}),Py(F.current,{transition:"none"}),i&&se({draggedDistance:o}),a&&!i){const e=(t=o,8*(Math.log(t+1)-2)),r=Math.min(-1*e,0)*n;return void Py(G.current,{transform:Ty(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`})}const m=1-f;if((le||p&&oe===p-1)&&(null==r||r(e,f),Py(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);Py(u,{borderRadius:`${t}px`,transform:Ty(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;Py(G.current,{transform:Ty(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:P,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-zy)/window.innerWidth,o=n+t*(1-n),r=t*zy-16;Py(G.current,{transform:Ty(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-zy)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Py(G.current,{transition:`transform ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`,transform:Ty(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=Dy(G.current,x);Py(G.current,{transition:"none",transform:Ty(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=Ty(x)?window.innerHeight:window.innerWidth,o=t?(n-zy)/n:1,r=t?-16:0;t&&Py(G.current,{transition:`transform ${Iy.DURATION}s cubic-bezier(${Iy.EASE.join(",")})`,transform:Ty(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ie,activeSnapPointIndex:oe,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:R}},o))}const Wy=e.forwardRef(function({...t},n){const{overlayRef:o,snapPoints:r,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=py(),u=Oy(n,o),d=r&&r.length>0;if(!l)return null;const f=e.useCallback(e=>a(e),[a]);return e.createElement(kf,{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",...t})});Wy.displayName="Drawer.Overlay";const Vy=e.forwardRef(function({onPointerDownOutside:t,style:n,onOpenAutoFocus:o,...r},a){const{drawerRef:i,onPress:s,onRelease:l,onDrag:c,keyboardIsOpen:u,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:h,direction:m,snapPoints:g,container:y,handleOnly:v,shouldAnimate:b,autoFocus:w}=py(),[x,E]=e.useState(!1),S=Oy(a,i),_=e.useRef(null),C=e.useRef(null),k=e.useRef(!1),N=g&&g.length>0;!function(){const{direction:t,isOpen:n,shouldScaleBackground:o,setBackgroundColorOnScale:r,noBodyStyles:a}=py(),i=e.useRef(null),s=e.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-26)/window.innerWidth}e.useEffect(()=>{if(n&&o){i.current&&clearTimeout(i.current);const e=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!e)return;r&&!a&&$y(document.body,{background:"black"}),$y(e,{transformOrigin:Ty(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Iy.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Iy.EASE.join(",")})`});const n=$y(e,{borderRadius:"8px",overflow:"hidden",...Ty(t)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},1e3*Iy.DURATION)}}},[n,o,s])}();function M(e){_.current=null,k.current=!1,l(e)}return e.useEffect(()=>{N&&window.requestAnimationFrame(()=>{E(!0)})},[]),e.createElement(Nf,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":h&&N?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...r,ref:S,style:d&&d.length>0?{"--snap-point-height":`${d[null!=f?f:0]}px`,...n}:n,onPointerDown:e=>{v||(null==r.onPointerDown||r.onPointerDown.call(r,e),_.current={x:e.pageX,y:e.pageY},s(e))},onOpenAutoFocus:e=>{null==o||o(e),w||e.preventDefault()},onPointerDownOutside:e=>{null==t||t(e),p&&!e.defaultPrevented?u.current&&(u.current=!1):e.preventDefault()},onFocusOutside:e=>{p||e.preventDefault()},onPointerMove:e=>{if(C.current=e,v)return;if(null==r.onPointerMove||r.onPointerMove.call(r,e),!_.current)return;const t=e.pageY-_.current.y,n=e.pageX-_.current.x,o="touch"===e.pointerType?10:2,a=((e,t,n=0)=>{if(k.current)return!0;const o=Math.abs(e.y),r=Math.abs(e.x),a=r>o,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&r>=0&&r<=n)return a}else if(!(e.y*i<0)&&o>=0&&o<=n)return!a;return k.current=!0,!0})({x:n,y:t},m,o);a?c(e):(Math.abs(n)>o||Math.abs(t)>o)&&(_.current=null)},onPointerUp:e=>{null==r.onPointerUp||r.onPointerUp.call(r,e),_.current=null,k.current=!1,l(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),M(C.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),C.current&&M(C.current)}})});Vy.displayName="Drawer.Content";const Yy=e.forwardRef(function({preventCycle:t=!1,children:n,...o},r){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=py(),m=e.useRef(null),g=e.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return e.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||t||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 e=s.findIndex(e=>e===l);if(-1===e)return;const n=s[e+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...o},e.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});Yy.displayName="Drawer.Handle";const Xy={Root:Hy,NestedRoot:function({onDrag:t,onOpenChange:n,open:o,...r}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=py();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return e.createElement(Hy,{nested:!0,open:o,onClose:()=>{i(!1)},onDrag:(e,n)=>{a(e,n),null==t||t(e,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...r})},Content:Vy,Overlay:Wy,Trigger:_f,Portal:function(t){const n=py(),{container:o=n.container,...r}=t;return e.createElement(Cf,{container:o,...r})},Handle:Yy,Close:Of,Title:Mf,Description:Rf},Ky=({shouldScaleBackground:e=!0,...t})=>r.createElement(Xy.Root,{shouldScaleBackground:e,...t});Ky.displayName="Drawer";const Uy=Xy.Portal,qy=r.forwardRef(({className:e,...t},n)=>r.createElement(Xy.Overlay,{ref:n,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:e,...t}));qy.displayName=Xy.Overlay.displayName;const Zy=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(Uy,null,r.createElement(qy,null),r.createElement(Xy.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:e,...n},r.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),t)));Zy.displayName="DrawerContent";r.forwardRef(({className:e,...t},n)=>r.createElement(Xy.Title,{ref:n,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:e,...t})).displayName=Xy.Title.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Xy.Description,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=Xy.Description.displayName;exports.AgenticFlowVisualizer=Bf,exports.AnthropicIcon=Pc,exports.Badge=dc,exports.Checkbox=dy,exports.Drawer=Ky,exports.Edge=Ul,exports.FileSelector=({files:t,currentFile:n,onFileSelect:o,onRefresh:r,loading:a=!1,disabled:i=!1})=>{const{theme:s}=Kl(),l=s.colors;return e.createElement(Lg,null,0!==t.length||a?e.createElement(bg,{value:n||"",onValueChange:o,disabled:i||a},e.createElement(Fg,{disabled:i,loading:a},e.createElement(Tg,null,e.createElement(jg,null,e.createElement(wg,{placeholder:a?"Loading sessions...":0===t.length?"No sessions found":"Select an Agent Session..."})))),e.createElement(Ig,null,0!==t.length||a?t.map(t=>e.createElement(zg,{key:t.name,value:t.name},t.name)):e.createElement(Hg,{themeColors:l},"No agent sessions available"))):e.createElement(Bg,{themeColors:l},"No agent sessions available"),t.length>0&&e.createElement(Wg,{onClick:e=>{e.stopPropagation(),r()},disabled:a||i,loading:a,title:a?"Loading...":"Refresh files",themeColors:l},a?e.createElement(Vg,{themeColors:l}):e.createElement(Yg,null)))},exports.GlobalStyles=()=>null,exports.GoogleIcon=Ac,exports.JsonTreeViewer=Rc,exports.Node=Dc,exports.OpenAIIcon=Oc,exports.Select=bg,exports.Sheet=Af,exports.ThemeProvider=({children:t,theme:n})=>{const[o,r]=e.useState(()=>{if(n)return n;return"dark"===localStorage.getItem("theme")?Vl:Wl});e.useEffect(()=>{n&&r(n)},[n]),e.useEffect(()=>{if(n)return;const e=()=>{const e=localStorage.getItem("theme");r("dark"===e?Vl:Wl)};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[n]);const a=e.useMemo(()=>({theme:o,setTheme:r}),[o]);return e.createElement(Xl.Provider,{value:a},e.createElement(Hl,{theme:o},t))},exports.Timeline=ru,exports.Visualizer=t=>e.createElement(Wi,null,e.createElement(Bf,t)),exports.calculateAutoLayout=zf,exports.cn=function(...e){return function(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=nc(e))&&(o&&(o+=" "),o+=t);return o}(e)},exports.conditionalStyle=function(e,t,n=""){return e?t:n},exports.darkTheme=Vl,exports.defaultTheme=Yl,exports.formatCurrency=rc,exports.formatLatency=ac,exports.getColor=function(e,t){return e.colors[t]||e.colors.foreground},exports.getSpacing=function(e,t){return e.spacing[t]||e.spacing.md},exports.lightTheme=Wl,exports.toTitleCase=oc,exports.truncateText=ic,exports.useComponentTheme=e=>{const{theme:t}=Kl();return e||t},exports.useTheme=Kl,exports.useThemeValue=()=>{const{theme:e}=Kl();return e};
|