@railtownai/railtracks-visualizer 0.0.15 → 0.0.17
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 +1 -0
- package/dist/cjs/index.js +110 -42
- package/dist/esm/index.js +110 -42
- package/dist/types/components/AgenticFlowVisualizer.d.ts +0 -1
- package/dist/types/components/Edge.d.ts +0 -1
- package/dist/types/components/FileSelector.d.ts +0 -1
- package/dist/types/components/Node.d.ts +0 -1
- package/dist/types/components/Timeline.d.ts +0 -1
- package/dist/types/components/Visualizer.d.ts +0 -1
- package/dist/types/components/icons/AnthropicIcon.d.ts +6 -0
- package/dist/types/components/icons/GoogleIcon.d.ts +6 -0
- package/dist/types/components/icons/OpenAIIcon.d.ts +6 -0
- package/dist/types/components/icons/index.d.ts +3 -0
- package/dist/types/components/ui/badge.d.ts +3 -7
- package/dist/types/components/ui/checkbox.d.ts +0 -1
- package/dist/types/components/ui/drawer.d.ts +0 -1
- package/dist/types/components/ui/json-tree.d.ts +0 -1
- package/dist/types/components/ui/select.d.ts +0 -1
- package/dist/types/components/ui/sheet.d.ts +1 -2
- package/dist/types/dto/AgentRun.d.ts +0 -1
- package/dist/types/dto/AgentRunEdge.d.ts +0 -1
- package/dist/types/dto/AgentRunNode.d.ts +0 -1
- package/dist/types/dto/AgentSession.d.ts +0 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/useApi.d.ts +0 -1
- package/dist/types/hooks/useFlowData.d.ts +0 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/index.d.ts +0 -1
- package/dist/types/lib/layout.d.ts +0 -1
- package/dist/types/lib/utils.d.ts +0 -1
- package/package.json +7 -10
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/types/App.d.ts +0 -9
- package/dist/types/App.d.ts.map +0 -1
- package/dist/types/components/AgenticFlowVisualizer.d.ts.map +0 -1
- package/dist/types/components/Edge.d.ts.map +0 -1
- package/dist/types/components/FileSelector.d.ts.map +0 -1
- package/dist/types/components/Node.d.ts.map +0 -1
- package/dist/types/components/Timeline.d.ts.map +0 -1
- package/dist/types/components/Visualizer.d.ts.map +0 -1
- package/dist/types/components/ui/badge.d.ts.map +0 -1
- package/dist/types/components/ui/checkbox.d.ts.map +0 -1
- package/dist/types/components/ui/drawer.d.ts.map +0 -1
- package/dist/types/components/ui/json-tree.d.ts.map +0 -1
- package/dist/types/components/ui/select.d.ts.map +0 -1
- package/dist/types/components/ui/sheet.d.ts.map +0 -1
- package/dist/types/dto/AgentRun.d.ts.map +0 -1
- package/dist/types/dto/AgentRunEdge.d.ts.map +0 -1
- package/dist/types/dto/AgentRunNode.d.ts.map +0 -1
- package/dist/types/dto/AgentSession.d.ts.map +0 -1
- package/dist/types/hooks/index.d.ts.map +0 -1
- package/dist/types/hooks/useApi.d.ts.map +0 -1
- package/dist/types/hooks/useFlowData.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/lib/index.d.ts.map +0 -1
- package/dist/types/lib/layout.d.ts.map +0 -1
- package/dist/types/lib/utils.d.ts.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,31 +1,4 @@
|
|
|
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={};
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.development.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/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}
|
|
11
|
-
/**
|
|
12
|
-
* @license React
|
|
13
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var v,b={};
|
|
20
|
-
/**
|
|
21
|
-
* @license React
|
|
22
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
23
|
-
*
|
|
24
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the MIT license found in the
|
|
27
|
-
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/"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 N=(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 k(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 O(){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 R(o)}function R(e){this._=e}function P(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function A(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}R.prototype=O.prototype={constructor:R,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]=A(r[n],e.name,t);else if(null==t)for(n in r)r[n]=A(r[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=P(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new R(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 D="http://www.w3.org/1999/xhtml",T={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function I(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),T.hasOwnProperty(t)?{space:T[t],local:e}:e}function z(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===D&&t.documentElement.namespaceURI===D?t.createElement(e):t.createElementNS(n,e)}}function L(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $(e){var t=I(e);return(t.local?L:z)(t)}function j(){}function B(e){return null==e?j:function(){return this.querySelector(e)}}function H(){return[]}function F(e){return null==e?H: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 q=Array.prototype.filter;function U(){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 Ne(e){return function(){this.textContent=e}}function ke(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Me(){this.innerHTML=""}function Oe(e){return function(){this.innerHTML=e}}function Re(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 De(){return null}function Te(){var e=this.parentNode;e&&e.removeChild(this)}function Ie(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ze(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Le(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 $e(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 je(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 Be(e,t){return function(){return je(this,e,t)}}function He(e,t){return function(){return je(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 Fe=[null];function Ve(e,t){this._groups=e,this._parents=t}function We(){return new Ve([[document.documentElement]],Fe)}function Ye(e){return"string"==typeof e?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],Fe)}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]}Ve.prototype=We.prototype={constructor:Ve,select:function(e){"function"!=typeof e&&(e=B(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 Ve(o,this._parents)},selectAll:function(e){e="function"==typeof e?V(e):F(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 Ve(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?U:function(e){return function(){return q.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,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 Ve(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 Ve(s,r))._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 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 Ve(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 Ve(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=I(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?ke:Ne)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Me:("function"==typeof e?Re:Oe)(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:$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:$(e),o=null==t?De:"function"==typeof t?t:B(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Te)},clone:function(e){return this.select(e?ze:Ie)},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?$e:Le,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?He:Be)(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},qe={capture:!0,passive:!1};function Ue(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,qe);"onselectstart"in t?n.on("selectstart.drag",Ze,qe):(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,qe),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 kt(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 kt(t[1],t[2],t[3],1):(t=mt.exec(e))?new kt(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))?Dt(t[1],t[2]/100,t[3]/100,1):(t=bt.exec(e))?Dt(t[1],t[2]/100,t[3]/100,t[4]):wt.hasOwnProperty(e)?_t(wt[e]):"transparent"===e?new kt(NaN,NaN,NaN,0):null}function _t(e){return new kt(e>>16&255,e>>8&255,255&e,1)}function Ct(e,t,n,o){return o<=0&&(e=t=n=NaN),new kt(e,t,n,o)}function Nt(e,t,n,o){return 1===arguments.length?((r=e)instanceof st||(r=St(r)),r?new kt((r=r.rgb()).r,r.g,r.b,r.opacity):new kt):new kt(e,t,n,null==o?1:o);var r}function kt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Mt(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Ot(){const e=Rt(this.opacity);return`${1===e?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${1===e?")":`, ${e})`}`}function Rt(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 Dt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new It(e,t,n,o)}function Tt(e){if(e instanceof It)return new It(e.h,e.s,e.l,e.opacity);if(e instanceof st||(e=St(e)),!e)return new It;if(e instanceof It)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 It(i,s,l,e.opacity)}function It(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function zt(e){return(e=(e||0)%360)<0?e+360:e}function Lt(e){return Math.max(0,Math.min(1,e||0))}function $t(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 Tt(this).formatHsl()},formatRgb:Et,toString:Et}),at(kt,Nt,it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new kt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new kt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kt(Pt(this.r),Pt(this.g),Pt(this.b),Rt(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:Ot,toString:Ot})),at(It,function(e,t,n,o){return 1===arguments.length?Tt(e):new It(e,t,n,null==o?1:o)},it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new It(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new It(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 kt($t(e>=240?e-240:e+120,r,o),$t(e,r,o),$t(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new It(zt(this.h),Lt(this.s),Lt(this.l),Rt(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=Rt(this.opacity);return`${1===e?"hsl(":"hsla("}${zt(this.h)}, ${100*Lt(this.s)}%, ${100*Lt(this.l)}%${1===e?")":`, ${e})`}`}}));var jt=e=>()=>e;function Bt(e){return 1===(e=+e)?Ht: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):jt(isNaN(t)?n:t)}}function Ht(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):jt(isNaN(e)?t:e)}var Ft=function e(t){var n=Bt(t);function o(e,t){var o=n((e=Nt(e)).r,(t=Nt(t)).r),r=n(e.g,t.g),a=n(e.b,t.b),i=Ht(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 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,o,r,a=Wt.lastIndex=Yt.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=Wt.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:Vt(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,qt=180/Math.PI,Ut={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)*qt,skewX:Math.atan(l)*qt,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:Vt(e,r)},{i:l-2,x:Vt(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:Vt(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:Vt(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:Vt(e,n)},{i:s-2,x:Vt(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?Ut:Zt(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Jt=Gt(function(e){return null==e?Ut:(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):Ut)},", ",")",")");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=O("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=Nn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Cn(e,t){var n=Nn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Nn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function kn(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 On(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 Rn(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 Nn(e,o).value[t]}}function Pn(e,t){var n;return("number"==typeof t?Vt:t instanceof St?Ft:(n=St(t))?(t=n,Ft):Xt)(e,t)}function An(e){return function(){this.removeAttribute(e)}}function Dn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tn(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 In(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 zn(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 Ln(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 $n(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 jn(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 Bn(e,t){return function(){_n(this,e).delay=+t.apply(this,arguments)}}function Hn(e,t){return t=+t,function(){_n(this,e).delay=t}}function Fn(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,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function qn(){return++Xn}var Un=We.prototype;Kn.prototype={constructor:Kn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=B(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,Nn(s,n)));return new Kn(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=F(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=Nn(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:Un.selectChild,selectChildren:Un.selectChildren,filter:function(e){"function"!=typeof e&&(e=W(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 Wn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=qn(),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=Nn(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:Un.call,nodes:Un.nodes,node:Un.node,size:Un.size,empty:Un.empty,each:Un.each,on:function(e,t){var n=this._id;return arguments.length<2?Nn(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=I(e),o="transform"===n?Jt:Pn;return this.attrTween(e,"function"==typeof t?(n.local?Ln:zn)(n,o,Rn(this,"attr."+e,t)):null==t?(n.local?Dn:An)(n):(n.local?In:Tn)(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=I(e);return this.tween(n,(o.local?$n:jn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Qt:Pn;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,Rn(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}}(Rn(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=Nn(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:On)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Bn:Hn)(t,e)):Nn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Fn:Vn)(t,e)):Nn(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)):Nn(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]:Un[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(){kn(this,e)})},We.prototype.transition=function(e){var t,n;e instanceof Kn?(t=e._id,e=e._name):(t=qn(),(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])},No=e=>e.userSelectionActive?"none":"all";function ko({position:t,children:n,className:o,style:r,...a}){const s=_o(No),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(ko,{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 Oo=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 Ro=e=>({width:e.offsetWidth,height:e.offsetHeight}),Po=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ao=(e={x:0,y:0},t)=>({x:Po(e.x,t[0][0],t[1][0]),y:Po(e.y,t[0][1],t[1][1])}),Do=(e,t,n)=>e<t?Po(Math.abs(e-t),1,50)/50:e>n?-Po(Math.abs(e-n),1,50)/50:0,To=(e,t)=>[20*Do(e.x,35,t.width-35),20*Do(e.y,35,t.height-35)],Io=e=>e.getRootNode?.()||window?.document,zo=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Lo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),$o=(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)},jo=e=>!isNaN(e)&&isFinite(e),Bo=Symbol.for("internals"),Ho=["Enter"," ","Escape"],Fo=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function Vo(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 Wo=e=>"clientX"in e,Yo=(e,t)=>{const n=Wo(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&&jo(o)&&jo(r)?e.createElement(Oo,{x:o,y:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function qo(e,t,n){return void 0===n?n:o=>{const r=t().edges.find(t=>t.id===e);r&&n(o,{...r})}}function Uo({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]=Uo({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]=Uo({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 Fo("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};return(({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}))(e.reduce((e,n)=>{const{x:o,y:r}=_r(n,t).positionAbsolute;return a=e,i=zo({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}))},Nr=(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=$o(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},kr=(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=Po(l,o,r);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Or=(e,t=0)=>e.transition().duration(t);function Rr(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 Pr={source:null,target:null,sourceHandle:null,targetHandle:null},Ar=()=>({handleDomNode:null,isValid:!1,connection:Pr,endHandle:null});function Dr(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={...Ar(),handleDomNode:l};if(l){const e=Tr(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 Tr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ir(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function zr(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Lr({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Io(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),_=Tr(l,S),C=f?.getBoundingClientRect();if(!C||!_)return;let N,k=Yo(e,C),M=!1,O=null,R=!1,P=null;const A=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((e,r)=>{if(r[Bo]){const{handleBounds:a}=r[Bo];let i=[],s=[];a&&(i=Rr(r,a,"source",`${t}-${n}-${o}`),s=Rr(r,a,"target",`${t}-${n}-${o}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),D=()=>{if(!p)return;const[e,t]=To(k,C);g({x:e,y:t}),w=requestAnimationFrame(D)};function T(e){const{transform:o}=a();k=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=Tr(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:Ar()};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(k,o,!1,[1,1]),h,A,e=>Dr(e,d,n,t,r?"target":"source",s,u));if(b=l,M||(D(),M=!0),P=c.handleDomNode,O=c.connection,R=c.isValid,i({connectionPosition:b&&R?Sr({x:b.x,y:b.y},o):k,connectionStatus:zr(!!b,R),connectionEndHandle:c.endHandle}),!b&&!R&&!P)return Ir(N);O.source!==O.target&&P&&(Ir(N),N=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",R),P.classList.toggle("react-flow__handle-valid",R))}function I(e){(b||P)&&O&&R&&o?.(O),a().onConnectEnd?.(e),l&&c?.(e),Ir(N),v(),cancelAnimationFrame(w),M=!1,R=!1,O=null,P=null,u.removeEventListener("mousemove",T),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",T),u.removeEventListener("touchend",I)}i({connectionPosition:k,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",T),u.addEventListener("mouseup",I),u.addEventListener("touchmove",T),u.addEventListener("touchend",I)}const $r=()=>!0,jr=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Br=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(jr,k),{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),k);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=Wo(e);a&&(t&&0===e.button||!t)&&Lr({event:e,handleId:g,nodeId:b,onConnect:_,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:o||v.getState().isValidConnection||$r}),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=Io(e.target),u=o||l||$r,{connection:d,isValid:f}=Dr({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)});Br.displayName="Handle";var Hr=e.memo(Br);const Fr=({data:t,isConnectable:n,targetPosition:o=nr.Top,sourcePosition:r=nr.Bottom})=>e.createElement(e.Fragment,null,e.createElement(Hr,{type:"target",position:o,isConnectable:n}),t?.label,e.createElement(Hr,{type:"source",position:r,isConnectable:n}));Fr.displayName="DefaultNode";var Vr=e.memo(Fr);const Wr=({data:t,isConnectable:n,sourcePosition:o=nr.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(Hr,{type:"source",position:o,isConnectable:n}));Wr.displayName="InputNode";var Yr=e.memo(Wr);const Xr=({data:t,isConnectable:n,targetPosition:o=nr.Top})=>e.createElement(e.Fragment,null,e.createElement(Hr,{type:"target",position:o,isConnectable:n}),t?.label);Xr.displayName="OutputNode";var Kr=e.memo(Xr);const qr=()=>null;qr.displayName="GroupNode";const Ur=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 k(e.selectedNodes.map(Zr),t.selectedNodes.map(Zr))&&k(e.selectedEdges.map(Zr),t.selectedEdges.map(Zr))}const Qr=e.memo(({onSelectionChange:t})=>{const n=Co(),{selectedNodes:o,selectedEdges:r}=_o(Ur,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:N,defaultEdgeOptions:M,fitView:O,fitViewOptions:R,onNodesDelete:P,onEdgesDelete:A,onNodeDrag:D,onNodeDragStart:T,onNodeDragStop:I,onSelectionDrag:z,onSelectionDragStart:L,onSelectionDragStop:$,noPanClassName:j,nodeOrigin:B,rfId:H,autoPanOnConnect:F,autoPanOnNodeDrag:V,onError:W,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:q,setEdges:U,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=_o(ta,k),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",N,ne.setState),oa("fitViewOnInit",O,ne.setState),oa("fitViewOnInitOptions",R,ne.setState),oa("onNodesDelete",P,ne.setState),oa("onEdgesDelete",A,ne.setState),oa("onNodeDrag",D,ne.setState),oa("onNodeDragStart",T,ne.setState),oa("onNodeDragStop",I,ne.setState),oa("onSelectionDrag",z,ne.setState),oa("onSelectionDragStart",L,ne.setState),oa("onSelectionDragStop",$,ne.setState),oa("noPanClassName",j,ne.setState),oa("nodeOrigin",B,ne.setState),oa("rfId",H,ne.setState),oa("autoPanOnConnect",F,ne.setState),oa("autoPanOnNodeDrag",V,ne.setState),oa("onError",W,ne.setState),oa("connectionRadius",Y,ne.setState),oa("isValidConnection",X,ne.setState),oa("nodeDragThreshold",K,ne.setState),na(t,q),na(n,U),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)&&Vo(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)&&Vo(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[Bo]?.z??0)>(n.z??0)?a[Bo]?.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[Bo]?.z??0},t);o.positionAbsolute={x:r,y:a},o[Bo].z=i,n?.[o.id]&&(o[Bo].isParent=!0)}})}function ya(e,t,n,o){const r=new Map,a={},i=o?1e3:0;return e.forEach(e=>{const n=(jo(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,Bo,{enumerable:!1,value:{handleBounds:c?void 0:o?.[Bo]?.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(Or(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,[Bo]:n[Bo],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,k),r=e.useMemo(()=>o&&n?{zoomIn:e=>n.scaleBy(Or(o,e?.duration),1.2),zoomOut:e=>n.scaleBy(Or(o,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Or(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(Or(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(Or(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(Or(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){a(0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"})))}},[]),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){i(t.map(e=>({item:e,type:"add"})))}},[]),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=kr(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=jo((o=e).width)&&jo(o.height)&&jo(o.x)&&jo(o.y);var o;const r=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!r)return[null,null,t];return[t?e:Lo(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=Lo(e),o=$o(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=$o(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 Na={actInsideInputWithModifier:!1};const ka={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ma=e=>({x:e.x,y:e.y,zoom:e.k}),Oa=(e,t)=>e.target.closest(`.${t}`),Ra=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Pa=e=>{const t=e.ctrlKey&&Xo()?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}),Da=({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),N=e.useRef(null),M=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:R,d3Selection:P,d3ZoomHandler:A,userSelectionActive:D}=_o(Aa,k),T=fa(y),I=e.useRef(0),z=e.useRef(!1),L=e.useRef();return function(t){const n=Co();e.useEffect(()=>{let e;const o=()=>{if(!t.current)return;const e=Ro(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)}},[])}(N),e.useEffect(()=>{if(N.current){const e=N.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=O("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",N).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new 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)],kn(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)],kn(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)),kn(this),d.start())}}function N(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 k(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(N.current).call(t),o=to.translate(p.x,p.y).scale(Po(p.zoom,m,g)),r=[[0,0],[e.width,e.height]],a=t.constrain()(o,r,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:N.current.closest(".react-flow")})}},[]),e.useEffect(()=>{P&&R&&(!s||T||D?void 0!==A&&P.on("wheel.zoom",function(e,t){if(!v&&"wheel"===e.type&&!e.ctrlKey||Oa(e,w))return null;e.preventDefault(),A.call(this,e,t)},{passive:!1}):P.on("wheel.zoom",e=>{if(Oa(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const r=P.property("__zoom").k||1;if(e.ctrlKey&&i){const t=Xe(e),n=Pa(e),o=r*Math.pow(2,n);return void R.scaleTo(P,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),R.translateBy(P,-s/r*l,-u/r*l,{internal:!0});const d=Ma(P.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=S.getState();clearTimeout(L.current),z.current||(z.current=!0,n?.(e,d),f?.(d)),z.current&&(t?.(e,d),p?.(d),L.current=setTimeout(()=>{o?.(e,d),h?.(d),z.current=!1},150))},{passive:!1}))},[D,s,c,P,R,A,T,i,v,w,n,t,o]),e.useEffect(()=>{R&&R.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;I.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)})},[R,n]),e.useEffect(()=>{R&&(D&&!_.current?R.on("zoom",null):D||R.on("zoom",e=>{const{onViewportChange:n}=S.getState();if(S.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),C.current=!(!r||!Ra(f,I.current??0)),(t||n)&&!e.sourceEvent?.internal){const o=Ma(e.transform);n?.(o),t?.(e.sourceEvent,o)}}))},[D,R,t,f,r]),e.useEffect(()=>{R&&R.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=S.getState();if(_.current=!1,S.setState({paneDragging:!1}),r&&Ra(f,I.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})},[R,s,f,o,r]),e.useEffect(()=>{R&&R.filter(e=>{const t=T||a,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(Oa(e,"react-flow__node")||Oa(e,"react-flow__edge")))return!0;if(!(f||t||s||u||i))return!1;if(D)return!1;if(!u&&"dblclick"===e.type)return!1;if(Oa(e,w)&&"wheel"===e.type)return!1;if(Oa(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!T))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})},[D,R,a,i,s,u,f,d,T]),e.createElement("div",{className:"react-flow__renderer",ref:N,style:ka},b)},Ta=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ia(){const{userSelectionActive:t,userSelectionRect:n}=_o(Ta,k);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 za(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 La(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&&za(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&&za(t,r);break;case"remove":return t}return t.push(r),t},n)}function $a(e,t){return La(e,t)}const ja=(e,t)=>({id:e,type:"select",selected:t});function Ba(e,t){return e.reduce((e,n)=>{const o=t.includes(n.id);return!n.selected&&o?(n.selected=!0,e.push(ja(n.id,!0))):n.selected&&!o&&(n.selected=!1,e.push(ja(n.id,!1))),e},[])}const Ha=(e,t)=>n=>{n.target===t.current&&e?.(n)},Fa=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Va=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(Fa,k),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:Ha(S,h),onContextMenu:Ha(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():l?.(e)},h),onWheel:Ha(_,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=Nr(r,h,i,n===Jo.Partial,!0,c),x=kr(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Ba(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Ba(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:ka},p,e.createElement(Ia,null))});function Wa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return!!o&&(!!o.selected||Wa(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||!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,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&&jo(o)&&jo(a)&&jo(t.width)&&jo(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?Ao(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function qa({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]}Va.displayName="Pane";const Ua=(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,...Ro(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=zo(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]=qa({nodeId:a,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=To(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]=qa({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=O("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,qe).on("mouseup.drag",m,qe),Ge(i.view),Ue(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]))&&(Ue(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])&&(Ue(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]=qa({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();return 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;r(u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:r,position:a}=Ka(e,t,n,o,void 0,l);e.position=a,e.positionAbsolute=r}return e}),!0,!1)},[])}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:N,resizeObserver:k,dragHandle:M,zIndex:O,isParent:R,noDragClassName:P,noPanClassName:A,initialized:D,disableKeyboardA11y:T,ariaLabel:I,rfId:z,hasHandleBounds:L})=>{const $=Co(),j=e.useRef(null),B=e.useRef(null),H=e.useRef(_),F=e.useRef(C),V=e.useRef(o),W=w||b||d||f||p||h,Y=ei(),X=Za(n,$.getState,f),K=Za(n,$.getState,p),q=Za(n,$.getState,h),U=Za(n,$.getState,m),Z=Za(n,$.getState,g);e.useEffect(()=>()=>{B.current&&(k?.unobserve(B.current),B.current=null)},[]),e.useEffect(()=>{if(j.current&&!N){const e=j.current;D&&L&&B.current===e||(B.current&&k?.unobserve(B.current),k?.observe(e),B.current=e)}},[N,D,L]),e.useEffect(()=>{const e=V.current!==o,t=H.current!==_,r=F.current!==C;j.current&&(e||t||r)&&(e&&(V.current=o),t&&(H.current=_),r&&(F.current=C),$.getState().updateNodeDimensions([{id:n,nodeElement:j.current,forceUpdate:!0}]))},[n,o,_,C]);const G=Ja({nodeRef:j,disabled:N||!b,noDragClassName:P,handleSelector:M,nodeId:n,isSelectable:w,selectNodesOnDrag:S});return N?null:e.createElement("div",{className:i(["react-flow__node",`react-flow__node-${o}`,{[A]:b},v,{selected:u,selectable:w,parent:R,dragging:G}]),ref:j,style:{zIndex:O,transform:`translate(${l}px,${c}px)`,pointerEvents:W?"all":"none",visibility:D?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:K,onMouseLeave:q,onContextMenu:U,onClick:e=>{const{nodeDragThreshold:t}=$.getState();if(w&&(!S||!b||t>0)&&Ga({id:n,store:$,nodeRef:j}),d){const t=$.getState().nodeInternals.get(n);t&&d(e,{...t})}},onDoubleClick:Z,onKeyDown:E?e=>{if(!Vo(e)&&!T)if(Ho.includes(e.key)&&w){const t="Escape"===e.key;Ga({id:n,store:$,unselect:t,nodeRef:j})}else b&&u&&Object.prototype.hasOwnProperty.call(ti,e.key)&&($.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":T?void 0:`${sa}-${z}`,"aria-label":I},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:O})))};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,k),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:N,panOnDrag:k,defaultViewport:M,translateExtent:O,minZoom:R,maxZoom:P,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:T,noPanClassName:I,disableKeyboardA11y:z})=>{const L=_o(ai),$=fa(f),j=fa(v),B=j||k,H=j||S,F=$||p&&!0!==B;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const o=Co(),{deleteElements:r}=Ca(),a=fa(t,Na),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(Da,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:H,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:N,panOnDrag:!$&&B,defaultViewport:M,translateExtent:O,minZoom:R,maxZoom:P,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:T,noPanClassName:I},e.createElement(Va,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:B,isSelecting:!!F,selectionMode:h},t,L&&e.createElement(ri,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:z})))};ii.displayName="FlowRenderer";var si=e.memo(ii);function li(e){return{...{input:ni(e.input||Yr),default:ni(e.default||Vr),output:ni(e.output||Kr),group:ni(e.group||qr)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ni(e[n]||Vr),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,k),l=(c=t.onlyRenderVisibleElements,_o(e.useCallback(e=>c?Nr(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:ka},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?Ao(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[Bo]?.z??0,isParent:!!i[Bo]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!i.width&&!!i.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[Bo]?.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:N,hidden:k,sourceHandleId:M,targetHandleId:O,onContextMenu:R,onMouseEnter:P,onMouseMove:A,onMouseLeave:D,reconnectRadius:T,onReconnect:I,onReconnectStart:z,onReconnectEnd:L,markerEnd:$,markerStart:j,rfId:B,ariaLabel:H,isFocusable:F,isReconnectable:V,pathOptions:W,interactionWidth:Y,disableKeyboardA11y:X})=>{const K=e.useRef(null),[q,U]=e.useState(!1),[Z,G]=e.useState(!1),Q=Co(),J=e.useMemo(()=>`url('#${wr(j,B)}')`,[j,B]),ee=e.useMemo(()=>`url('#${wr($,B)}')`,[$,B]);if(k)return null;const te=qo(n,Q.getState,l),ne=qo(n,Q.getState,R),oe=qo(n,Q.getState,P),re=qo(n,Q.getState,A),ae=qo(n,Q.getState,D),ie=(e,t)=>{if(0!==e.button)return;const{edges:o,isValidConnection:r}=Q.getState(),a=t?b:v,i=(t?O:M)||null,s=t?"target":"source",l=r||gi,c=t,u=o.find(e=>e.id===n);G(!0),z?.(e,u,s);Lr({event:e,handleId:i,nodeId:a,onConnect:e=>I?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{G(!1),L?.(e,u,s)}})},se=()=>U(!0),le=()=>U(!1),ce=!N&&!s;return e.createElement("g",{className:i(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:c,animated:u,inactive:ce,updating:q}]),onClick:e=>{const{edges:t,addSelectedEdges:o,unselectNodesAndEdges:r,multiSelectionActive:a}=Q.getState(),i=t.find(e=>e.id===n);i&&(N&&(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:F?e=>{if(!X&&Ho.includes(e.key)&&N){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:F?0:void 0,role:F?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===H?void 0:H||`Edge from ${v} to ${b}`,"aria-describedby":F?`${la}-${B}`: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:O,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:T,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:T,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?.[Bo]?.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=jo(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?.[Bo]?.z||0,e?.[Bo]?.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=zo({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},Ni=({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})))};Ni.displayName="MarkerDefinitions";var ki=e.memo(Ni);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}),Oi=({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:N,onError:M}=_o(Mi,k),O=Si(n,N,o);return S?e.createElement(e.Fragment,null,O.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(ki,{defaultColor:t,rfId:r}),e.createElement("g",null,o.map(t=>{const[n,o,v]=xi(N.get(t.source)),[S,_,k]=xi(N.get(t.target));if(!v||!k)return null;let O=t.type||"default";a[O]||(M?.("011",xo(O)),O="default");const R=a[O]||a.default,P=C===Go.Strict?_.target:(_.target??[]).concat(_.source??[]),A=wi(o.source,t.sourceHandle),D=wi(P,t.targetHandle),T=A?.position||nr.Bottom,I=D?.position||nr.Top,z=!!(t.focusable||w&&void 0===t.focusable),L=t.reconnectable||t.updatable,$=void 0!==h&&(L||x&&void 0===L);if(!A||!D)return M?.("008",bo(A,t)),null;const{sourceX:j,sourceY:B,targetX:H,targetY:F}=((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,A,T,S,D,I);return e.createElement(R,{key:t.id,id:t.id,className:i([t.className,s]),type:O,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:j,sourceY:B,targetX:H,targetY:F,sourcePosition:T,targetPosition:I,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:z,isReconnectable:$,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))),v):null};Oi.displayName="EdgeRenderer";var Ri=e.memo(Oi);const Pi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ai({children:t}){const n=_o(Pi);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const Di={[nr.Left]:nr.Right,[nr.Right]:nr.Left,[nr.Top]:nr.Bottom,[nr.Bottom]:nr.Top},Ti=({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]),k),f=s?.[Bo]?.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?Di[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})};Ti.displayName="ConnectionLine";const Ii=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function zi({containerStyle:t,style:n,type:o,component:r}){const{nodeId:a,handleType:s,nodesConnectable:l,width:c,height:u,connectionStatus:d}=_o(Ii,k);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(Ti,{nodeId:a,handleType:s,style:n,type:o,CustomComponent:r,connectionStatus:d}))):null}function Li(t,n){const o=e.useRef(null),r=Co();return e.useMemo(()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);k(o.current,e)&&r.getState().onError?.("002",po()),o.current=e}return n(t)},[t])}const $i=({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:N,zoomActivationKeyCode:k,deleteKeyCode:M,onlyRenderVisibleElements:O,elementsSelectable:R,selectNodesOnDrag:P,defaultViewport:A,translateExtent:D,minZoom:T,maxZoom:I,preventScrolling:z,defaultMarkerColor:L,zoomOnScroll:$,zoomOnPinch:j,panOnScroll:B,panOnScrollSpeed:H,panOnScrollMode:F,zoomOnDoubleClick:V,panOnDrag:W,onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:q,onPaneScroll:U,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=Li(t,li),he=Li(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:q,onPaneContextMenu:Z,onPaneScroll:U,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:C,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:R,onMove:o,onMoveStart:r,onMoveEnd:a,zoomOnScroll:$,zoomOnPinch:j,zoomOnDoubleClick:V,panOnScroll:B,panOnScrollSpeed:H,panOnScrollMode:F,panOnDrag:W,defaultViewport:A,translateExtent:D,minZoom:T,maxZoom:I,onSelectionContextMenu:m,preventScrolling:z,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(Ai,null,e.createElement(Ri,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:O,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,reconnectRadius:re,defaultMarkerColor:L,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:fe},e.createElement(zi,{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:O,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})))};$i.displayName="GraphView";var ji=e.memo($i);const Bi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Hi={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:Bi,nodeExtent:Bi,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:Fo,isValidConnection:void 0},Fi=()=>{return e=(e,t)=>({...Hi,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,[Bo]:{...n[Bo],handleBounds:void 0}});else if(n){const o=Ro(t.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||t.forceUpdate)&&(r.set(n.id,{...n,[Bo]:{...n[Bo],handleBounds:{source:Ua(".source",t.nodeElement,f,c),target:Ua(".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();r(e.map(e=>{const t={id:e.id,type:"position",dragging:o};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}))},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=ya($a(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=>ja(e,!0)):(i=Ba(a(),n),s=Ba(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=>ja(e,!0)):(i=Ba(r,n),s=Ba(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,ja(e.id,!1))),changedEdges:i.map(e=>ja(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=>ja(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>ja(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:o}=t();o.forEach(e=>{e.positionAbsolute=Ao(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:Hi.connectionNodeId,connectionHandleId:Hi.connectionHandleId,connectionHandleType:Hi.connectionHandleType,connectionStatus:Hi.connectionStatus,connectionStartHandle:Hi.connectionStartHandle,connectionEndHandle:Hi.connectionEndHandle}),reset:()=>e({...Hi})}),t=Object.is,e?N(e,t):N;var e,t},Vi=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=Fi()),e.createElement(fo,{value:n.current},t)};Vi.displayName="ReactFlowProvider";const Wi=({children:t})=>e.useContext(uo)?e.createElement(e.Fragment,null,t):e.createElement(Vi,null,t);Wi.displayName="ReactFlowWrapper";const Yi={input:Yr,default:Vr,output:Kr,group:qr},Xi={default:gr,straight:fr,step:dr,smoothstep:ur,simplebezier:ar},Ki=[0,0],qi=[15,15],Ui={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:N,onNodeDragStop:k,onNodesDelete:M,onEdgesDelete:O,onSelectionChange:R,onSelectionDragStart:P,onSelectionDrag:A,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,connectionMode:L=Go.Strict,connectionLineType:$=er.Bezier,connectionLineStyle:j,connectionLineComponent:B,connectionLineContainerStyle:H,deleteKeyCode:F="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:W=!1,selectionMode:Y=Jo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(Xo()?"Meta":"Control"),zoomActivationKeyCode:q=(Xo()?"Meta":"Control"),snapToGrid:U=!1,snapGrid:Z=qi,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=Ki,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,defaultViewport:ie=Ui,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Bi,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:Ne,onEdgeContextMenu:ke,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Re,onEdgeMouseLeave:Pe,onEdgeUpdate:Ae,onEdgeUpdateStart:De,onEdgeUpdateEnd:Te,onReconnect:Ie,onReconnectStart:ze,onReconnectEnd:Le,reconnectRadius:$e=10,edgeUpdaterRadius:je=10,onNodesChange:Be,onEdgesChange:He,noDragClassName:Fe="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:qe,proOptions:Ue,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(Wi,null,e.createElement(ji,{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:$,connectionLineStyle:j,connectionLineComponent:B,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:W,selectionMode:Y,deleteKeyCode:F,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:q,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:T,onSelectionStart:I,onSelectionEnd:z,onEdgeContextMenu:ke,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Re,onEdgeMouseLeave:Pe,onReconnect:Ie??Ae,onReconnectStart:ze??De,onReconnectEnd:Le??Te,reconnectRadius:$e??je,defaultMarkerColor:fe,noDragClassName:Fe,noWheelClassName:Ve,noPanClassName:We,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:Be,onEdgesChange:He,snapToGrid:U,snapGrid:Z,connectionMode:L,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:O,onNodeDragStart:C,onNodeDrag:N,onNodeDragStop:k,onSelectionDrag:A,onSelectionDragStart:P,onSelectionDragStop:D,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:rt,connectionRadius:nt,isValidConnection:ot,nodeDragThreshold:st}),e.createElement(ea,{onSelectionChange:R}),Ne,e.createElement(Mo,{proOptions:Ue,position:qe}),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($a),es=Qi(function(e,t){return La(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,k),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:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
|
|
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 k(e,t=_,n){const o=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(o),o}const C=(e,t)=>{const n=(e=>e?x(e):x)(e),o=(e,o=t)=>k(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 O(){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 P(o)}function P(e){this._=e}function R(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function A(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}P.prototype=O.prototype={constructor:P,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]=A(r[n],e.name,t);else if(null==t)for(n in r)r[n]=A(r[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=R(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new P(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 D="http://www.w3.org/1999/xhtml",T={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function I(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),T.hasOwnProperty(t)?{space:T[t],local:e}:e}function z(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===D&&t.documentElement.namespaceURI===D?t.createElement(e):t.createElementNS(n,e)}}function L(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $(e){var t=I(e);return(t.local?L:z)(t)}function B(){}function j(e){return null==e?B:function(){return this.querySelector(e)}}function H(){return[]}function F(e){return null==e?H: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 q=Array.prototype.filter;function U(){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 ke(){this.textContent=""}function Ce(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 Oe(e){return function(){this.innerHTML=e}}function Pe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Re(){this.nextSibling&&this.parentNode.appendChild(this)}function Ae(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function De(){return null}function Te(){var e=this.parentNode;e&&e.removeChild(this)}function Ie(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ze(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Le(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 $e(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 je(e,t){return function(){return Be(this,e,t)}}function He(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 Fe=[null];function Ve(e,t){this._groups=e,this._parents=t}function We(){return new Ve([[document.documentElement]],Fe)}function Ye(e){return"string"==typeof e?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],Fe)}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]}Ve.prototype=We.prototype={constructor:Ve,select:function(e){"function"!=typeof e&&(e=j(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 Ve(o,this._parents)},selectAll:function(e){e="function"==typeof e?V(e):F(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 Ve(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?U:function(e){return function(){return q.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,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 Ve(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 Ve(s,r))._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 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 Ve(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 Ve(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=I(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?ke:("function"==typeof e?Ne:Ce)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Me:("function"==typeof e?Pe:Oe)(e)):this.node().innerHTML},raise:function(){return this.each(Re)},lower:function(){return this.each(Ae)},append:function(e){var t="function"==typeof e?e:$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:$(e),o=null==t?De:"function"==typeof t?t:j(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Te)},clone:function(e){return this.select(e?ze:Ie)},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?$e:Le,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?He:je)(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},qe={capture:!0,passive:!1};function Ue(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,qe);"onselectstart"in t?n.on("selectstart.drag",Ze,qe):(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,qe),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?kt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?kt(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))?kt(t[1],t[2],t[3],t[4]):(t=yt.exec(e))?kt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=vt.exec(e))?Dt(t[1],t[2]/100,t[3]/100,1):(t=bt.exec(e))?Dt(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 kt(e,t,n,o){return o<=0&&(e=t=n=NaN),new Nt(e,t,n,o)}function Ct(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`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Ot(){const e=Pt(this.opacity);return`${1===e?"rgb(":"rgba("}${Rt(this.r)}, ${Rt(this.g)}, ${Rt(this.b)}${1===e?")":`, ${e})`}`}function Pt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return((e=Rt(e))<16?"0":"")+e.toString(16)}function Dt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new It(e,t,n,o)}function Tt(e){if(e instanceof It)return new It(e.h,e.s,e.l,e.opacity);if(e instanceof st||(e=St(e)),!e)return new It;if(e instanceof It)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 It(i,s,l,e.opacity)}function It(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function zt(e){return(e=(e||0)%360)<0?e+360:e}function Lt(e){return Math.max(0,Math.min(1,e||0))}function $t(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 Tt(this).formatHsl()},formatRgb:Et,toString:Et}),at(Nt,Ct,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(Rt(this.r),Rt(this.g),Rt(this.b),Pt(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:Ot,toString:Ot})),at(It,function(e,t,n,o){return 1===arguments.length?Tt(e):new It(e,t,n,null==o?1:o)},it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new It(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new It(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($t(e>=240?e-240:e+120,r,o),$t(e,r,o),$t(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new It(zt(this.h),Lt(this.s),Lt(this.l),Pt(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=Pt(this.opacity);return`${1===e?"hsl(":"hsla("}${zt(this.h)}, ${100*Lt(this.s)}%, ${100*Lt(this.l)}%${1===e?")":`, ${e})`}`}}));var Bt=e=>()=>e;function jt(e){return 1===(e=+e)?Ht: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 Ht(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 Ft=function e(t){var n=jt(t);function o(e,t){var o=n((e=Ct(e)).r,(t=Ct(t)).r),r=n(e.g,t.g),a=n(e.b,t.b),i=Ht(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 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,o,r,a=Wt.lastIndex=Yt.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=Wt.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:Vt(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,qt=180/Math.PI,Ut={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)*qt,skewX:Math.atan(l)*qt,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:Vt(e,r)},{i:l-2,x:Vt(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:Vt(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:Vt(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:Vt(e,n)},{i:s-2,x:Vt(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?Ut:Zt(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Jt=Gt(function(e){return null==e?Ut:(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):Ut)},", ",")",")");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=O("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=Cn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function kn(e,t){var n=Cn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Cn(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=kn(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 On(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var a=kn(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 Pn(e,t,n){var o=e._id;return e.each(function(){var e=kn(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Cn(e,o).value[t]}}function Rn(e,t){var n;return("number"==typeof t?Vt:t instanceof St?Ft:(n=St(t))?(t=n,Ft):Xt)(e,t)}function An(e){return function(){this.removeAttribute(e)}}function Dn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tn(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 In(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 zn(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 Ln(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 $n(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 jn(e,t){return function(){_n(this,e).delay=+t.apply(this,arguments)}}function Hn(e,t){return t=+t,function(){_n(this,e).delay=t}}function Fn(e,t){return function(){kn(this,e).duration=+t.apply(this,arguments)}}function Vn(e,t){return t=+t,function(){kn(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,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function qn(){return++Xn}var Un=We.prototype;Kn.prototype={constructor:Kn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=j(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,Cn(s,n)));return new Kn(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=F(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=Cn(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:Un.selectChild,selectChildren:Un.selectChildren,filter:function(e){"function"!=typeof e&&(e=W(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 Wn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=qn(),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=Cn(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:Un.call,nodes:Un.nodes,node:Un.node,size:Un.size,empty:Un.empty,each:Un.each,on:function(e,t){var n=this._id;return arguments.length<2?Cn(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:kn;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=I(e),o="transform"===n?Jt:Rn;return this.attrTween(e,"function"==typeof t?(n.local?Ln:zn)(n,o,Pn(this,"attr."+e,t)):null==t?(n.local?Dn:An)(n):(n.local?In:Tn)(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=I(e);return this.tween(n,(o.local?$n:Bn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Qt:Rn;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,Pn(this,"style."+e,t))).each(function(e,t){var n,o,r,a,i="style."+t,s="end."+i;return function(){var l=kn(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}}(Pn(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=Cn(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:On)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?jn:Hn)(t,e)):Cn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Fn:Vn)(t,e)):Cn(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(){kn(this,e).ease=t}}(t,e)):Cn(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;kn(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=kn(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]:Un[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=qn(),(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 k(o,t,n)}const ko=()=>{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])},Co=e=>e.userSelectionActive?"none":"all";function No({position:t,children:n,className:o,style:r,...a}){const s=_o(Co),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 Oo=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 Po=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ro=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ao=(e={x:0,y:0},t)=>({x:Ro(e.x,t[0][0],t[1][0]),y:Ro(e.y,t[0][1],t[1][1])}),Do=(e,t,n)=>e<t?Ro(Math.abs(e-t),1,50)/50:e>n?-Ro(Math.abs(e-n),1,50)/50:0,To=(e,t)=>[20*Do(e.x,35,t.width-35),20*Do(e.y,35,t.height-35)],Io=e=>e.getRootNode?.()||window?.document,zo=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Lo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),$o=(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),jo=Symbol.for("internals"),Ho=["Enter"," ","Escape"],Fo=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function Vo(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 Wo=e=>"clientX"in e,Yo=(e,t)=>{const n=Wo(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(Oo,{x:o,y:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function qo(e,t,n){return void 0===n?n:o=>{const r=t().edges.find(t=>t.id===e);r&&n(o,{...r})}}function Uo({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]=Uo({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]=Uo({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 Fo("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}},kr=(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=zo({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)},Cr=(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=$o(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=Ro(l,o,r);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Or=(e,t=0)=>e.transition().duration(t);function Pr(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 Rr={source:null,target:null,sourceHandle:null,targetHandle:null},Ar=()=>({handleDomNode:null,isValid:!1,connection:Rr,endHandle:null});function Dr(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={...Ar(),handleDomNode:l};if(l){const e=Tr(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 Tr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ir(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function zr(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Lr({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Io(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),_=Tr(l,S),k=f?.getBoundingClientRect();if(!k||!_)return;let C,N=Yo(e,k),M=!1,O=null,P=!1,R=null;const A=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((e,r)=>{if(r[jo]){const{handleBounds:a}=r[jo];let i=[],s=[];a&&(i=Pr(r,a,"source",`${t}-${n}-${o}`),s=Pr(r,a,"target",`${t}-${n}-${o}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),D=()=>{if(!p)return;const[e,t]=To(N,k);g({x:e,y:t}),w=requestAnimationFrame(D)};function T(e){const{transform:o}=a();N=Yo(e,k);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=Tr(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:Ar()};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,A,e=>Dr(e,d,n,t,r?"target":"source",s,u));if(b=l,M||(D(),M=!0),R=c.handleDomNode,O=c.connection,P=c.isValid,i({connectionPosition:b&&P?Sr({x:b.x,y:b.y},o):N,connectionStatus:zr(!!b,P),connectionEndHandle:c.endHandle}),!b&&!P&&!R)return Ir(C);O.source!==O.target&&R&&(Ir(C),C=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",P),R.classList.toggle("react-flow__handle-valid",P))}function I(e){(b||R)&&O&&P&&o?.(O),a().onConnectEnd?.(e),l&&c?.(e),Ir(C),v(),cancelAnimationFrame(w),M=!1,P=!1,O=null,R=null,u.removeEventListener("mousemove",T),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",T),u.removeEventListener("touchend",I)}i({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",T),u.addEventListener("mouseup",I),u.addEventListener("touchmove",T),u.addEventListener("touchend",I)}const $r=()=>!0,Br=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),jr=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=ko(),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)},k=e=>{if(!b)return;const t=Wo(e);a&&(t&&0===e.button||!t)&&Lr({event:e,handleId:g,nodeId:b,onConnect:_,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:o||v.getState().isValidConnection||$r}),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:k,onTouchStart:k,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=Io(e.target),u=o||l||$r,{connection:d,isValid:f}=Dr({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)});jr.displayName="Handle";var Hr=e.memo(jr);const Fr=({data:t,isConnectable:n,targetPosition:o=nr.Top,sourcePosition:r=nr.Bottom})=>e.createElement(e.Fragment,null,e.createElement(Hr,{type:"target",position:o,isConnectable:n}),t?.label,e.createElement(Hr,{type:"source",position:r,isConnectable:n}));Fr.displayName="DefaultNode";var Vr=e.memo(Fr);const Wr=({data:t,isConnectable:n,sourcePosition:o=nr.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(Hr,{type:"source",position:o,isConnectable:n}));Wr.displayName="InputNode";var Yr=e.memo(Wr);const Xr=({data:t,isConnectable:n,targetPosition:o=nr.Top})=>e.createElement(e.Fragment,null,e.createElement(Hr,{type:"target",position:o,isConnectable:n}),t?.label);Xr.displayName="OutputNode";var Kr=e.memo(Xr);const qr=()=>null;qr.displayName="GroupNode";const Ur=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=ko(),{selectedNodes:o,selectedEdges:r}=_o(Ur,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:k,connectOnClick:C,defaultEdgeOptions:M,fitView:O,fitViewOptions:P,onNodesDelete:R,onEdgesDelete:A,onNodeDrag:D,onNodeDragStart:T,onNodeDragStop:I,onSelectionDrag:z,onSelectionDragStart:L,onSelectionDragStop:$,noPanClassName:B,nodeOrigin:j,rfId:H,autoPanOnConnect:F,autoPanOnNodeDrag:V,onError:W,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:q,setEdges:U,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=_o(ta,N),ne=ko();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",C,ne.setState),oa("fitViewOnInit",O,ne.setState),oa("fitViewOnInitOptions",P,ne.setState),oa("onNodesDelete",R,ne.setState),oa("onEdgesDelete",A,ne.setState),oa("onNodeDrag",D,ne.setState),oa("onNodeDragStart",T,ne.setState),oa("onNodeDragStop",I,ne.setState),oa("onSelectionDrag",z,ne.setState),oa("onSelectionDragStart",L,ne.setState),oa("onSelectionDragStop",$,ne.setState),oa("noPanClassName",B,ne.setState),oa("nodeOrigin",j,ne.setState),oa("rfId",H,ne.setState),oa("autoPanOnConnect",F,ne.setState),oa("autoPanOnNodeDrag",V,ne.setState),oa("onError",W,ne.setState),oa("connectionRadius",Y,ne.setState),oa("isValidConnection",X,ne.setState),oa("nodeDragThreshold",K,ne.setState),na(t,q),na(n,U),na(g,G),na(y,Q),na(k,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)&&Vo(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)&&Vo(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[jo]?.z??0)>(n.z??0)?a[jo]?.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[jo]?.z??0},t);o.positionAbsolute={x:r,y:a},o[jo].z=i,n?.[o.id]&&(o[jo].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,jo,{enumerable:!1,value:{handleBounds:c?void 0:o?.[jo]?.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=kr(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(Or(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,[jo]:n[jo],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 ka(){const t=(()=>{const t=ko(),{d3Zoom:n,d3Selection:o}=_o(_a,N),r=e.useMemo(()=>o&&n?{zoomIn:e=>n.scaleBy(Or(o,e?.duration),1.2),zoomOut:e=>n.scaleBy(Or(o,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Or(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(Or(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(Or(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(Or(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=ko(),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:Lo(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=Lo(e),o=$o(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=$o(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 Ca={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}),Oa=(e,t)=>e.target.closest(`.${t}`),Pa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Ra=e=>{const t=e.ctrlKey&&Xo()?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}),Da=({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=ko(),_=e.useRef(!1),k=e.useRef(!1),C=e.useRef(null),M=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:R,d3ZoomHandler:A,userSelectionActive:D}=_o(Aa,N),T=fa(y),I=e.useRef(0),z=e.useRef(!1),L=e.useRef();return function(t){const n=ko();e.useEffect(()=>{let e;const o=()=>{if(!t.current)return;const e=Po(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)}},[])}(C),e.useEffect(()=>{if(C.current){const e=C.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=O("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",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new 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 k(n,...r){if(o.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,r,n.changedTouches.length===u).event(n);for(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 C(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(C.current).call(t),o=to.translate(p.x,p.y).scale(Ro(p.zoom,m,g)),r=[[0,0],[e.width,e.height]],a=t.constrain()(o,r,h);t.transform(n,a),t.wheelDelta(Ra),S.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:C.current.closest(".react-flow")})}},[]),e.useEffect(()=>{R&&P&&(!s||T||D?void 0!==A&&R.on("wheel.zoom",function(e,t){if(!v&&"wheel"===e.type&&!e.ctrlKey||Oa(e,w))return null;e.preventDefault(),A.call(this,e,t)},{passive:!1}):R.on("wheel.zoom",e=>{if(Oa(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const r=R.property("__zoom").k||1;if(e.ctrlKey&&i){const t=Xe(e),n=Ra(e),o=r*Math.pow(2,n);return void P.scaleTo(R,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),P.translateBy(R,-s/r*l,-u/r*l,{internal:!0});const d=Ma(R.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=S.getState();clearTimeout(L.current),z.current||(z.current=!0,n?.(e,d),f?.(d)),z.current&&(t?.(e,d),p?.(d),L.current=setTimeout(()=>{o?.(e,d),h?.(d),z.current=!1},150))},{passive:!1}))},[D,s,c,R,P,A,T,i,v,w,n,t,o]),e.useEffect(()=>{P&&P.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;I.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)})},[P,n]),e.useEffect(()=>{P&&(D&&!_.current?P.on("zoom",null):D||P.on("zoom",e=>{const{onViewportChange:n}=S.getState();if(S.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),k.current=!(!r||!Pa(f,I.current??0)),(t||n)&&!e.sourceEvent?.internal){const o=Ma(e.transform);n?.(o),t?.(e.sourceEvent,o)}}))},[D,P,t,f,r]),e.useEffect(()=>{P&&P.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=S.getState();if(_.current=!1,S.setState({paneDragging:!1}),r&&Pa(f,I.current??0)&&!k.current&&r(e.sourceEvent),k.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})},[P,s,f,o,r]),e.useEffect(()=>{P&&P.filter(e=>{const t=T||a,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(Oa(e,"react-flow__node")||Oa(e,"react-flow__edge")))return!0;if(!(f||t||s||u||i))return!1;if(D)return!1;if(!u&&"dblclick"===e.type)return!1;if(Oa(e,w)&&"wheel"===e.type)return!1;if(Oa(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!T))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})},[D,P,a,i,s,u,f,d,T]),e.createElement("div",{className:"react-flow__renderer",ref:C,style:Na},b)},Ta=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ia(){const{userSelectionActive:t,userSelectionRect:n}=_o(Ta,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 za(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 La(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&&za(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&&za(t,r);break;case"remove":return t}return t.push(r),t},n)}function $a(e,t){return La(e,t)}const Ba=(e,t)=>({id:e,type:"select",selected:t});function ja(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 Ha=(e,t)=>n=>{n.target===t.current&&e?.(n)},Fa=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Va=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=ko(),g=e.useRef(0),y=e.useRef(0),v=e.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=_o(Fa,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,k=w&&(t||b);return e.createElement("div",{className:i(["react-flow__pane",{dragging:x,selection:t}]),onClick:k?void 0:Ha(S,h),onContextMenu:Ha(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():l?.(e)},h),onWheel:Ha(_,h),onMouseEnter:k?void 0:u,onMouseDown:k?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:k?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=Cr(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=ja(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=ja(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:k?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}:f,ref:h,style:Na},p,e.createElement(Ia,null))});function Wa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return!!o&&(!!o.selected||Wa(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||!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,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?Ao(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function qa({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]}Va.displayName="Pane";const Ua=(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,...Po(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=ko(),[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=ko(),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=kr(d.current,h);v=zo(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]=qa({nodeId:a,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=To(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]=qa({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=O("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,qe).on("mouseup.drag",m,qe),Ge(i.view),Ue(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]))&&(Ue(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])&&(Ue(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]=qa({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=ko(),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:k,hidden:C,resizeObserver:N,dragHandle:M,zIndex:O,isParent:P,noDragClassName:R,noPanClassName:A,initialized:D,disableKeyboardA11y:T,ariaLabel:I,rfId:z,hasHandleBounds:L})=>{const $=ko(),B=e.useRef(null),j=e.useRef(null),H=e.useRef(_),F=e.useRef(k),V=e.useRef(o),W=w||b||d||f||p||h,Y=ei(),X=Za(n,$.getState,f),K=Za(n,$.getState,p),q=Za(n,$.getState,h),U=Za(n,$.getState,m),Z=Za(n,$.getState,g);e.useEffect(()=>()=>{j.current&&(N?.unobserve(j.current),j.current=null)},[]),e.useEffect(()=>{if(B.current&&!C){const e=B.current;D&&L&&j.current===e||(j.current&&N?.unobserve(j.current),N?.observe(e),j.current=e)}},[C,D,L]),e.useEffect(()=>{const e=V.current!==o,t=H.current!==_,r=F.current!==k;B.current&&(e||t||r)&&(e&&(V.current=o),t&&(H.current=_),r&&(F.current=k),$.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,o,_,k]);const G=Ja({nodeRef:B,disabled:C||!b,noDragClassName:R,handleSelector:M,nodeId:n,isSelectable:w,selectNodesOnDrag:S});return C?null:e.createElement("div",{className:i(["react-flow__node",`react-flow__node-${o}`,{[A]:b},v,{selected:u,selectable:w,parent:P,dragging:G}]),ref:B,style:{zIndex:O,transform:`translate(${l}px,${c}px)`,pointerEvents:W?"all":"none",visibility:D?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:K,onMouseLeave:q,onContextMenu:U,onClick:e=>{const{nodeDragThreshold:t}=$.getState();if(w&&(!S||!b||t>0)&&Ga({id:n,store:$,nodeRef:B}),d){const t=$.getState().nodeInternals.get(n);t&&d(e,{...t})}},onDoubleClick:Z,onKeyDown:E?e=>{if(!Vo(e)&&!T)if(Ho.includes(e.key)&&w){const t="Escape"===e.key;Ga({id:n,store:$,unselect:t,nodeRef:B})}else b&&u&&Object.prototype.hasOwnProperty.call(ti,e.key)&&($.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":T?void 0:`${sa}-${z}`,"aria-label":I},e.createElement(vr,{value:n},e.createElement(t,{id:n,data:r,type:o,xPos:a,yPos:s,selected:u,isConnectable:x,sourcePosition:_,targetPosition:k,dragging:G,dragHandle:M,zIndex:O})))};return n.displayName="NodeWrapper",e.memo(n)};const oi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...kr(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=ko(),{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:k,zoomOnDoubleClick:C,panOnDrag:N,defaultViewport:M,translateExtent:O,minZoom:P,maxZoom:R,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:T,noPanClassName:I,disableKeyboardA11y:z})=>{const L=_o(ai),$=fa(f),B=fa(v),j=B||N,H=B||S,F=$||p&&!0!==j;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const o=ko(),{deleteElements:r}=ka(),a=fa(t,Ca),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(Da,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:H,panOnScrollSpeed:_,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:!$&&j,defaultViewport:M,translateExtent:O,minZoom:P,maxZoom:R,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:T,noPanClassName:I},e.createElement(Va,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:j,isSelecting:!!F,selectionMode:h},t,L&&e.createElement(ri,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:z})))};ii.displayName="FlowRenderer";var si=e.memo(ii);function li(e){return{...{input:ni(e.input||Yr),default:ni(e.default||Vr),output:ni(e.output||Kr),group:ni(e.group||qr)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ni(e[n]||Vr),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?Cr(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?Ao(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[jo]?.z??0,isParent:!!i[jo]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!i.width&&!!i.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[jo]?.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:k,elementsSelectable:C,hidden:N,sourceHandleId:M,targetHandleId:O,onContextMenu:P,onMouseEnter:R,onMouseMove:A,onMouseLeave:D,reconnectRadius:T,onReconnect:I,onReconnectStart:z,onReconnectEnd:L,markerEnd:$,markerStart:B,rfId:j,ariaLabel:H,isFocusable:F,isReconnectable:V,pathOptions:W,interactionWidth:Y,disableKeyboardA11y:X})=>{const K=e.useRef(null),[q,U]=e.useState(!1),[Z,G]=e.useState(!1),Q=ko(),J=e.useMemo(()=>`url('#${wr(B,j)}')`,[B,j]),ee=e.useMemo(()=>`url('#${wr($,j)}')`,[$,j]);if(N)return null;const te=qo(n,Q.getState,l),ne=qo(n,Q.getState,P),oe=qo(n,Q.getState,R),re=qo(n,Q.getState,A),ae=qo(n,Q.getState,D),ie=(e,t)=>{if(0!==e.button)return;const{edges:o,isValidConnection:r}=Q.getState(),a=t?b:v,i=(t?O:M)||null,s=t?"target":"source",l=r||gi,c=t,u=o.find(e=>e.id===n);G(!0),z?.(e,u,s);Lr({event:e,handleId:i,nodeId:a,onConnect:e=>I?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{G(!1),L?.(e,u,s)}})},se=()=>U(!0),le=()=>U(!1),ce=!C&&!s;return e.createElement("g",{className:i(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:c,animated:u,inactive:ce,updating:q}]),onClick:e=>{const{edges:t,addSelectedEdges:o,unselectNodesAndEdges:r,multiSelectionActive:a}=Q.getState(),i=t.find(e=>e.id===n);i&&(C&&(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:F?e=>{if(!X&&Ho.includes(e.key)&&C){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:F?0:void 0,role:F?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===H?void 0:H||`Edge from ${v} to ${b}`,"aria-describedby":F?`${la}-${j}`: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:k,sourceHandleId:M,targetHandleId:O,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:T,onMouseDown:e=>ie(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===V||!0===V)&&e.createElement(mi,{position:k,centerX:E,centerY:S,radius:T,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?.[jo]?.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?.[jo]?.z||0,e?.[jo]?.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=zo({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 ki=({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=ko();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},Ci=({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(ki,{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})))};Ci.displayName="MarkerDefinitions";var Ni=e.memo(Ci);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}),Oi=({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:k,nodeInternals:C,onError:M}=_o(Mi,N),O=Si(n,C,o);return S?e.createElement(e.Fragment,null,O.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(C.get(t.source)),[S,_,N]=xi(C.get(t.target));if(!v||!N)return null;let O=t.type||"default";a[O]||(M?.("011",xo(O)),O="default");const P=a[O]||a.default,R=k===Go.Strict?_.target:(_.target??[]).concat(_.source??[]),A=wi(o.source,t.sourceHandle),D=wi(R,t.targetHandle),T=A?.position||nr.Bottom,I=D?.position||nr.Top,z=!!(t.focusable||w&&void 0===t.focusable),L=t.reconnectable||t.updatable,$=void 0!==h&&(L||x&&void 0===L);if(!A||!D)return M?.("008",bo(A,t)),null;const{sourceX:B,sourceY:j,targetX:H,targetY:F}=((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,A,T,S,D,I);return e.createElement(P,{key:t.id,id:t.id,className:i([t.className,s]),type:O,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:j,targetX:H,targetY:F,sourcePosition:T,targetPosition:I,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:z,isReconnectable:$,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))),v):null};Oi.displayName="EdgeRenderer";var Pi=e.memo(Oi);const Ri=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ai({children:t}){const n=_o(Ri);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const Di={[nr.Left]:nr.Right,[nr.Right]:nr.Left,[nr.Top]:nr.Bottom,[nr.Bottom]:nr.Top},Ti=({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?.[jo]?.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?Di[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})};Ti.displayName="ConnectionLine";const Ii=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function zi({containerStyle:t,style:n,type:o,component:r}){const{nodeId:a,handleType:s,nodesConnectable:l,width:c,height:u,connectionStatus:d}=_o(Ii,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(Ti,{nodeId:a,handleType:s,style:n,type:o,CustomComponent:r,connectionStatus:d}))):null}function Li(t,n){const o=e.useRef(null),r=ko();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 $i=({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:k,panActivationKeyCode:C,zoomActivationKeyCode:N,deleteKeyCode:M,onlyRenderVisibleElements:O,elementsSelectable:P,selectNodesOnDrag:R,defaultViewport:A,translateExtent:D,minZoom:T,maxZoom:I,preventScrolling:z,defaultMarkerColor:L,zoomOnScroll:$,zoomOnPinch:B,panOnScroll:j,panOnScrollSpeed:H,panOnScrollMode:F,zoomOnDoubleClick:V,panOnDrag:W,onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:q,onPaneScroll:U,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=Li(t,li),he=Li(n,vi);return function(t){const n=ka(),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:q,onPaneContextMenu:Z,onPaneScroll:U,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:k,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:P,onMove:o,onMoveStart:r,onMoveEnd:a,zoomOnScroll:$,zoomOnPinch:B,zoomOnDoubleClick:V,panOnScroll:j,panOnScrollSpeed:H,panOnScrollMode:F,panOnDrag:W,defaultViewport:A,translateExtent:D,minZoom:T,maxZoom:I,onSelectionContextMenu:m,preventScrolling:z,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(Ai,null,e.createElement(Pi,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:O,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,reconnectRadius:re,defaultMarkerColor:L,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:fe},e.createElement(zi,{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:R,onlyRenderVisibleElements:O,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})))};$i.displayName="GraphView";var Bi=e.memo($i);const ji=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Hi={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:ji,nodeExtent:ji,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:Fo,isValidConnection:void 0},Fi=()=>{return e=(e,t)=>({...Hi,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,[jo]:{...n[jo],handleBounds:void 0}});else if(n){const o=Po(t.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||t.forceUpdate)&&(r.set(n.id,{...n,[jo]:{...n[jo],handleBounds:{source:Ua(".source",t.nodeElement,f,c),target:Ua(".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($a(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=ja(a(),n),s=ja(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=ja(r,n),s=ja(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=Ao(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:Hi.connectionNodeId,connectionHandleId:Hi.connectionHandleId,connectionHandleType:Hi.connectionHandleType,connectionStatus:Hi.connectionStatus,connectionStartHandle:Hi.connectionStartHandle,connectionEndHandle:Hi.connectionEndHandle}),reset:()=>e({...Hi})}),t=Object.is,e?C(e,t):C;var e,t},Vi=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=Fi()),e.createElement(fo,{value:n.current},t)};Vi.displayName="ReactFlowProvider";const Wi=({children:t})=>e.useContext(uo)?e.createElement(e.Fragment,null,t):e.createElement(Vi,null,t);Wi.displayName="ReactFlowWrapper";const Yi={input:Yr,default:Vr,output:Kr,group:qr},Xi={default:gr,straight:fr,step:dr,smoothstep:ur,simplebezier:ar},Ki=[0,0],qi=[15,15],Ui={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:k,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:O,onSelectionChange:P,onSelectionDragStart:R,onSelectionDrag:A,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,connectionMode:L=Go.Strict,connectionLineType:$=er.Bezier,connectionLineStyle:B,connectionLineComponent:j,connectionLineContainerStyle:H,deleteKeyCode:F="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:W=!1,selectionMode:Y=Jo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(Xo()?"Meta":"Control"),zoomActivationKeyCode:q=(Xo()?"Meta":"Control"),snapToGrid:U=!1,snapGrid:Z=qi,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=Ki,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,defaultViewport:ie=Ui,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=ji,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:ke,children:Ce,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Re,onEdgeUpdate:Ae,onEdgeUpdateStart:De,onEdgeUpdateEnd:Te,onReconnect:Ie,onReconnectStart:ze,onReconnectEnd:Le,reconnectRadius:$e=10,edgeUpdaterRadius:Be=10,onNodesChange:je,onEdgesChange:He,noDragClassName:Fe="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:qe,proOptions:Ue,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(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:$,connectionLineStyle:B,connectionLineComponent:j,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:W,selectionMode:Y,deleteKeyCode:F,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:q,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:ke,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Re,onReconnect:Ie??Ae,onReconnectStart:ze??De,onReconnectEnd:Le??Te,reconnectRadius:$e??Be,defaultMarkerColor:fe,noDragClassName:Fe,noWheelClassName:Ve,noPanClassName:We,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:je,onEdgesChange:He,snapToGrid:U,snapGrid:Z,connectionMode:L,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:O,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:A,onSelectionDragStart:R,onSelectionDragStop:D,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:rt,connectionRadius:nt,isValidConnection:ot,nodeDragThreshold:st}),e.createElement(ea,{onSelectionChange:P}),Ce,e.createElement(Mo,{proOptions:Ue,position:qe}),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($a),es=Qi(function(e,t){return La(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:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
|
|
29
2
|
/**
|
|
30
3
|
* @license lucide-react v0.525.0 - ISC
|
|
31
4
|
*
|
|
@@ -39,17 +12,112 @@ const cs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperC
|
|
|
39
12
|
* This source code is licensed under the ISC license.
|
|
40
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
14
|
*/
|
|
42
|
-
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"};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*/function Ss(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=Ss(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function _s(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Ss(e))&&(o&&(o+=" "),o+=t);return o}const Cs=e=>{const t=Os(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Ns(n,t)||Ms(e)},getConflictingClassGroupIds:(e,t)=>{const r=n[e]||[];return t&&o[e]?[...r,...o[e]]:r}}},Ns=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Ns(e.slice(1),o):void 0;if(r)return r;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},ks=/^\[(.+)\]$/,Ms=e=>{if(ks.test(e)){const t=ks.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Os=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const e in n)Rs(n[e],o,e,t);return o},Rs=(e,t,n,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Ps(t,e)).classGroupId=n)}if("function"==typeof e)return As(e)?void Rs(e(o),t,n,o):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,r])=>{Rs(r,Ps(t,e),n,o)})})},Ps=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},As=e=>e.isThemeGetter,Ds=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(r,a)=>{n.set(r,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(r(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):r(e,t)}}},Ts=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=e=>{const t=[];let n,o=0,r=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===o&&0===r){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?o++:"]"===s?o--:"("===s?r++:")"===s&&r--}const i=0===t.length?e:e.substring(a),s=Is(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=o;o=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=o;o=t=>n({className:t,parseClassName:e})}return o},Is=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,zs=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...o.sort(),e),o=[]):o.push(e)}),n.push(...o.sort()),n}},Ls=/\s+/;function $s(){let e,t,n=0,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=js(e))&&(o&&(o+=" "),o+=t);return o}const js=e=>{if("string"==typeof e)return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=js(e[o]))&&(n&&(n+=" "),n+=t);return n};function Bs(e,...t){let n,o,r,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Ds(e.cacheSize),parseClassName:Ts(e),sortModifiers:zs(e),...Cs(e)}))(l),o=n.cache.get,r=n.cache.set,a=i,i(s)};function i(e){const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a}=t,i=[],s=e.trim().split(Ls);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=o(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=o(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=a(u).join(":"),y=d?g+"!":g,v=y+m;if(i.includes(v))continue;i.push(v);const b=r(m,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return r(e,a),a}return function(){return a($s.apply(null,arguments))}}const Hs=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Fs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ws=/^\d+\/\d+$/,Ys=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ks=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Us=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zs=e=>Ws.test(e),Gs=e=>!!e&&!Number.isNaN(Number(e)),Qs=e=>!!e&&Number.isInteger(Number(e)),Js=e=>e.endsWith("%")&&Gs(e.slice(0,-1)),el=e=>Ys.test(e),tl=()=>!0,nl=e=>Xs.test(e)&&!Ks.test(e),ol=()=>!1,rl=e=>qs.test(e),al=e=>Us.test(e),il=e=>!ll(e)&&!hl(e),sl=e=>xl(e,Cl,ol),ll=e=>Fs.test(e),cl=e=>xl(e,Nl,nl),ul=e=>xl(e,kl,Gs),dl=e=>xl(e,Sl,ol),fl=e=>xl(e,_l,al),pl=e=>xl(e,Ol,rl),hl=e=>Vs.test(e),ml=e=>El(e,Nl),gl=e=>El(e,Ml),yl=e=>El(e,Sl),vl=e=>El(e,Cl),bl=e=>El(e,_l),wl=e=>El(e,Ol,!0),xl=(e,t,n)=>{const o=Fs.exec(e);return!!o&&(o[1]?t(o[1]):n(o[2]))},El=(e,t,n=!1)=>{const o=Vs.exec(e);return!!o&&(o[1]?t(o[1]):n)},Sl=e=>"position"===e||"percentage"===e,_l=e=>"image"===e||"url"===e,Cl=e=>"length"===e||"size"===e||"bg-size"===e,Nl=e=>"length"===e,kl=e=>"number"===e,Ml=e=>"family-name"===e,Ol=e=>"shadow"===e,Rl=Bs(()=>{const e=Hs("color"),t=Hs("font"),n=Hs("text"),o=Hs("font-weight"),r=Hs("tracking"),a=Hs("leading"),i=Hs("breakpoint"),s=Hs("container"),l=Hs("spacing"),c=Hs("radius"),u=Hs("shadow"),d=Hs("inset-shadow"),f=Hs("text-shadow"),p=Hs("drop-shadow"),h=Hs("blur"),m=Hs("perspective"),g=Hs("aspect"),y=Hs("ease"),v=Hs("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",hl,ll],w=()=>[hl,ll,l],x=()=>[Zs,"full","auto",...w()],E=()=>[Qs,"none","subgrid",hl,ll],S=()=>["auto",{span:["full",Qs,hl,ll]},Qs,hl,ll],_=()=>[Qs,"auto",hl,ll],C=()=>["auto","min","max","fr",hl,ll],N=()=>["auto",...w()],k=()=>[Zs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,hl,ll],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",yl,dl,{position:[hl,ll]}],R=()=>["auto","cover","contain",vl,sl,{size:[hl,ll]}],P=()=>[Js,ml,cl],A=()=>["","none","full",c,hl,ll],D=()=>["",Gs,ml,cl],T=()=>[Gs,Js,yl,dl],I=()=>["","none",h,hl,ll],z=()=>["none",Gs,hl,ll],L=()=>["none",Gs,hl,ll],$=()=>[Gs,hl,ll],j=()=>[Zs,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[el],breakpoint:[el],color:[tl],container:[el],"drop-shadow":[el],ease:["in","out","in-out"],font:[il],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[el],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[el],shadow:[el],spacing:["px",Gs],text:[el],"text-shadow":[el],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Zs,ll,hl,g]}],container:["container"],columns:[{columns:[Gs,ll,hl,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Qs,"auto",hl,ll]}],basis:[{basis:[Zs,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Gs,Zs,"auto","initial","none",ll]}],grow:[{grow:["",Gs,hl,ll]}],shrink:[{shrink:["",Gs,hl,ll]}],order:[{order:[Qs,"first","last","none",hl,ll]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[s,"screen",...k()]}],"min-w":[{"min-w":[s,"screen","none",...k()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,ml,cl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,hl,ul]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Js,ll]}],"font-family":[{font:[gl,ll,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,hl,ll]}],"line-clamp":[{"line-clamp":[Gs,"none",hl,ul]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",hl,ll]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",hl,ll]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Gs,"from-font","auto",hl,cl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Gs,"auto",hl,ll]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",hl,ll]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",hl,ll]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qs,hl,ll],radial:["",hl,ll],conic:[Qs,hl,ll]},bl,fl]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Gs,hl,ll]}],"outline-w":[{outline:["",Gs,ml,cl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,wl,pl]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,wl,pl]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Gs,cl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,wl,pl]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Gs,hl,ll]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Gs]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[hl,ll]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Gs]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",hl,ll]}],filter:[{filter:["","none",hl,ll]}],blur:[{blur:I()}],brightness:[{brightness:[Gs,hl,ll]}],contrast:[{contrast:[Gs,hl,ll]}],"drop-shadow":[{"drop-shadow":["","none",p,wl,pl]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Gs,hl,ll]}],"hue-rotate":[{"hue-rotate":[Gs,hl,ll]}],invert:[{invert:["",Gs,hl,ll]}],saturate:[{saturate:[Gs,hl,ll]}],sepia:[{sepia:["",Gs,hl,ll]}],"backdrop-filter":[{"backdrop-filter":["","none",hl,ll]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Gs,hl,ll]}],"backdrop-contrast":[{"backdrop-contrast":[Gs,hl,ll]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Gs,hl,ll]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Gs,hl,ll]}],"backdrop-invert":[{"backdrop-invert":["",Gs,hl,ll]}],"backdrop-opacity":[{"backdrop-opacity":[Gs,hl,ll]}],"backdrop-saturate":[{"backdrop-saturate":[Gs,hl,ll]}],"backdrop-sepia":[{"backdrop-sepia":["",Gs,hl,ll]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",hl,ll]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Gs,"initial",hl,ll]}],ease:[{ease:["linear","initial",y,hl,ll]}],delay:[{delay:[Gs,hl,ll]}],animate:[{animate:["none",v,hl,ll]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,hl,ll]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[hl,ll,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:j()}],"translate-x":[{"translate-x":j()}],"translate-y":[{"translate-y":j()}],"translate-z":[{"translate-z":j()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",hl,ll]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",hl,ll]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Gs,ml,cl,ul]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Pl(...e){return Rl(_s(e))}function Al(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Dl(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function Tl(e){if(null==e)return"$0.00";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}function Il(e){if(null==e)return"0ms";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0ms":`${Math.round(t)}ms`}var zl=function(){return zl=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},zl.apply(this,arguments)};function Ll(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const $l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,jl=_s,Bl=(e,t)=>n=>{var o;if(null==(null==t?void 0:t.variants))return jl(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:r,defaultVariants:a}=t,i=Object.keys(r).map(e=>{const t=null==n?void 0:n[e],o=null==a?void 0:a[e];if(null===t)return null;const i=$l(t)||$l(o);return r[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,o]=t;return void 0===o||(e[n]=o),e},{}),l=null==t||null===(o=t.compoundVariants)||void 0===o?void 0:o.reduce((e,t)=>{let{class:n,className:o,...r}=t;return Object.entries(r).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,o]:e},[]);return jl(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},Hl=Bl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",cost:"border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200",gray:"border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200",latency:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200",latencyLow:"border-transparent bg-green-100 text-green-800 hover:bg-green-200",latencyMedium:"border-transparent bg-orange-100 text-orange-800 hover:bg-orange-200",latencyHigh:"border-transparent bg-red-100 text-red-800 hover:bg-red-200"}},defaultVariants:{variant:"default"}});function Fl(e){var{className:t,variant:n}=e,o=Ll(e,["className","variant"]);return r.createElement("div",Object.assign({className:Pl(Hl({variant:n}),t)},o))}const Vl=(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)}),Wl=({data:t,label:n,depth:o,maxDepth:r,path:a,priorityKeys:i})=>{const[s,l]=e.useState(!1),c=null!==t&&"object"==typeof t&&!Array.isArray(t),u=Array.isArray(t),d=(c||u)&&o<r,f=d&&Object.keys(t).length>0;return e.createElement("div",{className:"select-none"},e.createElement("div",{className:"flex items-center gap-1 py-1 px-2 hover:bg-gray-50 rounded cursor-pointer transition-colors duration-150 "+(d?"hover:bg-gray-50":""),onClick:()=>{d&&l(!s)},style:{paddingLeft:12*o+8+"px"}},d&&f?s?e.createElement(gs,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):e.createElement(ys,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):e.createElement("div",{className:"w-3 h-3 flex-shrink-0"}),e.createElement("span",{className:"font-medium text-gray-800 text-xs"},n,":"),!d&&e.createElement("span",{className:"text-xs "+(p=t,null==p?"text-gray-500":"string"==typeof p?"text-green-600":"number"==typeof p?"text-blue-600":"boolean"==typeof p?"text-purple-600":"text-gray-700")},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(t)),d&&!f&&e.createElement("span",{className:"text-xs text-gray-500"},u?"[]":"{}"),d&&f&&!s&&e.createElement("span",{className:"text-xs text-gray-500"},u?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),s&&f&&e.createElement("div",{className:"border-l border-gray-200 ml-3"},Vl(t,i).map(([t,n])=>e.createElement(Wl,{key:`${a}.${t}`,data:n,label:t,depth:o+1,maxDepth:r,path:`${a}.${t}`,priorityKeys:i}))));var p},Yl=({data:t,maxDepth:n=4,initialExpanded:o=!1,className:r="",priorityKeys:a=["input","output"]})=>null==t?e.createElement("div",{className:`text-xs text-gray-500 italic ${r}`},"No data available"):"object"!=typeof t?e.createElement("div",{className:`text-xs ${r}`},e.createElement("span",{className:"font-medium text-gray-800"},"Value:")," ",e.createElement("span",{className:"text-gray-600"},String(t))):0===Object.keys(t).length?e.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 p-4 text-center ${r}`},e.createElement("div",{className:"text-xs text-gray-500 italic"},Array.isArray(t)?"Empty array":"Empty object")):e.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 overflow-hidden ${r}`},e.createElement("div",{className:"w-full max-h-64 overflow-y-auto"},Vl(t,a).map(([t,o])=>e.createElement(Wl,{key:t,data:o,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a})))),Xl=({label:t,content:n,isExpanded:o,onToggle:r})=>{const a=o?n:(null==n?void 0:n.slice(0,100))+((null==n?void 0:n.length)>100?"...":"");return e.createElement("div",{className:"w-full"},e.createElement("div",{className:"flex justify-between items-center py-1 cursor-pointer select-none hover:bg-gray-50 rounded px-1",onClick:r},e.createElement("span",{className:"font-semibold text-gray-700 text-xs"},t),o?e.createElement(gs,{className:"w-3 h-3 text-gray-500 transition-transform duration-200"}):e.createElement(ys,{className:"w-3 h-3 text-gray-500 transition-transform duration-200"})),e.createElement("textarea",{className:"w-full border border-gray-300 rounded px-2 py-2 text-xs bg-gray-50 resize-none min-h-[40px] focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-all duration-200",value:a||"",readOnly:!0,rows:o?Math.max(3,Math.max((null==n?void 0:n.split("\n").length)||0,Math.ceil(((null==n?void 0:n.length)||0)/60))):2}))},Kl=({data:t,id:n})=>{var o,r,a,i,s,l,c,u,d,f,p,h,m,g,y,v,b,w,x,E,S,_,C,N,k,M,O,R,P,A;Ca();const[D,T]=e.useState(!1),[I,z]=e.useState(!1),L=(null===(o=t.edges)||void 0===o?void 0:o.some(e=>e.source===n))||!1,$=(null===(r=t.edges)||void 0===r?void 0:r.some(e=>e.target===n))||!1,j=t.nodeType||"Agent",B=t.label||Al(j)||"Agent",H=null===(l=null===(s=null===(i=null===(a=t.details)||void 0===a?void 0:a.internals)||void 0===i?void 0:i.llm_details)||void 0===s?void 0:s[0])||void 0===l?void 0:l.model_provider,F=((t,n)=>{if("tool"===t)return"🔧";if("coordinator"===t)return"🎯";if("agent"===t){if("OpenAI"===n)return e.createElement("img",{src:"/icon-openai.svg",alt:"OpenAI",className:"w-6 h-6",style:{filter:"brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%)"}});if("Anthropic"===n)return e.createElement("img",{src:"/icon-anthropic.svg",alt:"Anthropic",className:"w-6 h-6",style:{filter:"brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%)"}});if("Google"===n||"Vertex_AI"===n)return e.createElement("img",{src:"/icon-google.svg",alt:"Google",className:"w-6 h-6"})}return"🤖"})(j.toLowerCase(),H),V=(null===(f=null===(d=null===(u=null===(c=t.details)||void 0===c?void 0:c.internals)||void 0===u?void 0:u.llm_details)||void 0===d?void 0:d[0])||void 0===f?void 0:f.model_name)||"Unknown",W=Tl(null===(g=null===(m=null===(h=null===(p=t.details)||void 0===p?void 0:p.internals)||void 0===h?void 0:h.llm_details)||void 0===m?void 0:m[0])||void 0===g?void 0:g.total_cost),Y=(null===(E=null===(x=null===(w=null===(b=null===(v=null===(y=t.details)||void 0===y?void 0:y.internals)||void 0===v?void 0:v.llm_details)||void 0===b?void 0:b[0])||void 0===w?void 0:w.input)||void 0===x?void 0:x[0])||void 0===E?void 0:E.content)||"",X=(null===(M=null===(k=null===(N=null===(C=null===(_=null===(S=t.details)||void 0===S?void 0:S.internals)||void 0===_?void 0:_.llm_details)||void 0===C?void 0:C[0])||void 0===N?void 0:N.input)||void 0===k?void 0:k[1])||void 0===M?void 0:M.content)||"",K=null===(P=null===(R=null===(O=t.details)||void 0===O?void 0:O.internals)||void 0===R?void 0:R.latency)||void 0===P?void 0:P.total_time;return e.createElement("div",{className:"font-sans rounded-lg bg-white border-2 border-gray-200 shadow-sm min-w-[300px] max-w-[500px] transition-all duration-200 relative hover:border-indigo-500 hover:shadow-md",onClick:()=>{console.log("Node clicked:",{label:t.label,nodeType:t.nodeType,details:t.details})}},$&&e.createElement(Hr,{type:"target",position:nr.Top,className:"w-2 h-2 border-2 border-indigo-500 bg-white cursor-default",isConnectable:!1}),e.createElement("div",{className:"flex justify-between items-center gap-2 p-3 border-b border-gray-200"},e.createElement("div",{className:"flex items-center gap-2"},e.createElement("div",{className:"text-xl flex items-center justify-center"},F),e.createElement("div",{className:"font-semibold text-gray-800 text-sm break-words"},B)),"Agent"===j&&e.createElement("div",{className:"flex gap-2 justify-end items-center"},e.createElement(Fl,{variant:"gray",className:"text-xs"},V),e.createElement(Fl,{variant:"cost",className:"text-xs"},W)),"Tool"===j&&K&&e.createElement("div",{className:"flex gap-2 justify-end items-center"},e.createElement(Fl,{variant:"latency",className:"text-xs"},Il(K))),"Coordinator"===j&&e.createElement("div",{className:"flex gap-2 justify-end items-center"},e.createElement(Fl,{variant:"gray",className:"text-xs"},"Coordinator"))),e.createElement("div",{className:"p-3 flex flex-col items-start justify-center gap-2"},"Agent"===j?e.createElement(e.Fragment,null,e.createElement(Xl,{label:"System Message",content:Y,isExpanded:D,onToggle:()=>T(!D)}),e.createElement(Xl,{label:"User Message",content:X,isExpanded:I,onToggle:()=>z(!I)})):"Tool"===j?e.createElement(Yl,{data:(()=>{var e,n,o,r,a,i;const s=(null===(e=t.details)||void 0===e?void 0:e.internals)||{};return t.edgeDetails&&t.edgeDetails.length>0?Object.assign(Object.assign({},s),{input:{args:null===(n=t.edgeDetails[0])||void 0===n?void 0:n.input_args,kwargs:null===(o=t.edgeDetails[0])||void 0===o?void 0:o.input_kwargs},output:null===(r=t.edgeDetails[0])||void 0===r?void 0:r.output,state:null===(a=t.edgeDetails[0])||void 0===a?void 0:a.state,status:null===(i=t.edgeDetails[0])||void 0===i?void 0:i.status}):s})()}):"Coordinator"===j?e.createElement(Yl,{data:(null===(A=t.details)||void 0===A?void 0:A.internals)||{}}):null),L&&e.createElement(Hr,{type:"source",position:nr.Bottom,className:"w-2 h-2 border-2 border-indigo-500 bg-white cursor-default",isConnectable:!1}))},ql=({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("div",{className:"w-full h-full bg-white flex flex-col overflow-hidden"},e.createElement("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex justify-between items-start"},e.createElement("div",null,e.createElement("h3",{className:"m-0 text-base font-semibold text-gray-800"},"Timeline")),r&&e.createElement("button",{onClick:r,className:"border-none bg-transparent cursor-pointer text-gray-500 p-1 flex items-center justify-center transition-colors duration-200 hover:text-gray-700",title:"Collapse Panel"},e.createElement(ws,{size:16}))),e.createElement("div",{className:"flex-1 overflow-y-auto py-2 pb-4"},Array.from({length:s},(r,a)=>{const s=i+a,c=s===n,u=s<n,d=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=>{var n;const o=t.filter(t=>t.step===e);return 0===o.length?`Step ${e}`:(null===(n=o[0])||void 0===n?void 0:n.identifier)||`Step ${e}`})(s);return e.createElement("div",{key:s,onClick:()=>d&&o(s),className:`\n px-4 py-3 border-b border-gray-100 relative transition-all duration-200\n ${d?"cursor-pointer":"cursor-default"}\n ${c?"bg-blue-50 border-l-4 border-l-indigo-500":"border-l-4 border-l-transparent"}\n ${d&&!c?"hover:bg-gray-50":""}\n `},e.createElement("div",{className:"flex items-center gap-2 mb-1"},e.createElement("div",{className:`\n w-3 h-3 rounded-full border flex-shrink-0\n ${c?"bg-indigo-500 border-indigo-500":u?"bg-yellow-400 border-gray-300":d?"bg-gray-400 border-gray-300":"bg-gray-200 border-gray-300"}\n `}),e.createElement("span",{className:`\n text-sm font-medium\n ${c?"font-semibold text-gray-800":"text-gray-500"}\n `},"Step ",s),f&&e.createElement(Fl,{variant:l(f),className:"ml-auto"},Il(f))),e.createElement("div",{className:`\n text-sm leading-relaxed break-words\n ${d?"text-gray-800":"text-gray-400 italic"}\n `},d?p:"No activity"),c&&e.createElement("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-indigo-500 animate-pulse"}))})))};function Ul(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Zl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Gl(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Zl(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():Zl(e[t],null)}}}}function Ql(...e){return r.useCallback(Gl(...e),e)}function Jl(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}\``)}]},ec(a,...t)]}function ec(...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 tc=globalThis?.document?r.useLayoutEffect:()=>{},nc=r[" useId ".trim().toString()]||(()=>{}),oc=0;function rc(e){const[t,n]=r.useState(nc());return tc(()=>{e||n(e=>e??String(oc++))},[e]),e||(t?`radix-${t}`:"")}var ac=r[" useInsertionEffect ".trim().toString()]||tc;function ic({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 ac(()=>{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 sc(e){const t=lc(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,s=r.Children.toArray(a),l=s.find(uc);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 lc(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?Gl(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 cc=Symbol("radix.slottable");function uc(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===cc}var dc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const o=sc(`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 fc(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var pc,hc="dismissableLayer.update",mc="dismissableLayer.pointerDownOutside",gc="dismissableLayer.focusOutside",yc=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vc=r.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=r.useContext(yc),[f,p]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=r.useState({}),g=Ql(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=fc(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){wc(mc,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=fc(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){wc(gc,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=fc(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&&(pc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),bc(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=pc)}},[f,h,o,d]),r.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),bc())},[f,d]),r.useEffect(()=>{const e=()=>m({});return document.addEventListener(hc,e),()=>document.removeEventListener(hc,e)},[]),n.jsx(dc.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Ul(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Ul(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Ul(e.onPointerDownCapture,S.onPointerDownCapture)})});vc.displayName="DismissableLayer";function bc(){const e=new CustomEvent(hc);document.dispatchEvent(e)}function wc(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)}r.forwardRef((e,t)=>{const o=r.useContext(yc),a=r.useRef(null),i=Ql(t,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),n.jsx(dc.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var xc="focusScope.autoFocusOnMount",Ec="focusScope.autoFocusOnUnmount",Sc={bubbles:!1,cancelable:!0},_c=r.forwardRef((e,t)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=r.useState(null),d=fc(i),f=fc(s),p=r.useRef(null),h=Ql(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:Mc(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Mc(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Mc(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){Oc.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(xc,Sc);c.addEventListener(xc,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Mc(o,{select:t}),document.activeElement!==n)return}((e=Cc(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Mc(c))}return()=>{c.removeEventListener(xc,d),setTimeout(()=>{const e=new CustomEvent(Ec,Sc);c.addEventListener(Ec,f),c.dispatchEvent(e),e.defaultPrevented||Mc(t??document.body,{select:!0}),c.removeEventListener(Ec,f),Oc.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=Cc(e),n=Nc(t,e),o=Nc(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&Mc(a,{select:!0})):(e.preventDefault(),o&&Mc(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,m.paused]);return n.jsx(dc.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function Cc(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 Nc(e,t){for(const n of e)if(!kc(n,{upTo:t}))return n}function kc(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 Mc(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()}}_c.displayName="FocusScope";var Oc=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Rc(e,t),e.unshift(t)},remove(t){e=Rc(e,t),e[0]?.resume()}}}();function Rc(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Pc=r.forwardRef((e,o)=>{const{container:a,...i}=e,[s,l]=r.useState(!1);tc(()=>l(!0),[]);const c=a||s&&globalThis?.document?.body;return c?t.createPortal(n.jsx(dc.div,{...i,ref:o}),c):null});Pc.displayName="Portal";var Ac=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=Dc(o.current);i.current="mounted"===l?e:"none"},[l]),tc(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=Dc(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]),tc(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=Dc(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=Dc(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=Ql(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 Dc(e){return e?.animationName||"none"}Ac.displayName="Presence";var Tc=0;function Ic(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zc()),document.body.insertAdjacentElement("beforeend",e[1]??zc()),Tc++,()=>{1===Tc&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Tc--}},[])}function zc(){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 Lc="right-scroll-bar-position",$c="width-before-scroll-bar";function jc(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Bc="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Hc=new WeakMap;function Fc(t,n){var o,r,a,i=(o=n||null,r=function(e){return t.forEach(function(t){return jc(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 Bc(function(){var e=Hc.get(i);if(e){var n=new Set(e),o=new Set(t),r=i.current;n.forEach(function(e){o.has(e)||jc(e,null)}),o.forEach(function(e){n.has(e)||jc(e,r)})}Hc.set(i,t)},[t]),i}function Vc(e){return e}var Wc=function(e){var t=e.sideCar,n=Ll(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,zl({},n))};Wc.isSideCarExport=!0;var Yc=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Vc);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=zl({async:!0,ssr:!1},e),t}(),Xc=function(){},Kc=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:Xc,onWheelCapture:Xc,onTouchMoveCapture:Xc}),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=Ll(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=Fc([n,t]),_=zl(zl({},x),a);return r.createElement(r.Fragment,null,d&&r.createElement(E,{sideCar:Yc,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),zl(zl({},_),{ref:S})):r.createElement(b,zl({},_,{className:c,ref:S}),l))});Kc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kc.classNames={fullWidth:$c,zeroRight:Lc};function qc(){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 Uc=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=qc())&&(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)}}},Zc=function(){var e,t=(e=Uc(),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}},Gc={left:0,top:0,right:0,gap:0},Qc=function(e){return parseInt(e||"",10)||0},Jc=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Gc;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[Qc(n),Qc(o),Qc(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])}},eu=Zc(),tu="data-scroll-locked",nu=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(tu,"] {\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(Lc," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat($c," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Lc," .").concat(Lc," {\n right: 0 ").concat(o,";\n }\n \n .").concat($c," .").concat($c," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(tu,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},ou=function(){var e=parseInt(document.body.getAttribute(tu)||"0",10);return isFinite(e)?e:0},ru=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(tu,(ou()+1).toString()),function(){var e=ou()-1;e<=0?document.body.removeAttribute(tu):document.body.setAttribute(tu,e.toString())}},[]);var i=r.useMemo(function(){return Jc(a)},[a]);return r.createElement(eu,{styles:nu(i,!t,a,n?"":"!important")})},au=!1;if("undefined"!=typeof window)try{var iu=Object.defineProperty({},"passive",{get:function(){return au=!0,!0}});window.addEventListener("test",iu,iu),window.removeEventListener("test",iu,iu)}catch(e){au=!1}var su=!!au&&{passive:!1},lu=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])},cu=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),uu(e,o)){var r=du(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},uu=function(e,t){return"v"===e?function(e){return lu(e,"overflowY")}(t):function(e){return lu(e,"overflowX")}(t)},du=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},fu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pu=function(e){return[e.deltaX,e.deltaY]},hu=function(e){return e&&"current"in e?e.current:e},mu=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},gu=0,yu=[];function vu(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bu,wu=(bu=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),a=r.useState(gu++)[0],i=r.useState(Zc)[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(hu),!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=fu(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=cu(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=cu(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=du(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&uu(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(yu.length&&yu[yu.length-1]===i){var o="deltaY"in n?pu(n):fu(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(hu).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:vu(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=fu(e),o.current=void 0},[]),f=r.useCallback(function(t){u(t.type,pu(t),t.target,l(t,e.lockRef.current))},[]),p=r.useCallback(function(t){u(t.type,fu(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return yu.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,su),document.addEventListener("touchmove",c,su),document.addEventListener("touchstart",d,su),function(){yu=yu.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,su),document.removeEventListener("touchmove",c,su),document.removeEventListener("touchstart",d,su)}},[]);var h=e.removeScrollBar,m=e.inert;return r.createElement(r.Fragment,null,m?r.createElement(i,{styles:mu(a)}):null,h?r.createElement(ru,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Yc.useMedium(bu),Wc),xu=r.forwardRef(function(e,t){return r.createElement(Kc,zl({},e,{ref:t,sideCar:wu}))});xu.classNames=Kc.classNames;var Eu=xu,Su=new WeakMap,_u=new WeakMap,Cu={},Nu=0,ku=function(e){return e&&(e.host||ku(e.parentNode))},Mu=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ku(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]);Cu[n]||(Cu[n]=new WeakMap);var a=Cu[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=(Su.get(e)||0)+1,c=(a.get(e)||0)+1;Su.set(e,l),a.set(e,c),i.push(e),1===l&&r&&_u.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(),Nu++,function(){i.forEach(function(e){var t=Su.get(e)-1,r=a.get(e)-1;Su.set(e,t),a.set(e,r),t||(_u.has(e)||e.removeAttribute(o),_u.delete(e)),r||e.removeAttribute(n)}),--Nu||(Su=new WeakMap,Su=new WeakMap,_u=new WeakMap,Cu={})}},Ou=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"))),Mu(o,r,n,"aria-hidden")):function(){return null}},Ru="Dialog",[Pu,Au]=Jl(Ru),[Du,Tu]=Pu(Ru),Iu=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]=ic({prop:a,defaultProp:i??!1,onChange:s,caller:Ru});return n.jsx(Du,{scope:t,triggerRef:c,contentRef:u,contentId:rc(),titleId:rc(),descriptionId:rc(),open:d,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:l,children:o})};Iu.displayName=Ru;var zu="DialogTrigger",Lu=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Tu(zu,o),i=Ql(t,a.triggerRef);return n.jsx(dc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":od(a.open),...r,ref:i,onClick:Ul(e.onClick,a.onOpenToggle)})});Lu.displayName=zu;var $u="DialogPortal",[ju,Bu]=Pu($u,{forceMount:void 0}),Hu=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:i}=e,s=Tu($u,t);return n.jsx(ju,{scope:t,forceMount:o,children:r.Children.map(a,e=>n.jsx(Ac,{present:o||s.open,children:n.jsx(Pc,{asChild:!0,container:i,children:e})}))})};Hu.displayName=$u;var Fu="DialogOverlay",Vu=r.forwardRef((e,t)=>{const o=Bu(Fu,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=Tu(Fu,e.__scopeDialog);return i.modal?n.jsx(Ac,{present:r||i.open,children:n.jsx(Yu,{...a,ref:t})}):null});Vu.displayName=Fu;var Wu=sc("DialogOverlay.RemoveScroll"),Yu=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Tu(Fu,o);return n.jsx(Eu,{as:Wu,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(dc.div,{"data-state":od(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xu="DialogContent",Ku=r.forwardRef((e,t)=>{const o=Bu(Xu,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=Tu(Xu,e.__scopeDialog);return n.jsx(Ac,{present:r||i.open,children:i.modal?n.jsx(qu,{...a,ref:t}):n.jsx(Uu,{...a,ref:t})})});Ku.displayName=Xu;var qu=r.forwardRef((e,t)=>{const o=Tu(Xu,e.__scopeDialog),a=r.useRef(null),i=Ql(t,o.contentRef,a);return r.useEffect(()=>{const e=a.current;if(e)return Ou(e)},[]),n.jsx(Zu,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ul(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Ul(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Ul(e.onFocusOutside,e=>e.preventDefault())})}),Uu=r.forwardRef((e,t)=>{const o=Tu(Xu,e.__scopeDialog),a=r.useRef(!1),i=r.useRef(!1);return n.jsx(Zu,{...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()}})}),Zu=r.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=Tu(Xu,o),u=r.useRef(null),d=Ql(t,u);return Ic(),n.jsxs(n.Fragment,{children:[n.jsx(_c,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:n.jsx(vc,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":od(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(sd,{titleId:c.titleId}),n.jsx(ld,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Gu="DialogTitle",Qu=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Tu(Gu,o);return n.jsx(dc.h2,{id:a.titleId,...r,ref:t})});Qu.displayName=Gu;var Ju="DialogDescription",ed=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Tu(Ju,o);return n.jsx(dc.p,{id:a.descriptionId,...r,ref:t})});ed.displayName=Ju;var td="DialogClose",nd=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=Tu(td,o);return n.jsx(dc.button,{type:"button",...r,ref:t,onClick:Ul(e.onClick,()=>a.onOpenChange(!1))})});function od(e){return e?"open":"closed"}nd.displayName=td;var rd="DialogTitleWarning",[ad,id]=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}\``)}]}(rd,{contentName:Xu,titleName:Gu,docsSlug:"dialog"}),sd=({titleId:e})=>{const t=id(rd),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},ld=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${id("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},cd=Iu,ud=Lu,dd=Hu,fd=Vu,pd=Ku,hd=Qu,md=ed,gd=nd;const yd=cd,vd=ud,bd=dd,wd=r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(fd,Object.assign({className:Pl("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n)},o,{ref:t}))});wd.displayName=fd.displayName;const xd=Bl("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ed=r.forwardRef((e,t)=>{var{side:n="right",className:o,children:a}=e,i=Ll(e,["side","className","children"]);return r.createElement(bd,null,r.createElement(wd,null),r.createElement(pd,Object.assign({ref:t,className:Pl(xd({side:n}),o)},i),a,r.createElement(gd,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},r.createElement("svg",{className:"h-4 w-4",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",{className:"sr-only"},"Close"))))});Ed.displayName=pd.displayName;r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(hd,Object.assign({ref:t,className:Pl("text-lg font-semibold text-foreground",n)},o))}).displayName=hd.displayName;r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(md,Object.assign({ref:t,className:Pl("text-sm text-muted-foreground",n)},o))}).displayName=md.displayName;const Sd=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{var t;e.source&&e.target&&(null===(t=a.get(e.source))||void 0===t||t.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{var t;e.parent&&e.parent.identifier!==e.identifier&&(null===(t=a.get(e.parent.identifier))||void 0===t||t.push(e.identifier),i.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!i.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of a.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{var t;const n=null!==(t=l.get(e.identifier))&&void 0!==t?t:0;u[n]||(u[n]=[]),u[n].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,o+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of i){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=o,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),o=m.get(x[t]);if(Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2))<w){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const a=w/r,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,o.x+=i,o.y+=s}else n.x-=w/2,o.x+=w/2}}return m},_d={Agent:Kl,Tool:Kl,Coordinator:Kl},Cd=({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 u=t;if(!u)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",background:"#f9fafb",position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:r},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#6b7280",marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:"#9ca3af"}},"Please provide flowData prop")));const d=e.useRef(null),f=e.useRef(null),[p,h]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[m,g]=e.useState(0),[y,v]=e.useState(!1),b=e.useRef(null),[w,x]=e.useState(!1),E=e.useMemo(()=>{const e=u.stamps||u.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[u.stamps,u.steps]);e.useEffect(()=>(y?b.current=setInterval(()=>{g(e=>e>=E?(v(!1),e):e+1)},250):b.current&&(clearInterval(b.current),b.current=null),()=>{b.current&&clearInterval(b.current)}),[y,E]),e.useEffect(()=>{const e=u.stamps||u.steps||[];e.length>0&&g(Math.max(...e.map(e=>e.step)))},[u.stamps,u.steps]),e.useEffect(()=>{const e=()=>{if(d.current){const e=d.current.getBoundingClientRect();h({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&d.current){const t=new ResizeObserver(e);return t.observe(d.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const S=e.useMemo(()=>{if(!u.nodes)return new Map;const e=Math.max(p.width||800,1200);return Sd(u.nodes,u.edges||[],{minNodeSpacing:c,containerWidth:e})},[u.nodes,u.edges,p.width,c]),_=e.useCallback(e=>u.nodes?u.nodes.filter(t=>t.stamp.step<=e):[],[u.nodes]),C=e.useCallback(e=>(u.edges||[]).filter(t=>t.stamp.step<=e),[u.edges]),N=e.useMemo(()=>{const e=_(m),t=C(m);return e.map(e=>{const n=S.get(e.identifier)||{x:0,y:0},o=e.stamp.step===m,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"}}})},[S,m,_,C]),k=e.useMemo(()=>C(m).filter(e=>e.source&&e.target).map(e=>{var t,n,o,r;const a=e.stamp.step===m;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:a,bidirectional:!0,style:{stroke:a?"#6366f1":"#9ca3af",strokeWidth:a?3:2},label:(null===(t=e.stamp)||void 0===t?void 0:t.identifier)?Dl(String(e.stamp.identifier),50):void 0,data:{label:(null===(n=e.stamp)||void 0===n?void 0:n.identifier)?Dl(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:null===(o=e.stamp)||void 0===o?void 0:o.step,time:null===(r=e.stamp)||void 0===r?void 0:r.time,details:e.details}}}),[m,C]),[M,O,R]=Ji(N),[P,A,D]=es(k);e.useEffect(()=>{O(N)},[N,O]),e.useEffect(()=>{A(k)},[k,A]);const T=e.useCallback(e=>A(t=>xr(e,t)),[A]),I=e.useCallback(e=>{g(e),v(!1)},[]);e.useCallback(()=>{v(e=>!e)},[]);const z=(e,t)=>{var n;if(!f.current)return{x:0,y:0};const o=f.current.createSVGPoint();o.x=e,o.y=t;const r=o.matrixTransform(null===(n=f.current.getScreenCTM())||void 0===n?void 0:n.inverse());return{x:r.x,y:r.y}},L=Ca();return e.useEffect(()=>{if(s||!L||0===N.length)return;const e=new Map;k.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&&N.length>0&&(t=N[0].id),t&&setTimeout(()=>{L.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:a,maxZoom:1})},500)},[N,k,L,s,a]),e.createElement("div",{ref:d,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px"},className:r},l&&e.createElement(yd,{open:w,onOpenChange:x},e.createElement(vd,{asChild:!0},e.createElement("button",{className:"absolute top-4 left-4 z-50 w-10 h-10 bg-white border border-gray-300 rounded-lg shadow-sm hover:bg-gray-50 flex items-center justify-center transition-colors duration-200",title:"Open Timeline"},e.createElement(ws,{size:20,className:"text-gray-600"}))),e.createElement(bd,null,e.createElement(pd,{className:"fixed inset-y-0 left-0 h-full w-[280px] z-50 bg-background border-r shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left p-0",onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{className:"flex flex-col h-full"},e.createElement("div",{className:"flex-1 overflow-y-auto"},e.createElement(ql,{stamps:u.stamps||u.steps||[],currentStep:m,onStepChange:I}))),e.createElement(gd,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},e.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{className:"sr-only"},"Close"))))),e.createElement(Gi,{nodes:M,edges:P,onNodesChange:R,onEdgesChange:D,onConnect:T,nodeTypes:_d,edgeTypes:{default:t=>e.createElement(Es,Object.assign({},t,{clientToSvgCoords:z,svgRef:f}))},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:i.x,y:i.y,zoom:a},onInit:()=>{if(d.current){const e=d.current.querySelector("svg");e&&(f.current=e)}}},e.createElement(ls,{variant:ts.Lines,color:"#EEEEEE",gap:16})),e.createElement("style",null,"\n .react-flow__edge-label {\n font-size: 10px;\n background: white;\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid #e5e7eb;\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n "))};function Nd(e,[t,n]){return Math.min(n,Math.max(t,e))}var kd=r.createContext(void 0);const Md=["top","right","bottom","left"],Od=Math.min,Rd=Math.max,Pd=Math.round,Ad=Math.floor,Dd=e=>({x:e,y:e}),Td={left:"right",right:"left",bottom:"top",top:"bottom"},Id={start:"end",end:"start"};function zd(e,t,n){return Rd(e,Od(t,n))}function Ld(e,t){return"function"==typeof e?e(t):e}function $d(e){return e.split("-")[0]}function jd(e){return e.split("-")[1]}function Bd(e){return"x"===e?"y":"x"}function Hd(e){return"y"===e?"height":"width"}const Fd=new Set(["top","bottom"]);function Vd(e){return Fd.has($d(e))?"y":"x"}function Wd(e){return Bd(Vd(e))}function Yd(e){return e.replace(/start|end/g,e=>Id[e])}const Xd=["left","right"],Kd=["right","left"],qd=["top","bottom"],Ud=["bottom","top"];function Zd(e,t,n,o){const r=jd(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Kd:Xd:t?Xd:Kd;case"left":case"right":return t?qd:Ud;default:return[]}}($d(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Yd)))),a}function Gd(e){return e.replace(/left|right|bottom|top/g,e=>Td[e])}function Qd(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 Jd(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 ef(e,t,n){let{reference:o,floating:r}=e;const a=Vd(t),i=Wd(t),s=Hd(i),l=$d(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(jd(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function tf(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}=Ld(t,e),h=Qd(p),m=s[f?"floating"===d?"reference":"floating":d],g=Jd(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=Jd(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 nf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function of(e){return Md.some(t=>e[t]>=0)}const rf=new Set(["left","top"]);function af(){return"undefined"!=typeof window}function sf(e){return uf(e)?(e.nodeName||"").toLowerCase():"#document"}function lf(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cf(e){var t;return null==(t=(uf(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function uf(e){return!!af()&&(e instanceof Node||e instanceof lf(e).Node)}function df(e){return!!af()&&(e instanceof Element||e instanceof lf(e).Element)}function ff(e){return!!af()&&(e instanceof HTMLElement||e instanceof lf(e).HTMLElement)}function pf(e){return!(!af()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof lf(e).ShadowRoot)}const hf=new Set(["inline","contents"]);function mf(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=kf(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!hf.has(r)}const gf=new Set(["table","td","th"]);function yf(e){return gf.has(sf(e))}const vf=[":popover-open",":modal"];function bf(e){return vf.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const wf=["transform","translate","scale","rotate","perspective"],xf=["transform","translate","scale","rotate","perspective","filter"],Ef=["paint","layout","strict","content"];function Sf(e){const t=_f(),n=df(e)?kf(e):e;return wf.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||xf.some(e=>(n.willChange||"").includes(e))||Ef.some(e=>(n.contain||"").includes(e))}function _f(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Cf=new Set(["html","body","#document"]);function Nf(e){return Cf.has(sf(e))}function kf(e){return lf(e).getComputedStyle(e)}function Mf(e){return df(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Of(e){if("html"===sf(e))return e;const t=e.assignedSlot||e.parentNode||pf(e)&&e.host||cf(e);return pf(t)?t.host:t}function Rf(e){const t=Of(e);return Nf(t)?e.ownerDocument?e.ownerDocument.body:e.body:ff(t)&&mf(t)?t:Rf(t)}function Pf(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Rf(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=lf(r);if(a){const e=Af(i);return t.concat(i,i.visualViewport||[],mf(r)?r:[],e&&n?Pf(e):[])}return t.concat(r,Pf(r,[],n))}function Af(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Df(e){const t=kf(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ff(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=Pd(n)!==a||Pd(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Tf(e){return df(e)?e:e.contextElement}function If(e){const t=Tf(e);if(!ff(t))return Dd(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=Df(t);let i=(a?Pd(n.width):n.width)/o,s=(a?Pd(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const zf=Dd(0);function Lf(e){const t=lf(e);return _f()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zf}function $f(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Tf(e);let i=Dd(1);t&&(o?df(o)&&(i=If(o)):i=If(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==lf(e))&&t}(a,n,o)?Lf(a):Dd(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=lf(a),t=o&&df(o)?lf(o):o;let n=e,r=Af(n);for(;r&&o&&t!==n;){const e=If(r),t=r.getBoundingClientRect(),o=kf(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=lf(r),r=Af(n)}}return Jd({width:u,height:d,x:l,y:c})}function jf(e,t){const n=Mf(e).scrollLeft;return t?t.left+n:$f(cf(e)).left+n}function Bf(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jf(e,n),y:n.top+t.scrollTop}}const Hf=new Set(["absolute","fixed"]);function Ff(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=lf(e),o=cf(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=_f();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=jf(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=cf(e),n=Mf(e),o=e.ownerDocument.body,r=Rd(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Rd(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+jf(e);const s=-n.scrollTop;return"rtl"===kf(o).direction&&(i+=Rd(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(cf(e));else if(df(t))o=function(e,t){const n=$f(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=ff(e)?If(e):Dd(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=Lf(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jd(o)}function Vf(e,t){const n=Of(e);return!(n===t||!df(n)||Nf(n))&&("fixed"===kf(n).position||Vf(n,t))}function Wf(e,t,n){const o=ff(t),r=cf(t),a="fixed"===n,i=$f(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Dd(0);function c(){l.x=jf(r)}if(o||!o&&!a)if(("body"!==sf(t)||mf(r))&&(s=Mf(t)),o){const e=$f(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?Dd(0):Bf(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 Yf(e){return"static"===kf(e).position}function Xf(e,t){if(!ff(e)||"fixed"===kf(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cf(e)===n&&(n=n.ownerDocument.body),n}function Kf(e,t){const n=lf(e);if(bf(e))return n;if(!ff(e)){let t=Of(e);for(;t&&!Nf(t);){if(df(t)&&!Yf(t))return t;t=Of(t)}return n}let o=Xf(e,t);for(;o&&yf(o)&&Yf(o);)o=Xf(o,t);return o&&Nf(o)&&Yf(o)&&!Sf(o)?n:o||function(e){let t=Of(e);for(;ff(t)&&!Nf(t);){if(Sf(t))return t;if(bf(t))return null;t=Of(t)}return null}(e)||n}const qf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=cf(o),s=!!t&&bf(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Dd(1);const u=Dd(0),d=ff(o);if((d||!d&&!a)&&(("body"!==sf(o)||mf(i))&&(l=Mf(o)),ff(o))){const e=$f(o);c=If(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!i||d||a?Dd(0):Bf(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:cf,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a="clippingAncestors"===n?bf(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Pf(e,[],!1).filter(e=>df(e)&&"body"!==sf(e)),r=null;const a="fixed"===kf(e).position;let i=a?Of(e):e;for(;df(i)&&!Nf(i);){const t=kf(i),n=Sf(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&Hf.has(r.position)||mf(i)&&!n&&Vf(e,i))?o=o.filter(e=>e!==i):r=t,i=Of(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=Ff(t,n,r);return e.top=Rd(o.top,e.top),e.right=Od(o.right,e.right),e.bottom=Od(o.bottom,e.bottom),e.left=Rd(o.left,e.left),e},Ff(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Kf,getElementRects:async function(e){const t=this.getOffsetParent||Kf,n=this.getDimensions,o=await n(e.floating);return{reference:Wf(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}=Df(e);return{width:t,height:n}},getScale:If,isElement:df,isRTL:function(e){return"rtl"===kf(e).direction}};function Uf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zf(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=Tf(e),u=r||a?[...c?Pf(c):[],...Pf(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=cf(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:-Ad(d)+"px "+-Ad(r.clientWidth-(u+f))+"px "+-Ad(r.clientHeight-(d+p))+"px "+-Ad(u)+"px",threshold:Rd(0,Od(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||Uf(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?$f(e):null;return l&&function t(){const o=$f(e);m&&!Uf(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 Gf=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=$d(n),s=jd(n),l="y"===Vd(n),c=rf.has(i)?-1:1,u=a&&l?-1:1,d=Ld(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}}}}},Qf=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}=Ld(e,t),c={x:n,y:o},u=await tf(t,l),d=Vd($d(r)),f=Bd(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=zd(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=zd(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}}}}}},Jf=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}=Ld(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=$d(r),v=Vd(s),b=$d(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Gd(s)]:function(e){const t=Gd(e);return[Yd(e),t,Yd(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Zd(s,m,h,w));const S=[s,...x],_=await tf(t,g),C=[];let N=(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=jd(e),r=Wd(e),a=Hd(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Gd(i)),[i,Gd(i)]}(r,i,w);C.push(_[e[0]],_[e[1]])}if(N=[...N,{placement:r,overflows:C}],!C.every(e=>e<=0)){var k,M;const e=((null==(k=a.flip)?void 0:k.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==Vd(t))||N.every(e=>Vd(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:N},reset:{placement:t}}}let n=null==(M=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=N.filter(e=>{if(E){const t=Vd(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ep=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}=Ld(e,t),u=await tf(t,c),d=$d(r),f=jd(r),p="y"===Vd(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=Od(m-u[g],v),x=Od(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=Rd(u.left,0),t=Rd(u.right,0),n=Rd(u.top,0),o=Rd(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:Rd(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:Rd(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}}:{}}}},tp=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Ld(e,t);switch(o){case"referenceHidden":{const e=nf(await tf(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:of(e)}}}case"escaped":{const e=nf(await tf(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:of(e)}}}default:return{}}}}},np=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}=Ld(e,t)||{};if(null==c)return{};const d=Qd(u),f={x:n,y:o},p=Wd(r),h=Hd(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,N=Od(d[y],C),k=Od(d[v],C),M=N,O=S-m[h]-k,R=S/2-m[h]/2+_,P=zd(M,R,O),A=!l.arrow&&null!=jd(r)&&R!==P&&a.reference[h]/2-(R<M?N:k)-m[h]/2<0,D=A?R<M?R-M:R-O:0;return{[p]:f[p]+D,data:{[p]:P,centerOffset:R-P-D,...A&&{alignmentOffset:D}},reset:A}}}),op=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}=Ld(e,t),u={x:n,y:o},d=Vd(r),f=Bd(d);let p=u[f],h=u[d];const m=Ld(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=rf.has($d(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}}}},rp=(e,t,n)=>{const o=new Map,r={platform:qf,...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}=ef(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}=ef(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:a})};var ap="undefined"!=typeof document?e.useLayoutEffect:function(){};function ip(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(!ip(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)&&!ip(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function sp(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lp(e,t){const n=sp(e);return Math.round(t*n)/n}function cp(e){const t=r.useRef(e);return ap(()=>{t.current=e}),t}const up=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?np({element:n.current,padding:o}).fn(t):{}:n?np({element:n,padding:o}).fn(t):{};var r}}),dp=(e,t)=>({...Gf(e),options:[e,t]}),fp=(e,t)=>({...Qf(e),options:[e,t]}),pp=(e,t)=>({...op(e),options:[e,t]}),hp=(e,t)=>({...Jf(e),options:[e,t]}),mp=(e,t)=>({...ep(e),options:[e,t]}),gp=(e,t)=>({...tp(e),options:[e,t]}),yp=(e,t)=>({...up(e),options:[e,t]});var vp=r.forwardRef((e,t)=>{const{children:o,width:r=10,height:a=5,...i}=e;return n.jsx(dc.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"})})});vp.displayName="Arrow";var bp=vp;function wp(e){const[t,n]=r.useState(void 0);return tc(()=>{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 xp="Popper",[Ep,Sp]=Jl(xp),[_p,Cp]=Ep(xp),Np=e=>{const{__scopePopper:t,children:o}=e,[a,i]=r.useState(null);return n.jsx(_p,{scope:t,anchor:a,onAnchorChange:i,children:o})};Np.displayName=xp;var kp="PopperAnchor",Mp=r.forwardRef((e,t)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=Cp(kp,o),l=r.useRef(null),c=Ql(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(dc.div,{...i,ref:c})});Mp.displayName=kp;var Op="PopperContent",[Rp,Pp]=Ep(Op),Ap=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=Cp(Op,o),[w,x]=r.useState(null),E=Ql(t,e=>x(e)),[S,_]=r.useState(null),C=wp(S),N=C?.width??0,k=C?.height??0,M=i+("center"!==l?"-"+l:""),O="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(f)?f:[f],P=R.length>0,A={padding:O,boundary:R.filter(zp),altBoundary:P},{refs:D,floatingStyles:T,placement:I,isPositioned:z,middlewareData:L}=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);ip(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),N=r.useRef(f),k=null!=u,M=cp(u),O=cp(i),R=cp(d),P=r.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};O.current&&(e.platform=O.current),rp(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};A.current&&!ip(N.current,t)&&(N.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,O,R]);ap(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=r.useRef(!1);ap(()=>(A.current=!0,()=>{A.current=!1}),[]),ap(()=>{if(E&&(_.current=E),S&&(C.current=S),E&&S){if(M.current)return M.current(E,S,P);P()}},[E,S,P,M,k]);const D=r.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),T=r.useMemo(()=>({reference:E,floating:S}),[E,S]),I=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=lp(T.floating,f.x),o=lp(T.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...sp(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,T.floating,f.x,f.y]);return r.useMemo(()=>({...f,update:P,refs:D,elements:T,floatingStyles:I}),[f,P,D,T,I])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Zf(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[dp({mainAxis:s+k,alignmentAxis:c}),d&&fp({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?pp():void 0,...A}),d&&hp({...A}),mp({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&yp({element:S,padding:u}),Lp({arrowWidth:N,arrowHeight:k}),m&&gp({strategy:"referenceHidden",...A})]}),[$,j]=$p(I),B=fc(y);tc(()=>{z&&B?.()},[z,B]);const H=L.arrow?.x,F=L.arrow?.y,V=0!==L.arrow?.centerOffset,[W,Y]=r.useState();return tc(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(Rp,{scope:o,placedSide:$,onArrowChange:_,arrowX:H,arrowY:F,shouldHideArrow:V,children:n.jsx(dc.div,{"data-side":$,"data-align":j,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});Ap.displayName=Op;var Dp="PopperArrow",Tp={top:"bottom",right:"left",bottom:"top",left:"right"},Ip=r.forwardRef(function(e,t){const{__scopePopper:o,...r}=e,a=Pp(Dp,o),i=Tp[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(bp,{...r,ref:t,style:{...r.style,display:"block"}})})});function zp(e){return null!==e}Ip.displayName=Dp;var Lp=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]=$p(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 $p(e){const[t,n="center"]=e.split("-");return[t,n]}var jp=Np,Bp=Mp,Hp=Ap,Fp=Ip;function Vp(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 Wp=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(dc.span,{...e,ref:t,style:{...Wp,...e.style}})).displayName="VisuallyHidden";var Yp=[" ","Enter","ArrowUp","ArrowDown"],Xp=[" ","Enter"],Kp="Select",[qp,Up,Zp]=function(t){const o=t+"CollectionProvider",[r,a]=Jl(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=sc(c),d=e.forwardRef((e,t)=>{const{scope:o,children:r}=e,a=Ql(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=sc(f),m=e.forwardRef((t,o)=>{const{scope:r,children:a,...i}=t,l=e.useRef(null),c=Ql(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]}(Kp),[Gp,Qp]=Jl(Kp,[Zp,Sp]),Jp=Sp(),[eh,th]=Gp(Kp),[nh,oh]=Gp(Kp),rh=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=Jp(t),[v,b]=r.useState(null),[w,x]=r.useState(null),[E,S]=r.useState(!1),_=function(e){const t=r.useContext(kd);return e||t||"ltr"}(d),[C,N]=ic({prop:a,defaultProp:i??!1,onChange:s,caller:Kp}),[k,M]=ic({prop:l,defaultProp:c,onChange:u,caller:Kp}),O=r.useRef(null),R=!v||(g||!!v.closest("form")),[P,A]=r.useState(new Set),D=Array.from(P).map(e=>e.props.value).join(";");return n.jsx(jp,{...y,children:n.jsxs(eh,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:rc(),value:k,onValueChange:M,open:C,onOpenChange:N,dir:_,triggerPointerDownPosRef:O,disabled:h,children:[n.jsx(qp.Provider,{scope:t,children:n.jsx(nh,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),R?n.jsxs(Wh,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:k,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===k?n.jsx("option",{value:""}):null,Array.from(P)]},D):null]})})};rh.displayName=Kp;var ah="SelectTrigger",ih=r.forwardRef((e,t)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=Jp(o),l=th(ah,o),c=l.disabled||a,u=Ql(t,l.onTriggerChange),d=Up(o),f=r.useRef("touch"),[p,h,m]=Xh(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=Kh(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(Bp,{asChild:!0,...s,children:n.jsx(dc.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":Yh(l.value)?"":void 0,...i,ref:u,onClick:Ul(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Ul(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:Ul(i.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Yp.includes(e.key)&&(g(),e.preventDefault())})})})});ih.displayName=ah;var sh="SelectValue",lh=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=e,c=th(sh,o),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,f=Ql(t,c.onValueNodeChange);return tc(()=>{u(d)},[u,d]),n.jsx(dc.span,{...l,ref:f,style:{pointerEvents:"none"},children:Yh(c.value)?n.jsx(n.Fragment,{children:s}):i})});lh.displayName=sh;var ch=r.forwardRef((e,t)=>{const{__scopeSelect:o,children:r,...a}=e;return n.jsx(dc.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});ch.displayName="SelectIcon";var uh=e=>n.jsx(Pc,{asChild:!0,...e});uh.displayName="SelectPortal";var dh="SelectContent",fh=r.forwardRef((e,t)=>{const o=th(dh,e.__scopeSelect),[i,s]=r.useState();if(tc(()=>{s(new DocumentFragment)},[]),!o.open){const t=i;return t?a.createPortal(n.jsx(hh,{scope:e.__scopeSelect,children:n.jsx(qp.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),t):null}return n.jsx(yh,{...e,ref:t})});fh.displayName=dh;var ph=10,[hh,mh]=Gp(dh),gh=sc("SelectContent.RemoveScroll"),yh=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=th(dh,o),[x,E]=r.useState(null),[S,_]=r.useState(null),C=Ql(t,e=>E(e)),[N,k]=r.useState(null),[M,O]=r.useState(null),R=Up(o),[P,A]=r.useState(!1),D=r.useRef(!1);r.useEffect(()=>{if(x)return Ou(x)},[x]),Ic();const T=r.useCallback(e=>{const[t,...n]=R().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}},[R,S]),I=r.useCallback(()=>T([N,x]),[T,N,x]);r.useEffect(()=>{P&&I()},[P,I]);const{onOpenChange:z,triggerPointerDownPosRef:L}=w;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,z,L]),r.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[$,j]=Xh(e=>{const t=R().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Kh(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),B=r.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&(k(e),o&&(D.current=!0))},[w.value]),H=r.useCallback(()=>x?.focus(),[x]),F=r.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&O(e)},[w.value]),V="popper"===a?bh:vh,W=V===bh?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return n.jsx(hh,{scope:o,content:x,viewport:S,onViewportChange:_,itemRefCallback:B,selectedItem:N,onItemLeave:H,itemTextRefCallback:F,focusSelectedItem:I,selectedItemText:M,position:a,isPositioned:P,searchRef:$,children:n.jsx(Eu,{as:gh,allowPinchZoom:!0,children:n.jsx(_c,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ul(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:n.jsx(vc,{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:Ul(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||j(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=R().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});yh.displayName="SelectContentImpl";var vh=r.forwardRef((e,t)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=th(dh,o),l=mh(dh,o),[c,u]=r.useState(null),[d,f]=r.useState(null),p=Ql(t,e=>f(e)),h=Up(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-ph,d=Nd(a,[ph,Math.max(ph,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-ph,d=Nd(a,[ph,Math.max(ph,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const r=h(),i=window.innerHeight-2*ph,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-ph,N=i-C,k=v.offsetHeight/2,M=f+p+(v.offsetTop+k),O=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(N,k+(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)+k)+O;c.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}c.style.margin=`${ph}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]);tc(()=>x(),[x]);const[E,S]=r.useState();tc(()=>{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(wh,{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(dc.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});vh.displayName="SelectItemAlignedPosition";var bh=r.forwardRef((e,t)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=ph,...i}=e,s=Jp(o);return n.jsx(Hp,{...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)"}})});bh.displayName="SelectPopperPosition";var[wh,xh]=Gp(dh,{}),Eh="SelectViewport",Sh=r.forwardRef((e,t)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=mh(Eh,o),l=xh(Eh,o),c=Ql(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(qp.Slot,{scope:o,children:n.jsx(dc.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ul(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*ph,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})})})]})});Sh.displayName=Eh;var _h="SelectGroup",[Ch,Nh]=Gp(_h);r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=rc();return n.jsx(Ch,{scope:o,id:a,children:n.jsx(dc.div,{role:"group","aria-labelledby":a,...r,ref:t})})}).displayName=_h;var kh="SelectLabel",Mh=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Nh(kh,o);return n.jsx(dc.div,{id:a.id,...r,ref:t})});Mh.displayName=kh;var Oh="SelectItem",[Rh,Ph]=Gp(Oh),Ah=r.forwardRef((e,t)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=th(Oh,o),u=mh(Oh,o),d=c.value===a,[f,p]=r.useState(s??""),[h,m]=r.useState(!1),g=Ql(t,e=>u.itemRefCallback?.(e,a,i)),y=rc(),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(Rh,{scope:o,value:a,disabled:i,textId:y,isSelected:d,onItemTextChange:r.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:n.jsx(qp.ItemSlot,{scope:o,value:a,disabled:i,textValue:f,children:n.jsx(dc.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:Ul(l.onFocus,()=>m(!0)),onBlur:Ul(l.onBlur,()=>m(!1)),onClick:Ul(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Ul(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Ul(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Ul(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ul(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ul(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Xp.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Ah.displayName=Oh;var Dh="SelectItemText",Th=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=th(Dh,o),u=mh(Dh,o),d=Ph(Dh,o),f=oh(Dh,o),[p,h]=r.useState(null),m=Ql(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 tc(()=>(v(y),()=>b(y)),[v,b,y]),n.jsxs(n.Fragment,{children:[n.jsx(dc.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});Th.displayName=Dh;var Ih="SelectItemIndicator",zh=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return Ph(Ih,o).isSelected?n.jsx(dc.span,{"aria-hidden":!0,...r,ref:t}):null});zh.displayName=Ih;var Lh="SelectScrollUpButton",$h=r.forwardRef((e,t)=>{const o=mh(Lh,e.__scopeSelect),a=xh(Lh,e.__scopeSelect),[i,s]=r.useState(!1),l=Ql(t,a.onScrollButtonChange);return tc(()=>{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(Hh,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});$h.displayName=Lh;var jh="SelectScrollDownButton",Bh=r.forwardRef((e,t)=>{const o=mh(jh,e.__scopeSelect),a=xh(jh,e.__scopeSelect),[i,s]=r.useState(!1),l=Ql(t,a.onScrollButtonChange);return tc(()=>{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(Hh,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Bh.displayName=jh;var Hh=r.forwardRef((e,t)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=mh("SelectScrollButton",o),l=r.useRef(null),c=Up(o),u=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),tc(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),n.jsx(dc.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ul(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:Ul(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:Ul(i.onPointerLeave,()=>{u()})})}),Fh=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return n.jsx(dc.div,{"aria-hidden":!0,...r,ref:t})});Fh.displayName="SelectSeparator";var Vh="SelectArrow";r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Jp(o),i=th(Vh,o),s=mh(Vh,o);return i.open&&"popper"===s.position?n.jsx(Fp,{...a,...r,ref:t}):null}).displayName=Vh;var Wh=r.forwardRef(({__scopeSelect:e,value:t,...o},a)=>{const i=r.useRef(null),s=Ql(a,i),l=Vp(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(dc.select,{...o,style:{...Wp,...o.style},ref:s,defaultValue:t})});function Yh(e){return""===e||void 0===e}function Xh(e){const t=fc(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 Kh(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(r,0));1===o.length&&(a=a.filter(e=>e!==n));const i=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return i!==n?i:void 0}Wh.displayName="SelectBubbleInput";var qh=ih,Uh=ch,Zh=uh,Gh=fh,Qh=Sh,Jh=Mh,em=Ah,tm=Th,nm=zh,om=$h,rm=Bh,am=Fh;const im=rh,sm=lh,lm=r.forwardRef((e,t)=>{var{className:n,children:o}=e,a=Ll(e,["className","children"]);return r.createElement(qh,Object.assign({ref:t,className:Pl("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n)},a),o,r.createElement(Uh,{asChild:!0},r.createElement(gs,{className:"h-4 w-4 opacity-50"})))});lm.displayName=qh.displayName;const cm=r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(om,Object.assign({ref:t,className:Pl("flex cursor-default items-center justify-center py-1",n)},o),r.createElement(vs,{className:"h-4 w-4"}))});cm.displayName=om.displayName;const um=r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(rm,Object.assign({ref:t,className:Pl("flex cursor-default items-center justify-center py-1",n)},o),r.createElement(gs,{className:"h-4 w-4"}))});um.displayName=rm.displayName;const dm=r.forwardRef((e,t)=>{var{className:n,children:o,position:a="popper"}=e,i=Ll(e,["className","children","position"]);return r.createElement(Zh,null,r.createElement(Gh,Object.assign({ref:t,className:Pl("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:a},i),r.createElement(cm,null),r.createElement(Qh,{className:Pl("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},o),r.createElement(um,null)))});dm.displayName=Gh.displayName;r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(Jh,Object.assign({ref:t,className:Pl("py-1.5 pl-8 pr-2 text-sm font-semibold",n)},o))}).displayName=Jh.displayName;const fm=r.forwardRef((e,t)=>{var{className:n,children:o}=e,a=Ll(e,["className","children"]);return r.createElement(em,Object.assign({ref:t,className:Pl("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n)},a),r.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},r.createElement(nm,null,r.createElement(ms,{className:"h-4 w-4"}))),r.createElement(tm,null,o))});fm.displayName=em.displayName;r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(am,Object.assign({ref:t,className:Pl("-mx-1 my-1 h-px bg-muted",n)},o))}).displayName=am.displayName;var pm="Checkbox",[hm,mm]=Jl(pm),[gm,ym]=hm(pm);function vm(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]=ic({prop:o,defaultProp:i??!1,onChange:u,caller:pm}),[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:!km(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return n.jsx(gm,{scope:t,...E,children:Nm(p)?p(E):a})}var bm="CheckboxTrigger",wm=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}=ym(bm,e),y=Ql(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(dc.button,{type:"button",role:"checkbox","aria-checked":km(u)?"mixed":u,"aria-required":d,"data-state":Mm(u),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:y,onKeyDown:Ul(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Ul(o,e=>{p(e=>!!km(e)||!e),g&&m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});wm.displayName=bm;var xm=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(vm,{__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(wm,{...f,ref:t,__scopeCheckbox:o}),e&&n.jsx(Cm,{__scopeCheckbox:o})]})})});xm.displayName=pm;var Em="CheckboxIndicator",Sm=r.forwardRef((e,t)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=ym(Em,o);return n.jsx(Ac,{present:r||km(i.checked)||!0===i.checked,children:n.jsx(dc.span,{"data-state":Mm(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Sm.displayName=Em;var _m="CheckboxBubbleInput",Cm=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}=ym(_m,e),g=Ql(o,m),y=Vp(s),v=wp(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=km(s),n.call(e,!km(s)&&s),e.dispatchEvent(t)}},[h,y,s,i]);const b=r.useRef(!km(s)&&s);return n.jsx(dc.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 Nm(e){return"function"==typeof e}function km(e){return"indeterminate"===e}function Mm(e){return km(e)?"indeterminate":e?"checked":"unchecked"}Cm.displayName=_m;const Om=r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(xm,Object.assign({ref:t,className:Pl("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n)},o),r.createElement(Sm,{className:Pl("flex items-center justify-center text-current")},r.createElement(ms,{className:"h-4 w-4"})))});Om.displayName=xm.displayName;const Rm=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}),Pm=()=>{const t=e.useContext(Rm);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};function Am(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Dm(){return Im(/^iPad/)||Im(/^Mac/)&&navigator.maxTouchPoints>1}function Tm(){return Im(/^iPhone/)||Dm()}function Im(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const zm="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function Lm(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const $m="undefined"!=typeof document&&window.visualViewport;function jm(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Bm(e){for(jm(e)&&(e=e.parentElement);e&&!jm(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Hm=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Fm,Vm=0;function Wm(e={}){let{isDisabled:t}=e;zm(()=>{if(!t)return Vm++,1===Vm&&Tm()&&(Fm=function(){let e,t=0,n=n=>{e=Bm(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;Km(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;Km(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",$m&&($m.height<window.innerHeight?requestAnimationFrame(()=>{Xm(t)}):$m.addEventListener("resize",()=>Xm(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Lm(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=Lm(Ym(document,"touchstart",n,{passive:!1,capture:!0}),Ym(document,"touchmove",o,{passive:!1,capture:!0}),Ym(document,"touchend",r,{passive:!1,capture:!0}),Ym(document,"focus",a,!0),Ym(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Vm--,0===Vm&&(null==Fm||Fm())}},[t])}function Ym(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function Xm(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Bm(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 Km(e){return e instanceof HTMLInputElement&&!Hm.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function qm(...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 Um=new WeakMap;function Zm(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||Um.set(e,o)}const Gm=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Qm(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(", ")[Gm(t)?13:12]):(r=o.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[Gm(t)?5:4]):null)}function Jm(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const eg={DURATION:.5,EASE:[.32,.72,0,1]},tg=16,ng="vaul-dragging";function og(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 rg({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=og(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=og(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 ag=null;function ig({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:N=!0,onAnimationEnd:k,container:M,autoFocus:O=!1}){var R,P;const[A=!1,D]=rg({defaultProp:E,prop:t,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==k||k(e)},1e3*eg.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[T,I]=e.useState(!1),[z,L]=e.useState(!1),[$,j]=e.useState(!1),B=e.useRef(null),H=e.useRef(null),F=e.useRef(null),V=e.useRef(null),W=e.useRef(null),Y=e.useRef(!1),X=e.useRef(null),K=e.useRef(0),q=e.useRef(!1),U=e.useRef(!E),Z=e.useRef(0),G=e.useRef(null),Q=e.useRef((null==(R=G.current)?void 0:R.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&&(H.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]=rg({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)),Gm(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),Zm(r.current,{transition:`transform ${eg.DURATION}s cubic-bezier(${eg.EASE.join(",")})`,transform:Gm(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?Zm(a.current,{transition:`opacity ${eg.DURATION}s cubic-bezier(${eg.EASE.join(",")})`,opacity:"0"}):Zm(a.current,{transition:`opacity ${eg.DURATION}s cubic-bezier(${eg.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&&Zm(a.current,{transition:`opacity ${eg.DURATION}s cubic-bezier(${eg.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=Gm(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]||Zm(r.current,{transform:Gm(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:B,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Wm({isDisabled:!A||z||!y||$||!T||!N||!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(Am()&&null===ag&&t&&!i){ag={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(Am()&&null!==ag&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,ag),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),ag=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:A,modal:y,nested:null!=b&&b,hasBeenOpened:T,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?Qm(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(H.current&&i.getTime()-H.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(r&&r.length>0)return!1;if(W.current&&i.getTime()-W.current.getTime()<u&&0===a)return W.current=i,!1;if(t)return W.current=i,!1;for(;o;){if(o.scrollHeight>o.clientHeight){if(0!==o.scrollTop)return W.current=new Date,!1;if("dialog"===o.getAttribute("role"))return!0}o=o.parentNode}return!0}function pe(e){!function(){if(!z||!G.current)return;G.current.classList.remove(ng),Y.current=!1,L(!1),V.current=new Date}(),null==v||v(),e||D(!1),setTimeout(()=>{i&&re(i[0])},1e3*eg.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=Qm(G.current,x);Zm(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${eg.DURATION}s cubic-bezier(${eg.EASE.join(",")})`}),Zm(B.current,{transition:`opacity ${eg.DURATION}s cubic-bezier(${eg.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&A&&Zm(e,{borderRadius:"8px",overflow:"hidden",...Gm(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:`${eg.DURATION}s`,transitionTimingFunction:`cubic-bezier(${eg.EASE.join(",")})`},!0)}return e.useEffect(()=>{window.requestAnimationFrame(()=>{U.current=!0})},[]),e.useEffect(()=>{var e;function t(){if(!G.current||!N)return;if(Km(document.activeElement)||q.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&&(q.current=!q.current),i&&i.length>0&&ie&&oe){o+=ie[oe]||0}if(Z.current=o,r>t||q.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&&!q.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(()=>(A&&(Zm(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Um.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(cd,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?I(!0):pe(!0),D(e))},open:A},e.createElement(Rm.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:re,drawerRef:G,overlayRef:B,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,L(!0),F.current=new Date,Tm()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=Gm(x)?e.pageY:e.pageX))},onRelease:function(e){if(!z||!G.current)return;G.current.classList.remove(ng),Y.current=!1,L(!1),V.current=new Date;const t=Qm(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===F.current)return;const n=V.current.getTime()-F.current.getTime(),o=K.current-(Gm(x)?e.pageY:e.pageX),r=Math.abs(o)/n;if(r>.05&&(j(!0),setTimeout(()=>{j(!1)},200)),i){return ae({draggedDistance:o*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:r,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?o>0:o<0)return he(),void(null==a||a(e,!0));if(r>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&z){const n="bottom"===x||"right"===x?1:-1,o=(K.current-(Gm(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(ng),Y.current=!0,Zm(G.current,{transition:"none"}),Zm(B.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 Zm(G.current,{transform:Gm(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),Zm(B.current,{opacity:`${m}`,transition:"none"},!0)),u&&B.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);Zm(u,{borderRadius:`${t}px`,transform:Gm(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;Zm(G.current,{transform:Gm(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:U,handleOnly:f,isOpen:A,isDragging:z,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-tg)/window.innerWidth,o=n+t*(1-n),r=t*tg-16;Zm(G.current,{transform:Gm(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-tg)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Zm(G.current,{transition:`transform ${eg.DURATION}s cubic-bezier(${eg.EASE.join(",")})`,transform:Gm(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=Qm(G.current,x);Zm(G.current,{transition:"none",transform:Gm(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=Gm(x)?window.innerHeight:window.innerWidth,o=t?(n-tg)/n:1,r=t?-16:0;t&&Zm(G.current,{transition:`transform ${eg.DURATION}s cubic-bezier(${eg.EASE.join(",")})`,transform:Gm(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`})},keyboardIsOpen:q,modal:y,snapPointsOffset:ie,activeSnapPointIndex:oe,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:O}},o))}const sg=e.forwardRef(function({...t},n){const{overlayRef:o,snapPoints:r,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Pm(),u=qm(n,o),d=r&&r.length>0;if(!l)return null;const f=e.useCallback(e=>a(e),[a]);return e.createElement(fd,{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})});sg.displayName="Drawer.Overlay";const lg=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}=Pm(),[x,E]=e.useState(!1),S=qm(a,i),_=e.useRef(null),C=e.useRef(null),N=e.useRef(!1),k=g&&g.length>0;!function(){const{direction:t,isOpen:n,shouldScaleBackground:o,setBackgroundColorOnScale:r,noBodyStyles:a}=Pm(),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&&Jm(document.body,{background:"black"}),Jm(e,{transformOrigin:Gm(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${eg.DURATION}s`,transitionTimingFunction:`cubic-bezier(${eg.EASE.join(",")})`});const n=Jm(e,{borderRadius:"8px",overflow:"hidden",...Gm(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*eg.DURATION)}}},[n,o,s])}();function M(e){_.current=null,N.current=!1,l(e)}return e.useEffect(()=>{k&&window.requestAnimationFrame(()=>{E(!0)})},[]),e.createElement(pd,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":h&&k?"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(N.current)return!0;const o=Math.abs(e.y),r=Math.abs(e.x),a=r>o,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&r>=0&&r<=n)return a}else if(!(e.y*i<0)&&o>=0&&o<=n)return!a;return N.current=!0,!0})({x:n,y:t},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,N.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)}})});lg.displayName="Drawer.Content";const cg=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}=Pm(),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))});cg.displayName="Drawer.Handle";const ug={Root:ig,NestedRoot:function({onDrag:t,onOpenChange:n,open:o,...r}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Pm();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return e.createElement(ig,{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:lg,Overlay:sg,Trigger:ud,Portal:function(t){const n=Pm(),{container:o=n.container,...r}=t;return e.createElement(dd,{container:o,...r})},Handle:cg,Close:gd,Title:hd,Description:md},dg=e=>{var{shouldScaleBackground:t=!0}=e,n=Ll(e,["shouldScaleBackground"]);return r.createElement(ug.Root,Object.assign({shouldScaleBackground:t},n))};dg.displayName="Drawer";const fg=ug.Portal,pg=r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(ug.Overlay,Object.assign({ref:t,className:Pl("fixed inset-0 z-50 bg-black/80",n)},o))});pg.displayName=ug.Overlay.displayName;const hg=r.forwardRef((e,t)=>{var{className:n,children:o}=e,a=Ll(e,["className","children"]);return r.createElement(fg,null,r.createElement(pg,null),r.createElement(ug.Content,Object.assign({ref:t,className:Pl("fixed inset-x-0 top-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",n)},a),r.createElement("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),o))});hg.displayName="DrawerContent";r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(ug.Title,Object.assign({ref:t,className:Pl("text-lg font-semibold leading-none tracking-tight",n)},o))}).displayName=ug.Title.displayName;r.forwardRef((e,t)=>{var{className:n}=e,o=Ll(e,["className"]);return r.createElement(ug.Description,Object.assign({ref:t,className:Pl("text-sm text-muted-foreground",n)},o))}).displayName=ug.Description.displayName,exports.AgenticFlowVisualizer=Cd,exports.Badge=Fl,exports.Checkbox=Om,exports.Drawer=dg,exports.Edge=Es,exports.FileSelector=({files:t,currentFile:n,onFileSelect:o,onRefresh:r,loading:a=!1,disabled:i=!1})=>e.createElement("div",{className:"flex items-center gap-2"},0!==t.length||a?e.createElement(im,{value:n||"",onValueChange:o,disabled:i||a},e.createElement(lm,{className:Pl("w-fit shadcn-select transition-all duration-200",(i||a)&&"opacity-60 cursor-not-allowed")},e.createElement("div",{className:"flex items-center justify-between w-full gap-3 p-2"},e.createElement(sm,{placeholder:a?"Loading sessions...":0===t.length?"No sessions found":"Select an Agent Session..."}))),e.createElement(dm,null,0!==t.length||a?t.map(t=>e.createElement(fm,{key:t.name,value:t.name},t.name)):e.createElement("div",{className:"px-2 py-3 text-center text-sm text-gray-500"},"No agent sessions available"))):e.createElement("div",{className:"text-sm text-gray-500 px-3 py-2"},"No agent sessions available"),t.length>0&&e.createElement("button",{onClick:e=>{e.stopPropagation(),r()},disabled:a||i,title:a?"Loading...":"Refresh files",className:Pl("file-selector-refresh-btn transition-all duration-200",(a||i)&&"opacity-50 cursor-not-allowed")},a?e.createElement(bs,{className:"h-4 w-4 animate-spin text-gray-400"}):e.createElement(xs,{className:"h-4 w-4"}))),exports.JsonTreeViewer=Yl,exports.Node=Kl,exports.Select=im,exports.Sheet=yd,exports.Timeline=ql,exports.Visualizer=t=>e.createElement(Vi,null,e.createElement(Cd,Object.assign({},t))),exports.calculateAutoLayout=Sd,exports.cn=Pl,exports.formatCurrency=Tl,exports.formatLatency=Il,exports.toTitleCase=Al,exports.truncateText=Dl;
|
|
55
|
-
|
|
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"}]]),Es=({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[h,m,g]=e.useMemo(()=>mr({sourceX:n,sourceY:o,targetX:r,targetY:a}),[n,o,r,a]),y={...l,stroke:(()=>{const e=d?.details?.state;switch(e){case"Open":case"Completed":return"#000000";case"Error":return"#ef4444";default:return l.stroke||"#000000"}})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(Ko,{path:h,style:y}))};function Ss(){return Ss=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},Ss.apply(null,arguments)}var _s=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}(),ks="-ms-",Cs="-moz-",Ns="-webkit-",Ms="comm",Os="rule",Ps="decl",Rs="@keyframes",As=Math.abs,Ds=String.fromCharCode,Ts=Object.assign;function Is(e){return e.trim()}function zs(e,t,n){return e.replace(t,n)}function Ls(e,t){return e.indexOf(t)}function $s(e,t){return 0|e.charCodeAt(t)}function Bs(e,t,n){return e.slice(t,n)}function js(e){return e.length}function Hs(e){return e.length}function Fs(e,t){return t.push(e),e}var Vs=1,Ws=1,Ys=0,Xs=0,Ks=0,qs="";function Us(e,t,n,o,r,a,i){return{value:e,root:t,parent:n,type:o,props:r,children:a,line:Vs,column:Ws,length:i,return:""}}function Zs(e,t){return Ts(Us("",null,null,"",null,null,0),e,{length:-e.length},t)}function Gs(){return Ks=Xs>0?$s(qs,--Xs):0,Ws--,10===Ks&&(Ws=1,Vs--),Ks}function Qs(){return Ks=Xs<Ys?$s(qs,Xs++):0,Ws++,10===Ks&&(Ws=1,Vs++),Ks}function Js(){return $s(qs,Xs)}function el(){return Xs}function tl(e,t){return Bs(qs,e,t)}function nl(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 ol(e){return Vs=Ws=1,Ys=js(qs=e),Xs=0,[]}function rl(e){return qs="",e}function al(e){return Is(tl(Xs-1,ll(91===e?e+2:40===e?e+1:e)))}function il(e){for(;(Ks=Js())&&Ks<33;)Qs();return nl(e)>2||nl(Ks)>3?"":" "}function sl(e,t){for(;--t&&Qs()&&!(Ks<48||Ks>102||Ks>57&&Ks<65||Ks>70&&Ks<97););return tl(e,el()+(t<6&&32==Js()&&32==Qs()))}function ll(e){for(;Qs();)switch(Ks){case e:return Xs;case 34:case 39:34!==e&&39!==e&&ll(Ks);break;case 40:41===e&&ll(e);break;case 92:Qs()}return Xs}function cl(e,t){for(;Qs()&&e+Ks!==57&&(e+Ks!==84||47!==Js()););return"/*"+tl(t,Xs-1)+"*"+Ds(47===e?e:Qs())}function ul(e){for(;!nl(Js());)Qs();return tl(e,Xs)}function dl(e){return rl(fl("",null,null,null,[""],e=ol(e),0,[0],e))}function fl(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=Qs()){case 40:if(108!=h&&58==$s(S,d-1)){-1!=Ls(S+=zs(al(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=al(v);break;case 9:case 10:case 13:case 32:S+=il(h);break;case 92:S+=sl(el()-1,7);continue;case 47:switch(Js()){case 42:case 47:Fs(hl(cl(Qs(),el()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=js(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=zs(S,/\f/g,"")),p>0&&js(S)-d&&Fs(p>32?ml(S+";",o,n,d-1):ml(zs(S," ","")+";",o,n,d-2),l);break;case 59:S+=";";default:if(Fs(E=pl(S,t,n,c,u,r,s,b,w=[],x=[],d),a),123===v)if(0===u)fl(S,t,E,E,w,a,d,s,x);else switch(99===f&&110===$s(S,3)?100:f){case 100:case 108:case 109:case 115:fl(e,E,E,o&&Fs(pl(e,E,E,0,0,r,s,b,r,w=[],d),x),r,x,d,s,o?w:x);break;default:fl(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=i;break;case 58:d=1+js(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==Gs())continue;switch(S+=Ds(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(js(S)-1)*y,y=1;break;case 64:45===Js()&&(S+=al(Qs())),f=Js(),u=d=js(b=S+=ul(el())),v++;break;case 45:45===h&&2==js(S)&&(m=0)}}return a}function pl(e,t,n,o,r,a,i,s,l,c,u){for(var d=r-1,f=0===r?a:[""],p=Hs(f),h=0,m=0,g=0;h<o;++h)for(var y=0,v=Bs(e,d+1,d=As(m=i[h])),b=e;y<p;++y)(b=Is(m>0?f[y]+" "+v:zs(v,/&\f/g,f[y])))&&(l[g++]=b);return Us(e,t,n,0===r?Os:s,l,c,u)}function hl(e,t,n){return Us(e,t,n,Ms,Ds(Ks),Bs(e,2,-2),0)}function ml(e,t,n,o){return Us(e,t,n,Ps,Bs(e,0,o),Bs(e,o+1,-1),o)}function gl(e,t){for(var n="",o=Hs(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function yl(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ps:return e.return=e.return||e.value;case Ms:return"";case Rs:return e.return=e.value+"{"+gl(e.children,o)+"}";case Os:e.value=e.props.join(",")}return js(n=gl(e.children,o))?e.return=e.value+"{"+n+"}":""}function vl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var bl=function(e,t,n){for(var o=0,r=0;o=r,r=Js(),38===o&&12===r&&(t[n]=1),!nl(r);)Qs();return tl(e,Xs)},wl=function(e,t){return rl(function(e,t){var n=-1,o=44;do{switch(nl(o)){case 0:38===o&&12===Js()&&(t[n]=1),e[n]+=bl(Xs-1,t,n);break;case 2:e[n]+=al(o);break;case 4:if(44===o){e[++n]=58===Js()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Ds(o)}}while(o=Qs());return e}(ol(e),t))},xl=new WeakMap,El=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)||xl.get(n))&&!o){xl.set(e,!0);for(var r=[],a=wl(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]}}},Sl=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function _l(e,t){switch(function(e,t){return 45^$s(e,0)?(((t<<2^$s(e,0))<<2^$s(e,1))<<2^$s(e,2))<<2^$s(e,3):0}(e,t)){case 5103:return Ns+"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 Ns+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ns+e+Cs+e+ks+e+e;case 6828:case 4268:return Ns+e+ks+e+e;case 6165:return Ns+e+ks+"flex-"+e+e;case 5187:return Ns+e+zs(e,/(\w+).+(:[^]+)/,Ns+"box-$1$2"+ks+"flex-$1$2")+e;case 5443:return Ns+e+ks+"flex-item-"+zs(e,/flex-|-self/,"")+e;case 4675:return Ns+e+ks+"flex-line-pack"+zs(e,/align-content|flex-|-self/,"")+e;case 5548:return Ns+e+ks+zs(e,"shrink","negative")+e;case 5292:return Ns+e+ks+zs(e,"basis","preferred-size")+e;case 6060:return Ns+"box-"+zs(e,"-grow","")+Ns+e+ks+zs(e,"grow","positive")+e;case 4554:return Ns+zs(e,/([^-])(transform)/g,"$1"+Ns+"$2")+e;case 6187:return zs(zs(zs(e,/(zoom-|grab)/,Ns+"$1"),/(image-set)/,Ns+"$1"),e,"")+e;case 5495:case 3959:return zs(e,/(image-set\([^]*)/,Ns+"$1$`$1");case 4968:return zs(zs(e,/(.+:)(flex-)?(.*)/,Ns+"box-pack:$3"+ks+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ns+e+e;case 4095:case 3583:case 4068:case 2532:return zs(e,/(.+)-inline(.+)/,Ns+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(js(e)-1-t>6)switch($s(e,t+1)){case 109:if(45!==$s(e,t+4))break;case 102:return zs(e,/(.+:)(.+)-([^]+)/,"$1"+Ns+"$2-$3$1"+Cs+(108==$s(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ls(e,"stretch")?_l(zs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==$s(e,t+1))break;case 6444:switch($s(e,js(e)-3-(~Ls(e,"!important")&&10))){case 107:return zs(e,":",":"+Ns)+e;case 101:return zs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ns+(45===$s(e,14)?"inline-":"")+"box$3$1"+Ns+"$2$3$1"+ks+"$2box$3")+e}break;case 5936:switch($s(e,t+11)){case 114:return Ns+e+ks+zs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ns+e+ks+zs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ns+e+ks+zs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ns+e+ks+e+e}return e}var kl=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Ps:e.return=_l(e.value,e.length);break;case Rs:return gl([Zs(e,{value:zs(e.value,"@","@"+Ns)})],o);case Os: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 gl([Zs(e,{props:[zs(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return gl([Zs(e,{props:[zs(t,/:(plac\w+)/,":"+Ns+"input-$1")]}),Zs(e,{props:[zs(t,/:(plac\w+)/,":-moz-$1")]}),Zs(e,{props:[zs(t,/:(plac\w+)/,ks+"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||kl,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=[yl,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Hs(e);return function(n,o,r,a){for(var i="",s=0;s<t;s++)i+=e[s](n,o,r,a)||"";return i}}([El,Sl].concat(a,u));r=function(e,t,n,o){l=n,gl(dl(e?e+"{"+t.styles+"}":t.styles),d),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new _s({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return f.sheet.hydrate(s),f};var 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},Ol=/[A-Z]|^ms/g,Pl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Rl=function(e){return 45===e.charCodeAt(1)},Al=function(e){return null!=e&&"boolean"!=typeof e},Dl=vl(function(e){return Rl(e)?e:e.replace(Ol,"-$&").toLowerCase()}),Tl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Pl,function(e,t,n){return zl={name:t,styles:n,next:zl},t})}return 1===Ml[e]||Rl(e)||"number"!=typeof t||0===t?t:t+"px"};function Il(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 zl={name:r.name,styles:r.styles,next:zl},r.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 o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=Il(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]+"}":Al(s)&&(o+=Dl(a)+":"+Tl(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Il(e,t,i);switch(a){case"animation":case"animationName":o+=Dl(a)+":"+l+";";break;default:o+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Al(i[c])&&(o+=Dl(a)+":"+Tl(a,i[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=zl,l=n(e);return zl=s,Il(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var zl,Ll=/label:\s*([^\s;{]+)\s*(;|$)/g;var $l=!!r.useInsertionEffect&&r.useInsertionEffect||function(e){return e()},Bl=r.createContext("undefined"!=typeof HTMLElement?Cl({key:"css"}):null);Bl.Provider;var jl=r.createContext({}),Hl=/^((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)-.*))$/,Fl=vl(function(e){return Hl.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Vl=function(e){return"theme"!==e},Wl=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Fl:Vl},Yl=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},Xl=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Nl(t,n,o),$l(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},Kl=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=Yl(n,o,s),u=c||Wl(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(jl)}"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="";zl=void 0;var a=e[0];null==a||void 0===a.raw?(o=!1,r+=Il(n,t,a)):r+=a[0];for(var i=1;i<e.length;i++)r+=Il(n,t,e[i]),o&&(r+=a[i]);Ll.lastIndex=0;for(var s,l="";null!==(s=Ll.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:zl}}(p.concat(g),t.registered,y);m+=t.key+"-"+b.name,void 0!==i&&(m+=" "+i);var w=d&&void 0===c?Wl(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(Xl,{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,Ss({},o,n,{shouldForwardProp:Yl(v,n,!0)})).apply(void 0,p)},v}}.bind(null);function ql(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=ql(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ul(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ql(e))&&(o&&(o+=" "),o+=t);return o}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Kl[e]=Kl(e)});const Zl=e=>{const t=ec(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Gl(n,t)||Jl(e)},getConflictingClassGroupIds:(e,t)=>{const r=n[e]||[];return t&&o[e]?[...r,...o[e]]:r}}},Gl=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Gl(e.slice(1),o):void 0;if(r)return r;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},Ql=/^\[(.+)\]$/,Jl=e=>{if(Ql.test(e)){const t=Ql.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ec=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const e in n)tc(n[e],o,e,t);return o},tc=(e,t,n,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:nc(t,e)).classGroupId=n)}if("function"==typeof e)return oc(e)?void tc(e(o),t,n,o):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,r])=>{tc(r,nc(t,e),n,o)})})},nc=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},oc=e=>e.isThemeGetter,rc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(r,a)=>{n.set(r,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(r(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):r(e,t)}}},ac=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=e=>{const t=[];let n,o=0,r=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===o&&0===r){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?o++:"]"===s?o--:"("===s?r++:")"===s&&r--}const i=0===t.length?e:e.substring(a),s=ic(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=o;o=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=o;o=t=>n({className:t,parseClassName:e})}return o},ic=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,sc=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...o.sort(),e),o=[]):o.push(e)}),n.push(...o.sort()),n}},lc=/\s+/;function cc(){let e,t,n=0,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=uc(e))&&(o&&(o+=" "),o+=t);return o}const uc=e=>{if("string"==typeof e)return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=uc(e[o]))&&(n&&(n+=" "),n+=t);return n};function dc(e,...t){let n,o,r,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:rc(e.cacheSize),parseClassName:ac(e),sortModifiers:sc(e),...Zl(e)}))(l),o=n.cache.get,r=n.cache.set,a=i,i(s)};function i(e){const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a}=t,i=[],s=e.trim().split(lc);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=o(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=o(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=a(u).join(":"),y=d?g+"!":g,v=y+m;if(i.includes(v))continue;i.push(v);const b=r(m,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return r(e,a),a}return function(){return a(cc.apply(null,arguments))}}const fc=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},pc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mc=/^\d+\/\d+$/,gc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xc=e=>mc.test(e),Ec=e=>!!e&&!Number.isNaN(Number(e)),Sc=e=>!!e&&Number.isInteger(Number(e)),_c=e=>e.endsWith("%")&&Ec(e.slice(0,-1)),kc=e=>gc.test(e),Cc=()=>!0,Nc=e=>yc.test(e)&&!vc.test(e),Mc=()=>!1,Oc=e=>bc.test(e),Pc=e=>wc.test(e),Rc=e=>!Dc(e)&&!Bc(e),Ac=e=>Xc(e,Zc,Mc),Dc=e=>pc.test(e),Tc=e=>Xc(e,Gc,Nc),Ic=e=>Xc(e,Qc,Ec),zc=e=>Xc(e,qc,Mc),Lc=e=>Xc(e,Uc,Pc),$c=e=>Xc(e,eu,Oc),Bc=e=>hc.test(e),jc=e=>Kc(e,Gc),Hc=e=>Kc(e,Jc),Fc=e=>Kc(e,qc),Vc=e=>Kc(e,Zc),Wc=e=>Kc(e,Uc),Yc=e=>Kc(e,eu,!0),Xc=(e,t,n)=>{const o=pc.exec(e);return!!o&&(o[1]?t(o[1]):n(o[2]))},Kc=(e,t,n=!1)=>{const o=hc.exec(e);return!!o&&(o[1]?t(o[1]):n)},qc=e=>"position"===e||"percentage"===e,Uc=e=>"image"===e||"url"===e,Zc=e=>"length"===e||"size"===e||"bg-size"===e,Gc=e=>"length"===e,Qc=e=>"number"===e,Jc=e=>"family-name"===e,eu=e=>"shadow"===e,tu=dc(()=>{const e=fc("color"),t=fc("font"),n=fc("text"),o=fc("font-weight"),r=fc("tracking"),a=fc("leading"),i=fc("breakpoint"),s=fc("container"),l=fc("spacing"),c=fc("radius"),u=fc("shadow"),d=fc("inset-shadow"),f=fc("text-shadow"),p=fc("drop-shadow"),h=fc("blur"),m=fc("perspective"),g=fc("aspect"),y=fc("ease"),v=fc("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Bc,Dc],w=()=>[Bc,Dc,l],x=()=>[xc,"full","auto",...w()],E=()=>[Sc,"none","subgrid",Bc,Dc],S=()=>["auto",{span:["full",Sc,Bc,Dc]},Sc,Bc,Dc],_=()=>[Sc,"auto",Bc,Dc],k=()=>["auto","min","max","fr",Bc,Dc],C=()=>["auto",...w()],N=()=>[xc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,Bc,Dc],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Fc,zc,{position:[Bc,Dc]}],P=()=>["auto","cover","contain",Vc,Ac,{size:[Bc,Dc]}],R=()=>[_c,jc,Tc],A=()=>["","none","full",c,Bc,Dc],D=()=>["",Ec,jc,Tc],T=()=>[Ec,_c,Fc,zc],I=()=>["","none",h,Bc,Dc],z=()=>["none",Ec,Bc,Dc],L=()=>["none",Ec,Bc,Dc],$=()=>[Ec,Bc,Dc],B=()=>[xc,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[kc],breakpoint:[kc],color:[Cc],container:[kc],"drop-shadow":[kc],ease:["in","out","in-out"],font:[Rc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[kc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[kc],shadow:[kc],spacing:["px",Ec],text:[kc],"text-shadow":[kc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xc,Dc,Bc,g]}],container:["container"],columns:[{columns:[Ec,Dc,Bc,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Sc,"auto",Bc,Dc]}],basis:[{basis:[xc,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ec,xc,"auto","initial","none",Dc]}],grow:[{grow:["",Ec,Bc,Dc]}],shrink:[{shrink:["",Ec,Bc,Dc]}],order:[{order:[Sc,"first","last","none",Bc,Dc]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",n,jc,Tc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Bc,Ic]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_c,Dc]}],"font-family":[{font:[Hc,Dc,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Bc,Dc]}],"line-clamp":[{"line-clamp":[Ec,"none",Bc,Ic]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Bc,Dc]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Bc,Dc]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ec,"from-font","auto",Bc,Tc]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ec,"auto",Bc,Dc]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Bc,Dc]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Bc,Dc]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sc,Bc,Dc],radial:["",Bc,Dc],conic:[Sc,Bc,Dc]},Wc,Lc]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ec,Bc,Dc]}],"outline-w":[{outline:["",Ec,jc,Tc]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,Yc,$c]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,Yc,$c]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ec,Tc]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,Yc,$c]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ec,Bc,Dc]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ec]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Bc,Dc]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ec]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Bc,Dc]}],filter:[{filter:["","none",Bc,Dc]}],blur:[{blur:I()}],brightness:[{brightness:[Ec,Bc,Dc]}],contrast:[{contrast:[Ec,Bc,Dc]}],"drop-shadow":[{"drop-shadow":["","none",p,Yc,$c]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ec,Bc,Dc]}],"hue-rotate":[{"hue-rotate":[Ec,Bc,Dc]}],invert:[{invert:["",Ec,Bc,Dc]}],saturate:[{saturate:[Ec,Bc,Dc]}],sepia:[{sepia:["",Ec,Bc,Dc]}],"backdrop-filter":[{"backdrop-filter":["","none",Bc,Dc]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Ec,Bc,Dc]}],"backdrop-contrast":[{"backdrop-contrast":[Ec,Bc,Dc]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ec,Bc,Dc]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ec,Bc,Dc]}],"backdrop-invert":[{"backdrop-invert":["",Ec,Bc,Dc]}],"backdrop-opacity":[{"backdrop-opacity":[Ec,Bc,Dc]}],"backdrop-saturate":[{"backdrop-saturate":[Ec,Bc,Dc]}],"backdrop-sepia":[{"backdrop-sepia":["",Ec,Bc,Dc]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Bc,Dc]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ec,"initial",Bc,Dc]}],ease:[{ease:["linear","initial",y,Bc,Dc]}],delay:[{delay:[Ec,Bc,Dc]}],animate:[{animate:["none",v,Bc,Dc]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Bc,Dc]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[Bc,Dc,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Bc,Dc]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Bc,Dc]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ec,jc,Tc,Ic]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function nu(...e){return tu(Ul(e))}function ou(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function ru(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function au(e){if(null==e)return"$0.00";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}function iu(e){if(null==e)return"0ms";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0ms":`${Math.round(t)}ms`}const su=Kl.div`
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
border-radius: 9999px;
|
|
19
|
+
border: 1px solid transparent;
|
|
20
|
+
padding: 0.125rem 0.625rem;
|
|
21
|
+
font-size: 0.75rem;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
transition: colors 0.2s ease-in-out;
|
|
24
|
+
outline: none;
|
|
25
|
+
|
|
26
|
+
&:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${({variant:e})=>{switch(e){case"default":default:return"\n background-color: #6366f1;\n color: white;\n &:hover {\n background-color: #5855eb;\n }\n ";case"secondary":return"\n background-color: #f3f4f6;\n color: #374151;\n &:hover {\n background-color: #e5e7eb;\n }\n ";case"destructive":return"\n background-color: #ef4444;\n color: white;\n &:hover {\n background-color: #dc2626;\n }\n ";case"outline":return"\n background-color: transparent;\n color: #374151;\n border-color: #d1d5db;\n ";case"cost":case"gray":return"\n background-color: #f3f4f6;\n color: #1f2937;\n &:hover {\n background-color: #e5e7eb;\n }\n ";case"latency":return"\n background-color: #dbeafe;\n color: #1e40af;\n &:hover {\n background-color: #bfdbfe;\n }\n ";case"latencyLow":return"\n background-color: #dcfce7;\n color: #166534;\n &:hover {\n background-color: #bbf7d0;\n }\n ";case"latencyMedium":return"\n background-color: #fed7aa;\n color: #c2410c;\n &:hover {\n background-color: #fdba74;\n }\n ";case"latencyHigh":return"\n background-color: #fecaca;\n color: #dc2626;\n &:hover {\n background-color: #fca5a5;\n }\n "}}}
|
|
32
|
+
`;function lu({className:e,variant:t="default",...n}){return r.createElement(su,{variant:t,className:e,...n})}const cu=(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)}),uu=({data:t,label:n,depth:o,maxDepth:r,path:a,priorityKeys:i})=>{const[s,l]=e.useState(!1),c=null!==t&&"object"==typeof t&&!Array.isArray(t),u=Array.isArray(t),d=(c||u)&&o<r,f=d&&Object.keys(t).length>0;return e.createElement("div",{className:"select-none"},e.createElement("div",{className:"flex items-center gap-1 py-1 px-2 hover:bg-gray-50 rounded cursor-pointer transition-colors duration-150 "+(d?"hover:bg-gray-50":""),onClick:()=>{d&&l(!s)},style:{paddingLeft:12*o+8+"px"}},d&&f?s?e.createElement(gs,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):e.createElement(ys,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):e.createElement("div",{className:"w-3 h-3 flex-shrink-0"}),e.createElement("span",{className:"font-medium text-gray-800 text-xs"},n,":"),!d&&e.createElement("span",{className:"text-xs "+(p=t,null==p?"text-gray-500":"string"==typeof p?"text-green-600":"number"==typeof p?"text-blue-600":"boolean"==typeof p?"text-purple-600":"text-gray-700")},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(t)),d&&!f&&e.createElement("span",{className:"text-xs text-gray-500"},u?"[]":"{}"),d&&f&&!s&&e.createElement("span",{className:"text-xs text-gray-500"},u?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),s&&f&&e.createElement("div",{className:"border-l border-gray-200 ml-3"},cu(t,i).map(([t,n])=>e.createElement(uu,{key:`${a}.${t}`,data:n,label:t,depth:o+1,maxDepth:r,path:`${a}.${t}`,priorityKeys:i}))));var p},du=({data:t,maxDepth:n=4,initialExpanded:o=!1,className:r="",priorityKeys:a=["input","output"]})=>null==t?e.createElement("div",{className:`text-xs text-gray-500 italic ${r}`},"No data available"):"object"!=typeof t?e.createElement("div",{className:`text-xs ${r}`},e.createElement("span",{className:"font-medium text-gray-800"},"Value:")," ",e.createElement("span",{className:"text-gray-600"},String(t))):0===Object.keys(t).length?e.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 p-4 text-center ${r}`},e.createElement("div",{className:"text-xs text-gray-500 italic"},Array.isArray(t)?"Empty array":"Empty object")):e.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 overflow-hidden ${r}`},e.createElement("div",{className:"w-full max-h-64 overflow-y-auto"},cu(t,a).map(([t,o])=>e.createElement(uu,{key:t,data:o,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a})))),fu=({className:t="w-6 h-6"})=>e.createElement("svg",{className:t,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"})),pu=({className:t="w-6 h-6"})=>e.createElement("svg",{className:t,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"})),hu=({className:t="w-6 h-6"})=>e.createElement("svg",{className:t,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"})),mu=({label:t,content:n,isExpanded:o,onToggle:r})=>{const a=o?n:n?.slice(0,100)+(n?.length>100?"...":"");return e.createElement(_u,null,e.createElement(ku,{onClick:r},e.createElement(Cu,null,t),e.createElement(Mu,null,o?e.createElement(gs,{style:{width:"12px",height:"12px",color:"#6b7280"}}):e.createElement(ys,{style:{width:"12px",height:"12px",color:"#6b7280"}}))),e.createElement(Nu,{value:a||"",readOnly:!0,rows:o?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2}))},gu=({data:t,id:n})=>{ka();const[o,r]=e.useState(!1),[a,i]=e.useState(!1),s=t.edges?.some(e=>e.source===n)||!1,l=t.edges?.some(e=>e.target===n)||!1,c=t.nodeType||"Agent",u=t.label||ou(c)||"Agent",d=t.details?.internals?.llm_details?.[0]?.model_provider,f=((t,n)=>{if("tool"===t)return"🔧";if("coordinator"===t)return"🎯";if("agent"===t){if("OpenAI"===n)return e.createElement(fu,null);if("Anthropic"===n)return e.createElement(pu,null);if("Google"===n||"Vertex_AI"===n)return e.createElement(hu,null)}return"🤖"})(c.toLowerCase(),d),p=t.details?.internals?.llm_details?.[0]?.model_name||"Unknown",h=au(t.details?.internals?.llm_details?.[0]?.total_cost),m=t.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",g=t.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"",y=t.details?.internals?.latency?.total_time;return e.createElement(yu,{onClick:()=>{console.log("Node clicked:",{label:t.label,nodeType:t.nodeType,details:t.details})}},l&&e.createElement(Hr,{type:"target",position:nr.Top,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:"white",cursor:"default"},isConnectable:!1}),e.createElement(vu,null,e.createElement(bu,null,e.createElement(wu,null,f),e.createElement(xu,null,u)),"Agent"===c&&e.createElement(Eu,null,e.createElement(lu,{variant:"gray"},p),e.createElement(lu,{variant:"cost"},h)),"Tool"===c&&y&&e.createElement(Eu,null,e.createElement(lu,{variant:"latency"},iu(y))),"Coordinator"===c&&e.createElement(Eu,null,e.createElement(lu,{variant:"gray"},"Coordinator"))),e.createElement(Su,null,"Agent"===c?e.createElement(e.Fragment,null,e.createElement(mu,{label:"System Message",content:m,isExpanded:o,onToggle:()=>r(!o)}),e.createElement(mu,{label:"User Message",content:g,isExpanded:a,onToggle:()=>i(!a)})):"Tool"===c?e.createElement(du,{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"===c?e.createElement(du,{data:t.details?.internals||{}}):null),s&&e.createElement(Hr,{type:"source",position:nr.Bottom,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:"white",cursor:"default"},isConnectable:!1}))},yu=Kl.div`
|
|
33
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
34
|
+
border-radius: 0.5rem;
|
|
35
|
+
background-color: white;
|
|
36
|
+
border: 2px solid #e5e7eb;
|
|
37
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
38
|
+
min-width: 300px;
|
|
39
|
+
max-width: 500px;
|
|
40
|
+
transition: all 0.2s ease-in-out;
|
|
41
|
+
position: relative;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
border-color: #6366f1;
|
|
46
|
+
box-shadow:
|
|
47
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
48
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
49
|
+
}
|
|
50
|
+
`,vu=Kl.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: space-between;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 0.5rem;
|
|
55
|
+
padding: 0.75rem;
|
|
56
|
+
border-bottom: 1px solid #e5e7eb;
|
|
57
|
+
`,bu=Kl.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 0.5rem;
|
|
61
|
+
`,wu=Kl.div`
|
|
62
|
+
font-size: 1.25rem;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
`,xu=Kl.div`
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
color: #1f2937;
|
|
69
|
+
font-size: 0.875rem;
|
|
70
|
+
word-break: break-words;
|
|
71
|
+
`,Eu=Kl.div`
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
justify-content: flex-end;
|
|
75
|
+
align-items: center;
|
|
76
|
+
`,Su=Kl.div`
|
|
77
|
+
padding: 0.75rem;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
align-items: flex-start;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
gap: 0.5rem;
|
|
83
|
+
`,_u=Kl.div`
|
|
84
|
+
width: 100%;
|
|
85
|
+
`,ku=Kl.div`
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: space-between;
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding: 0.25rem 0;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
user-select: none;
|
|
92
|
+
border-radius: 0.25rem;
|
|
93
|
+
padding-left: 0.25rem;
|
|
94
|
+
padding-right: 0.25rem;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
background-color: #f9fafb;
|
|
98
|
+
}
|
|
99
|
+
`,Cu=Kl.span`
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
color: #374151;
|
|
102
|
+
font-size: 0.75rem;
|
|
103
|
+
`,Nu=Kl.textarea`
|
|
104
|
+
width: 100%;
|
|
105
|
+
border: 1px solid #d1d5db;
|
|
106
|
+
border-radius: 0.25rem;
|
|
107
|
+
padding: 0.5rem;
|
|
108
|
+
font-size: 0.75rem;
|
|
109
|
+
background-color: #f9fafb;
|
|
110
|
+
resize: none;
|
|
111
|
+
min-height: 40px;
|
|
112
|
+
font-family: inherit;
|
|
113
|
+
|
|
114
|
+
&:focus {
|
|
115
|
+
outline: none;
|
|
116
|
+
border-color: #6366f1;
|
|
117
|
+
box-shadow: 0 0 0 1px #6366f1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
transition: all 0.2s ease-in-out;
|
|
121
|
+
`,Mu=Kl.div`
|
|
122
|
+
transition: transform 0.2s ease-in-out;
|
|
123
|
+
`,Ou=({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("div",{className:"w-full h-full bg-white flex flex-col overflow-hidden"},e.createElement("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex justify-between items-start"},e.createElement("div",null,e.createElement("h3",{className:"m-0 text-base font-semibold text-gray-800"},"Timeline")),r&&e.createElement("button",{onClick:r,className:"border-none bg-transparent cursor-pointer text-gray-500 p-1 flex items-center justify-center transition-colors duration-200 hover:text-gray-700",title:"Collapse Panel"},e.createElement(ws,{size:16}))),e.createElement("div",{className:"flex-1 overflow-y-auto py-2 pb-4"},Array.from({length:s},(r,a)=>{const s=i+a,c=s===n,u=s<n,d=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("div",{key:s,onClick:()=>d&&o(s),className:`\n px-4 py-3 border-b border-gray-100 relative transition-all duration-200\n ${d?"cursor-pointer":"cursor-default"}\n ${c?"bg-blue-50 border-l-4 border-l-indigo-500":"border-l-4 border-l-transparent"}\n ${d&&!c?"hover:bg-gray-50":""}\n `},e.createElement("div",{className:"flex items-center gap-2 mb-1"},e.createElement("div",{className:`\n w-3 h-3 rounded-full border flex-shrink-0\n ${c?"bg-indigo-500 border-indigo-500":u?"bg-yellow-400 border-gray-300":d?"bg-gray-400 border-gray-300":"bg-gray-200 border-gray-300"}\n `}),e.createElement("span",{className:`\n text-sm font-medium\n ${c?"font-semibold text-gray-800":"text-gray-500"}\n `},"Step ",s),f&&e.createElement(lu,{variant:l(f),className:"ml-auto"},iu(f))),e.createElement("div",{className:`\n text-sm leading-relaxed break-words\n ${d?"text-gray-800":"text-gray-400 italic"}\n `},d?p:"No activity"),c&&e.createElement("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-indigo-500 animate-pulse"}))})))};function Pu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Ru(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Au(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Ru(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():Ru(e[t],null)}}}}function Du(...e){return r.useCallback(Au(...e),e)}function Tu(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}\``)}]},Iu(a,...t)]}function Iu(...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 zu=globalThis?.document?r.useLayoutEffect:()=>{},Lu=r[" useId ".trim().toString()]||(()=>{}),$u=0;function Bu(e){const[t,n]=r.useState(Lu());return zu(()=>{e||n(e=>e??String($u++))},[e]),e||(t?`radix-${t}`:"")}var ju=r[" useInsertionEffect ".trim().toString()]||zu;function Hu({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 ju(()=>{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 Fu(e){const t=Vu(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,s=r.Children.toArray(a),l=s.find(Yu);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?Au(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 Wu=Symbol("radix.slottable");function Yu(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Wu}var Xu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const o=Fu(`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 Ku(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var qu,Uu="dismissableLayer.update",Zu="dismissableLayer.pointerDownOutside",Gu="dismissableLayer.focusOutside",Qu=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ju=r.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=r.useContext(Qu),[f,p]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=r.useState({}),g=Du(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=Ku(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){nd(Zu,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=Ku(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){nd(Gu,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=Ku(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&&(qu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),td(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=qu)}},[f,h,o,d]),r.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),td())},[f,d]),r.useEffect(()=>{const e=()=>m({});return document.addEventListener(Uu,e),()=>document.removeEventListener(Uu,e)},[]),n.jsx(Xu.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Pu(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Pu(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Pu(e.onPointerDownCapture,S.onPointerDownCapture)})});Ju.displayName="DismissableLayer";var ed=r.forwardRef((e,t)=>{const o=r.useContext(Qu),a=r.useRef(null),i=Du(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 td(){const e=new CustomEvent(Uu);document.dispatchEvent(e)}function nd(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)}ed.displayName="DismissableLayerBranch";var od="focusScope.autoFocusOnMount",rd="focusScope.autoFocusOnUnmount",ad={bubbles:!1,cancelable:!0},id=r.forwardRef((e,t)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=r.useState(null),d=Ku(i),f=Ku(s),p=r.useRef(null),h=Du(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:ud(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ud(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ud(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){dd.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(od,ad);c.addEventListener(od,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ud(o,{select:t}),document.activeElement!==n)return}((e=sd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ud(c))}return()=>{c.removeEventListener(od,d),setTimeout(()=>{const e=new CustomEvent(rd,ad);c.addEventListener(rd,f),c.dispatchEvent(e),e.defaultPrevented||ud(t??document.body,{select:!0}),c.removeEventListener(rd,f),dd.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=sd(e),n=ld(t,e),o=ld(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&ud(a,{select:!0})):(e.preventDefault(),o&&ud(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,m.paused]);return n.jsx(Xu.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function sd(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 ld(e,t){for(const n of e)if(!cd(n,{upTo:t}))return n}function cd(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 ud(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()}}id.displayName="FocusScope";var dd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fd(e,t),e.unshift(t)},remove(t){e=fd(e,t),e[0]?.resume()}}}();function fd(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var pd=r.forwardRef((e,o)=>{const{container:a,...i}=e,[s,l]=r.useState(!1);zu(()=>l(!0),[]);const c=a||s&&globalThis?.document?.body;return c?t.createPortal(n.jsx(Xu.div,{...i,ref:o}),c):null});pd.displayName="Portal";var hd=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=md(o.current);i.current="mounted"===l?e:"none"},[l]),zu(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=md(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]),zu(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=md(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=md(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=Du(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 md(e){return e?.animationName||"none"}hd.displayName="Presence";var gd=0;function yd(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vd()),document.body.insertAdjacentElement("beforeend",e[1]??vd()),gd++,()=>{1===gd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),gd--}},[])}function vd(){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 bd=function(){return bd=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},bd.apply(this,arguments)};function wd(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 xd="right-scroll-bar-position",Ed="width-before-scroll-bar";function Sd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var _d="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,kd=new WeakMap;function Cd(t,n){var o,r,a,i=(o=n||null,r=function(e){return t.forEach(function(t){return Sd(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 _d(function(){var e=kd.get(i);if(e){var n=new Set(e),o=new Set(t),r=i.current;n.forEach(function(e){o.has(e)||Sd(e,null)}),o.forEach(function(e){n.has(e)||Sd(e,r)})}kd.set(i,t)},[t]),i}function Nd(e){return e}var Md=function(e){var t=e.sideCar,n=wd(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,bd({},n))};Md.isSideCarExport=!0;var Od=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=bd({async:!0,ssr:!1},e),t}(),Pd=function(){},Rd=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:Pd,onWheelCapture:Pd,onTouchMoveCapture:Pd}),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=wd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=Cd([n,t]),_=bd(bd({},x),a);return r.createElement(r.Fragment,null,d&&r.createElement(E,{sideCar:Od,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),bd(bd({},_),{ref:S})):r.createElement(b,bd({},_,{className:c,ref:S}),l))});Rd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Rd.classNames={fullWidth:Ed,zeroRight:xd};function Ad(){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 Dd=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=Ad())&&(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)}}},Td=function(){var e,t=(e=Dd(),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}},Id={left:0,top:0,right:0,gap:0},zd=function(e){return parseInt(e||"",10)||0},Ld=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Id;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[zd(n),zd(o),zd(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])}},$d=Td(),Bd="data-scroll-locked",jd=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(Bd,"] {\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(xd," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Ed," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(xd," .").concat(xd," {\n right: 0 ").concat(o,";\n }\n \n .").concat(Ed," .").concat(Ed," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(Bd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Hd=function(){var e=parseInt(document.body.getAttribute(Bd)||"0",10);return isFinite(e)?e:0},Fd=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(Bd,(Hd()+1).toString()),function(){var e=Hd()-1;e<=0?document.body.removeAttribute(Bd):document.body.setAttribute(Bd,e.toString())}},[]);var i=r.useMemo(function(){return Ld(a)},[a]);return r.createElement($d,{styles:jd(i,!t,a,n?"":"!important")})},Vd=!1;if("undefined"!=typeof window)try{var Wd=Object.defineProperty({},"passive",{get:function(){return Vd=!0,!0}});window.addEventListener("test",Wd,Wd),window.removeEventListener("test",Wd,Wd)}catch(e){Vd=!1}var Yd=!!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])},Kd=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),qd(e,o)){var r=Ud(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},qd=function(e,t){return"v"===e?function(e){return Xd(e,"overflowY")}(t):function(e){return Xd(e,"overflowX")}(t)},Ud=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},Zd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gd=function(e){return[e.deltaX,e.deltaY]},Qd=function(e){return e&&"current"in e?e.current:e},Jd=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},ef=0,tf=[];function nf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var of,rf=(of=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),a=r.useState(ef++)[0],i=r.useState(Td)[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(Qd),!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=Zd(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=Kd(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=Kd(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=Ud(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&qd(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(tf.length&&tf[tf.length-1]===i){var o="deltaY"in n?Gd(n):Zd(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(Qd).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:nf(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=Zd(e),o.current=void 0},[]),f=r.useCallback(function(t){u(t.type,Gd(t),t.target,l(t,e.lockRef.current))},[]),p=r.useCallback(function(t){u(t.type,Zd(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return tf.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Yd),document.addEventListener("touchmove",c,Yd),document.addEventListener("touchstart",d,Yd),function(){tf=tf.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,Yd),document.removeEventListener("touchmove",c,Yd),document.removeEventListener("touchstart",d,Yd)}},[]);var h=e.removeScrollBar,m=e.inert;return r.createElement(r.Fragment,null,m?r.createElement(i,{styles:Jd(a)}):null,h?r.createElement(Fd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Od.useMedium(of),Md),af=r.forwardRef(function(e,t){return r.createElement(Rd,bd({},e,{ref:t,sideCar:rf}))});af.classNames=Rd.classNames;var sf=af,lf=new WeakMap,cf=new WeakMap,uf={},df=0,ff=function(e){return e&&(e.host||ff(e.parentNode))},pf=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ff(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]);uf[n]||(uf[n]=new WeakMap);var a=uf[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=(lf.get(e)||0)+1,c=(a.get(e)||0)+1;lf.set(e,l),a.set(e,c),i.push(e),1===l&&r&&cf.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(),df++,function(){i.forEach(function(e){var t=lf.get(e)-1,r=a.get(e)-1;lf.set(e,t),a.set(e,r),t||(cf.has(e)||e.removeAttribute(o),cf.delete(e)),r||e.removeAttribute(n)}),--df||(lf=new WeakMap,lf=new WeakMap,cf=new WeakMap,uf={})}},hf=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"))),pf(o,r,n,"aria-hidden")):function(){return null}},mf="Dialog",[gf,yf]=Tu(mf),[vf,bf]=gf(mf),wf=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]=Hu({prop:a,defaultProp:i??!1,onChange:s,caller:mf});return n.jsx(vf,{scope:t,triggerRef:c,contentRef:u,contentId:Bu(),titleId:Bu(),descriptionId:Bu(),open:d,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:l,children:o})};wf.displayName=mf;var xf="DialogTrigger",Ef=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(xf,o),i=Du(t,a.triggerRef);return n.jsx(Xu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ff(a.open),...r,ref:i,onClick:Pu(e.onClick,a.onOpenToggle)})});Ef.displayName=xf;var Sf="DialogPortal",[_f,kf]=gf(Sf,{forceMount:void 0}),Cf=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:i}=e,s=bf(Sf,t);return n.jsx(_f,{scope:t,forceMount:o,children:r.Children.map(a,e=>n.jsx(hd,{present:o||s.open,children:n.jsx(pd,{asChild:!0,container:i,children:e})}))})};Cf.displayName=Sf;var Nf="DialogOverlay",Mf=r.forwardRef((e,t)=>{const o=kf(Nf,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=bf(Nf,e.__scopeDialog);return i.modal?n.jsx(hd,{present:r||i.open,children:n.jsx(Pf,{...a,ref:t})}):null});Mf.displayName=Nf;var Of=Fu("DialogOverlay.RemoveScroll"),Pf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(Nf,o);return n.jsx(sf,{as:Of,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(Xu.div,{"data-state":Ff(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Rf="DialogContent",Af=r.forwardRef((e,t)=>{const o=kf(Rf,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=bf(Rf,e.__scopeDialog);return n.jsx(hd,{present:r||i.open,children:i.modal?n.jsx(Df,{...a,ref:t}):n.jsx(Tf,{...a,ref:t})})});Af.displayName=Rf;var Df=r.forwardRef((e,t)=>{const o=bf(Rf,e.__scopeDialog),a=r.useRef(null),i=Du(t,o.contentRef,a);return r.useEffect(()=>{const e=a.current;if(e)return hf(e)},[]),n.jsx(If,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pu(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Pu(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Pu(e.onFocusOutside,e=>e.preventDefault())})}),Tf=r.forwardRef((e,t)=>{const o=bf(Rf,e.__scopeDialog),a=r.useRef(!1),i=r.useRef(!1);return n.jsx(If,{...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()}})}),If=r.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=bf(Rf,o),u=r.useRef(null),d=Du(t,u);return yd(),n.jsxs(n.Fragment,{children:[n.jsx(id,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:n.jsx(Ju,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ff(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(Xf,{titleId:c.titleId}),n.jsx(Kf,{contentRef:u,descriptionId:c.descriptionId})]})]})}),zf="DialogTitle",Lf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(zf,o);return n.jsx(Xu.h2,{id:a.titleId,...r,ref:t})});Lf.displayName=zf;var $f="DialogDescription",Bf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf($f,o);return n.jsx(Xu.p,{id:a.descriptionId,...r,ref:t})});Bf.displayName=$f;var jf="DialogClose",Hf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(jf,o);return n.jsx(Xu.button,{type:"button",...r,ref:t,onClick:Pu(e.onClick,()=>a.onOpenChange(!1))})});function Ff(e){return e?"open":"closed"}Hf.displayName=jf;var Vf="DialogTitleWarning",[Wf,Yf]=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:Rf,titleName:zf,docsSlug:"dialog"}),Xf=({titleId:e})=>{const t=Yf(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},Kf=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yf("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},qf=wf,Uf=Ef,Zf=Cf,Gf=Mf,Qf=Af,Jf=Lf,ep=Bf,tp=Hf;const np=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,op=Ul,rp=qf,ap=Uf,ip=Zf,sp=r.forwardRef(({className:e,...t},n)=>r.createElement(Gf,{className:nu("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));sp.displayName=Gf.displayName;const lp=(cp="fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",up={variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}},e=>{var t;if(null==(null==up?void 0:up.variants))return op(cp,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:n,defaultVariants:o}=up,r=Object.keys(n).map(t=>{const r=null==e?void 0:e[t],a=null==o?void 0:o[t];if(null===r)return null;const i=np(r)||np(a);return n[t][i]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,o]=t;return void 0===o||(e[n]=o),e},{}),i=null==up||null===(t=up.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...a}[t]):{...o,...a}[t]===n})?[...e,n,r]:e},[]);return op(cp,r,i,null==e?void 0:e.class,null==e?void 0:e.className)});var cp,up;const dp=r.forwardRef(({side:e="right",className:t,children:n,...o},a)=>r.createElement(ip,null,r.createElement(sp,null),r.createElement(Qf,{ref:a,className:nu(lp({side:e}),t),...o},n,r.createElement(tp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},r.createElement("svg",{className:"h-4 w-4",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",{className:"sr-only"},"Close")))));dp.displayName=Qf.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Jf,{ref:n,className:nu("text-lg font-semibold text-foreground",e),...t})).displayName=Jf.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(ep,{ref:n,className:nu("text-sm text-muted-foreground",e),...t})).displayName=ep.displayName;const fp=(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},pp={Agent:gu,Tool:gu,Coordinator:gu},hp=({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 u=t;if(!u)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",background:"#f9fafb",position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:r},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#6b7280",marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:"#9ca3af"}},"Please provide flowData prop")));const d=e.useRef(null),f=e.useRef(null),[p,h]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[m,g]=e.useState(0),[y,v]=e.useState(!1),b=e.useRef(null),[w,x]=e.useState(!1),E=e.useMemo(()=>{const e=u.stamps||u.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[u.stamps,u.steps]);e.useEffect(()=>(y?b.current=setInterval(()=>{g(e=>e>=E?(v(!1),e):e+1)},250):b.current&&(clearInterval(b.current),b.current=null),()=>{b.current&&clearInterval(b.current)}),[y,E]),e.useEffect(()=>{const e=u.stamps||u.steps||[];e.length>0&&g(Math.max(...e.map(e=>e.step)))},[u.stamps,u.steps]),e.useEffect(()=>{const e=()=>{if(d.current){const e=d.current.getBoundingClientRect();h({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&d.current){const t=new ResizeObserver(e);return t.observe(d.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const S=e.useMemo(()=>{if(!u.nodes)return new Map;const e=Math.max(p.width||800,1200);return fp(u.nodes,u.edges||[],{minNodeSpacing:c,containerWidth:e})},[u.nodes,u.edges,p.width,c]),_=e.useCallback(e=>u.nodes?u.nodes.filter(t=>t.stamp.step<=e):[],[u.nodes]),k=e.useCallback(e=>(u.edges||[]).filter(t=>t.stamp.step<=e),[u.edges]),C=e.useMemo(()=>{const e=_(m),t=k(m);return e.map(e=>{const n=S.get(e.identifier)||{x:0,y:0},o=e.stamp.step===m,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"}}})},[S,m,_,k]),N=e.useMemo(()=>k(m).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===m;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?ru(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?ru(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[m,k]),[M,O,P]=Ji(C),[R,A,D]=es(N);e.useEffect(()=>{O(C)},[C,O]),e.useEffect(()=>{A(N)},[N,A]);const T=e.useCallback(e=>A(t=>xr(e,t)),[A]),I=e.useCallback(e=>{g(e),v(!1)},[]);e.useCallback(()=>{v(e=>!e)},[]);const z=(e,t)=>{if(!f.current)return{x:0,y:0};const n=f.current.createSVGPoint();n.x=e,n.y=t;const o=n.matrixTransform(f.current.getScreenCTM()?.inverse());return{x:o.x,y:o.y}},L=ka();return e.useEffect(()=>{if(s||!L||0===C.length)return;const e=new Map;N.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&&C.length>0&&(t=C[0].id),t&&setTimeout(()=>{L.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:a,maxZoom:1})},500)},[C,N,L,s,a]),e.createElement("div",{ref:d,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px"},className:r},l&&e.createElement(rp,{open:w,onOpenChange:x},e.createElement(ap,{asChild:!0},e.createElement("button",{className:"absolute top-4 left-4 z-50 w-10 h-10 bg-white border border-gray-300 rounded-lg shadow-sm hover:bg-gray-50 flex items-center justify-center transition-colors duration-200",title:"Open Timeline"},e.createElement(ws,{size:20,className:"text-gray-600"}))),e.createElement(ip,null,e.createElement(Qf,{className:"fixed inset-y-0 left-0 h-full w-[280px] z-50 bg-background border-r shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left p-0",onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{className:"flex flex-col h-full"},e.createElement("div",{className:"flex-1 overflow-y-auto"},e.createElement(Ou,{stamps:u.stamps||u.steps||[],currentStep:m,onStepChange:I}))),e.createElement(tp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},e.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{className:"sr-only"},"Close"))))),e.createElement(Gi,{nodes:M,edges:R,onNodesChange:P,onEdgesChange:D,onConnect:T,nodeTypes:pp,edgeTypes:{default:t=>e.createElement(Es,{...t,clientToSvgCoords:z,svgRef:f})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:i.x,y:i.y,zoom:a},onInit:()=>{if(d.current){const e=d.current.querySelector("svg");e&&(f.current=e)}}},e.createElement(ls,{variant:ts.Lines,color:"#EEEEEE",gap:16})),e.createElement("style",null,"\n .react-flow__edge-label {\n font-size: 10px;\n background: white;\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid #e5e7eb;\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n "))};function mp(e,[t,n]){return Math.min(n,Math.max(t,e))}var gp=r.createContext(void 0);const yp=["top","right","bottom","left"],vp=Math.min,bp=Math.max,wp=Math.round,xp=Math.floor,Ep=e=>({x:e,y:e}),Sp={left:"right",right:"left",bottom:"top",top:"bottom"},_p={start:"end",end:"start"};function kp(e,t,n){return bp(e,vp(t,n))}function Cp(e,t){return"function"==typeof e?e(t):e}function Np(e){return e.split("-")[0]}function Mp(e){return e.split("-")[1]}function Op(e){return"x"===e?"y":"x"}function Pp(e){return"y"===e?"height":"width"}const Rp=new Set(["top","bottom"]);function Ap(e){return Rp.has(Np(e))?"y":"x"}function Dp(e){return Op(Ap(e))}function Tp(e){return e.replace(/start|end/g,e=>_p[e])}const Ip=["left","right"],zp=["right","left"],Lp=["top","bottom"],$p=["bottom","top"];function Bp(e,t,n,o){const r=Mp(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?zp:Ip:t?Ip:zp;case"left":case"right":return t?Lp:$p;default:return[]}}(Np(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Tp)))),a}function jp(e){return e.replace(/left|right|bottom|top/g,e=>Sp[e])}function Hp(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 Fp(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 Vp(e,t,n){let{reference:o,floating:r}=e;const a=Ap(t),i=Dp(t),s=Pp(i),l=Np(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(Mp(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function Wp(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}=Cp(t,e),h=Hp(p),m=s[f?"floating"===d?"reference":"floating":d],g=Fp(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=Fp(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 Yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xp(e){return yp.some(t=>e[t]>=0)}const Kp=new Set(["left","top"]);function qp(){return"undefined"!=typeof window}function Up(e){return Qp(e)?(e.nodeName||"").toLowerCase():"#document"}function Zp(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Gp(e){var t;return null==(t=(Qp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Qp(e){return!!qp()&&(e instanceof Node||e instanceof Zp(e).Node)}function Jp(e){return!!qp()&&(e instanceof Element||e instanceof Zp(e).Element)}function eh(e){return!!qp()&&(e instanceof HTMLElement||e instanceof Zp(e).HTMLElement)}function th(e){return!(!qp()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Zp(e).ShadowRoot)}const nh=new Set(["inline","contents"]);function oh(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=mh(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!nh.has(r)}const rh=new Set(["table","td","th"]);function ah(e){return rh.has(Up(e))}const ih=[":popover-open",":modal"];function sh(e){return ih.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const lh=["transform","translate","scale","rotate","perspective"],ch=["transform","translate","scale","rotate","perspective","filter"],uh=["paint","layout","strict","content"];function dh(e){const t=fh(),n=Jp(e)?mh(e):e;return lh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ch.some(e=>(n.willChange||"").includes(e))||uh.some(e=>(n.contain||"").includes(e))}function fh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ph=new Set(["html","body","#document"]);function hh(e){return ph.has(Up(e))}function mh(e){return Zp(e).getComputedStyle(e)}function gh(e){return Jp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yh(e){if("html"===Up(e))return e;const t=e.assignedSlot||e.parentNode||th(e)&&e.host||Gp(e);return th(t)?t.host:t}function vh(e){const t=yh(e);return hh(t)?e.ownerDocument?e.ownerDocument.body:e.body:eh(t)&&oh(t)?t:vh(t)}function bh(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=vh(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=Zp(r);if(a){const e=wh(i);return t.concat(i,i.visualViewport||[],oh(r)?r:[],e&&n?bh(e):[])}return t.concat(r,bh(r,[],n))}function wh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xh(e){const t=mh(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=eh(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=wp(n)!==a||wp(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Eh(e){return Jp(e)?e:e.contextElement}function Sh(e){const t=Eh(e);if(!eh(t))return Ep(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=xh(t);let i=(a?wp(n.width):n.width)/o,s=(a?wp(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const _h=Ep(0);function kh(e){const t=Zp(e);return fh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_h}function Ch(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Eh(e);let i=Ep(1);t&&(o?Jp(o)&&(i=Sh(o)):i=Sh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Zp(e))&&t}(a,n,o)?kh(a):Ep(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=Zp(a),t=o&&Jp(o)?Zp(o):o;let n=e,r=wh(n);for(;r&&o&&t!==n;){const e=Sh(r),t=r.getBoundingClientRect(),o=mh(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Zp(r),r=wh(n)}}return Fp({width:u,height:d,x:l,y:c})}function Nh(e,t){const n=gh(e).scrollLeft;return t?t.left+n:Ch(Gp(e)).left+n}function Mh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Nh(e,n),y:n.top+t.scrollTop}}const Oh=new Set(["absolute","fixed"]);function Ph(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Zp(e),o=Gp(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=fh();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=Nh(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=Gp(e),n=gh(e),o=e.ownerDocument.body,r=bp(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=bp(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Nh(e);const s=-n.scrollTop;return"rtl"===mh(o).direction&&(i+=bp(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(Gp(e));else if(Jp(t))o=function(e,t){const n=Ch(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=eh(e)?Sh(e):Ep(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=kh(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fp(o)}function Rh(e,t){const n=yh(e);return!(n===t||!Jp(n)||hh(n))&&("fixed"===mh(n).position||Rh(n,t))}function Ah(e,t,n){const o=eh(t),r=Gp(t),a="fixed"===n,i=Ch(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Ep(0);function c(){l.x=Nh(r)}if(o||!o&&!a)if(("body"!==Up(t)||oh(r))&&(s=gh(t)),o){const e=Ch(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?Ep(0):Mh(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 Dh(e){return"static"===mh(e).position}function Th(e,t){if(!eh(e)||"fixed"===mh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Gp(e)===n&&(n=n.ownerDocument.body),n}function Ih(e,t){const n=Zp(e);if(sh(e))return n;if(!eh(e)){let t=yh(e);for(;t&&!hh(t);){if(Jp(t)&&!Dh(t))return t;t=yh(t)}return n}let o=Th(e,t);for(;o&&ah(o)&&Dh(o);)o=Th(o,t);return o&&hh(o)&&Dh(o)&&!dh(o)?n:o||function(e){let t=yh(e);for(;eh(t)&&!hh(t);){if(dh(t))return t;if(sh(t))return null;t=yh(t)}return null}(e)||n}const zh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=Gp(o),s=!!t&&sh(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Ep(1);const u=Ep(0),d=eh(o);if((d||!d&&!a)&&(("body"!==Up(o)||oh(i))&&(l=gh(o)),eh(o))){const e=Ch(o);c=Sh(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!i||d||a?Ep(0):Mh(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:Gp,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a="clippingAncestors"===n?sh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=bh(e,[],!1).filter(e=>Jp(e)&&"body"!==Up(e)),r=null;const a="fixed"===mh(e).position;let i=a?yh(e):e;for(;Jp(i)&&!hh(i);){const t=mh(i),n=dh(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&Oh.has(r.position)||oh(i)&&!n&&Rh(e,i))?o=o.filter(e=>e!==i):r=t,i=yh(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=Ph(t,n,r);return e.top=bp(o.top,e.top),e.right=vp(o.right,e.right),e.bottom=vp(o.bottom,e.bottom),e.left=bp(o.left,e.left),e},Ph(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:Ah(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}=xh(e);return{width:t,height:n}},getScale:Sh,isElement:Jp,isRTL:function(e){return"rtl"===mh(e).direction}};function Lh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $h(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=Eh(e),u=r||a?[...c?bh(c):[],...bh(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=Gp(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:-xp(d)+"px "+-xp(r.clientWidth-(u+f))+"px "+-xp(r.clientHeight-(d+p))+"px "+-xp(u)+"px",threshold:bp(0,vp(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?Ch(e):null;return l&&function t(){const o=Ch(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 Bh=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=Np(n),s=Mp(n),l="y"===Ap(n),c=Kp.has(i)?-1:1,u=a&&l?-1:1,d=Cp(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},jh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Cp(e,t),c={x:n,y:o},u=await Wp(t,l),d=Ap(Np(r)),f=Op(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=kp(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=kp(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}}}}}},Hh=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}=Cp(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=Np(r),v=Ap(s),b=Np(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[jp(s)]:function(e){const t=jp(e);return[Tp(e),t,Tp(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Bp(s,m,h,w));const S=[s,...x],_=await Wp(t,g),k=[];let C=(null==(o=a.flip)?void 0:o.overflows)||[];if(u&&k.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Mp(e),r=Dp(e),a=Pp(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=jp(i)),[i,jp(i)]}(r,i,w);k.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:r,overflows:k}],!k.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==Ap(t))||C.every(e=>Ap(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(M=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=C.filter(e=>{if(E){const t=Ap(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Fh=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}=Cp(e,t),u=await Wp(t,c),d=Np(r),f=Mp(r),p="y"===Ap(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=vp(m-u[g],v),x=vp(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=bp(u.left,0),t=bp(u.right,0),n=bp(u.top,0),o=bp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:bp(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:bp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const k=await i.getDimensions(s.floating);return h!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}},Vh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Cp(e,t);switch(o){case"referenceHidden":{const e=Yp(await Wp(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Xp(e)}}}case"escaped":{const e=Yp(await Wp(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Xp(e)}}}default:return{}}}}},Wh=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}=Cp(e,t)||{};if(null==c)return{};const d=Hp(u),f={x:n,y:o},p=Dp(r),h=Pp(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,k=S/2-m[h]/2-1,C=vp(d[y],k),N=vp(d[v],k),M=C,O=S-m[h]-N,P=S/2-m[h]/2+_,R=kp(M,P,O),A=!l.arrow&&null!=Mp(r)&&P!==R&&a.reference[h]/2-(P<M?C:N)-m[h]/2<0,D=A?P<M?P-M:P-O:0;return{[p]:f[p]+D,data:{[p]:R,centerOffset:P-R-D,...A&&{alignmentOffset:D}},reset:A}}}),Yh=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}=Cp(e,t),u={x:n,y:o},d=Ap(r),f=Op(d);let p=u[f],h=u[d];const m=Cp(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=Kp.has(Np(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}}}},Xh=(e,t,n)=>{const o=new Map,r={platform:zh,...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}=Vp(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}=Vp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:a})};var Kh="undefined"!=typeof document?e.useLayoutEffect:function(){};function qh(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(!qh(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)&&!qh(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Uh(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zh(e,t){const n=Uh(e);return Math.round(t*n)/n}function Gh(e){const t=r.useRef(e);return Kh(()=>{t.current=e}),t}const Qh=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?Wh({element:n.current,padding:o}).fn(t):{}:n?Wh({element:n,padding:o}).fn(t):{};var r}}),Jh=(e,t)=>({...Bh(e),options:[e,t]}),em=(e,t)=>({...jh(e),options:[e,t]}),tm=(e,t)=>({...Yh(e),options:[e,t]}),nm=(e,t)=>({...Hh(e),options:[e,t]}),om=(e,t)=>({...Fh(e),options:[e,t]}),rm=(e,t)=>({...Vh(e),options:[e,t]}),am=(e,t)=>({...Qh(e),options:[e,t]});var im=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"})})});im.displayName="Arrow";var sm=im;function lm(e){const[t,n]=r.useState(void 0);return zu(()=>{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 cm="Popper",[um,dm]=Tu(cm),[fm,pm]=um(cm),hm=e=>{const{__scopePopper:t,children:o}=e,[a,i]=r.useState(null);return n.jsx(fm,{scope:t,anchor:a,onAnchorChange:i,children:o})};hm.displayName=cm;var mm="PopperAnchor",gm=r.forwardRef((e,t)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=pm(mm,o),l=r.useRef(null),c=Du(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})});gm.displayName=mm;var ym="PopperContent",[vm,bm]=um(ym),wm=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=pm(ym,o),[w,x]=r.useState(null),E=Du(t,e=>x(e)),[S,_]=r.useState(null),k=lm(S),C=k?.width??0,N=k?.height??0,M=i+("center"!==l?"-"+l:""),O="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],R=P.length>0,A={padding:O,boundary:P.filter(_m),altBoundary:R},{refs:D,floatingStyles:T,placement:I,isPositioned:z,middlewareData:L}=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);qh(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!==k.current&&(k.current=e,b(e))},[]),E=s||g,S=l||v,_=r.useRef(null),k=r.useRef(null),C=r.useRef(f),N=null!=u,M=Gh(u),O=Gh(i),P=Gh(d),R=r.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:t,strategy:n,middleware:h};O.current&&(e.platform=O.current),Xh(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};A.current&&!qh(C.current,t)&&(C.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,O,P]);Kh(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=r.useRef(!1);Kh(()=>(A.current=!0,()=>{A.current=!1}),[]),Kh(()=>{if(E&&(_.current=E),S&&(k.current=S),E&&S){if(M.current)return M.current(E,S,R);R()}},[E,S,R,M,N]);const D=r.useMemo(()=>({reference:_,floating:k,setReference:w,setFloating:x}),[w,x]),T=r.useMemo(()=>({reference:E,floating:S}),[E,S]),I=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Zh(T.floating,f.x),o=Zh(T.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...Uh(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,T.floating,f.x,f.y]);return r.useMemo(()=>({...f,update:R,refs:D,elements:T,floatingStyles:I}),[f,R,D,T,I])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>$h(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[Jh({mainAxis:s+N,alignmentAxis:c}),d&&em({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?tm():void 0,...A}),d&&nm({...A}),om({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&am({element:S,padding:u}),km({arrowWidth:C,arrowHeight:N}),m&&rm({strategy:"referenceHidden",...A})]}),[$,B]=Cm(I),j=Ku(y);zu(()=>{z&&j?.()},[z,j]);const H=L.arrow?.x,F=L.arrow?.y,V=0!==L.arrow?.centerOffset,[W,Y]=r.useState();return zu(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(vm,{scope:o,placedSide:$,onArrowChange:_,arrowX:H,arrowY:F,shouldHideArrow:V,children:n.jsx(Xu.div,{"data-side":$,"data-align":B,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});wm.displayName=ym;var xm="PopperArrow",Em={top:"bottom",right:"left",bottom:"top",left:"right"},Sm=r.forwardRef(function(e,t){const{__scopePopper:o,...r}=e,a=bm(xm,o),i=Em[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(sm,{...r,ref:t,style:{...r.style,display:"block"}})})});function _m(e){return null!==e}Sm.displayName=xm;var km=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]=Cm(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 Cm(e){const[t,n="center"]=e.split("-");return[t,n]}var Nm=hm,Mm=gm,Om=wm,Pm=Sm;function Rm(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 Am=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:{...Am,...e.style}})).displayName="VisuallyHidden";var Dm=[" ","Enter","ArrowUp","ArrowDown"],Tm=[" ","Enter"],Im="Select",[zm,Lm,$m]=function(t){const o=t+"CollectionProvider",[r,a]=Tu(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=Fu(c),d=e.forwardRef((e,t)=>{const{scope:o,children:r}=e,a=Du(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=Fu(f),m=e.forwardRef((t,o)=>{const{scope:r,children:a,...i}=t,l=e.useRef(null),c=Du(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),[Bm,jm]=Tu(Im,[$m,dm]),Hm=dm(),[Fm,Vm]=Bm(Im),[Wm,Ym]=Bm(Im),Xm=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=Hm(t),[v,b]=r.useState(null),[w,x]=r.useState(null),[E,S]=r.useState(!1),_=function(e){const t=r.useContext(gp);return e||t||"ltr"}(d),[k,C]=Hu({prop:a,defaultProp:i??!1,onChange:s,caller:Im}),[N,M]=Hu({prop:l,defaultProp:c,onChange:u,caller:Im}),O=r.useRef(null),P=!v||(g||!!v.closest("form")),[R,A]=r.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return n.jsx(Nm,{...y,children:n.jsxs(Fm,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:Bu(),value:N,onValueChange:M,open:k,onOpenChange:C,dir:_,triggerPointerDownPosRef:O,disabled:h,children:[n.jsx(zm.Provider,{scope:t,children:n.jsx(Wm,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),P?n.jsxs(Ag,{"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(R)]},D):null]})})};Xm.displayName=Im;var Km="SelectTrigger",qm=r.forwardRef((e,t)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=Hm(o),l=Vm(Km,o),c=l.disabled||a,u=Du(t,l.onTriggerChange),d=Lm(o),f=r.useRef("touch"),[p,h,m]=Tg(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(Mm,{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":Dg(l.value)?"":void 0,...i,ref:u,onClick:Pu(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Pu(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:Pu(i.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Dm.includes(e.key)&&(g(),e.preventDefault())})})})});qm.displayName=Km;var Um="SelectValue",Zm=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=e,c=Vm(Um,o),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,f=Du(t,c.onValueNodeChange);return zu(()=>{u(d)},[u,d]),n.jsx(Xu.span,{...l,ref:f,style:{pointerEvents:"none"},children:Dg(c.value)?n.jsx(n.Fragment,{children:s}):i})});Zm.displayName=Um;var Gm=r.forwardRef((e,t)=>{const{__scopeSelect:o,children:r,...a}=e;return n.jsx(Xu.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});Gm.displayName="SelectIcon";var Qm=e=>n.jsx(pd,{asChild:!0,...e});Qm.displayName="SelectPortal";var Jm="SelectContent",eg=r.forwardRef((e,t)=>{const o=Vm(Jm,e.__scopeSelect),[i,s]=r.useState();if(zu(()=>{s(new DocumentFragment)},[]),!o.open){const t=i;return t?a.createPortal(n.jsx(ng,{scope:e.__scopeSelect,children:n.jsx(zm.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),t):null}return n.jsx(ag,{...e,ref:t})});eg.displayName=Jm;var tg=10,[ng,og]=Bm(Jm),rg=Fu("SelectContent.RemoveScroll"),ag=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=Vm(Jm,o),[x,E]=r.useState(null),[S,_]=r.useState(null),k=Du(t,e=>E(e)),[C,N]=r.useState(null),[M,O]=r.useState(null),P=Lm(o),[R,A]=r.useState(!1),D=r.useRef(!1);r.useEffect(()=>{if(x)return hf(x)},[x]),yd();const T=r.useCallback(e=>{const[t,...n]=P().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===o&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==r)return}},[P,S]),I=r.useCallback(()=>T([C,x]),[T,C,x]);r.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:z,triggerPointerDownPosRef:L}=w;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,z,L]),r.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[$,B]=Tg(e=>{const t=P().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Ig(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),j=r.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&(N(e),o&&(D.current=!0))},[w.value]),H=r.useCallback(()=>x?.focus(),[x]),F=r.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&O(e)},[w.value]),V="popper"===a?sg:ig,W=V===sg?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return n.jsx(ng,{scope:o,content:x,viewport:S,onViewportChange:_,itemRefCallback:j,selectedItem:C,onItemLeave:H,itemTextRefCallback:F,focusSelectedItem:I,selectedItemText:M,position:a,isPositioned:R,searchRef:$,children:n.jsx(sf,{as:rg,allowPinchZoom:!0,children:n.jsx(id,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Pu(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:n.jsx(Ju,{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:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Pu(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});ag.displayName="SelectContentImpl";var ig=r.forwardRef((e,t)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=Vm(Jm,o),l=og(Jm,o),[c,u]=r.useState(null),[d,f]=r.useState(null),p=Du(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-tg,d=mp(a,[tg,Math.max(tg,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-tg,d=mp(a,[tg,Math.max(tg,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const r=h(),i=window.innerHeight-2*tg,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),k=e.top+e.height/2-tg,C=i-k,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),O=w-M;if(M<=k){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(C,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(k,f+y.offsetTop+(e?S:0)+N)+O;c.style.height=t+"px",y.scrollTop=M-k+y.offsetTop}c.style.margin=`${tg}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]);zu(()=>x(),[x]);const[E,S]=r.useState();zu(()=>{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(lg,{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}})})})});ig.displayName="SelectItemAlignedPosition";var sg=r.forwardRef((e,t)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=tg,...i}=e,s=Hm(o);return n.jsx(Om,{...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)"}})});sg.displayName="SelectPopperPosition";var[lg,cg]=Bm(Jm,{}),ug="SelectViewport",dg=r.forwardRef((e,t)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=og(ug,o),l=cg(ug,o),c=Du(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(zm.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:Pu(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*tg,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})})})]})});dg.displayName=ug;var fg="SelectGroup",[pg,hg]=Bm(fg);r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Bu();return n.jsx(pg,{scope:o,id:a,children:n.jsx(Xu.div,{role:"group","aria-labelledby":a,...r,ref:t})})}).displayName=fg;var mg="SelectLabel",gg=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=hg(mg,o);return n.jsx(Xu.div,{id:a.id,...r,ref:t})});gg.displayName=mg;var yg="SelectItem",[vg,bg]=Bm(yg),wg=r.forwardRef((e,t)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=Vm(yg,o),u=og(yg,o),d=c.value===a,[f,p]=r.useState(s??""),[h,m]=r.useState(!1),g=Du(t,e=>u.itemRefCallback?.(e,a,i)),y=Bu(),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(vg,{scope:o,value:a,disabled:i,textId:y,isSelected:d,onItemTextChange:r.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:n.jsx(zm.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:Pu(l.onFocus,()=>m(!0)),onBlur:Pu(l.onBlur,()=>m(!1)),onClick:Pu(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Pu(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Pu(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Pu(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pu(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Pu(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Tm.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});wg.displayName=yg;var xg="SelectItemText",Eg=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=Vm(xg,o),u=og(xg,o),d=bg(xg,o),f=Ym(xg,o),[p,h]=r.useState(null),m=Du(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 zu(()=>(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]})});Eg.displayName=xg;var Sg="SelectItemIndicator",_g=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return bg(Sg,o).isSelected?n.jsx(Xu.span,{"aria-hidden":!0,...r,ref:t}):null});_g.displayName=Sg;var kg="SelectScrollUpButton",Cg=r.forwardRef((e,t)=>{const o=og(kg,e.__scopeSelect),a=cg(kg,e.__scopeSelect),[i,s]=r.useState(!1),l=Du(t,a.onScrollButtonChange);return zu(()=>{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(Og,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Cg.displayName=kg;var Ng="SelectScrollDownButton",Mg=r.forwardRef((e,t)=>{const o=og(Ng,e.__scopeSelect),a=cg(Ng,e.__scopeSelect),[i,s]=r.useState(!1),l=Du(t,a.onScrollButtonChange);return zu(()=>{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(Og,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Mg.displayName=Ng;var Og=r.forwardRef((e,t)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=og("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]),zu(()=>{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:Pu(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:Pu(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:Pu(i.onPointerLeave,()=>{u()})})}),Pg=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return n.jsx(Xu.div,{"aria-hidden":!0,...r,ref:t})});Pg.displayName="SelectSeparator";var Rg="SelectArrow";r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Hm(o),i=Vm(Rg,o),s=og(Rg,o);return i.open&&"popper"===s.position?n.jsx(Pm,{...a,...r,ref:t}):null}).displayName=Rg;var Ag=r.forwardRef(({__scopeSelect:e,value:t,...o},a)=>{const i=r.useRef(null),s=Du(a,i),l=Rm(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:{...Am,...o.style},ref:s,defaultValue:t})});function Dg(e){return""===e||void 0===e}function Tg(e){const t=Ku(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}Ag.displayName="SelectBubbleInput";var zg=qm,Lg=Gm,$g=Qm,Bg=eg,jg=dg,Hg=gg,Fg=wg,Vg=Eg,Wg=_g,Yg=Cg,Xg=Mg,Kg=Pg;const qg=Xm,Ug=Zm,Zg=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(zg,{ref:o,className:nu("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n},t,r.createElement(Lg,{asChild:!0},r.createElement(gs,{className:"h-4 w-4 opacity-50"}))));Zg.displayName=zg.displayName;const Gg=r.forwardRef(({className:e,...t},n)=>r.createElement(Yg,{ref:n,className:nu("flex cursor-default items-center justify-center py-1",e),...t},r.createElement(vs,{className:"h-4 w-4"})));Gg.displayName=Yg.displayName;const Qg=r.forwardRef(({className:e,...t},n)=>r.createElement(Xg,{ref:n,className:nu("flex cursor-default items-center justify-center py-1",e),...t},r.createElement(gs,{className:"h-4 w-4"})));Qg.displayName=Xg.displayName;const Jg=r.forwardRef(({className:e,children:t,position:n="popper",...o},a)=>r.createElement($g,null,r.createElement(Bg,{ref:a,className:nu("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o},r.createElement(Gg,null),r.createElement(jg,{className:nu("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},t),r.createElement(Qg,null))));Jg.displayName=Bg.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Hg,{ref:n,className:nu("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=Hg.displayName;const ey=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(Fg,{ref:o,className:nu("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n},r.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},r.createElement(Wg,null,r.createElement(ms,{className:"h-4 w-4"}))),r.createElement(Vg,null,t)));ey.displayName=Fg.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Kg,{ref:n,className:nu("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=Kg.displayName;var ty="Checkbox",[ny,oy]=Tu(ty),[ry,ay]=ny(ty);function iy(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]=Hu({prop:o,defaultProp:i??!1,onChange:u,caller:ty}),[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:!my(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return n.jsx(ry,{scope:t,...E,children:hy(p)?p(E):a})}var sy="CheckboxTrigger",ly=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}=ay(sy,e),y=Du(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":my(u)?"mixed":u,"aria-required":d,"data-state":gy(u),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:y,onKeyDown:Pu(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Pu(o,e=>{p(e=>!!my(e)||!e),g&&m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});ly.displayName=sy;var cy=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(iy,{__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(ly,{...f,ref:t,__scopeCheckbox:o}),e&&n.jsx(py,{__scopeCheckbox:o})]})})});cy.displayName=ty;var uy="CheckboxIndicator",dy=r.forwardRef((e,t)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=ay(uy,o);return n.jsx(hd,{present:r||my(i.checked)||!0===i.checked,children:n.jsx(Xu.span,{"data-state":gy(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});dy.displayName=uy;var fy="CheckboxBubbleInput",py=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}=ay(fy,e),g=Du(o,m),y=Rm(s),v=lm(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=my(s),n.call(e,!my(s)&&s),e.dispatchEvent(t)}},[h,y,s,i]);const b=r.useRef(!my(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 hy(e){return"function"==typeof e}function my(e){return"indeterminate"===e}function gy(e){return my(e)?"indeterminate":e?"checked":"unchecked"}py.displayName=fy;const yy=r.forwardRef(({className:e,...t},n)=>r.createElement(cy,{ref:n,className:nu("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t},r.createElement(dy,{className:nu("flex items-center justify-center text-current")},r.createElement(ms,{className:"h-4 w-4"}))));yy.displayName=cy.displayName;const vy=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}),by=()=>{const t=e.useContext(vy);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};function wy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function xy(){return Sy(/^iPad/)||Sy(/^Mac/)&&navigator.maxTouchPoints>1}function Ey(){return Sy(/^iPhone/)||xy()}function Sy(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 _y="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function ky(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Cy="undefined"!=typeof document&&window.visualViewport;function Ny(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function My(e){for(Ny(e)&&(e=e.parentElement);e&&!Ny(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Oy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Py,Ry=0;function Ay(e={}){let{isDisabled:t}=e;_y(()=>{if(!t)return Ry++,1===Ry&&Ey()&&(Py=function(){let e,t=0,n=n=>{e=My(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;Iy(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;Iy(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Cy&&(Cy.height<window.innerHeight?requestAnimationFrame(()=>{Ty(t)}):Cy.addEventListener("resize",()=>Ty(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=ky(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=ky(Dy(document,"touchstart",n,{passive:!1,capture:!0}),Dy(document,"touchmove",o,{passive:!1,capture:!0}),Dy(document,"touchend",r,{passive:!1,capture:!0}),Dy(document,"focus",a,!0),Dy(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Ry--,0===Ry&&(null==Py||Py())}},[t])}function Dy(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function Ty(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=My(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 Iy(e){return e instanceof HTMLInputElement&&!Oy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function zy(...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 Ly=new WeakMap;function $y(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||Ly.set(e,o)}const By=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),o=n.transform||n.webkitTransform||n.mozTransform;let r=o.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[By(t)?13:12]):(r=o.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[By(t)?5:4]):null)}function Hy(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const Fy={DURATION:.5,EASE:[.32,.72,0,1]},Vy=16,Wy="vaul-dragging";function Yy(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 Xy({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=Yy(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=Yy(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 Ky=null;function qy({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:k=!1,repositionInputs:C=!0,onAnimationEnd:N,container:M,autoFocus:O=!1}){var P,R;const[A=!1,D]=Xy({defaultProp:E,prop:t,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*Fy.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[T,I]=e.useState(!1),[z,L]=e.useState(!1),[$,B]=e.useState(!1),j=e.useRef(null),H=e.useRef(null),F=e.useRef(null),V=e.useRef(null),W=e.useRef(null),Y=e.useRef(!1),X=e.useRef(null),K=e.useRef(0),q=e.useRef(!1),U=e.useRef(!E),Z=e.useRef(0),G=e.useRef(null),Q=e.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().height)||0),J=e.useRef((null==(R=G.current)?void 0:R.getBoundingClientRect().width)||0),ee=e.useRef(0),te=e.useCallback(e=>{i&&e===ie.length-1&&(H.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]=Xy({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)),By(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),$y(r.current,{transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,transform:By(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?$y(a.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,opacity:"0"}):$y(a.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.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&&$y(a.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.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=By(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]||$y(r.current,{transform:By(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:j,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Ay({isDisabled:!A||z||!y||$||!T||!C||!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(wy()&&null===Ky&&t&&!i){Ky={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(wy()&&null!==Ky&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ky),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),Ky=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:A,modal:y,nested:null!=b&&b,hasBeenOpened:T,preventScrollRestoration:k,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let o=e;const r=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?jy(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(H.current&&i.getTime()-H.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(r&&r.length>0)return!1;if(W.current&&i.getTime()-W.current.getTime()<u&&0===a)return W.current=i,!1;if(t)return W.current=i,!1;for(;o;){if(o.scrollHeight>o.clientHeight){if(0!==o.scrollTop)return W.current=new Date,!1;if("dialog"===o.getAttribute("role"))return!0}o=o.parentNode}return!0}function pe(e){!function(){if(!z||!G.current)return;G.current.classList.remove(Wy),Y.current=!1,L(!1),V.current=new Date}(),null==v||v(),e||D(!1),setTimeout(()=>{i&&re(i[0])},1e3*Fy.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=jy(G.current,x);$y(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`}),$y(j.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&A&&$y(e,{borderRadius:"8px",overflow:"hidden",...By(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:`${Fy.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Fy.EASE.join(",")})`},!0)}return e.useEffect(()=>{window.requestAnimationFrame(()=>{U.current=!0})},[]),e.useEffect(()=>{var e;function t(){if(!G.current||!C)return;if(Iy(document.activeElement)||q.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&&(q.current=!q.current),i&&i.length>0&&ie&&oe){o+=ie[oe]||0}if(Z.current=o,r>t||q.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&&!q.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(()=>(A&&($y(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Ly.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(qf,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?I(!0):pe(!0),D(e))},open:A},e.createElement(vy.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:re,drawerRef:G,overlayRef:j,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,L(!0),F.current=new Date,Ey()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=By(x)?e.pageY:e.pageX))},onRelease:function(e){if(!z||!G.current)return;G.current.classList.remove(Wy),Y.current=!1,L(!1),V.current=new Date;const t=jy(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===F.current)return;const n=V.current.getTime()-F.current.getTime(),o=K.current-(By(x)?e.pageY:e.pageX),r=Math.abs(o)/n;if(r>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:o*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:r,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?o>0:o<0)return he(),void(null==a||a(e,!0));if(r>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&z){const n="bottom"===x||"right"===x?1:-1,o=(K.current-(By(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(Wy),Y.current=!0,$y(G.current,{transition:"none"}),$y(j.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 $y(G.current,{transform:By(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),$y(j.current,{opacity:`${m}`,transition:"none"},!0)),u&&j.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);$y(u,{borderRadius:`${t}px`,transform:By(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;$y(G.current,{transform:By(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:U,handleOnly:f,isOpen:A,isDragging:z,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-Vy)/window.innerWidth,o=n+t*(1-n),r=t*Vy-16;$y(G.current,{transform:By(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-Vy)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),$y(G.current,{transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,transform:By(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);$y(G.current,{transition:"none",transform:By(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=By(x)?window.innerHeight:window.innerWidth,o=t?(n-Vy)/n:1,r=t?-16:0;t&&$y(G.current,{transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,transform:By(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`})},keyboardIsOpen:q,modal:y,snapPointsOffset:ie,activeSnapPointIndex:oe,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:O}},o))}const Uy=e.forwardRef(function({...t},n){const{overlayRef:o,snapPoints:r,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=by(),u=zy(n,o),d=r&&r.length>0;if(!l)return null;const f=e.useCallback(e=>a(e),[a]);return e.createElement(Gf,{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})});Uy.displayName="Drawer.Overlay";const Zy=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}=by(),[x,E]=e.useState(!1),S=zy(a,i),_=e.useRef(null),k=e.useRef(null),C=e.useRef(!1),N=g&&g.length>0;!function(){const{direction:t,isOpen:n,shouldScaleBackground:o,setBackgroundColorOnScale:r,noBodyStyles:a}=by(),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&&Hy(document.body,{background:"black"}),Hy(e,{transformOrigin:By(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Fy.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Fy.EASE.join(",")})`});const n=Hy(e,{borderRadius:"8px",overflow:"hidden",...By(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*Fy.DURATION)}}},[n,o,s])}();function M(e){_.current=null,C.current=!1,l(e)}return e.useEffect(()=>{N&&window.requestAnimationFrame(()=>{E(!0)})},[]),e.createElement(Qf,{"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(k.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(C.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 C.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,C.current=!1,l(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),M(k.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),k.current&&M(k.current)}})});Zy.displayName="Drawer.Content";const Gy=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}=by(),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))});Gy.displayName="Drawer.Handle";const Qy={Root:qy,NestedRoot:function({onDrag:t,onOpenChange:n,open:o,...r}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=by();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return e.createElement(qy,{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:Zy,Overlay:Uy,Trigger:Uf,Portal:function(t){const n=by(),{container:o=n.container,...r}=t;return e.createElement(Zf,{container:o,...r})},Handle:Gy,Close:tp,Title:Jf,Description:ep},Jy=({shouldScaleBackground:e=!0,...t})=>r.createElement(Qy.Root,{shouldScaleBackground:e,...t});Jy.displayName="Drawer";const ev=Qy.Portal,tv=r.forwardRef(({className:e,...t},n)=>r.createElement(Qy.Overlay,{ref:n,className:nu("fixed inset-0 z-50 bg-black/80",e),...t}));tv.displayName=Qy.Overlay.displayName;const nv=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(ev,null,r.createElement(tv,null),r.createElement(Qy.Content,{ref:o,className:nu("fixed inset-x-0 top-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n},r.createElement("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t)));nv.displayName="DrawerContent";r.forwardRef(({className:e,...t},n)=>r.createElement(Qy.Title,{ref:n,className:nu("text-lg font-semibold leading-none tracking-tight",e),...t})).displayName=Qy.Title.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Qy.Description,{ref:n,className:nu("text-sm text-muted-foreground",e),...t})).displayName=Qy.Description.displayName,exports.AgenticFlowVisualizer=hp,exports.AnthropicIcon=pu,exports.Badge=lu,exports.Checkbox=yy,exports.Drawer=Jy,exports.Edge=Es,exports.FileSelector=({files:t,currentFile:n,onFileSelect:o,onRefresh:r,loading:a=!1,disabled:i=!1})=>e.createElement("div",{className:"flex items-center gap-2"},0!==t.length||a?e.createElement(qg,{value:n||"",onValueChange:o,disabled:i||a},e.createElement(Zg,{className:nu("w-fit shadcn-select transition-all duration-200",(i||a)&&"opacity-60 cursor-not-allowed")},e.createElement("div",{className:"flex items-center justify-between w-full gap-3 p-2"},e.createElement(Ug,{placeholder:a?"Loading sessions...":0===t.length?"No sessions found":"Select an Agent Session..."}))),e.createElement(Jg,null,0!==t.length||a?t.map(t=>e.createElement(ey,{key:t.name,value:t.name},t.name)):e.createElement("div",{className:"px-2 py-3 text-center text-sm text-gray-500"},"No agent sessions available"))):e.createElement("div",{className:"text-sm text-gray-500 px-3 py-2"},"No agent sessions available"),t.length>0&&e.createElement("button",{onClick:e=>{e.stopPropagation(),r()},disabled:a||i,title:a?"Loading...":"Refresh files",className:nu("file-selector-refresh-btn transition-all duration-200",(a||i)&&"opacity-50 cursor-not-allowed")},a?e.createElement(bs,{className:"h-4 w-4 animate-spin text-gray-400"}):e.createElement(xs,{className:"h-4 w-4"}))),exports.GoogleIcon=hu,exports.JsonTreeViewer=du,exports.Node=gu,exports.OpenAIIcon=fu,exports.Select=qg,exports.Sheet=rp,exports.Timeline=Ou,exports.Visualizer=t=>e.createElement(Vi,null,e.createElement(hp,t)),exports.calculateAutoLayout=fp,exports.cn=nu,exports.formatCurrency=au,exports.formatLatency=iu,exports.toTitleCase=ou,exports.truncateText=ru;
|